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

Re: Array: inserting what isn't there

by boo_radley (Parson)
on May 30, 2003 at 19:57 UTC ( #261930=note: print w/replies, xml ) Need Help??


in reply to Array: inserting what isn't there

grep hash fu!
do you have a more useful dataset to check these against?
my @array = ("12.found","1.found","2.found", "4.found", "5.found", "8. +found", "100.found"); my @e = sort {$a<=>$b} map {m/^(\d+)/ && $1}@array; my %hash; @hash{@e}= (@array); for ($e[0]..$e[-1]) {defined ($hash{$_})or$hash{$_} ="$_.missing"} print join " ", sort {$a<=>$b} values %hash;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2023-03-24 02:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (60 votes). Check out past polls.

    Notices?