in reply to Universal Require

If you haven't tried it yet, add this to the top of your code:

use strict; use diagnostics;

What you should then see when you run your code:

Can't locate UNIVERSAL/require.pm in @INC (@INC contains: ... BEGIN failed--compilation aborted at wtf.pl line 9 (#1) (F) You said to do (or require, or use) a file that couldn't be found. Perl looks for the file in all the locations mentioned in @ +INC, unless the file name included the full path to the file. Perhaps +you need to set the PERL5LIB or PERL5OPT environment variable to say w +here the extra library is, or maybe the script needs to add the library + name to @INC. Or maybe you just misspelled the name of the file. See perlfunc/require and lib.

perl will help you, if you'll let it. It will take some time to get your head wrapped around the warnings so you'll know what they're telling you/what to look for. Once you've got a good feel for it, you can keep the screen clutter down by switching from the diagnostics pragma to the warnings pragma.

Good on ya for the effort!

Replies are listed 'Best First'.
Re^2: Universal Require
by simonodell1 (Novice) on Apr 13, 2007 at 09:18 UTC

    thanks gh, i'll bear that in mind for future ref..

    as for the prob i got it working, all it needed was ;

    my $content = get $url; changing to my $content = get($url);

    doh!

    aXML now has a new plugin called <geturl> :) :)

      as for the prob i got it working, all it needed was ;
      my $content = get $url; changing to my $content = get($url);

      Really? I find that hard to believe:

      Update: I stand corrected. Had not really understood what the issue was about, out of only reading superficially. Shame on me! Rest of post fundamentally irrelevant now.


      and

        Really? I find that hard to believe:

        Of course you get the prototype for get() if you load LWP::Simple at compile time! Without a BEGIN block, however, UNIVERSAL::require loads a module at run time though.