Re: A funny module that shortens one-liners - is it worth global namespace?

[email protected] (Aristotle Pagaltzis)
Newsgroups perl.module-authors
Message-ID <[email protected]>
Hi Konstantin,

* Konstantin S. Uvarin <[email protected]> [2016-12-27 11:24]:
>   I've come up with an interface to shorten that to just
>
>   perl -Mnew=x=My::Very::Long::Module,foo,42 -we "print $x->foo;"

maybe https://metacpan.org/pod/aliased is good enough?

    perl -Maliased=My::Very::Long::Module,X -we 'print X->new( foo => 42 )'

I don’t know if that’s enough magic for you, though.

Personally I find it a lot more obvious what’s going on there compared
to your proposed interface. I’m sure I would never need to look at the
docs to decipher what that line was supposed to be doing.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.