Testing parameter input to perl script
Hi All,
I'm working on trying to get a redirector script to add to a squid install and I am trying to debug the sample script but I am having a perl brain deficiency... The script is called Redirector.pl and is as follows: Code:
#!/usr/bin/perl So to test this supposition (suppository? LOL) in the shell; it would be like: Code:
echo http://some.url.info | ./Redirector.pl Code:
./Redirector.pl: line 1: http://some.url.info: No such file or directory Your comments appreciated! : EDIT : I just added the "-w" to the "#!/usr/bin/perl" line and now I am getting the output to the screen when I run: Code:
echo http://some.url.info | ./Redirector.pl Code:
302:http://some.url.info |
The problem is that $| doesn't change the default filehandle. It's the autoflush option; setting it to non-zero forces a buffer flush after every write operation (see `man perlvar`). It's best to be explicit with the diamond operator:
Code:
#!/usr/bin/env perl |
All times are GMT -5. The time now is 06:40 PM. |