in reply to octal error

quote it... $item = '05540986';  #do not change! a leading 0 in an unquoted number in perl makes it octal...
print "Urk\n" if(777 != 0777);

                - Ant
                - Some of my best work - Fish Dinner

Replies are listed 'Best First'.
Re: Re: octal error
by Gerryjun (Scribe) on Sep 26, 2001 at 00:25 UTC
    i know but i cant quote it its from a user input! $item = 05540986;# dont change! i must convert this to a string to another variable but how?
      In reply to Gerryjun question on how to keep user input from being interpreted as Octal. in this thread
      my $test=<STDIN>; my $test=sprintf("%s",$test); print $test;


      --mandog
      Well, how does the user input it? It should already be a string if read in from STDIN or anything like that...

                      - Ant
                      - Some of my best work - Fish Dinner

        its comming from a form but the octal error happens!