in reply to Open Function Question
"< $i" results in a string similar to "< SCALAR(0x814f66c)" because references can't exist in a string (by definition). open my $myfile, "< $i" doesn't find a file named SCALAR(0x814f66c), so it returns an error.
Since 5.8, when you use the three arg form of open and the third arg is a scalar reference, the referenced scalar is used as a virtual file from which data can be read or to which data can be written.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Open Function Question
by bichonfrise74 (Vicar) on Apr 17, 2009 at 19:57 UTC | |
by runrig (Abbot) on Apr 17, 2009 at 20:10 UTC | |
by ikegami (Patriarch) on Apr 17, 2009 at 20:51 UTC | |
by Marshall (Canon) on Apr 18, 2009 at 03:13 UTC | |
by johngg (Canon) on Apr 18, 2009 at 12:25 UTC | |
by Marshall (Canon) on Apr 18, 2009 at 12:52 UTC |