As has been mentioned before, the safest is to check your matching:
my $everything_to_first_hyphen;
if ( $line=~/^([^-]*)-/ ) {
$everything_to_first_hyphen=$1;
} else {
die "Failed to find hypen in line: $line\n";
} # if line =~ /^([^-]*)-/
I missed the first part (so the above may be already mentioned) but will
note the '*' means:
-12345
will match, but $everything_to_first_hypen will be empty. If not what you
want, use '+'.
a
Andy Bach, Sys. Mangler
Internet: [EMAIL PROTECTED]
VOICE: (608) 261-5738 FAX 264-5932
Call out Gouranga be happy!!!
Gouranga Gouranga Gouranga ....
That which brings the highest happiness!!
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs