4

I have a perl script which needs to be called from Windows batch file. Batch file script reads text file and pass the parameters to perl script. Now one of the argument is "User Input". Now if i give double quotes in text file the following error comes
Could not open : No such file or directory at perl_script.pl at Line 10
code is (echo the input and its showing as User Input on command prompt)
echo %INPUT%
perl perl_script.pl %INPUT%

Now if i give single quotes then the perl_script gets only User (Input is truncated)
Please suggest the best way to handle this

2
  • 1
    Inside the perl script, you could improve the error message to tell you what Perl thinks the filename was: open ... or die qq(Could not open "$filename: $!"). You can also dump all command line arguments like say "[$_]" for @ARGV, which enclosed each argument in brackets. Commented Apr 26, 2013 at 14:06
  • Please post the batch script and the perl program. Tough to tell what's going on otherwise. Commented Apr 26, 2013 at 23:49

1 Answer 1

3
echo %INPUT%
perl perl_script.pl "%INPUT%"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.