Steve K. <> wrote:
> #!/usr/local/bin/perl
> use strict;
> our $text = "line 1\nline 2\nline 3";
> format STDOUT =
> Text: ^*
> $text
> ~~ ^*
> $text
> .
> write (STDOUT);
I don't see in the 5.6.1 documentation that ^* is supported. So it's
either not supposed to work in older versions, or it wasn't much used
and you've found an old bug.
99% of the formats I've seen and used just worked with simple
fixed-width fields.
> I'm also wondering why one would want to use them over printf/sprintf,
> especially when they seem to be so much trouble to use. It reminds me a
> little of Cobol.
Maybe you don't. But formats do understand line counts per page, so if
you're used to 66 line pages, they take a bit of work out. You'd have
to code some extra logic to do that with printf.
--
Darren Dunham
Senior Technical Consultant TAOS
http://www.taos.com/
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >