in perl5 C<use strict> doesn't save us from typo bugs in code like

  use strict;
  print $OtherPackage::erroneuos_name;

in perl5 C<our $var> auotovivifies ${__PACKAGE__ . "::"}{var} glob at compile time, so there's something one could check with C<exists>, but to do it manually is senseless.
And there are no globs in perl6..


So, what about perl6? would it be possible to require declaration of global vars before their first use, even if vars in question are in other package? would it be default behaviour?

hmm, I wonder, is there any sense in C<our $Package::var> in that case.

P.S. I have one (almost unrelated to topic) observation: if sigil is a part of a variable name, then C< Package::$var > makes more sense than perl5 C< $Package::var >. (AFAIK, PHP5 works this way) And this requires less magic from perl.
On the other hand it's considerably harder to interpolate that..

Reply via email to