Re: Reading X lines at a time

Uri Guttman <[email protected]>
Newsgroups gmane.comp.lang.perl.fun
Message-ID <[email protected]>
>>>>> "XN" == Xavier Noria <[email protected]> writes:

  XN> What about a foreach loop:

  XN>      use Perl6::Slurp;

File::Slurp also supports $/ being a regex.

  XN>      $X = 4;
  XN>      $regexp = '.*\n?' x $X;

  XN>      foreach $Xlines (slurp 'foo.txt', { irs => qr/$regexp/ }) {
  XN>          # ...
  XN>      }

uri

-- 
Uri Guttman  ------  [email protected]  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org
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.