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

Re: unexpected modify hash in a distance with grep { $_ }

by LanX (Cardinal)
on Dec 20, 2019 at 18:26 UTC ( #11110443=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl 
    
    ...
    
    warn Dumper [ grep {$$h{$_}} qw/a b c x/ ];      # <-- no side effect
    warn Dumper [ keys %$h ];
    
  2. or download this
    C:/Perl_524/bin\perl.exe  d:/tmp/pm/grep_autovivify.pl 
    $VAR1 = [
    ...
              'c',
              'b'
            ];
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2020-11-26 07:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?