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

Ernst, Yehuda yernst at ndsisrael.com
Thu Jul 15 04:04:33 PDT 2004

but chop take the end no?

-----Original Message-----
From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il]On Behalf Of Gaal Yahas
Sent: Thursday, July 15, 2004 1:51 PM
To: Perl in Israel
Subject: Re: [Israel.pm] how do i cut the first 2 characters/digits of astring?

On Thu, Jul 15, 2004 at 01:47:49PM +0300, Shlomi Fish wrote:
> You can also do it in place using "substr":
> <<<
> $mystring="abcdefgh";
> substr($mystring,0,2)="";
> >>>
> As substr returns an lvalue.
> There's more than one way to do it.

Speaking of which, the following may be self-referentially fastest:

     chop; chop

Gaal Yahas <gaal at forum2.org>
Perl mailing list
Perl at perl.org.il
Information contained in this email message is intended only for use of the individual or entity named above. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the postmaster at nds.com and destroy the original message.

More information about the Perl mailing list