Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: RFC: Is there more to alias?

by ysth (Canon)
on Aug 25, 2004 at 05:15 UTC ( [id://385588]=note: print w/replies, xml ) Need Help??


in reply to RFC: Is there more to alias?

Clarification, please: Would  @x = @y alias @x to @y, so push/shift/clear/whatever done to one would affect the other, while  @x[0..$#x] = @y[0..$#y] would alias only the array elements, not the whole array, so that push/shift/clear/whatever done to one array would leave the other unaffected?

Replies are listed 'Best First'.
Re^2: RFC: Is there more to alias?
by xmath (Hermit) on Aug 25, 2004 at 08:53 UTC
    Yes.

    Note that alias @x[0..$#x] = @y[0..$#y] would only do what you probably want when $#x == $#y. If you simply want to replace the contents of @x with aliases, use alias +(@x) = @y (or perhaps alias((@x) = @y), matter of taste)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2025-07-12 03:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.