Bharadwaj T
Bharadwaj T

Reputation: 71

I need to pass variable values form a bat file to a perl script

I have a bat file named exp.bat that runs exp.pl a perl script. I need to pass the values to the perl scipt when i run bat from my command prompt.Is that possible.TIA

Upvotes: 0

Views: 891

Answers (1)

Ekkehard.Horner
Ekkehard.Horner

Reputation: 38745

minimal .pl:

use strict;
use warnings;

print join "*", @ARGV;

minimal .bat:

@perl exp.pl %*

usage/demo:

exp.bat a "b c" d
a*b c*d

Upvotes: 4

Related Questions