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!