Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: "symbol lookup error" message help

by Anonymous Monk
on Feb 01, 2023 at 05:54 UTC ( [id://11150063]=note: print w/replies, xml ) Need Help??


in reply to Re^2: "symbol lookup error" message help
in thread "symbol lookup error" message help

Use Module::Metadata (core) to examine the path:
/usr/bin/perl -MModule::Metadata -le 'print Module::Metadata->find_mod +ule_by_name("Class::Struct")'
/System/Library/Perl/5.18/Class/Struct.pm

Replies are listed 'Best First'.
Re^4: "symbol lookup error" message help
by Special_K (Monk) on Feb 03, 2023 at 20:10 UTC

    That gives me the path to a module I specify by name, but that's not what I'm asking.

    I'm asking: given a directory where 1 or more perl modules are installed (ex: /home/user_foo/perl_modules/lib/perl5 from my original message), is there a way to determine what version of perl (e.g. 5.12.2, 5.16.3, etc.) was used to install those modules?

      given a directory where 1 or more perl modules are installed [...], is there a way to determine what version of perl [...] was used to install those modules?

      For pure-perl modules, no, because the installation process essentially just copies the module from the source / unpacked archive directory. The installing perl does not leave any "fingerprints".

      For XS-based modules, partially. The Perl part is copied as before, so again, no "fingerprints". The C library generated from XS is compiled code, and even when stripped, you should still be able to find some traces in the binary:

      >strings /usr/lib64/perl5/vendor_perl/auto/DBI/DBI.so|sort -u|grep -i +perl Note: perl is running without the recommended perl -w option PERL_DBI_XSBYPASS PerlIO_open PerlIO_printf PerlIO_puts PerlIO_vprintf Perl_PerlIO_close Perl_PerlIO_flush ... a lot of matches omitted here ... Perl_sv_upgrade Perl_taint_proper Perl_warn_nocontext Perl_warn_sv Perl_xs_boot_epilog Perl_xs_handshake >

      Well, no version here, but because the XS API changed over time, you should at least be able to elimitate some older versions. E.g. I guess PerlIO functions weren't available in 5.005.

      Let's be a little bit smarter and search for a digit followed by a dot:

      >strings /usr/lib64/perl5/vendor_perl/auto/DBI/DBI.so|sort -u|grep '[[ +:digit:]]\.' 1.636 GCC: (GNU) 5.3.0 GLIBC_2.2.5 GLIBC_2.3 GLIBC_2.3.4 GLIBC_2.4 bind_col: column %d is not a valid column (1..%d) v5.22.0 >perl -v This is perl 5, version 22, subversion 2 (v5.22.2) built for x86_64-li +nux-thread-multi Copyright 1987-2015, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge. >perl -MDBI -E 'say $DBI::VERSION' 1.636 >

      That looks about right.

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11150063]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-03-29 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found