Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Creating exception classes

by tobyink (Abbot)
on Feb 05, 2013 at 10:08 UTC ( #1017101=note: print w/replies, xml ) Need Help??


in reply to Re: Creating exception classes
in thread Creating exception classes

"When you write A::B::C in your program, perl searches all the directories in @INC for a directory named A that has a subdirectory named B, which contains a file called C.pm."

No it doesn't. It only does that search if you write use A::B::C, no A::B::C or require A::B::C. Merely mentioning the A::B::C package (for example, to call a constructor) does not force Perl to attempt to load the module.

The following code does not attempt to load "This/File/Does/No/Exist/On/My/Disk.pm"...

use strict; use warnings; { package This::File::Does::No::Exist::On::My::Disk; require Math::BigInt; our @ISA = 'Math::BigInt'; } my $number = This::File::Does::No::Exist::On::My::Disk->new(7); print $number * 6, "\n";
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1017101]
help
Chatterbox?
[Eily]: hu, it came with 5.22 ...
Discipulus win32 is the vietnam of envs..
[Eily]: what's your perl version Discipulus ?
[karlgoethebier]: Eily, Discipulus : IMHO it's worth to ask in SoPW
[Discipulus]: dunno, it is the damned doublequote issue, i think
[karlgoethebier]: Eily: ah, i have v5.24.1
Discipulus is distracted by work..

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2017-07-21 08:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (319 votes). Check out past polls.