in reply to Re^3: Capture::Tiny getting stuck on ldd /proc/self/fd/1
in thread Capture::Tiny getting stuck on ldd /proc/self/fd/1

> I'm not aware of a perl module which provides that information.

You can experiment with File::Type, File::LibMagic, File::MMagic, etc.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^5: Capture::Tiny getting stuck on ldd /proc/self/fd/1
by shmem (Chancellor) on Jun 22, 2021 at 15:22 UTC

    These only provide the MIME type:

    perl -MFile::MMagic -E 'say File::MMagic->new->checktype_filename(pop) +' /usr/lib/x86_64-linux-gnu/libHalf.so.12.0.0 application/octet-stream perl -MFile::Type -E 'say File::Type->new->checktype_filename(pop)' /u +sr/lib/x86_64-linux-gnu/libHalf.so.12.0.0 application/x-executable-file

    update

    File::LibMagic is more informative:
    perl -MFile::LibMagic -E 'say File::LibMagic->new->info_from_filename( +pop)->{description}' /usr/lib/x86_64-linux-gnu/libHalf.so.12.0.0 ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically li +nked, BuildID[sha1]=442946ad0e7c43d51d7b05c7a73e02273b9b56d2, strippe +d

    Thanks, choroba.

    perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'