$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
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
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
@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
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