in reply to cut of first char of a string

There are an infinity of ways of course, but here are some.

substr($s, 0, 1, ""); substr($s, 0, 1) x= 0; $s =~ /.(.*)/s and $s = $1; open $s, "<", \$s; seek $s, 1, 0; local $/; $s = <$s>; # using no _add +ittional_ vars $s = substr $s, 1; $s = substr $s, 1, ~0>>1, "JAPH"; $s=~s s.sss;

Update 2006 apr 11.

Here is a list of other threads on choping the first character of strings; thanks to Limbic~Region for finding them.

If so many people want this, maybe we really need the chip/chimp functions in perl6?

Also, on substr($s, 0, 1) x= 0;, see substr() as an lvalue.

Replies are listed 'Best First'.
Re^2: cut of first char of a string
by MidLifeXis (Monsignor) on Mar 08, 2005 at 17:58 UTC

    I especially like the last one (six 's's. Hmm, would that be six-σ?). Very cool.

    --MidLifeXis