Search code examples
regexperlunicodenullnul

How do I omit lines that contain Unicode NULL (U+0000)?


I am reading a file and am wondering how to skip lines that have Unicode NULL, U+0000? I have tried everything below, but none works:

  • if($line)
  • chomp($line)
  • $line =~ s/\s*$//g;

Solution

  • Your list of "everything" does not seem to include the obvious $line =~ m/\000/.