sprintf did the trick! Thanks to all who responded. >>> "Craig Sharp" <[EMAIL PROTECTED]> 07/23/04 10:57AM >>> I need to get 2 digit time and date in a scalar when there is only 1 digit.
Eg: Using printf with %02d, I am able to get 05 to print at 5 min past the hour. printf("%02d",$Minute) I need to assign this output to a scalar variable so that I can use it as part of a filename later in the code. This is a snippit of what I tried. $realminute = printf("%02d",$Minute); This works but prints the formatted minute. I do not want it to print, just assign the scalar with two digits. Craig A. Sharp Unix Systems Administrator DNS Administrator Security Administrator Roush Industries Office: 734-466-6286 Cell: 734-231-6769 Fax: 734-466-6939 [EMAIL PROTECTED] ==================================================== I have not lost my mind, it's backed up on tape somewhere! ==================================================== CONFIDENTIALITY NOTE This electronic transmission, including all attachments, is directed in confidence solely to the person(s) to which it is addressed, or an authorized recipient, and may not otherwise be distributed, copied or disclosed. The contents of the transmission may also be subject to intellectual property rights and all such rights are expressly claimed and are not waived. If you have received this transmission in error, please notify the sender immediately by return electronic transmission and then immediately delete this transmission, including all attachments, without copying, distributing or disclosing same. _______________________________________________ Perl-Unix-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _______________________________________________ Perl-Unix-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs