So this example can be simplified as long as the packages are not enclosed in a block or in different files.
#!/usr/bin/perl -w use strict; { package Foo; our $bar = "Hello World"; package Zoo; print $bar; # no "Foo::" necessary } print $Foo::bar; # now again in package main __END__ Hello WorldHello World
Cheers Rolf
In reply to Re^2: how to use packages as classes in perl?
by LanX
in thread how to use packages as classes in perl?
by The Elite Noob
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |