RE: Perl simple array

2002-04-18 Thread Hooten, Michael
$d = 'test1,test2,test3,test4'; @data = split(/,/, $d); print $data[1]; -Original Message- From: Daniel Falkenberg [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 17, 2002 9:54 PM To: [EMAIL PROTECTED] Subject: Perl simple array Hey All, Just wondering why the following code won't p

qw for help in - Re: Perl simple array

2002-04-17 Thread drieux
On Wednesday, April 17, 2002, at 04:59 , A. Rivera wrote: > @data = ("test1","test2","test3","test4"); > print $data[1]; my @data = qw/test1 test2 test3 test4/ ; gives us all a chance to remember that since hubris and laziness are two of our three virtues why quote and comma that which ca

RE: Perl simple array

2002-04-17 Thread Timothy Johnson
What you are telling Perl is this: @data = "test1,test2,test3,test4"; #Store this string in $data[0] @data = split(/,/); #replace the contents of @data with the result #of splitting $_ by /,/ #($_ is not defined at this point) print $data[1]; #print the second element of $data #(which does not

Re: Perl simple array

2002-04-17 Thread A. Rivera
@data = ("test1","test2","test3","test4"); print $data[1]; Regards, Agustin Rivera Webmaster, Pollstar.com / PollstarOnline.com - Original Message - From: "Daniel Falkenberg" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, April 17, 2002 6:53 PM Subject: Perl simple array

RE: Perl simple array

2002-04-17 Thread Mark Anderson
perldoc -f split Your split statement is attempting to split $_, not @data. -Original Message- From: Daniel Falkenberg [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 17, 2002 6:54 PM To: [EMAIL PROTECTED] Subject: Perl simple array Hey All, Just wondering why the following code wo