Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

bigmacbear's scratchpad

by bigmacbear (Monk)
on May 01, 2006 at 21:58 UTC ( #546780=scratchpad: print w/replies, xml ) Need Help??

The following is my personal LiveJournal and as such has little if any Perl content, but I link it here precisely to demonstrate how easy it is to do: bigmacbear. I keep my publically accessible stuff clean but friends-only stuff may not be safe for work.


Wondering why this construct returns as many empty elements as are present in the argument of keys(), instead of nothing, when %found and %good are identical:

@bogus = map { $_ if !defined $good{$_}; } keys %found; @missing = map { $_ if !defined $found{$_}; } keys %good;

Answer: use grep instead of map. per merlyn and ysth, grep selects and map transforms.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2022-06-27 17:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (88 votes). Check out past polls.

    Notices?