- or download this
(my $var1 = <<EOT) =~ s/\r?\n/(munched)/g;
First line of "var1"
...
First line of "var2"
Second line of "var2" had a newline here ->
EOT
- or download this
# Was building $var3 in scalar instead of list context
# my $var3 = map { s/\r?\n\Z/(munched)/; $_ } <<EOT;
...
$interpolated
And the last newline is also absent ->
EOT
- or download this
my $var4;
# This generates "Modification of a read-only value attempted at";
...
EOT
}
- or download this
# map{}' on the last key is ok.
my $href = {
...
$href->{key2}->{subkey2} = "Set after eval";
$@ = undef;
}
- or download this
# This doesn't die, but gives the count of matches...
$href->{key3} = {
...
EOT
subkey3 => "No explosion here...but the count of matches",
};
- or download this
$href->{key4} = {
subkey1 => "Hello",
...
},
subkey3 => "No explosion here...",
};
- or download this
use strict;
use warnings;
...
key4->subkey3
<$href->{key4}->{subkey3}>
EOF