All lectures about Y2k aside, you could do it with sprintf() or a regex:
if($var =~ /^\d{2}(\d{2})/){#two digits followed by two digits
$var = $1; #set $var as match in parentheses
}else{
die "Variable has invalid format!\n";
}
-----Original Message-----
From: Daniel Falkenberg [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 6:55 PM
To: [EMAIL PROTECTED]
Subject: Stripping digits from a variable...
Hey all,
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?
Regards,
Dan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------------------
This email may contain confidential and privileged
material for the sole use of the intended recipient.
If you are not the intended recipient, please contact
the sender and delete all copies.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]