andyford has asked for the wisdom of the Perl Monks concerning the following question:
But, it didn't stop the error from killing the program.eval { use Cache::File; };
Update Added readmore tags.
/usr/lib/dld.sl: Can't shl_load() a library containing Thread Local Storage: /usr/lib/libpthread.1 /usr/lib/dld.sl: Exec format error Can't load '/usr/local/perl-5.8.7/lib/5.8.7/PA-RISC2.0/auto/DB_File/DB_File.sl' for module DB_File: Exec format error at /usr/local/perl-5.8.7/lib/5.8.7/PA-RISC2.0/XSLoader.pm line 68. at /usr/local/perl-5.8.7/lib/5.8.7/PA-RISC2.0/DB_File.pm line 251 Compilation failed in require at /usr/local/perl-5.8.7/lib/site_perl/5.8.7/Cache/File/Heap.pm line 29. BEGIN failed--compilation aborted at /usr/local/perl-5.8.7/lib/site_perl/5.8.7/Cache/File/Heap.pm line 29. Compilation failed in require at /usr/local/perl-5.8.7/lib/site_perl/5.8.7/Cache/File.pm line 26. BEGIN failed--compilation aborted at /usr/local/perl-5.8.7/lib/site_perl/5.8.7/Cache/File.pm line 26. Compilation failed in require at ./tryCache line 6. BEGIN failed--compilation aborted at ./tryCache line 6.
Now here's the background:
My fix looks like this
Now I'm OK with this, but I'd like to make it resilient to changes in perl or module location/version, so I'm thinking, capture the error output, get the location of the shared library and then put the variable in my BEGIN block.# fix for Cache::File BEGIN { if (!defined($ENV{LD_PRELOAD})) { $ENV{LD_PRELOAD} = '/usr/local/perl-5.8.7/lib/5.8.7/PA-RISC2.0 +/auto/DB_File/DB_File.sl'; my $me = "export LD_PRELOAD='$ENV{LD_PRELOAD}' && $0"; {exec $me} print STDERR "couldn't exec $me\n"; } elsif ($ENV{LD_PRELOAD} =~ /DB_File.sl/) { print "LD_PRELOAD is $ENV{LD_PRELOAD}\n"; } else { $ENV{LD_PRELOAD} = '/usr/local/perl-5.8.7/lib/5.8.7/PA-RISC2.0 +/auto/DB_File/DB_File.sl'.":$ENV{LD_PRELOAD}:" ; my $me = "export LD_PRELOAD='$ENV{LD_PRELOAD}' && $0"; {exec $me} print STDERR "couldn't exec $me\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: stronger than eval?
by cephas (Pilgrim) on Sep 21, 2006 at 18:47 UTC | |
by andyford (Curate) on Sep 21, 2006 at 19:03 UTC | |
by ysth (Canon) on Sep 21, 2006 at 19:51 UTC | |
by andyford (Curate) on Sep 21, 2006 at 20:38 UTC | |
by cephas (Pilgrim) on Sep 22, 2006 at 00:18 UTC | |
|
Re: stronger than eval?
by chorny (Scribe) on Sep 21, 2006 at 18:51 UTC | |
by cephas (Pilgrim) on Sep 21, 2006 at 18:54 UTC | |
by ikegami (Patriarch) on Sep 21, 2006 at 21:30 UTC | |
|
Re: stronger than eval?
by mreece (Friar) on Sep 21, 2006 at 19:08 UTC | |
by diotalevi (Canon) on Sep 21, 2006 at 19:18 UTC | |
by mreece (Friar) on Sep 21, 2006 at 19:34 UTC | |
by diotalevi (Canon) on Sep 21, 2006 at 19:38 UTC | |
by mreece (Friar) on Sep 21, 2006 at 19:46 UTC | |
|