[Omaha.pm] Some lines of a file

Jay Hannah jay at jays.net
Fri Oct 31 09:25:44 PDT 2008


James Harr wrote:
> ... continuing on the path to insanity through inverted loops ...
>
> <> foreach 0 .. 1;
> push @buf, scalar(<>) foreach 0 .. 5;
> sub {push @buf, $_; print shift @buf}->() while <>;
>
> I shouldn't be allowed to code perl.
>   

Laugh! Reverse Perl golf! Longer and harder to read!   ;)

Thanks for   @in = <>;    I like that better than my 3 line version.  :)

j



More information about the Omaha-pm mailing list