in reply to unless/if
To question assumptions as I usually do these days... die is normally for programming errors, whereas this looks more like a fatal data issue, which should be handled in a different way, e.g.:
<>; if ( /^aaa/ ) { DataFatal( "problem-description, for $_" ); } chomp; my $file = $_; if ( /okregexp/ ) { #do something } else { #matches neither! # this case wasn't mentioned, by the way! } sub DataFatal { # fatal messaging. print STDERR "*** DATA FATAL ***\n+++ " . shift . " +++\n"; exit 1; }
-M
Free your mind
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: unless/if
by sth (Priest) on Oct 11, 2005 at 18:41 UTC | |
by Moron (Curate) on Oct 12, 2005 at 08:17 UTC | |
by sgifford (Prior) on Oct 12, 2005 at 15:49 UTC | |
by Moron (Curate) on Oct 18, 2005 at 12:07 UTC | |
by sth (Priest) on Oct 12, 2005 at 16:58 UTC | |
by blazar (Canon) on Oct 13, 2005 at 08:34 UTC |
In Section
Seekers of Perl Wisdom