in reply to Re: Odd warning
in thread Odd warning

The abs $2 is to chop off any leading 0's (00012 to 12 for example). Probably not the approved method, butwhatthehell.

Haven't really got any additional info. on the problem. I'm basically going through a large data file, and each line starts with a numeric. Everything goes fine, but then suddenly I'll get a crop of warnings, then fine again, then warnings.

It doesn't really make any sense to me, and I wonder if the problem is elsewhere in my code and being misreported.

Still, apart from that, I get no warnings, so I guess I'll turn 'em off.

Oh, perl 5.6.0 under win2000.

Tom Melly, tom@tomandlu.co.uk

Replies are listed 'Best First'.
Re: Re: Re: Odd warning
by Ovid (Cardinal) on Jul 25, 2002 at 17:05 UTC

    Melly wrote: The abs $2 is to chop off any leading 0's (00012 to 12 for example).

    If you run into this frequently, you can just add zero to the string to force a numeric context and eliminate those zeroes.

    perl -e '$foo="007";print "$foo\n";$foo+=0;print "$foo\n"' 007 7

    Cheers,
    Ovid

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.