It now works because $bar has been declared, so &printit() has something to print.package Hello; sub printit; # NB: used $bar instead of special var $b for sanity our $bar = "Hello, world!\n"; sub printit { print $bar; } 1; package main; use strict; use warnings; &Hello::printit(); __output__ Hello, world!
broquaint
In reply to Re: Source files, packages and name spaces
by broquaint
in thread Source files, packages and name spaces
by Dinosaur
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |