For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > October 2006 > Re: getting a 2 digit readout no matter what









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: getting a 2 digit readout no matter what
Igor Sutton

2006-10-04, 9:57 pm

> This is running on a sun box, so I also tried pulling from:
> $string = system "date"; but if one digit, it will not put a "0" in front.



Don't do that. There's a lot of date and time modules waiting for you at
CPAN.


But this doesn't only seems to assign "0". And it prints output
> correctly, but not assigning it to my string.



By the way, if you want to know how to get the output of some external
command, you can check the qx// operator, that works the same as backticks.

$string = `date`;

Remember this approach is not portable.

--
Igor Sutton Lopes <igor.sutton@gmail.com>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com