$ matches line end. When a string has multiple lines, how to much the
last line end?
Thanks,
Peng
> $ matches line end.
No, it matches end of string, not end of line.
If used with //m, _then_ it matches end of line.
> When a string has multiple lines, how to much the
> last line end?
/$/
See it for yourself:
-------------------------------
#!/usr/bin/perl
use warnings;
use strict;
$_ = '
foo
bar
baz
';
s/$/END-OF-STRING/;
print;
-------------------------------
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"