Showoff! :)
-----Original Message----- From: John W. Krahn [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 7:24 PM To: [EMAIL PROTECTED] Subject: Re: Stripping digits from a variable... 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] -------------------------------------------------------------------------------- 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]
