in reply to Re^4: Please critique this script -- Read emails and write URLs into bookmarks
in thread Please critique this script -- Read emails and write URLs into bookmarks
Rather than
I would prefer something more along the lines of this:if ( not length $message->as_string or $message->as_string =~ /\A\s*\z/ ) { cluck "$in_filepath: Invalid message"; next; }
Also, I would recommend || to or two conditionals together, rather than or.my @errors; length $message->as_string or push ( @errors, 'Message empty' ); $message->as_string =~ /\A\s*\z/ or push ( @errors, 'Invalid message' ); if ( @errors ) { foreach my $e ( @errors ) { cluck "in_filepath: $e"; } next; }
|
|---|