3 # Copyright (c) 2006 Jonathan Rockway <jrockway@cpan.org>
5 package TestApp::Controller::Fork;
9 use base 'Catalyst::Controller';
14 my ($self, $c, $ls) = @_;
15 my ($result, $code) = (undef, 1);
21 $result = system($ls, $ls, $ls);
22 $result = $! if $result != 0;
25 $c->response->body(Dump({result => $result}));
28 sub backticks : Local {
29 my ($self, $c, $ls) = @_;
30 my ($result, $code) = (undef, 1);
37 $result = `$ls $ls $ls` || $!;
41 $c->response->body(Dump({result => $result, code => $code}));
56 waitpid $pid,0 or die;
58 $c->response->body(Dump({pid => $pid, result => $x}));