BEGIN { my ($add_ts) = @ARGV; eval 'use subs qw( die )' if $add_ts; } sub die { my $ts = '[' . localtime() . '] '; my $msg = join '', @_; $msg =~ s/^/$ts/mg; CORE::die($msg); } die("foo\n");
>perl test.pl 1 [Sun Aug 23 11:52:55 2009] foo >perl test.pl 0 foo
Execution is required to decide whether die is a subroutine call or an operator.
In reply to Re^2: Unparseability is A Good Thing
by ikegami
in thread Unparseability is A Good Thing
by Jeffrey Kegler
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |