in reply to perl script that accepts parameters via STDIN
This will give you a start (from memory and untested)
> 1. How do I make my script to accept these three (3) name/value pairs via STDIN?
while (my $line = <STDIN> ) { chomp $line; ... }
> 2. How do I access these values from within my script?
%args = split /\s*=\s*/, $line;
> 3. How do I test such a call on Windows?
C:>echo a = 1 |perl -e " print split /=/, <STDIN>" a 1
or
C:>echo a = 1 |perl myScript.pl
or (update)
you can put the lines after __DATA__ at the of your code and replace <STDIN> with <DATA> while testing.
while (my $line = <DATA> ) { ... __DATA__ a=1 b=2 c=3
You've been a unclear about the exact format of your arguments * , depending on this it might be a bit more complicated.
But we expect you to try and are happy to help if you give decent feedback ...
HTH! :)
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
*) like
|
|---|