Re: Reading X lines at a time

Georg Moritz <[email protected]>
Newsgroups gmane.comp.lang.perl.fun
Message-ID <[email protected]>
From the keyboard of Georg Moritz [03.05.04,13:34]:

> From the keyboard of Jose Alves de Castro [03.05.04,10:56]:
>
> > This has been bugging me for some time...
> >
> > What would be the easiest way to read X lines of input at a time?
> >
> > I don't really think you can use $/ for this, as it's not a regex, but a
> > string...
> >
> > However, the thought of having to use more than one line of code to do
> > this scares the hell out of me O:-)
>
> $_=<>x$n

or
@_=<>x$n
in array context
:-)

> greets,
> georg
>
>

-- 
_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s,/,($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e,e && print}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.