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.
- 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:
- #!/usr/bin/perl -w
- use strict;
Enabling makes Perl complain even more verbosely, but unlike , these complaints are not fatal under ordinary circumstances.
- #!/usr/bin/perl
- $a + 0; # void context warning
- # name used once warning
- # undef warning
- print "program continued\n"; # prints
If you want to be fatal, tell it so: