[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Perl Question
- Subject: [ale] Perl Question
- From: terry at esc1.com (Terry Lee Tucker)
- Date: Tue, 15 Jun 1999 16:37:19 +0000
Bob Kruger wrote:
>
> A quick Perl question...
>
> I have a perl script that I would like to run that includes a "system"
> command. I would like to capture the result of this system command to a
> perl variable that I can use later.
>
> example
>
> #!/usr/bin/perl
> #The following system command generates a Julian date
> system('date +%j') ;
> print "The Julian date is $d " ;
>
> The question is how to capture the output of the system command to the
> variable $d.
>
> As always, thanks in advance for any assistance.
>
> Regards - Bob Kruger
$d = `date +%j`;
print "The Julian date is $d";
Enclose the system command in "backtics" as above.
--
Oakwood, GA 30566 USA
770.965.9294
http://www.esc1.com
The Gates of hell shall NOT prevail...