2 # Copyright (c) 2006 Jonathan Rockway <jrockway@cpan.org>
4 package TestApp::Controller::Fork;
8 use base 'Catalyst::Controller';
13 my ($self, $c, $ls) = @_;
14 my ($result, $code) = (undef, 1);
20 $result = system($ls, $ls, $ls);
21 $result = $! if $result != 0;
24 $c->response->body(Dump({result => $result}));
27 sub backticks : Local {
28 my ($self, $c, $ls) = @_;
29 my ($result, $code) = (undef, 1);
36 $result = `$ls $ls $ls` || $!;
40 $c->response->body(Dump({result => $result, code => $code}));
55 waitpid $pid,0 or die;
57 $c->response->body(Dump({pid => $pid, result => $x}));