Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: Using '#' at the beginning of a format?

by 2teez (Priest)
on Jan 10, 2013 at 13:24 UTC ( #1012659=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Using '#' at the beginning of a format?
in thread Using '#' at the beginning of a format?

Perl6::Form is a lot better than format. The usage is a lot easier.
loris request can be done like so:

use warnings; use strict; use Perl6::Form; my %name_n_price_tag; print form "#\tName\tPrice", "#\t------ -------"; while (<DATA>) { chomp; my ( $name, $price ) = split /:\s/, $_, 2; $name_n_price_tag{$name} = $price; } print form "\t{|||||}\t{|||||}", $_, $name_n_price_tag{$_}, $/ for sort keys %name_n_price_tag; __DATA__ large: 90.12 small: 12.34 medium: 57.78
Output:
# Name Price # ------ ------- large 90.12 medium 57.78 small 12.34
NOTE however, I don't know how the OP gets it data. This is just a head up using the module Perl6::Form.
Hope this helps.

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me


Comment on Re^3: Using '#' at the beginning of a format?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2014-12-18 02:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (41 votes), past polls