Tim McGeary wrote:
I have a file of data that I want to safety check to ensure that there is data for each piece of the line being split. Is there a fast way to say "If any of these are '' then write to error log"?

How about this:

for(@lines) {
  chomp;
  print ERRLOG 'Blank line' if $_ eq '';
  # where ERRLOG is a previously opened file handle
  # you could do if !$_; but that would also match '0'
}

HTH :)

Lee.M - JupiterHost.Net


Thanks, Tim


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to