did this, but dont work
Of course it works:
$ ls log.err ls: cannot access log.err: No such file or directory $ cat dieonpurpose.pl #!/usr/bin/env perl use strict; use warnings; local $SIG{__DIE__} = sub { my $message = shift; system qq(echo "$message" >> log.err); }; die "Afghanistan bananastand\n"; $ ./dieonpurpose.pl Afghanistan bananastand $ cat log.err Afghanistan bananastand $
"It doesn't work" is as useful to a developer as "I'm ill" is to a medic. Try to be specific.
In reply to Re: how i capture a script error to a file ?
by hippo
in thread how i capture a script error to a file ?
by gabrielsousa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |