Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: how to format print statements with data from array

by AnomalousMonk (Archbishop)
on Mar 24, 2009 at 20:27 UTC ( [id://752962]=note: print w/replies, xml ) Need Help??


in reply to how to format print statements with data from array

Something like this may be useful:
use warnings; use strict; my %data; while (<DATA>) { chomp; my ($n, $d) = split; push @{ $data{$n} }, $d; } print "$_ # ", @{$data{$_}}, "\n" for sort keys %data; __DATA__ 0.000 - 0.331 W 0.370 D 0.000 M 0.331 K 0.370 N 0.000 M 0.331 T 0.370 E
Output:
>perl pm752936_1.pl 0.000 # -MM 0.331 # WKT 0.370 # DNE

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-26 02:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found