while(my $line = <$FILE>){ next if $line =~ /^\s*(?:;\s*)*$/; ... }