Grant wrote:
> 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

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to