This doesn't do 'the right thing' for strings starting with a newline (which admittedly is a border case):
perl -MData::Dumper -e "$foo=qq(\nHello);$foo =~ s/.//; print Dumper \ +$foo"
Adding the /s flag makes dot match newline too:
perl -MData::Dumper -e "$foo=qq(\nHello);$foo =~ s/.//s; print Dumper +\$foo"
In reply to Re^2: cut of first char of a string
by Corion
in thread cut of first char of a string
by holli
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |