in reply to substr and strings on the outside
Hello,
I'm not sure I perfectly understood what you wanted to do.
Do you want to append '12345' to the $f variable,
with at least 5 spaces at the beginning?
If so, here's a snippet that should do what you want:
<kbd>--sub pad { my ($spaces, $string) = @_; return( " " x (5 - length $spaces) . $string ); } my $add = "12345"; my $f = " " x 4; # for leading spaces smaller than 5 print "[" . pad( $f, '12345') . "]";
my $OeufMayo = new PerlMonger::Paris({http => 'paris.mongueurs.net'});</kbd>
In Section
Seekers of Perl Wisdom