I have what I thought was a straightforward program.
#!/usr/bin/perl -w
use strict;
$a = 6;
$b = 9;
$c = 7;
print $a . "\n";
print $b . "\n";
print $c . "\n";
I assumed this would display:
6
9
7
and it does when I remove use strict;
on line 2. When I leave it in the program, I get this error.
Global symbol "$c" requires explicit package name at C:\Users\Rick\Documents\PerlStuff\perlexperiment.pl line 6.
Global symbol "$c" requires explicit package name at C:\Users\Rick\Documents\PerlStuff\perlexperiment.pl line 10.
Execution of C:\Users\Rick\Documents\PerlStuff\perlexperiment.pl aborted due to compilation errors.
It gives me this error for c
, but not a
or b
. a
, b
, and c
are just variable names here, right?