You can use the Getopt module

myscript.pl

use Getopt::Long;
use vars qw($date);
GetOptions('D=s' => \$date);

print "\n date is $date";
***************************************
$perl myscript.pl -D="12/21/00"

should print

date is 12/21/00



                                                                                       
                                  
                    "Alloun, Jonathan"                                                 
                                  
                    <[EMAIL PROTECTED]>                  To:     
[EMAIL PROTECTED]      
                    Sent by:                                     cc:                   
                                  
                    [EMAIL PROTECTED]        Subject:     RE: 
Grasping input parameter off the       
                    eState.com                                   command line . . .    
                                  
                                                                                       
                                  
                                                                                       
                                  
                    12/13/00 01:09 PM                                                  
                                  
                                                                                       
                                  
                                                                                       
                                  



Hello,

I need to give my script a run date parameter i.e.

script_name date="13.12.2000"

I have seen how to use <STDIN> to grasp user input but this script will be
run as a batch job and therefore will need to pass the parameter in when
the
script is called.

How would I capture the date that is passed in??

Thanks in advance.

Jonathan
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users




_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to