in reply to Re: Re: Formatting Question
in thread Formatting Question

$_ = 'justify my love'; printf "[%20s] and [%-20s]\n", $_, $_;
will give you
[ justify my love] and [justify my love ]
You can actually combine sprintf and formats, if you want to avoid specifying the width as a picture. You can use @* as your format for a line, and do all the actual formatting of the line with a sprintf. That assumes that you have some reason for using format/write instead of doing it all with printf.

The PerlMonk tr/// Advocate

Replies are listed 'Best First'.
Re: Re^3: Formatting Question
by debiandude (Scribe) on May 27, 2004 at 14:14 UTC
    Thanks. printf is just what I need. I appreciate all the help.