Same way with stereotypes. Stereotypes come into existence because someone noticed a correlation. Upon commenting on this correlation (real or not), other people notice it until it propagates onto comedy shows (where hopefully their true nature is revealed).
Knowing the real wisdom embodied in a rule of thumb is real knowledge. Blindly following it is real dumb. I submit this example for your review:
which gives me something like this (though the line numbers are different, and my real code has all the other variables declared):use strict; use warnings; use Getopt::Declare; # all reference variable names declared above this line my $option_spec = qq{ Version: $VERSION Description: $SCRIPT_NAME reads a related set of Agilent ".dlog" files and genera +tes the equivalent set of Genesis input files. Options: -$SPLIT_MAP_FILE_PARM <$SPLIT_MAP_FILE_STRING> Name of the split +map file (no default) <${INPUT_FILE_OPT}:if>... One or more input files to process (wil +dcards may be used) [required] -$FORCE_OUTPUT_OPT Overwrite existing output files (default is to + abort when an existing output file is encountered) -$OUTPUT_DIR_OPT <$OUTPUT_DIR_PARM> Put output files in this dire +ctory, create the directory if it doesn't exist (default is current d +irectory) -$OUTPUT_PREFIX_OPT Prefix for naming all output files (default: + $OUTPUT_PREFIX_DEFAULT) -$OUTPUT_SUFFIX_OPT Sufffix for naming all output files (default: + $OUTPUT_SUFFIX_DEFAULT) -$VERBOSE_OPT Enable verbose info Example: Run $SCRIPT_NAME with split map RV900_split_map, verbose info, and u +se output prefix "RV900", and process all *.dlog files in the current + directory: $SCRIPT_NAME -$SPLIT_MAP_FILE_PARM RV900_split_map -$OUTPUT_PREF +IX_OPT RV900 -$VERBOSE_OPT *.dlog } my $options = Getopt::Declare->new( $option_spec ) or die "\n**** Error processing command line options, terminating $S +CRIPT_NAME\n";
Of course, this was buried in with other errors and warnings. It took me a while to isolate, until I got my head on straight and started testing code snippets on their own. For the longest time I couldn't see that I needed a semi-colon after the closing brace on qq.syntax error at xxx.pl line 37, near "my "
Somehow I had distilled down the general rule of "no semi-colon after a statement brace" to "no semi-colon after a brace", even though I know that doesn't work for hash elements.
So be careful with what you "think" you know, because you may not actually know it.
-QM
--
Quantum Mechanics: The dreams stuff is made of
In reply to Rules of Thumb, Stereotypes, and other misleading "knowledge" by QM
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |