hide random home http://www.fmi.uni-passau.de/archive/doc/unix/perl/faq/2.30.html (Einblicke ins Internet, 10/1995)

Do I always/never have to quote my strings or use semicolons?

Do I always/never have to quote my strings or use semicolons?


    You don't have to quote strings that can't mean anything else
    in the language, like identifiers with any upper-case letters
    in them.  Therefore, it's fine to do this:

        $SIG{INT} = Timeout_Routine;
    or 

    @Days = (Sun, Mon, Tue, Wed, Thu, Fri, Sat, Sun);

    but you can't get away with this:

        $foo{while} = until;

    in place of 

        $foo{'while'} = 'until';

    The requirements on semicolons have been increasingly relaxed.  You no
    longer need one at the end of a block, but stylistically, you're
    better to use them if you don't put the curly brace on the same line:

        for (1..10) { print }

    is ok, as is

        @nlist = sort { $a <=> $b } @olist;

    but you probably shouldn't do this:
        
        for ($i = 0; $i < @a; $i++) {
            print "i is $i\n"  # <-- oops!
        } 

    because you might want to add lines later, and anyway, 
    it looks funny. :-)