Hey monks. Quick question. When in slurp mode, is there anyway to match a newline character other than "\n" ? At the moment I don't need to, but probably will at one point.
Example:
local $/ = undef;
my $names = <DATA>;
$names =~ /First: (\w+)\nSecond: (\w+)\nThird: (\w+)/;
my ( $first, $second, $third ) = ( $1, $2, $3 );
print "$first, $second, $third\n";
__DATA__
First: Bob
Second: Me
Third: You
The above works, but if I try to replace "\n" in the regex with something else which I would assume would work (namely * or .+) I of course get complaints. Yes, I know that newline characters are special, but if you can't recognize them with a wildcard, isn't slurp mode kinda pointless? The data I'm slurping now is very pretty and well layed out, but what if I was slurping a news article or something?
I'm sure I'm missing something important, so please -- feel free to verbally pound me now.