Andrej Kastrin wrote: > Dear all, > > Is there any simple way to add user defined switches in Perl. I want > someting like that: > > perl --filein MyInputFileName --fileout MyOutputFileName ##in command line > > With --filein switch I want to define file, which will be read as the > input and with the --fileout the output file. > > > Thanks in advance for any suggestion, Andrej >
I assume you meant to say: perl myscript.pl and so on. I think what you are looking for is getopt::long http://perldoc.perl.org/Getopt/Long.html Also if you just want to use this for input and output file then standard file redirection would be the way to go: perl myscript.pl < MyInputfileName > MyOutputFileName HTH -- MattJ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>