"Mr. Shawn H. Corey" schreef:
> while( <IFILE> ){
> if( /^\s*(\d+)/ ){
> my $id = $1;
> $longz{$id} = $_;
> }else{
> die "no ID in line $.: $_";
> }
> }
Why use $1 if you can get the match by putting the regex in a list
context?
while ( <$in> ) {
if( my ($id) = m/^\s*(\d+)/ ) {
$longz{$id} = $_;
}
else {
die "no ID in line $.: $_";
}
}
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
