Help for this page
my $str = "some string\n\n\n\n"; chomp $str; print "[$str]"; # still three trailing newlines ... $/ = ""; # 'paragraph mode' chomp $str; print "[$str]"; # all gone
$/ = 'ggl'; # giggle mode my $str2 = "a string ggl"; my $cnt = chomp $str2; print "$cnt"; # prints: 3