<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3086" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=104250022-11052007><FONT face="Courier New" 
color=#0000ff size=2>Thanks Adam.&nbsp; I am afraid I don't have the luxury of 
using "date" utility in my Sun Unix OS.&nbsp; :D</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=104250022-11052007><FONT face="Courier New" 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=104250022-11052007><FONT face="Courier New" 
color=#0000ff size=2>date: illegal option -- d<BR>usage:&nbsp; date [-u] 
mmddHHMM[[cc]yy][.SS]<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; date [-u] 
[+format]<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; date -a 
[-]sss[.fff]</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV align=left><FONT face="Courier New" size=2>Peter</FONT></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> 
sanfrancisco-pm-bounces+peter.loo=source.wolterskluwer.com@pm.org 
[mailto:sanfrancisco-pm-bounces+peter.loo=source.wolterskluwer.com@pm.org] <B>On 
Behalf Of </B>Adam Morgan<BR><B>Sent:</B> Friday, May 11, 2007 2:41 
PM<BR><B>To:</B> San Francisco Perl Mongers User Group<BR><B>Subject:</B> Re: 
[sf-perl] Embedded Perl in a Korn shell program<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><SPAN class=681381621-11052007><FONT face=Arial 
color=#0000ff size=2>As well as all the good advice you have already received, 
if you are using the perl purely to add a day to the date in ksh, then you 
can&nbsp;get that fiunctionality using the gnu date command, for 
example:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=681381621-11052007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=681381621-11052007><FONT face=Arial 
color=#0000ff size=2>date -d "01/01/2002 +1 day"</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=681381621-11052007></SPAN><SPAN 
class=681381621-11052007><FONT face=Arial color=#0000ff size=2>gives 
</FONT>&nbsp;<FONT face=Arial color=#0000ff size=2>"Wed Jan&nbsp; 2 00:00:00 MST 
2002" as it's result<BR></FONT></SPAN><SPAN class=681381621-11052007><FONT 
face=Arial color=#0000ff size=2></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=681381621-11052007><FONT face=Arial 
color=#0000ff size=2>or</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=681381621-11052007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=681381621-11052007><FONT face=Arial 
color=#0000ff size=2>date -d "+1 day"</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=681381621-11052007><FONT face=Arial 
color=#0000ff size=2>gave "Sat May 12 15:39:09 MDT 2007" when I ran it as it is 
relative to now.</DIV></FONT></SPAN><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> 
sanfrancisco-pm-bounces+adam.morgan=safeway.com@pm.org 
[mailto:sanfrancisco-pm-bounces+adam.morgan=safeway.com@pm.org] <B>On Behalf Of 
</B>Loo, Peter # PHX<BR><B>Sent:</B> Friday, May 11, 2007 2:10 PM<BR><B>To:</B> 
sanfrancisco-pm@pm.org<BR><B>Subject:</B> [sf-perl] Embedded Perl in a Korn 
shell program<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" size=2>Hi 
All,</FONT></SPAN></DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" size=2>I am trying 
to add a day to a date using Perl Time::Local library within a Korn shell.&nbsp; 
However it is not allowing my Korn shell variable to be used within the Perl 
command.</FONT></SPAN></DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" 
size=2>MM=05</FONT></SPAN></DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" 
size=2>DD=06</FONT></SPAN></DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" 
size=2>YYYY=2007</FONT></SPAN></DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" 
size=2>DAY_ADDED=`perl -e 'use Time::Local; ($secs = 
timelocal(0,0,0,$MM,$DD,$YYYY) + 86400); ($year, $mon, $day) = 
(localtime($secs))[5,4,3]; $year+=1900; $mon =~ s/^/0/ if $mon &lt; 10; $day =~ 
s/^/0/ if $day &lt; 10; print $year . $mon . $day;';`</FONT></SPAN></DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" size=2>echo 
$DAY_ADDED</FONT></SPAN></DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" size=2>I am getting 
the following error:</FONT></SPAN></DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" size=2>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" size=2>Day '' out 
of range 1..31 at -e line 1</FONT></SPAN></DIV></FONT></SPAN></DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" size=2>Then I tried 
the following and got a different error:</FONT></SPAN></DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" 
size=2>PERL_CMD="perl -e 'use Time::Local; (\$secs = 
timelocal(0,0,0,$MM,$DD,$YYYY) + 86400); (\$year, \$mon, \$day) = 
(localtime(\$secs))[5,4,3]; \$year+=1900; \$mon =~ s/^/0/ if \$mon &lt; 10; 
\$day =~ s/^/0/ if \$day &lt; 10; print \$year . \$mon . \$day; 
';"</FONT></SPAN></DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" 
size=2>DAY_ADDED=`${PERL_CMD}`</FONT></SPAN></DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" size=2>Can't find 
string terminator "'" anywhere before EOF at -e line 1.</FONT></SPAN></DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=174420221-11052007><FONT face="Courier New" size=2>What am I 
doing wrong here?&nbsp; </FONT></SPAN></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV align=left><FONT face="Courier New" size=2>Peter</FONT></DIV>
<P></P>
<P>This E-mail message is for the sole use of the intended recipient(s) and may 
contain confidential and privileged information. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended recipient, 
please contact the sender by reply E-mail, and destroy all copies of the 
original message. 
<P>"MMS &lt;safeway.com&gt;" made the following 
annotations.<BR>------------------------------------------------------------------------------<BR>Warning: 
<BR>All e-mail sent to this address will be received by the Safeway corporate 
e-mail system, and is subject to archival and review by someone other than the 
recipient. This e-mail may contain information proprietary to Safeway and is 
intended only for the use of the intended recipient(s). If the reader of this 
message is not the intended recipient(s), you are notified that you have 
received this message in error and that any review, dissemination, distribution 
or copying of this message is strictly prohibited. If you have received this 
message in error, please notify the sender immediately. 
<BR><BR>==============================================================================<BR></P></BODY></HTML>