>>>>> "sw" == shawn wilson <ag4ve...@gmail.com> writes:

  sw> That looks to be pretty much the same as:
  sw> zcat file ¦ script ¦ gzip -c -
  sw> (Untested)

yes it is. and a perl one liner like perl -0777p le '$_ .= "text"' is
all you need there. the issue is if text is large and/or from a file.

  sw> Nice addition to the module BTW. Haven't had the need for
  sw> File::Slurp (used more specialized modules such as Text::CSV_XS or
  sw> Web::Scraper) but this feature is definitely good. If not just
  sw> because it makes how to do in place edits a no brainer.

file::slurp can make those modules faster as most typical modules use
either slow slurping or line by line reading when they don't need to. as
i have said, decades ago line by line was required but with today's ram
size it isn't and for most files slurping wins big. you can either pass
a list of lines directly to modules that you already slurped or do a
foreach loop over those slurped lines and you could gain a nice amount
of speed.

uri

-- 
Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to