Solved

how to pass variable from perl script to batch file

Posted on 2008-10-14
3
526 Views
Last Modified: 2012-05-05
how to pass variable from perl script to batch file?
perl script:
$fpword = "xxxx";
system("D:\\test.bat %$fpword%");

batch script:
echo "%1", I'm getting blank
0
Comment
Question by:matgold
  • 2
3 Comments
 
LVL 39

Accepted Solution

by:
Adam314 earned 50 total points
Comment Utility
system("D:\\test.bat $fpword");

or if $fpword might contain spaces:
system("D:\\test.bat \"$fpword\"");
0
 

Author Closing Comment

by:matgold
Comment Utility
Great Thank You !!!!
I saw an example on Google that used "%", I guess that wasn't right
0
 
LVL 39

Expert Comment

by:Adam314
Comment Utility
The % is how a batch file would access a variable.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now