"< $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.
In reply to Re: Open Function Question
by ikegami
in thread Open Function Question
by bichonfrise74
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |