Found on perlmonks.org today...
One can check ascii from binaries, for example manpages
embedded and/or .so. files found as dependencies
Might be a duplicate of a tool in base.
Usage:
perl [ program below.pl] [binary ]
Code:
#!perl
use 5.010_000;
use warnings;
use strict;
if ((@ARGV < 1))
{
$0 =~ m#([^\\/]+$)#;
my $name = $1 // $0;
print STDERR "$name file ...\n" . <<'_DESCRIPTION_';
Extract ASCII strings from files listed. Multiple files allowed.
_DESCRIPTION_
exit 1;
}
for my $file (@ARGV)
{
open my $fh, '<:bytes', $file or die "Error: Can't open '$file': $!\n";
my $buf;
while (read $fh, $buf, 1024)
{
my @strings = split /\P{PosixGraph}/, $buf;
for (@strings)
{
next if /^\s*$/;
print "$_\n";
}
}
}