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.
In reply to Re: Continuing with program execution even when function gives error
by Kanji
in thread Continuing with program execution even when function gives error
by stew
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |