74 |
|
|
75 |
write_file( $code->name, $code->source ); |
write_file( $code->name, $code->source ); |
76 |
chmod 0700, $code->name; |
chmod 0700, $code->name; |
77 |
|
my $cmd = './' . $code->name; |
78 |
|
|
79 |
write_file( $input->name, $input->content ) if ( $input->content ); |
if ( $input->content ) { |
80 |
|
write_file( $input->name, $input->content ); |
81 |
my $cmd = './' . $code->name . ' ' . $input->name; |
$cmd .= ' ' . $input->name; |
82 |
|
$self->result->content( input => $input->content ); |
83 |
|
} |
84 |
|
|
85 |
my $output = `$cmd 2>&1`; |
my $output = `$cmd 2>&1`; |
86 |
$output =~ s/^Can't ignore signal CHLD, forcing to default\.\n//s; |
$output =~ s/^Can't ignore signal CHLD, forcing to default\.\n//s; |
87 |
|
$self->result->content( output => $output ); |
88 |
|
|
89 |
my $message = '$ ' . $cmd; |
my $message = '$ ' . $cmd; |
90 |
|
|
91 |
|
#warn "$message\n$output\n"; |
92 |
|
|
93 |
chdir( $cwd ) || die "can't return to $cwd"; |
chdir( $cwd ) || die "can't return to $cwd"; |
94 |
|
|
95 |
$self->result->message( $message ); |
$self->result->message( $message ); |
96 |
$self->result->content( output => $output, cmd => $cmd ); |
|
97 |
|
#warn "content in action = ",dump( $self->result->content ); |
98 |
|
|
99 |
return 1; |
return 1; |
100 |
} |
} |