Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Appending values to existing hash key

by graff (Chancellor)
on Mar 21, 2014 at 03:52 UTC ( [id://1079170]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @val = split(" ",$val);
    my $v = join (":", @val);
    
  2. or download this
    $val =~ s/\s+/:/g
    
  3. or download this
    my %hash;
    while (<DATA>) {
    ...
    foreach my $k (sort keys %hash) {
        print $k.join( ', ', @{$hash{$k}} )."\n";
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-24 20:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found