title: How do I pass Shell parameters to Perl script?
body: <p>I am trying to find dates with in a certain format, I have done it before with perl(<code>strftime</code>), but that time I mentioned a static time, this time i need a variable $CURRENT_DAY here.</p>
  
  <p>Below is the issue, when equate the <code>CURRENT_DAY</code> by using <code>DAYHOUR=86400</code> and an integer, the variable is giving the right time, but once I put <code>$CURRENT_DAY</code> variable in the statement, the date would not decrease. </p>
  
  <pre><code>$ DAYHOUR=86400
  $ DAY=1
  $ CURRENT_DAY=`echo $(($DAYHOUR*$DAY))`
  $ DD=`perl -e 'use POSIX; print strftime "%d", localtime time - $CURRENT_DAY;'`
  $ echo $DD
  20
  $ DAY=`echo $(($DAY+1))`
  $ CURRENT_DAY=`echo $(($DAYHOUR*$DAY))`
  $ DD=`perl -e 'use POSIX; print strftime "%d", localtime time - $CURRENT_DAY;'`
  $ echo $DD
  20
  $ DAY=`echo $(($DAY+1))`
  $ echo $DAY
  3
  $ CURRENT_DAY=`echo $(($DAYHOUR*$DAY))`
  $ echo $CURRENT_DAY
  259200
  $ echo `perl -e 'use POSIX; print strftime "%d", localtime time - 259200;'`
  17
  </code></pre>