On Jun 20, Nick Transier said:

>package blah;
>{
>sub foo {
>       print "I do not understand perl"

Missing a semicolon above...

>       return 5;
>}
>}
>
>Now, how do I call this function from outside the package?

blah::foo() will work.

>$perlversion = blah::->foo;

That works too, but kinda kruftily.

>but it doesn't work, it asks for explicit package name.

That's on your variable.  You need to declare it.

  my $version = blah::foo();

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
I am Marillion, the wielder of Ringril, known as Hesinaur, the Winter-Sun.
Are you a Monk?  http://www.perlmonks.com/     http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc.     http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter.         Brother #734
**      Manning Publications, Co, is publishing my Perl Regex book      **

Reply via email to