exilepanda has asked for the wisdom of the Perl Monks concerning the following question:
use myRoboFolks; eval { hey myRoboFolks -> provided(%argv) -> please("do something"); }; Sorry if $@; # hey() is the constructor alias to new() for real # Sorry is an exported sub which extends die() by # $SIG{__DIE__} capture
Question: Can I do something to make "With" alias to use()? So I can write
Plus, if there's such a way, can it apply to other perlfuncs ?With myRoboFolks; eval {...}
My current approach is to use eval{require()} at the BEGIN block, because 'require' looks better than 'use' but I think I better reserve the BEGIN block more clear for some init processes. And this approach actually looks bulky.
So... I am not a professional programmer, and I just want to write codes in the style un-dull, for my very own long boring projects. So please don't blame me on the style manner, I really need some fun with the codes...
Any clues would be much appreciate! Thanks a lot!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Possible to make alias for 'use' ?
by moritz (Cardinal) on Oct 07, 2011 at 10:20 UTC | |
|
Re: Possible to make alias for 'use' ?
by AnomalousMonk (Archbishop) on Oct 07, 2011 at 05:57 UTC | |
by Anonymous Monk on Oct 07, 2011 at 07:13 UTC | |
|
Re: Possible to make alias for 'use' ?
by afresh1 (Hermit) on Oct 07, 2011 at 06:12 UTC | |
by Anonymous Monk on Oct 07, 2011 at 07:17 UTC | |
by Anonymous Monk on Oct 07, 2011 at 07:22 UTC | |
by exilepanda (Friar) on Oct 07, 2011 at 07:36 UTC | |
by Anonymous Monk on Oct 07, 2011 at 07:37 UTC | |
|