--- Roger C Haslock <[EMAIL PROTECTED]> wrote:
> I have cut your script down (see below)
Some comments:
> #!usr/perl/bin
>
> use CGI;
In this program, you're using the function oriented version of CGI.pm. That means
you'll need to
import the functions. One way:
use CGI qw/:standard/;
If you don't import the functions, the script won't know where to find them and the
program will
abend.
> my $pattern = param('query');
> chop($pattern);
'chop' has been so horribly abused that they're considering eliminating it in Perl 6
(this is
straight from the mouth of Damian Conway). In this case, you're just removing the
last character.
What happens when the pattern is something like '\s+'? Be removing the plus, you've
drastically
changed the meaning of the pattern.
You're probably looking for 'chomp', which removes whatever was last in the input
record separator
($/), which in most cases is the newline.
> open INPUT, "<$filename"; # open file for reading
Don't forget to check for success. If the file fails to open (it's been moved, for
example), then
this call will silently fail and the rest of the script will continue to run.
open INPUT, "< $filename" or die "Cannot open $filename for input: $!";
Cheers,
Curtis Poe
=====
Senior Programmer
Onsite! Technology (http://www.onsitetech.com/)
"Ovid" on http://www.perlmonks.org/
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]