in reply to cut of first char of a string

Not necessary '^' metasym:
my $s = "123456789"; $s =~ s/.//

Replies are listed 'Best First'.
Re^2: cut of first char of a string
by Corion (Patriarch) on Mar 08, 2005 at 08:55 UTC

    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"