1

I would like to process many file/ string into perl and do not wait stdin responded from batch file,.How would be the batch file?

for instance I have test.pl and the content is

my $o=<STDIN>; print "$o\n"; my $c=<STDIN>; print "$c\n"; 

And a batch file executes the test.pl with different stdin at any time

Consider that the functionality of the batch file would be

perl test.pl <stdin> <stdin> perl test.pl <stdin> <stdin> perl test.pl <stdin> <stdin> perl test.pl <stdin> <stdin> 

Then I wonder how to send the stdin into the test.pl.

1 Answer 1

1

Here you have to use @ARGV to receive data. It should be as follows :

my $o=$ARGV[0]; print "$o\n"; my $c=$ARGV[1]; print "$c\n"; 

You can execute the program as follows :

perl test.pl argument_1a argument_2a 

You will get output as

argument_1a argument_2a 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.