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

Re: Conflict between two libglib-2.0.so



* Laurent BESSON <laurent besson st com> [2005-08-10 10:30]:
> I have tried silly things in my perl app like this but without
> success:
> 
> BEGIN { $ENV{LD_LIBRARY_PATH} = 
> "/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:

    #!/bin/sh
    LD_LIBRARY_PATH=/apa/free2/SunOS/5.8/lib:$LD_LIBRARY_PATH
    export LD_LIBRARY_PATH
    ${PERL:=perl} -x $0 ${1+"$@"}

    #!/usr/bin/perl
    # 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)…

Regards,
-- 
#Aristotle
*AUTOLOAD=*_=sub{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1};
&Just->another->Perl->hacker;



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