At 7:29 PM +0000 1/29/10, Bob Williams wrote:
Thanks. There's a lot in your version for a newbie to learn, but
unfortunately, it still gives the same error :(
It helps if you post the actual code generating the error. You should
also trim the accumulated text to remove non-relevant portions.
In general, you should always test whether or not a regular
expression matches before using the results of a potential match. The
easiest way to do this is test the return value:
if( $entry =~ m{ (.*?) \s+ (.*) \n }xms ) {
# there is a match
my $checksum = $1;
my $song = $2;
# save or process the data
}else{
# there was no match -- ignore or do something as appropriate
}
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/