Perl programming question
I am trying to write a perl program that checks if a text file has an even number of characters and if it does to print it. This is what I have so far: #!/usr/bin/perl
if($str=~/\A(..)+\Z/)
{print OUTFL $STR;}
I was told that this is somewhat how you do it, but I don't understand what the text file is and what this program is looking at. Do I need to name a file somewhere and then this will work or does it need more lines? I have the Learning Perl book, but I can't seem to find anything like that. Thanks for any help.
|