in reply to howto strip the first char of a string?

Those are both perfectly reasonable ways of removing the first character of a string. Other far less reasonable ways might include:

my @foo = split //; shift @foo; $_ = join '', @foo; or my $foo = reverse($_); chop($foo); $_ = reverse($foo); or $_ = unpack "xA*", $_;
and so forth.

/J\

Replies are listed 'Best First'.
Re^2: howto strip the first char of a string?
by wfsp (Abbot) on Sep 08, 2004 at 13:34 UTC
    Excellent! Could anti-golf be the new golf?
      Notwithstanding gellyfish's excellent diversion, there is no "longest" way to do it. You can always add another semi-colon.

      On the other hand, once you whittle a solution down to the empty string, I'm reasonably sure* that nothing shorter will show up.

      And for the longest contest, after the first few TB solutions, we'll all grow tired of waiting for the latest entry to download.

      * Solutions by TheDamian excepted.

      -QM
      --
      Quantum Mechanics: The dreams stuff is made of

      It became almost a tradition in clpm a few years back.

      /J\