in reply to Re^2: cut of first char of a string
in thread cut of first char of a string

Yes, that doesn't, but this does:
s/(.(.*))/($2ne'')?$2:$1/e


Replies are listed 'Best First'.
Re^4: cut of first char of a string
by Anonymous Monk on Mar 08, 2005 at 15:08 UTC
    $_ = "a"; s/(.(.*))/($2ne'')?$2:$1/e; print
    That gives "a". I'd expect nothing to get printed - if I remove the first character of a one-character string, I should be left with the empty string, not with the same string.
      $_ = "a"; s/(.(.*))/($2ne'')?$2:$1/e; print

      That gives "a". I'd expect nothing to get printed - if I remove the first character of a one-character string,
      I should be left with the empty string, not with the same string.

      As stated - "First, but not last" which means in plain English - the 1-st symbol is not the last one and if so - it is cut.