[Israel.pm] how do i cut the first 2 characters/digits of a string?

Gaal Yahas gaal at forum2.org
Thu Jul 15 03:58:51 PDT 2004

On Thu, Jul 15, 2004 at 01:51:08PM +0300, Gaal Yahas wrote:
> Speaking of which, the following may be self-referentially fastest:
>      chop; chop

Yikes! I misspoke. That does the opposite of what's desired (though at
least it does it quickly). This is no longer as fast, but at least does
the job:

     chop($_ = reverse); chop; $_ = reverse

And a riddle!

Why does this:

     chop($_ = reverse); $_ = reverse chop

not do the same thing?

Gaal Yahas <gaal at forum2.org>

More information about the Perl mailing list