The Sane module allows you to access SANE-compatible scanners in a Perl
https://metacpan.org/release/Sane