Re: removing an entry from a file

2002-11-23 Thread Octavian Rasnita
Du you want to remove the file as you told us, or you want to remove a line
from the file?

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, November 24, 2002 3:13 AM
Subject: removing an entry from a file


I have a text file i called users.dat
I want to be able to delete users from the list
ie i have form with a text input, and i would like to be able to type the
name in and have it delted from my users.dat

how can i remove the file?

thanks guys, you were great on my last question
Ambrose



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: tutorials

2002-11-23 Thread fliptop
On Sat, 23 Nov 2002 at 17:25, [EMAIL PROTECTED] opined:

:does anybody have any really good sites or books that deal just with CGI as 
:in applications to web programming. Almost all i have found in the book area 
:is how to code perl in the command line interface. I looking for just web 
:based stuff.

have you looked at the form data checker tutorial i wrote?

http://www.peacecomputers.com/form_checker/index.html


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Re: tutorials

2002-11-23 Thread Mark Bergeron
Yes, CGI with Perl is a great one. I wish they would print a 3rd Edition though.

-Original Message-
From: "Scot Robnett"<[EMAIL PROTECTED]>
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Date: Sat Nov 23 14:30:15 PST 2002
Subject: Re: tutorials

>Always look to O'Reilly first, they usually have something not only relevant
>to your request, but well-written and comprehensive as well.
>
>Try "CGI Programming with Perl". It's the one with the mouse on the cover.
>
>I don't have this one, but I hear "The Perl Cookbook" is supposed to be good
>also.
>
>-
>Scot Robnett
>inSite Internet Solutions
>Square West Center
>454 West Jackson Street
>Woodstock, IL 60098
>(815)206-2907 office
>(815)790-9687 mobile
>[EMAIL PROTECTED]
>http://www.insiteful.tv
>
>
>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>Sent: Saturday, November 23, 2002 4:26 PM
>To: [EMAIL PROTECTED]
>Subject: tutorials
>
>
>does anybody have any really good sites or books that deal just with CGI as
>in applications to web programming. Almost all i have found in the book area
>is how to code perl in the command line interface. I looking for just web
>based stuff.
>
>Thanks
>
>
>-- 
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>


___
GO.com Mail
Get Your Free, Private E-mail at http://mail.go.com



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




removing an entry from a file

2002-11-23 Thread Ambrose007
I have a text file i called users.dat
I want to be able to delete users from the list
ie i have form with a text input, and i would like to be able to type the 
name in and have it delted from my users.dat

how can i remove the file?

thanks guys, you were great on my last question   
Ambrose



Re: Re: tutorials

2002-11-23 Thread Mark Bergeron
Don't forget about the "Official Guide To Programming With CGI.pm". The book is hard 
to find but the site has a lot of information and examples:

http://www.wiley.com/legacy/compbooks/stein/index.html

-Original Message-
From: "Al Hospers"<[EMAIL PROTECTED]>
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Date: Sat Nov 23 14:32:42 PST 2002
Subject: Re: tutorials

>try the O Reilly series. there is a great book, CGI Proramming With Perl
>that I use all the time.
>
>hth
>
>Al
>
>> -Original Message-
>> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>> Sent: Saturday, November 23, 2002 5:26 PM
>> To: [EMAIL PROTECTED]
>> Subject: tutorials
>>
>>
>> does anybody have any really good sites or books that deal
>> just with CGI as
>> in applications to web programming. Almost all i have found
>> in the book area
>> is how to code perl in the command line interface. I looking
>> for just web
>> based stuff.
>>
>> Thanks
>>
>
>
>
>-- 
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>


___
GO.com Mail
Get Your Free, Private E-mail at http://mail.go.com



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: tutorials

2002-11-23 Thread Wiggins d'Anconia
It is a very good book, but I am not sure it is what the original poster 
was looking for, I don't think it is geared towards the cgi spectrum of 
Perl.  It is great for doing specific tasks, many of which can be 
implemented in multiple arenas, but as a CGI book it really isn't.

Along with the CGI Programming with Perl there is also this book from 
ORA: http://www.oreilly.com/catalog/perlwsmng/

Sorry I can't provide a review of either, when I started on the CGI 
front there really weren't any of these available :-), oh how times have 
changed but not enough has changed in the CGI world to warrant getting them.

http://danconia.org

Al Hospers wrote:
Perl Cookbook is a very good book too...

Al



-Original Message-
From: Scot Robnett [mailto:[EMAIL PROTECTED]]
Sent: Saturday, November 23, 2002 5:30 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: tutorials


Always look to O'Reilly first, they usually have something 
not only relevant
to your request, but well-written and comprehensive as well.

Try "CGI Programming with Perl". It's the one with the mouse 
on the cover.

I don't have this one, but I hear "The Perl Cookbook" is 
supposed to be good
also.

-
Scot Robnett
inSite Internet Solutions
Square West Center
454 West Jackson Street
Woodstock, IL 60098
(815)206-2907 office
(815)790-9687 mobile
[EMAIL PROTECTED]
http://www.insiteful.tv


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Saturday, November 23, 2002 4:26 PM
To: [EMAIL PROTECTED]
Subject: tutorials


does anybody have any really good sites or books that deal 
just with CGI as
in applications to web programming. Almost all i have found 
in the book area
is how to code perl in the command line interface. I looking 
for just web
based stuff.

Thanks


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]








--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: tutorials

2002-11-23 Thread Al Hospers
Perl Cookbook is a very good book too...

Al

> -Original Message-
> From: Scot Robnett [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, November 23, 2002 5:30 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: tutorials
> 
> 
> Always look to O'Reilly first, they usually have something 
> not only relevant
> to your request, but well-written and comprehensive as well.
> 
> Try "CGI Programming with Perl". It's the one with the mouse 
> on the cover.
> 
> I don't have this one, but I hear "The Perl Cookbook" is 
> supposed to be good
> also.
> 
> -
> Scot Robnett
> inSite Internet Solutions
> Square West Center
> 454 West Jackson Street
> Woodstock, IL 60098
> (815)206-2907 office
> (815)790-9687 mobile
> [EMAIL PROTECTED]
> http://www.insiteful.tv
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, November 23, 2002 4:26 PM
> To: [EMAIL PROTECTED]
> Subject: tutorials
> 
> 
> does anybody have any really good sites or books that deal 
> just with CGI as
> in applications to web programming. Almost all i have found 
> in the book area
> is how to code perl in the command line interface. I looking 
> for just web
> based stuff.
> 
> Thanks
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: tutorials

2002-11-23 Thread Al Hospers
try the O Reilly series. there is a great book, CGI Proramming With Perl
that I use all the time.

hth

Al

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, November 23, 2002 5:26 PM
> To: [EMAIL PROTECTED]
> Subject: tutorials
>
>
> does anybody have any really good sites or books that deal
> just with CGI as
> in applications to web programming. Almost all i have found
> in the book area
> is how to code perl in the command line interface. I looking
> for just web
> based stuff.
>
> Thanks
>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: tutorials

2002-11-23 Thread Scot Robnett
Always look to O'Reilly first, they usually have something not only relevant
to your request, but well-written and comprehensive as well.

Try "CGI Programming with Perl". It's the one with the mouse on the cover.

I don't have this one, but I hear "The Perl Cookbook" is supposed to be good
also.

-
Scot Robnett
inSite Internet Solutions
Square West Center
454 West Jackson Street
Woodstock, IL 60098
(815)206-2907 office
(815)790-9687 mobile
[EMAIL PROTECTED]
http://www.insiteful.tv


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Saturday, November 23, 2002 4:26 PM
To: [EMAIL PROTECTED]
Subject: tutorials


does anybody have any really good sites or books that deal just with CGI as
in applications to web programming. Almost all i have found in the book area
is how to code perl in the command line interface. I looking for just web
based stuff.

Thanks


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




tutorials

2002-11-23 Thread Ambrose007
does anybody have any really good sites or books that deal just with CGI as 
in applications to web programming. Almost all i have found in the book area 
is how to code perl in the command line interface. I looking for just web 
based stuff.

Thanks



Re: arrays & lists

2002-11-23 Thread james lundeen
here is an example of MySQL code to pick a random
record using some select criteria.  i use it in a
homepage for an online store where my client has
random items from his catalog displayed as "featured"
items (really nothing more than picking a random
record from the 10,000+ items!)...


$mysql_query="SELECT
UIN,EXTENDED_DESC,PIC_FILENAME,LOGO_ID,LIST_PRICE,UNIT
from $items_database order by rand() limit 1";






--- Octavian Rasnita <[EMAIL PROTECTED]> wrote:
> First I need to tell you that I am not a MySQL
> specialist and my opinion
> might be wrong butI think that:
> 
> 1. You'll better use where day=$day and where
> month=$month because it works
> faster than using the "like" operator.
> 
> 2. I think MySQL has a function for returning random
> numbers, so you better
> use that function instead.
> It will return a single row that match a criteria
> from the database and not
> a lot of records that need to be processed by Perl
> after that.
> You might check MySQL documentation for finding out
> this function.
> 
> What you want, I think that it can be made with a
> single SQL line and you
> will need to get the data from a single row using
> Perl.
> 
> Teddy,
> Teddy's Center: http://teddy.fcc.ro/
> Email: [EMAIL PROTECTED]
> 
> - Original Message -
> From: "Al Hospers" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, November 22, 2002 11:03 PM
> Subject: arrays & lists
> 
> 
> hi
> 
> I know I am missing a lot in my knowledge, but I'm
> trying to figure
> something out & seemingly am in a hole...
> 
> the task is as follows:
> 
> 1) query a mysql database for as many records as
> match a criteria
> (I can do this OK)
> 
> 2) put the resulting records, how ever many there
> are, into a list or an
> array
> 
> 3) count the number of records I have retrived
> (I can do this OK)
> 
> 4) choose a random record number
> (I can do this)
> 
> 5) get the record corresponding to the random record
> number from the array
> 
> 6) get a particular field from the stored record
> 
> I am using DBI to get the data from the database.
> here is what I have so
> far:
> 
> sub getRandomRecord{
>   my $cgi = shift;
>   my $dbh = shift;
>   my $month = shift;
>   my $day = shift;
> 
>   my $searchResult;
>   my $returnValue;
> 
>#prepare and execute SQL statement
> $sqlstatement = "SELECT * FROM $TABLE WHERE
> month like $month and day
> like $day";
> $sth = executeSQLStatement($sqlstatement, $dbh);
> 
>$counter = 0;
> 
># put the records returned in an array/list &
> count how many
> while ($searchResult = $sth->fetchrow_array() )
> {
> # get the 4th field from the record in the array
> & put it in the list
> my @list = ($searchResult[3]);
>  ++$counter;
>}
> 
> # pass the counter to the random integer routine
> & get a value back
> my $randomNumber = getRandomNumber($counter);
> 
> $returnValue = @list[$randomNumber];
> 
># clean up the DBI
>$sth->finish();
> 
>return $returnValue
>}
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> -- 
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail Plus – Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: arrays & lists

2002-11-23 Thread Jason Purdy
> I know I am missing a lot in my knowledge, but I'm trying to figure
> something out & seemingly am in a hole...

MySQL can do a lot of this for you, I believe...

You want a random record from the database and retrieve a particular field
from that record:

# Untested, but you would call this subroutine like so:
# getRandomRecord( $dbh, "SELECT field_Im_interested_in FROM $TABLE
# WHERE month like $month and day like $day" );
# NOTE: $sql (2nd parameter) can't already have a LIMIT in it, or any SQL
# statement which a LIMIT suffix would result in an invalid SQL statement.
sub getRandomRecord {
my( $dbh, $sql ) = @_;
my ( $sth, $randomNumber, $myValue );

$sth = $dbh->prepare( $sql );
$sth->execute;

$randomNumber = int(rand( $sth->rows ) );
$sth->finish;
# $randomNumber will be 0 <= $randomNumber < $sth->rows, which
# fits nicely with MySQL's LIMIT clause

( $myValue ) = $dbh->selectrow_array( $sql . " LIMIT $randomNumber,
1" );
return $myValue;
}

HTH & Have Fun!

Jason

> the task is as follows:
>
> 1) query a mysql database for as many records as match a criteria
> (I can do this OK)
>
> 2) put the resulting records, how ever many there are, into a list or an
> array
>
> 3) count the number of records I have retrived
> (I can do this OK)
>
> 4) choose a random record number
> (I can do this)
>
> 5) get the record corresponding to the random record number from the array
>
> 6) get a particular field from the stored record
>
> I am using DBI to get the data from the database. here is what I have so
> far:
>
> sub getRandomRecord{
>   my $cgi = shift;
>   my $dbh = shift;
>   my $month = shift;
>   my $day = shift;
>
>   my $searchResult;
>   my $returnValue;
>
>#prepare and execute SQL statement
> $sqlstatement = "SELECT * FROM $TABLE WHERE month like $month and day
> like $day";
> $sth = executeSQLStatement($sqlstatement, $dbh);
>
>$counter = 0;
>
># put the records returned in an array/list & count how many
> while ($searchResult = $sth->fetchrow_array() )
> {
> # get the 4th field from the record in the array & put it in the list
> my @list = ($searchResult[3]);
>  ++$counter;
>}
>
> # pass the counter to the random integer routine & get a value back
> my $randomNumber = getRandomNumber($counter);
>
> $returnValue = @list[$randomNumber];
>
># clean up the DBI
>$sth->finish();
>
>return $returnValue
>}
>
>
>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: multiple selection

2002-11-23 Thread Jason Purdy
Two things:
1) Your action parameter of the form tag was pointing to a separate program.
If you leave it blank (or leave it out altogether), then this same script
will process it.
2) You don't need to split param('list') - CGI.pm will automatically make an
array for you, if it contains multiple entries.

HTH & Have Fun!

Jason

#!/usr/local/bin/perl
use CGI qw(:standard);

$action = param('action');

print header();
print start_html();

  if (!$action) {
print start_html();
print qq~


Select List:
~;
print scrolling_list(
-name=>'list',
-value=>['List_1','List_2','List_3'],
-default=>['List_1'],
-multiple=>1
);
print qq~

~;
print end_html();
   } else {
@lists = param('list');
print qq|Total: @lists|;
   }

exit();

"Mikeblezien" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello all,
>
> having a problem with processing multiple selection from a scrolling
list...
> first time working with tha scrolling list. Here is the test script I'm
working
> with:
> #!/usr/local/bin/perl
> use CGI qw(:standard);
>
> $action = param('action');
>
> print header();
> print start_html();
>   if (!$action) {
> print start_html();
> print qq~
> 
> 
> Select List:
> ~;
> print scrolling_list(-name=>'list',
>   -value=>['List_1','List_2','List_3'],
>   -default=>['List_1'],
>   -multiple=>1);
> print qq~
> 
> ~;
> print end_html();
>} else {
>@lists = split(/ /,param('list'));
> print qq|Total: @lists|;
>}
>
> exit();
>
> Now I thought that the @list array would store all the selected values
from the
> list... but it doesn't, just one, even if all the items have been selected
from
> the list... what am I missing here ??
>
> thanks
> --
> MikeBlezien
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Thunder Rain Internet Publishing
> Providing Internet Solutions that work!
> http://www.thunder-rain.com
> Tel:  1(985)902-8484
> MSN: [EMAIL PROTECTED]
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: libwww example / tutorial

2002-11-23 Thread fliptop
On Sat, 23 Nov 2002 at 05:07, Admin-Stress opined:

A:   if ($res->is_success) {
A:  print $res->content;
A:   } else {
A:  print "Error: " . $res->status_line . "\n";
A:   }
A:
A:What is the variable type of $res->content ? is it Array? Because it
A:just dumped the output (multiple lines), I need to parse line by line.

you can find out by

print ref $res->content;



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: multiple selection

2002-11-23 Thread fliptop
On Fri, 22 Nov 2002 at 15:56, Mike(mickako)Blezien opined:

M:   @lists = split(/ /,param('list'));

from perldoc CGI:

FETCHING THE VALUE OR VALUES OF A SINGLE NAMED PARAMETER:

   @values = $query->param('foo');

 -or-

   $value = $query->param('foo');



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




libwww example / tutorial

2002-11-23 Thread Admin-Stress
Hi,

Anyone know any URL about libwww example / tutorial? 
I cant find decent source. I just want to learn how to GET an ouput from a website and 
parse the
output.

from one of example, I can print the output like this :

   if ($res->is_success) {
  print $res->content;
   } else {
  print "Error: " . $res->status_line . "\n";
   }

What is the variable type of $res->content ? is it Array? Because it just dumped the 
output
(multiple lines), I need to parse line by line.

Thanks,

kapot

__
Do you Yahoo!?
Yahoo! Mail Plus – Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]