>> I have a variable which could contain any number from 01-12.  I need
>> to remove the leading zero from numbers 01-09, otherwise I get an
>> "octal digit" error when the number is used in a calculation.  Can
>> anyone show me how to remove that leading zero?
>
> use warnings;
> use strict;
>
> my @numbers = qw ( 01 02 03 04 05 );
>
> for my $num (@numbers) {
>        $num = int $num;
>        print "$num\n";
> }
>
> Steve

That got it.  Thank you Steve and Uri.

- Grant

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to