good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: RFC: new.pm - a perl -e use/new shortener (default variable)by LanX (Saint) |
on Dec 24, 2016 at 13:04 UTC ( [id://1178462]=note: print w/replies, xml ) | Need Help?? |
I like this a lot, just one suggestion > use new qw(My::Very::Long::Module x foo 42) If conciseness is your goal,better try to make the variable name (here x) optional and default to something like $new or $obj or only $o. Though I'm not sure about the best syntax for an optional var, probably something like use new qw(My::Very::Long::Module>x foo 42) Other options are | or * but any solution should play well with the -M option, ie shouldn't confuse the shell/CLI on various OSes. update: untested perl -Mnew=My::Very::Long::Module>x,foo,42
Cheers Rolf
In Section
Meditations
|
|