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