Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: modify list through grep

by mickeyn (Priest)
on Nov 26, 2006 at 16:01 UTC ( #586118=note: print w/replies, xml ) Need Help??

in reply to modify list through grep

the "aliases" are relevant when you work on a list returned by grep and not on an array that was created using this list.
(unless, of course the original array contained references which will still refer to the same vars/arrays/hashes)

example (here map works on the list returned by grep before it's assigned to an array):

@l = ( "a", "b", "c" ); @m = map {s/a/z/} grep /a/, @l; print @l;
will print "zbc"

-- Mickey

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://586118]
[oiskuu]: I'm unfamiliar with android or SELinux. But I believe there is nothing of a kind. Unless you play with capabilities or build your own containers/ namespaces.

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (10)
As of 2017-06-23 19:26 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (554 votes). Check out past polls.