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

Re^4: Trying to create a common "variable library"

by fullermd (Priest)
on Jul 21, 2010 at 13:57 UTC ( #850643=note: print w/replies, xml ) Need Help??

in reply to Re^3: Trying to create a common "variable library"
in thread Trying to create a common "variable library"

Even if the docs call use vars "superseded", it still has its occasional uses, because the functionality isn't the same as "our" in every respect.

No, that's what Exporter is for.

As long as there's nothing else in the module, where's the benefit?

In this very specific, narrow case, probably not much. But specific, narrow cases have very bad habits of becoming general, larger cases on their own, as well as being physically or mentally cut&pasted into larger cases. So when the cost of doing it "cleanly" is so small (one package line and two Exporter lines), I think it's well worthwhile.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://850643]
[Eily]: oh, boolean context uses the "" overload if no bool overload has been defined
[Eily]: (I wondered if overloading bool was actually necessary)
[Corion]: Yeah, you need bool to get a true value, and the rest to return the other value ;)
[choroba]: perl -wE '{package o; use Tie::Scalar; use parent -norequire => "Tie::StdScalar" ;sub FETCH { "x" x int rand 2}} tie my $x, "o" ; say $x for 1 .. 10'
[choroba]: for complete ness

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (9)
As of 2017-07-27 13:48 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (414 votes). Check out past polls.