Perl Monk, Perl Meditation | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
In your second attempt you should use 'sprintf'.
As it is, you are setting $ymd to the value returned from actually printing (using printf). So printf actually prints the desired value. Then '1' (success) is assigned to $ymd. Then that '1' is printed by the line: print "$ymd"; This also explains the result of '1.summary' in your final trace print. If you say my $ymd = sprintf("%04d%02d%02d",$year+1900,$mon+1,$mday); you should be fine. In reply to Re: create file with current date for name
by dvergin
|
|