<br>
Is there a one line way to slurp a file into an array?<br>
<br>
Instead of <br>
open(FILE, "file" ¦¦ warn "couldn't open file";<br>
@array = <FILE>;<br>
close(FILE);<br>
<br>
I would like to <br>
@array = <"file">;<br>
<br>
I know, it's just a couple of lines, but Larry Wall himself says that lazyness is a virtue. <br>
<br>
I saw someone do this:<br>
@array = `/bin/cat file`;<br>
<br>
but I want to stay in perl.<br>
<br>
Thanks!<br>
- Kai.<br>
Is there a one line way to slurp a file into an array?<br>
<br>
Instead of <br>
open(FILE, "file" ¦¦ warn "couldn't open file";<br>
@array = <FILE>;<br>
close(FILE);<br>
<br>
I would like to <br>
@array = <"file">;<br>
<br>
I know, it's just a couple of lines, but Larry Wall himself says that lazyness is a virtue. <br>
<br>
I saw someone do this:<br>
@array = `/bin/cat file`;<br>
<br>
but I want to stay in perl.<br>
<br>
Thanks!<br>
- Kai.<br>