On Tuesday, July 23, 2002, at 03:43 , kent ho wrote:
Please help. I want to expand the date command in the echo command:
Ex:
$log=/tmp/ito.log
`echo Warning: some text $log`
I need to expand the date command somewhere in this echo command, please
show me how.
why go outside of perl
$log=/tmp/ito.log
`echo Warning: some text $log`
I need to expand the date command somewhere in this echo command, please
show me how.
the perl localtime function returns the same information as a unix date
command. printing to an append filehandle in perl is similar to echoing to a
file.
Ick.
If you want to shell program you should just program shell. How about:
my $log=/tmp/ito.log;
open LOG, $log;
chomp (my $date = scalar localtime);
print LOG [$date] Warning: some text\n;
On Tuesday, July 23, 2002, at 06:43 PM, kent ho wrote:
Please help. I want to expand the date
Nkuipers [EMAIL PROTECTED] wrote:
or something along those lines. in any case I have been under the
impression that calls to the system are more appropriately made like
this:
system date;
than this:
`date`
though I can't remember what gave me that impression. =)
Backticks