Re: One sprintf() initializations problem
- From: tom@xxxxxxxxxxxxxx (Tom Phoenix)
- Date: Tue, 30 Oct 2007 09:58:19 -0700
On 10/29/07, jiangfan <Jiangfan.Shi@xxxxxxxxx> wrote:
What is wrong with this statement?
my $time = sprintf( "0x%08x", `date +%s` );
I don't know what's wrong with it on your machine, but I'd change the
command in backticks to be Perl's time operator:
my $time = sprintf("0x%08x", time);
Doesn't that do the same thing? Most simple shell commands aren't
needed from Perl.
"Use of uninitialized value in sprintf at /opt/MoteWorks/tos/../make/
scripts/ident_flags line 15."
Maybe your date command doesn't support that format. But Perl's time
operator should work everywhere.
Cheers!
--Tom Phoenix
Stonehenge Perl Training
.
- References:
- One sprintf() initializations problem
- From: Jiangfan
- One sprintf() initializations problem
- Prev by Date: Re: how to get source of of web page which is hosted on the server (which I dont have access).
- Next by Date: Re: Perl 5.8.6 bug in open()?
- Previous by thread: Re: One sprintf() initializations problem
- Next by thread: how to get source of of web page which is hosted on the server (which I dont have access).
- Index(es):
Relevant Pages
|