Your skill will accomplish what the force of many cannot |
|
PerlMonks |
become another via exec in dispatch tableby Discipulus (Canon) |
on Jan 31, 2012 at 10:05 UTC ( [id://950924]=perlquestion: print w/replies, xml ) | Need Help?? |
Discipulus has asked for the wisdom of the Perl Monks concerning the following question:
hello wise ones i had a strange Perl idea but i can get it works: i want a program that can transform itself into another thing on given argouments. I would like to use it alone: me.pl --execute --key sum or in a pipeline, like in: echo '1 2 3' | me.pl --execute --key sum | cat I' m using Getopt::Long as it can grab options that i need in the main program, and can also leave other things in @ARGV.. The below code only works in the case c and not in pipeline: me.pl --execute --key c 1 2 3 Any suggestion or explication are welcome thanks L* UPDATE: on ikegami suggestion i add what i'm getting on tests: echo 1 2 3 | code-dispatch.pl --execute --key c gives something like:"the process proved to write in an unexisting pipe" ole Use of uninitialized value $res in print at c:\SCRIPTS\code-dispatch.pl line 14. echo 1 2 3 | code-dispatch.pl --execute --key a prints: ole c:\SCRIPTS>syntax error at -e line 1, at EOF Execution of -e aborted due to compilation errors. and program hangs.. L*
there are no rules, there are no thumbs..
Back to
Seekers of Perl Wisdom
|
|