Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: About Tabbed Printing

by robin (Chaplain)
on Dec 10, 2005 at 18:37 UTC ( #515737=note: print w/ replies, xml ) Need Help??


in reply to About Tabbed Printing

The old-school solution is to use Perl formats. For your example, you could write:

my @aoa = ( [qw (GAL_up800.fasta 6 800 4.8)], [qw (hm01g.fasta 18 2008 36.144)], [qw (hm02r.fasta 9 1000 9)], [qw (train_muscle.fasta 7 50 0.35 )], ); my $aref; # Variable must be visible to the format format STDOUT = @<<<<<<<<<<<<<<<<<<<<<< @<<<<<< @<<<<<< @<<<<<< @$aref . foreach $aref (@aoa) { write; }

For a more contemporary solution, why not try Perl6::Form? It looks very nice from what I've seen.


Comment on Re: About Tabbed Printing
Download Code
Re^2: About Tabbed Printing
by ikegami (Pope) on Dec 12, 2005 at 16:03 UTC
    Caveat: Perl6::Form uses filters (by way of Perl6::Export) and requires Perl 5.8. Filters are generally seen as unfit for production code, and many people still use Perl 5.6.
      It's certainly true that Perl6::Form only works with Perl 5.8 and later, so you can't use it if you're still on 5.6.

      But I think your concern about source filtering is misplaced in this instance. Perl6::Form doesn't use a source filter on your code - it uses it on its own code. The problem with source filters that attempt to add syntax to Perl is that they will never parse the language completely accurately, and so will misbehave on certain code. (That's why Switch.pm is unreliable, for example.) In this case, the code that's being filtered is the source code of Perl6::Form, which obviously won't change, and has been verified to work with the Perl6::Export filter.

        Thanks for clarifying. I must admit I only looked quickly.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2014-09-20 19:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (160 votes), past polls