Re: How to start some file as Perl script argument?



max wrote:
How to start some file as Perl script argument?
Start with perl script + argument

Eg.
File is someexcel.xls
How to start it as
perlscript.pl someexcel.xls

This seems to be a self answering question (SAQ).

You can run a perl script by typing the command
perlscript.pl someexcel.xls

If Perl isn't installed in the normal way you might need to prefix the command with the name of the perl interpreter.

perl perlscript.pl someexcel.xls

If your path doesn't include the directory containing your perl interpreter then you may need to use the full pathname of the perl interpreter

"c:\Program Files\perl\perl" perlscript.pl someexcel.xls

Your path is almost certainly different.

I have more *.xls file in work folder.

If your perl script is written to expect multiple files then you can probably just do

perlscript.pl *.xls

Otherwise you'll have to write a shell script or command to invoke the Perl script for each file.
.



Relevant Pages

  • RE: setting unix command through perl script
    ... I am automating one task in Perl in which this command is ... If I don't execute this command then entire task would fail. ... setting unix command through perl script ... To unsubscribe, e-mail: beginners-unsubscribe@xxxxxxxx ...
    (perl.beginners)
  • Re: command line with -e
    ... specify a Perl script directly on the command line instead of saving it ... It is exactly the same Perl code and has exactly the same ... First I am not sure how all those shell escapes work ... then this is the one and only statement in your Perl script. ...
    (comp.lang.perl.misc)
  • RE: setting unix command through perl script
    ... I am automating one task in Perl in which this command is ... If I don't execute this command then entire task would fail. ... setting unix command through perl script ...
    (perl.beginners)
  • Re: Displaying a users group memberships
    ... Perl script. ... The user's username is passed to the script via the command ... line and captured with ARGV. ...
    (perl.beginners)
  • Re: Displaying a users group memberships
    ... Perl script. ... The user's username is passed to the script via the command ... perldoc -f split ...
    (perl.beginners)