Melly has asked for the wisdom of the Perl Monks concerning the following question:
Anyone know why this works:
print '' . (sprintf "%5.5d", 1) . "hello\n";
but this doesn't:
print (sprintf "%5.5d", 1) . "hello\n";
and what should I be writing? (I am revolted by that '')
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: sprintf minor problem
by castaway (Parson) on Sep 03, 2003 at 11:31 UTC | |
|
Re: sprintf minor problem
by gjb (Vicar) on Sep 03, 2003 at 11:33 UTC | |
|
Re: sprintf minor problem
by jmcnamara (Monsignor) on Sep 03, 2003 at 12:24 UTC | |
|
Re: sprintf minor problem
by Hutta (Scribe) on Sep 03, 2003 at 12:20 UTC | |
|
Re: sprintf minor problem
by davido (Cardinal) on Sep 03, 2003 at 17:08 UTC | |
by Melly (Chaplain) on Sep 04, 2003 at 14:45 UTC |