Re: Conflict between two

* Laurent BESSON <laurent besson st com> [2005-08-10 10:30]:
I have tried silly things in my perl app like this but without

"/apa/free2/SunOS/5.8/lib:".$ENV{LD_LIBRARY_PATH} }

I thought the line above would help perl using the
/apa/free2/.. link path before the /usr/lib but it didn't work.

Have you tried putting this at the very top of the script? Iâm
not sure that actually helps, but I do know that if itâs after
âuse Gtk2;â it canât possibly do anything.

But if that doesnât work:

* Laurent BESSON <laurent besson st com> [2005-08-10 11:50]:
In fact, I just found a solution by modifying my perl header
like this:

: # -*- perl -*-

eval 'export LD_LIBRARY_PATH; 
LD_LIBRARY_PATH=/apa/free2/SunOS/5.8/lib:$LD_LIBRARY_PATH; exec 
${PERL:=perl} $0 ${1+"$@"}'
 if 0;

and this workaround the problem

A less ugly way is to use perlâs â-xâ switch which tells the
interpreter to ignore any âjunkâ at the top of the file until it
finds a Perl shebang:

    export LD_LIBRARY_PATH
    ${PERL:=perl} -x $0 ${1+"$@"}

    # Perl code follows here as usual

You can even put switches on the Perl shebang and perl will find
and parse them.

That switch is very handy for wrapping Perl scripts up inside
something else. Iâve even used it to wrap a Perl script up inside
an SSI webpage (.shtml)â

*AUTOLOAD=*_=sub{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1};

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]