#!/usr/local/apps/perl/bin/perl ############################################################################# # # # WHO: John L. Moreland # # # # WHAT: strict # # # # WHY: Demonstrates the use of the strict library module. # # # # WHERE: Opus Software # # # # WHEN: Thu Oct 8 19:44:51 PDT 1998 # # # # HOW: PERL # # # ############################################################################# # Impose strict refs, vars, and subs for the block use strict; # Strict 'refs' $ref = \$foo; print $$ref; # OK $ref = "foo"; print $$ref; # Run-time error: Not a real reference # Strict 'vars' my $foo = 7; print $foo; # OK print $foe; # Run-time error: Must use "my", import, or fully qualify # Strict 'subs' $SIG{PIPE} = \&Plumber; # OK $SIG{PIPE} = Plumber; # Run-Time error: bareword identifier