You can't create global variables when using strict but you can create lexical variablesThis isn't strictly true (NPI). You can't use variables that either haven't been declared (see. my|/our and vars) or aren't fully qualified while the strict 'vars' pragma is in use e.g
shell> perl -c - use strict 'vars'; use vars qw( $foo ); $foo = "package variable declared with use vars"; my $bar = "lexical variable"; $main::baz = "fully qualified package variable"; our $quux = "YAWTDAV"; $::abc = 'shortcut for $main::abc'; ${*{$main::{x}}{SCALAR}} = 'verbosely assign to $::x'; - syntax OK
_________
broquaint
In reply to Re: Re: Creating variables while using 'strict'
by broquaint
in thread Creating variables while using 'strict'
by nedals
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |