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