Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Re: Extracting array of hashes from data

by nysus (Deacon)
on Jun 10, 2001 at 01:44 UTC ( #87240=note: print w/ replies, xml ) Need Help??


in reply to Re: Extracting array of hashes from data
in thread Extracting array of hashes from data

I'm still running into a problem using push @{ $alldata{$key} }, \%temphash;

For instance, try: print "$alldata{PROTSIM}[2]{PCT}\n"; at the end of the file. You'll get an Use of uninitialized value at test.pl line 24, <DATA> chunk 35. error. What's strange is that: print "$alldata{PROTSIM}[2]{ORG}\n"; is AOK.

Anyone have any ideas?

I have not read perldsc but I certainly will. Looks useful.

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar";
$nysus = $PM . $MCF;


Comment on Re: Re: Extracting array of hashes from data
Select or Download Code
Re: Re: Re: Extracting array of hashes from data
by srawls (Friar) on Jun 10, 2001 at 02:06 UTC
    Took me a sec, but I got it. In your data, sometimes you have spaces after the ;, and sometimes you don't. After each of your splits (or just the split/;/'s) add  \s* as in:
    my @splitvalue = split /;\s*/, $value;

    The 15 year old, freshman programmer,
    Stephen Rawls

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (13)
As of 2014-08-28 15:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (263 votes), past polls