>>>>> "MGS" == Michael G Schwern <[EMAIL PROTECTED]> writes:

  MGS> Backwards?

  MGS>     File.read_backwards($filename) {
  MGS>         print
  MGS>     }

not trivial but not too hard. check out File::ReadBackwards for a way to
do it efficiently in perl5. it requires some careful seeking, buffering
and scanning for the line endings. it probably should be a module and
not core. it could be combined with a bunch of other useful file or file
iterators classes.

  MGS> How about each line seperated by the string "Peterbilt"?

  MGS>     my $fh = File.open($filename);
  MGS>     $fh.each('Peterbilt') {
  MGS>         print
  MGS>     }

wouldn't that be better as a input record separator attribute on $fh? it
shouldn't be passed to the iterator as it is usually set only once.

        $fh.irs( 'Peterbilt' ) ;
        $fh.each { print } ;

uri

-- 
Uri Guttman  ---------  [EMAIL PROTECTED]  ----------  http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Search or Offer Perl Jobs  --------------------------  http://jobs.perl.org

Reply via email to