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"; } }
In reply to stronger than eval? by andyford
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |