in reply to Re: Print Statement
in thread Print Statement

I was trying to do :
perl -e 'print 0100101."\n"'
As expected I got the decimal equivalent of octal as:
32833
However, doing
perl -e 'print 100101."\n"'
returned
String found where operator expected at -e line 1, near "100101."\n"" (Missing operator before "\n"?) syntax error at -e line 1, near "100101."\n"" Execution of -e aborted due to compilation errors.
Any idea why this fuss about a zero? Not a burning problem or something. Just curious.

Replies are listed 'Best First'.
Re^3: Print Statement
by ikegami (Patriarch) on Feb 21, 2011 at 20:17 UTC

    The "." is part of the number.

    print 100101. "\n" ^ missing operator

    Add a space before the ".".