Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: Undefined Subroutine & Global symbol requires explicit package name

by tobyink (Canon)
on Jan 24, 2012 at 16:48 UTC ( [id://949727]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Undefined Subroutine & Global symbol requires explicit package name
in thread Undefined Subroutine & Global symbol requires explicit package name

Perl is mostly case-sensitive. There is some ambiguity over case with regard to module names on case-insensitive file systems. For example, given the following module:

# this code is in Foo/Bar.pm package Foo::Bar; use parent qw/Exporter/; our @EXPORT = qw/baz/; sub baz { "Hello world"; } 1;

On a Windows system (Windows a uses case-insensitive but case-preserving file system) you could do this:

use 5.010; use strict; use foo::bar; say Foo::Bar::baz(); # says "Hello world"

And you could do this:

use 5.010; use strict; use Foo::Bar; say baz(); # says "Hello world"

But you couldn't do this:

use 5.010; use strict; use foo::bar; say baz(); # dies - undefined subroutine main::baz

And you couldn't do this:

use 5.010; use strict; use foo::bar; say foo::bar::baz(); # dies - undefined subroutine again

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://949727]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-25 09:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found