Why did you add /m? Are you trying to split into lines? To do this with /myou need to use ^or $in regex:
my @lines = split /^/m, $big_string;
However, if you want to treat the large string as strings, just open the file descriptor on the scalar link:
open my $string_fh, '<', \ $big_string;
while( <$string_fh> ) {
... process a line
}
source
share