Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Wrong + Right = Even Worse

by tobyink (Abbot)
on Apr 03, 2014 at 22:01 UTC ( #1081018=note: print w/ replies, xml ) Need Help??

in reply to Wrong + Right = Even Worse

Or in the OO module...

package Foo::Bar; use strict; use warnings; { package main; require ""; require ""; }; ...; 1;
use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name

Comment on Re: Wrong + Right = Even Worse
Download Code
Replies are listed 'Best First'.
Re^2: Wrong + Right = Even Worse
by choroba (Canon) on Apr 03, 2014 at 22:20 UTC
    But in that case I would have to change all calls in the OO module from subroutine() to main::subroutine().
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

      Or ::subroutine() (the main is optional). That seems simpler than changing everything else though, and less hacky than trying to fool %INC (which will probably lead you to a whole bunch of warnings in the redefine category if warnings are enabled).

      use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name
        You can guess - legacy code. No strict, no warnings. I can get almost there with simple

        There would've been no redefine warnings, though. I need the scripts to be read again, because the subroutines are going to a different namespace, therefore nothing gets redefined.

        لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2015-11-28 23:26 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (746 votes), past polls