Hi Meir and Dotan,
On Tue, 02 Aug 2011 16:34:12 +0300
Dotan Dimet <[email protected]> wrote:

> Hi Meir,
> 
> Wow. I've never seen Perl formats being used in RL (or even mentioned 
> anywhere outside of the Perl documentation)!
> 

I have seen them used once in an old version of Test::Harness, before I
converted the code away from them, as part of my work on Test::Run. But that's
it.

I should note that PBP recommends against using the built-in perlform and I and
other people on Freenode's #perl agreed with it:

http://perl-begin.org/tutorials/bad-elements/#perlform

In Meir's case he may opt to use http://search.cpan.org/dist/Text-CSV/ instead
or maybe http://search.cpan.org/dist/Perl6-Form/ or whatever. There are also
http://search.cpan.org/dist/Text-Format/ and
http://search.cpan.org/dist/Text-Table/ (I maintain both, but have originated
neither) which may prove of use as well.

Regards,

        Shlomi Fish

> The last paragraph of the perlform document (perldoc perlform) says:
> 
> 
>  > "Within strings that are to be displayed in a fixed length text 
> field, each control character is substituted by a space."
> 
> 
> I think that because the main point of formats is to produce fixed-width 
> output, characters like tabs that have a variable-width representation 
> are problematic.
> 
> 
> Does using format/write in this case give you anything that "print" 
> doesn't provide?
> 
> 
> - Dotan
> 
> 

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Chuck Norris/etc. Facts - http://www.shlomifish.org/humour/bits/facts/

Modern Perl — the 3‐D Movie. In theatres near you.

Please reply to list if it's a mailing list post - http://shlom.in/reply .
_______________________________________________
Perl mailing list
[email protected]
http://mail.perl.org.il/mailman/listinfo/perl

Reply via email to