in reply to for loops

just wondering here... if a value is not assigned to a variable at the startup does that mean that the value is automatically assigned to 0 ? Jason Temple AKA Falthor Assistant Operartions Manager Neurogames

Replies are listed 'Best First'.
RE: RE: for loops
by davorg (Chancellor) on Jun 29, 2000 at 16:51 UTC

    No. An unassigned variable contains the special value undef. This will evaluate as false under some circumstances. 0 (and, indeed, '0') also evaluates as false, which is where the confusion arises.

    --
    <http://www.dave.org.uk>

    European Perl Conference - Sept 22/24 2000
    <http://www.yapc.org/Europe/>
RE: RE: for loops
by Anonymous Monk on Jun 28, 2000 at 05:20 UTC
    Now how does it know to print on the next line ? do we specify anything or it just does it ?
      Suggest you re-visit the String scalars section. The \n is a newline character to be printed. Thus after each value, a newline is printed (CR/LF) so the next print will start on a new line