Perl Cookbook error?

D

Dave Saville

In chapter 8.16 "Reading configuration files" and using "do" to read
perlish conf files they give the example of overriding a system file
with a user file viz:

do "sysconf";
do "userconf";

They then go on to say "if you want to ignore the system config file
when the user has his own test the return value of the do."

do "sysconf"
or
do "userconf";

Is this not the wrong way around?

My take is that if there is *not* a userconf then the do will silently
fail. So the test needs to run the system file only if there is no
userfile as in

do "userconf" or do "systemconf";

Or have I got it wrong? Although a quick test seems to bear me out.

BTW, it seems one can't use strict when doing this type of thing.
 
D

Dave Saville

Yes, this is the wrong way around.

Thanks for the confirmation Ben and the extra info. I tried to submit
an errata report to O'Reilly but the link to do so throws an error.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top