import-bot (20211) [Avatar] Offline
#1
[Originally posted by sromero]

Hi.

I'm having a problem getting the faqgrep.pl script to execute successfully.
I'm very new to perl, so please bear with me.

The error I get is:

Argument "perlfaq1.pod" isn't numeric in divide at faqgrep.pl line 10.
Argument "d:/Perl/lib/Pod" isn't numeric in divide at faqgrep.pl line 10.
Illegal division by zero at faqgrep.pl line 10.

I thing this has something to do with how I declared the Pod directory in the
script:

my $faq_directory = 'd:/Perl/lib/Pod';

Most of the examples I've seen in the forum, and the one in the book, is for
UNIX systems. How do I declare the path of the Pods on a Windows system.

BTW - I'm trying to execute the script from the c: drive. d: is on a seperate
partition. Should I be executing the script from the same partition that the
Pod directory is in?

Thanks.

-Steve
import-bot (20211) [Avatar] Offline
#2
Re: faqgrep.pl on Windows
[Originally posted by jandrew]

Without seeing your script, my first guess is that you've neglected
to quote the filename argument in the open() call at line 10:

open(FILE, "$faq_directory/$filename") or die "Can't open file: $!";

With the double quotes we create a string containing the faq
directory, a slash, and the filename -- without the quotes we
are trying to divide the faq_directory by the filename.

Does that solve the problem?

andrew
import-bot (20211) [Avatar] Offline
#3
Re: faqgrep.pl on Windows
[Originally posted by sromero]

Andrew,

You fixed it! I was wondering why I was getting a math error in a script that
searches text.

Thanks for your patience, and your help.

Regards,
Steve Romero

> Without seeing your script, my first guess is that you've neglected
> to quote the filename argument in the open() call at line 10:
>
> open(FILE, "$faq_directory/$filename"smilie or die "Can't open file: $!";
>
> With the double quotes we create a string containing the faq
> directory, a slash, and the filename -- without the quotes we
> are trying to divide the faq_directory by the filename.
>
> Does that solve the problem?
>
> andrew
import-bot (20211) [Avatar] Offline
#4
Re: faqgrep.pl on Windows
[Originally posted by jandrew]


> You fixed it! I was wondering why I was getting a math error in a
> script that searches text.

Glad to hear it's working now. And don't worry about making little
mistakes like that -- the only reason I can pinpoint them so well
is because I've made them all before (more times than I'd care to
admit ... I'm not a bad typist, but I'm certainly not error free
either smilie

Best regards,
andrew