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

Re: Need Help in Array

by Utilitarian (Vicar)
on Jan 03, 2012 at 14:36 UTC ( #946069=note: print w/replies, xml ) Need Help??


in reply to Need Help in Array

Take a look at the following:
#!/usr/bin/perl use strict; use warnings; my %modules; my $current_module; while(<DATA>){ if(/Module:\s*(\d+)/){ $current_module=$1; } else{ $modules{$current_module}{$1}=$2 if (/^(\w+)\s*:\s*(\w+)$/); } } use Data::Dumper; print Dumper(\%modules); __DATA__ Module: 1 ID:001 Customer : yes Module: 2 ID:002 Customer : no Module: 3 ID:003 Customer : yes Module: 4 ID:004 Customer : no

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://946069]
help
Chatterbox?
Discipulus without Corion and with choroba in another timezone the monastery was silent.. I was silbing alone in the cloister
[choroba]: Yes, I feel alone in the cyberspace...
[choroba]: Not many occasions to talk to my wife, either :-(
Discipulus s/silbing/whistle/ dunno from where this word was in my mind..
[Discipulus]: lost in time in space and in the meaning (rocky horror picture show)
[Corion]: Discipulus: Yeah, a short vacation on the Canary islands (Lanzarote). Always great to be in the warmth and sun, from a cold and rainy February here ;)
[Corion]: choroba: Yeah, you have to find a time for the regular skype (or whatever) meetup, I imagine that's hard

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2017-02-22 08:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (325 votes). Check out past polls.