Ahhh ok. I thought that I would no longer be able to call $cfg once inside the 'unless'.. Well that fixed the problem. Thank you. I still have another problem specific to this module.. maybe youve seen something simular before. here is my current code
#!/usr/local/bin/perl -w use strict; use Config::Simple; my $config_file = shift; if (!$config_file) { $config_file = "etc/allweb-backup.conf"; } my $cfg = new Config::Simple($config_file); my (%Config); unless (%Config = $cfg->vars()) { die "CRITICAL: $config_file is not a valid INI file!\n"; }
I tried the unless statement wrapped around the $cfg line, and that gave me an error.. In the above I wrapped my unless around the %Config line, that also gave the same error.. I guess neither is returning false when it craps out. Any idea how I can get it to die and print my message instead of the message in the module... this is the error message I get when running this code.
Something went wrong. No supported configuration file syntax found at +/usr/local/lib/perl5/site_perl/5.8.2/Config/Simple.pm line 184, <FH> +line 16.

In reply to Re^2: For the life of me, i can't figure out this "use strict" variable problem by dcasey
in thread For the life of me, i can't figure out this "use strict" variable problem by dcasey

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.