Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: RFC: new.pm - a perl -e use/new shortener

by 1nickt (Canon)
on Dec 24, 2016 at 11:54 UTC ( [id://1178457]=note: print w/replies, xml ) Need Help??


in reply to RFC: new.pm - a perl -e use/new shortener

This is really cool. You can use the -M sugar allowing comma-separated args to simplify the syntax further:

$ cat text.txt hello, world $ perl -Mnew=Path::Tiny,file,text.txt -E' say $file->slurp; ' hello, world
I think a good improvement would be to load the strict and warnings pragmas automatically.

(Also suggest: $ABSTRACT =~ s/shorted/shortens/;)


The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^2: RFC: new.pm - a perl -e use/new shortener (strictness)
by LanX (Saint) on Dec 24, 2016 at 12:50 UTC
    Mentioning -M from perlrun is a good point.

    > I think a good improvement would be to load the strict and warnings pragmas automatically.

    I tend to disagree, especially regarding strict.

    strict is a must for longer scripts, but don't really pay off with one liners which need to be concise.

    If ever this should be optional.

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2024-04-26 09:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found