Daniel Falkenberg wrote:
> 
> Hey all,

Hello,

> I have a variable that prints... 2002
> 
> I want to strip the first two digits from that.  Could someone give me a
> hand with that.  At the moment I have ...
> 
> $year = "2002";
> 
> $year =~ s//20/;
> 
> Is there a more precise way of doing that?


$year = substr $year, 2;

$year =~ s/..//;

$year = unpack 'x2 a2', $year;

$year = sprintf '%02d', $year % 100;



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to