Style

    Have you ever had to maintain code like this?

    The mixed-case-for-words is called camelCase in the Perl world, and it's generally frowned upon because it makes reading code difficult.

    1. my $variable_that_contains_data =

    warnings & strict

    For any program you expect to maintain, reuse, or distribute (that is, for any program), you should have the following lines of code:

    Although, if your Perl is older than 5.6, you need to do this instead:

    1. #!/usr/bin/perl -w
    2.  
    3. use strict;

    Enabling makes Perl complain even more verbosely, but unlike , these complaints are not fatal under ordinary circumstances.

    1. #!/usr/bin/perl
    2. $a + 0; # void context warning
    3. # name used once warning
    4. # undef warning
    5. print "program continued\n"; # prints

    If you want to be fatal, tell it so: