M
Marc Girod
a) map
b) {$_ => 1}
perldoc -f map
c) 1..keys
perldoc perlop
Look for 'range operator'
Marc
a) map
b) {$_ => 1}
c) 1..keys
ela said:#my %absent = map {$_ => 1} 1..keys %countries;
my %absent = map {$_ => 1} 3..keys %countries;
so what does "3..keys" actually mean?
if i have a table like:
ID
2
19
117
67
8
and information file like:
1
USA
2
China
3
Japan
4
England
...
100000
Australia
then I can first put the information file into hash and then retrieve the
country information later by the hashed ID. This is the "present" case that
can be solved easily. How can the other way, that is, those IDs that are
absent, to retrieve the coresponding "absent" country information?
....1 USA, MA, Boston
2 China,
Beijing,
Chaoyang
3
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.