in reply to Continuing with program execution even when function gives error
You'll want to take a look at eval...
eval { @time_arr = split(/-/,$components[1]); $time_arr[1] = $time_arr[1] -1; $unix_time = timelocal(0,0,0,@time_arr[2,1,0]); }; if ( $@ ) { # propagate unknown errors die $@ unless $@ =~ /out of range/; } # ... script continues
--k.
|
|---|