[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Perl Question
- Subject: [ale] Perl Question
- From: chrish at realminfo.com (Chris Hamilton)
- Date: Tue, 15 Jun 1999 13:26:07 -0400 (EDT)
> #!/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.
Personally, I try to avoid using system calls. I would do:
use POSIX;
$d = strftime("%j\n", localtime(time));
print $d;
Perl's POSIX::strftime conforms to strftime(3).
--
Chris Hamilton REALM Information Technologies
chrish at realminfo.com Manager, Information Technology Services