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

Re^3: A different OO approach

by adrianh (Chancellor)
on Dec 15, 2002 at 03:22 UTC ( #219949=note: print w/replies, xml ) Need Help??

in reply to Re^2: A different OO approach
in thread A different OO approach

++ That is very nice. I didn't realise that you could use my and \() like that. Learn something new every day!

The only pain is that you have to remember to do:

my @A = \my %Foo;


my @A = \my (%Foo);

... which could lead to some nasty buggettes if you're not careful.

Replies are listed 'Best First'.
Re^4: A different OO approach
by Aristotle (Chancellor) on Dec 15, 2002 at 03:32 UTC
    Odd. I didn't even notice. I'm not sure I understand - I shuffled parens around but there's no difference. This is funny and sort of embarrassing.. what am I missing?

    Makeshifts last the longest.

      A single hash is a special case with \(). From perlref.

      As a special case, "\(@foo)" returns a list of refer- ences to the contents of @foo, not a reference to @foo itself. Likewise for %foo, except that the key refer- ences are to copies (since the keys are just strings rather than full-fledged scalars).

      Annoying eh?

        Wow, ya learn something new every day. Yes, annoying indeed. Ugh.

        Makeshifts last the longest.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2022-05-29 12:15 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (101 votes). Check out past polls.