Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Any downsides to this slurp idiom?

by jimpudar (Pilgrim)
on Jun 22, 2018 at 16:15 UTC ( [id://1217221]=note: print w/replies, xml ) Need Help??


in reply to Any downsides to this slurp idiom?

There are a lot of good answers to your question here already, so I thought I would ask another tangentially related one.

Why not use File::Slurp?

Best,

Jim

πάντων χρημάτων μέτρον έστιν άνθρωπος.

Replies are listed 'Best First'.
Re^2: Any downsides to this slurp idiom?
by hippo (Bishop) on Jun 22, 2018 at 16:21 UTC

      Huh, very interesting. Sounds like I will probably be switching over to File::Slurper from now on.

      Thanks!

      Jim

      πάντων χρημάτων μέτρον έστιν άνθρωπος.

        Path::Tiny's helpers are great and the package has a lot more than slurping to offer.

Re^2: Any downsides to this slurp idiom?
by haukex (Archbishop) on Jun 22, 2018 at 17:39 UTC
    Why not use File::Slurp?

    One reason is what hippo said, the other being that this is IMO one of those cases where pure Perl does everything I need - I can read lines in list context and I can use layers like :raw, :crlf, and :encoding(...) - there's really no need to load a module. (Unless I'm doing additional stuff, like filename manipulation, in which case I usually use Path::Class, which has slurping and spewing built in.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1217221]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-03-29 05:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found