in reply to Formats and spaces to the EOL

forget this format gizmo. Just use print or printf. You need the "x" operator in the print list, run the below and you will see how to extend this to arbitrary number of spaces.

#!/usr/bin/perl -w use strict; print "some vars","-" x 60,"\n";
Oh, instead of just 60, this could be a return value from a subroutine.
Prints: some vars------------------------------------------------------------

Replies are listed 'Best First'.
Re^2: Formats and spaces to the EOL
by SuicideJunkie (Vicar) on Aug 07, 2009 at 14:36 UTC
    If you want padding,
    $line .= ' ' x (60-length($line));
    just before you write it out should do the trick.