KHLeow has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use Win32::Process; for (1..3) { eval { print "$_\n"; Win32::Process::Create(my $proc, $^X, "perl child.pl", 0, 0, "."); }; if ($@) { if (index($@, 'Custom Exception') == 0) { print "Caught exception: $@"; next; } else { die $@; } } }
#!/usr/bin/perl die 'Custom Exception';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: eval-ling code in another process
by targetsmart (Curate) on Jun 02, 2009 at 09:15 UTC | |
|
Re: eval-ling code in another process
by lakshmananindia (Chaplain) on Jun 02, 2009 at 09:46 UTC | |
|
Re: eval-ling code in another process
by ikegami (Patriarch) on Jun 02, 2009 at 14:42 UTC | |
|
Re: eval-ling code in another process
by KHLeow (Novice) on Jun 02, 2009 at 10:12 UTC | |
by wol (Hermit) on Jun 02, 2009 at 15:48 UTC | |
by Errto (Vicar) on Jun 02, 2009 at 15:29 UTC |