Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Changing an array from a sub

by hippo (Bishop)
on Feb 13, 2018 at 09:14 UTC ( [id://1209048]=note: print w/replies, xml ) Need Help??


in reply to Re: Changing an array from a sub
in thread Changing an array from a sub

Personally I prefer this formulation (with the same caveat about modifying the global):

sub ChangeArray1 { $_ = 1 for @A; }

which to me is both clear and concise. All subjective, of course.

And for the benefit of the OP: Go To Statement Considered Harmful.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-04-23 16:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found