Perl Cookbook error?

Discussion in 'Perl Misc' started by Dave Saville, May 4, 2013.

  1. Dave Saville

    Dave Saville Guest

    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.
    --
    Regards
    Dave Saville
    Dave Saville, May 4, 2013
    #1
    1. Advertising

  2. Dave Saville

    Dave Saville Guest

    On Sat, 4 May 2013 23:48:56 UTC, Ben Morrow <> wrote:

    > 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.

    --
    Regards
    Dave Saville
    Dave Saville, May 5, 2013
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    339
  2. kj
    Replies:
    4
    Views:
    282
    Tim Roberts
    Jan 12, 2008
  3. Janek Schleicher

    Perl Cookbook?

    Janek Schleicher, Jul 19, 2003, in forum: Perl Misc
    Replies:
    1
    Views:
    91
    Joseph Cipale
    Jul 19, 2003
  4. Paul Gillingwater
    Replies:
    0
    Views:
    110
    Paul Gillingwater
    Apr 6, 2004
  5. Staale
    Replies:
    16
    Views:
    228
    Tad McClellan
    Sep 30, 2004
Loading...

Share This Page