Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This is not a CSV file by the waya,b,c,d,e,f,g 1,2,3,4,5,6,7 x,y,z,s,t,u,v
This doesn't find the second row in the file. So how do I reference the first element of $_ (with a field seperator of comma) ? I tried using $_[0] but that doesn't work. Thanks$id = 1 open(MYFILE,"/var/tmp/mylist.dat") or die "Cant open mylist.dat" while (<DMPLD>) { chomp; die "Request Id $id already present in file\n" if $_ eq $id; } close DMPLD;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Access elements of $_
by moritz (Cardinal) on Aug 12, 2010 at 12:24 UTC | |
by Anonymous Monk on Aug 12, 2010 at 12:37 UTC | |
|
Re: Access elements of $_
by AnomalousMonk (Archbishop) on Aug 12, 2010 at 12:40 UTC | |
by Anonymous Monk on Aug 12, 2010 at 12:55 UTC | |
|
Re: Access elements of $_
by shmem (Chancellor) on Aug 12, 2010 at 14:03 UTC | |
by Anonymous Monk on Aug 12, 2010 at 14:18 UTC | |
by shmem (Chancellor) on Aug 12, 2010 at 14:29 UTC | |
by Anonymous Monk on Aug 12, 2010 at 14:24 UTC |