in reply to Alternative to substr on unknown length of scalar

Simply use
substr($line.(' 'x6), 0, 6)
or
substr("$line      ", 0, 6)

Replies are listed 'Best First'.
Re^2: Alternative to substr on unknown length of scalar
by PerlingTheUK (Hermit) on Oct 19, 2004 at 07:58 UTC
    Great Idea,
    should have come up with it myself really.

    Thanks,
    PerlingTheUK