in reply to Re: Append to beginning of line (multi line file)
in thread Append to beginning of line (multi line file)
(undef)=<FILE>; reads lines out of <FILE>, and stores it nowhere, it's the same as <FILE>. The answer to your puzzle isn't that (undef)=<FILE> is somehow magical (other then having a list-context call that goes nowhere; ()=<FILE> would should work just as well for that), it's that $. is a special variable that holds the current (input) line number. It's updated on all reads.
|
|---|