in reply to Re: divide one file into multiple arrays
in thread divide one file into multiple arrays

"usually - you need 'm' for 'match' ..."

You don't need it for /pattern/ or 'pattern'. You also don't need it for ?pattern?; however, that construct is deprecated.

#!/usr/bin/env perl use strict; use warnings; my $x = 'abc'; if ($x =~ /b/) { print "y\n" } else { print "n\n" } if ($x =~ 'b') { print "y\n" } else { print "n\n" } if ($x =~ ?b?) { print "y\n" } else { print "n\n" }

Output:

$ junk Use of ?PATTERN? without explicit operator is deprecated at ./junk lin +e 7. y y y

See perlop - Regexp Quote-Like Operators for details.

-- Ken