in reply to Access elements of $_
This doesn't find the second row in the file.
Which file: the one accessed by the file handle MYFILE or by the DMPLD handle?
Maybe try writing a program which opens a file, reads and prints each line in a while loop, and then closes the file. This might be a good foundation for your ultimate goal.
As moritz suggested, you might then want to try splitting each line as you go through the while loop to access its fields.
[H]ow do I reference the first element of $_ ...
$_ is a scalar; it has no elements. It may be a scalar that is a reference to an array, in which case $_->[0], $_->[1], ... would access the first, second, etc., elements of the array.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Access elements of $_
by Anonymous Monk on Aug 12, 2010 at 12:55 UTC |