fork download
  1. #!/usr/bin/perl
  2. # your code goes here
  3.  
  4. use Capture::Tiny ':all';
  5. my $codetoeval = 'print "Hello, World!";';
  6. my ($merged, @result) = capture_merged { eval $codetoeval };
  7. die "Merge Fail" if !@result;
  8. print("Output : " . $merged);
Success #stdin #stdout 0.03s 9344KB
stdin
Standard input is empty
stdout
Output : Hello, World!