in reply to Warning: Freeing unreferenced scalar

use lib File::Basename::dirname($0);

What is the function call doing here??? Also I think $0 has no meaning yet when the use statements are compiled.

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^2: Warning: Freeing unreferenced scalar
by Anonymous Monk on Aug 18, 2009 at 15:12 UTC
    What is the function call doing here???

    Basically BEGIN{ require lib; lib->import( File::Basename::dirname($0) ); }

    Also I think $0 has no meaning yet when the use statements are compiled.

    It is defined, test it

    BEGIN { warn $0 }; use lib $0; print $_,$/ for @INC; __END__

      Thanks for the explanation, I hadn't expected this! Looks really useful. Sorry that I was not able to help you with your original problem then.

      -- 
      Ronald Fischer <ynnor@mm.st>
        Hi ronald.
        This is just for being able to call that script outside of the containing folder.
        e.g. ./bin/avp2unit.pl

        But I'm not sure whether this is the best method to solve this problem. But it works (this is enough for me xD )

        Anyhow... does anyone know whats the solution to the unreferenced scalar issue? :D

        thx 4 any help...
        me am not mck :)