Discipulus has asked for the wisdom of the Perl Monks concerning the following question:
UPDATE:#!/usr/bin/perl use warnings; use strict; use Getopt::Long; my ( $execute, $key); GetOptions ( "key=s" => \$key, "execute" => \$execute)||die; my %cmds = ( a => sub {exec 'perl -e "print map {qq!\t$_\n!}"',@_ }, b => sub {exec 'perl -e "$|++;print qq(ee r r );sleep 5"' +}, c => sub {my $res; foreach (@ARGV) {$res+=$_}; print $res +;exit 0 }, ); if ($execute && exists $cmds{$key} ) { print "ole\n"; $cmds{$key}->(@ARGV); } # theoretically never here .. print "still in \@ARGV: ", (join("|",@ARGV),"\n");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: become another via exec in dispatch table
by ikegami (Patriarch) on Jan 31, 2012 at 10:29 UTC | |
by Discipulus (Canon) on Jan 31, 2012 at 10:46 UTC | |
by ikegami (Patriarch) on Jan 31, 2012 at 12:05 UTC | |
by Discipulus (Canon) on Jan 31, 2012 at 12:36 UTC | |
by ikegami (Patriarch) on Jan 31, 2012 at 21:18 UTC | |
by ikegami (Patriarch) on Jan 31, 2012 at 21:24 UTC | |
|
Re: become another via exec in dispatch table
by ikegami (Patriarch) on Jan 31, 2012 at 10:23 UTC |