kayak9630 has asked for the wisdom of the Perl Monks concerning the following question:
I am writing a Perl program to do some parsing. It will be used from the command line as:
myprogram <your file>
I am using the diamond operator to get the data out of the file. I want to write a section that checks to see if the user specified anything at the command line and if they did not, I want to give them some help as far as how to use the program.
I tried checking <> several ways with no success:
myprogram <your file>
I am using the diamond operator to get the data out of the file. I want to write a section that checks to see if the user specified anything at the command line and if they did not, I want to give them some help as far as how to use the program.
I tried checking <> several ways with no success:
So clearly I am ignorant of how to check the diamond operator for the existance of data. Please help me :-)if (<> == "") { some helpful code } if (<> eq "") { some helpful code } if (<> == 0) { some helpful code }
edit (broquaint): added <code> tags
Back to
Seekers of Perl Wisdom