I had the same problem. I have decided as follows.
First I installed the package below.
apt-get install build-essential (I'm running on Ubuntu Server 16.04 LTS)
I then logged into perl and executed the commands below.
[user@submit2 ~]$ perl -MCPAN -e shell
cpan shell -- CPAN exploration and modules installation (v1.7602)
ReadLine support enabled
cpan> install File::Slurp
CPAN: Storable loaded ok
Going to read /home/user/.cpan/Metadata
Database was generated on Mon, 06 Jun 2011 09:27:35 GMT
Running install for module File::Slurp
Running make for U/UR/URI/File-Slurp-9999.18.tar.gz
CPAN: LWP::UserAgent loaded ok
Fetching with LWP:
ftp://mirrors.kernel.org/pub/CPAN/autho ... .18.tar.gz
CPAN: Digest::MD5 loaded ok
Fetching with LWP:
ftp://mirrors.kernel.org/pub/CPAN/autho ... /CHECKSUMS
CPAN: Compress::Zlib loaded ok
Checksum for /home/user/.cpan/sources/authors/id/U/UR/URI/File-Slurp-9999.18.tar.gz ok
Scanning cache /home/user/.cpan/build for sizes
Deleting from cache: /home/user/.cpan/build/Bundle-CPAN-1.858 (24.1>10.0 MB)
Deleting from cache: /home/user/.cpan/build/ExtUtils-CBuilder-0.280202 (24.0>10.0 MB)
Deleting from cache: /home/user/.cpan/build/Test-Harness-3.23 (23.9>10.0 MB)
Deleting from cache: /home/user/.cpan/build/ExtUtils-MakeMaker-6.56 (21.9>10.0 MB)
Deleting from cache: /home/user/.cpan/build/Module-Build-0.3800 (20.1>10.0 MB)
Deleting from cache: /home/user/.cpan/build/PathTools-3.33 (19.1>10.0 MB)
Deleting from cache: /home/user/.cpan/build/File-Temp-0.22 (18.2>10.0 MB)
Deleting from cache: /home/user/.cpan/build/Scalar-List-Utils-1.23 (17.9>10.0 MB)
Deleting from cache: /home/user/.cpan/build/Test-Simple-0.98 (17.4>10.0 MB)
Deleting from cache: /home/user/.cpan/build/Data-Dumper-2.131 (16.6>10.0 MB)
Deleting from cache: /home/user/.cpan/build/Compress-Raw-Bzip2-2.035 (15.9>10.0 MB)
Deleting from cache: /home/user/.cpan/build/Compress-Raw-Zlib-2.035 (14.5>10.0 MB)
Deleting from cache: /home/user/.cpan/build/libnet-1.22 (12.1>10.0 MB)
Deleting from cache: /home/user/.cpan/build/TermReadKey-2.30 (11.5>10.0 MB)
Deleting from cache: /home/user/.cpan/build/Term-ReadLine-Perl-1.0303 (11.0>10.0 MB)
Deleting from cache: /home/user/.cpan/build/YAML-0.73 (10.6>10.0 MB)
File-Slurp-9999.18/
File-Slurp-9999.18/t/
File-Slurp-9999.18/t/no_clobber.t
File-Slurp-9999.18/t/edit_file.t
File-Slurp-9999.18/t/write_file_win32.t
File-Slurp-9999.18/t/error.t
File-Slurp-9999.18/t/pod_coverage.t
File-Slurp-9999.18/t/perms.t
File-Slurp-9999.18/t/binmode.t
File-Slurp-9999.18/t/pod.t
File-Slurp-9999.18/t/file_object.t
File-Slurp-9999.18/t/stdin.t
File-Slurp-9999.18/t/prepend_file.t
File-Slurp-9999.18/t/read_dir.t
File-Slurp-9999.18/t/large.t
File-Slurp-9999.18/t/paragraph.t
File-Slurp-9999.18/t/error_mode.t
File-Slurp-9999.18/t/TestDriver.pm
File-Slurp-9999.18/t/handle.t
File-Slurp-9999.18/t/data_list.t
File-Slurp-9999.18/t/original.t
File-Slurp-9999.18/t/append_null.t
File-Slurp-9999.18/t/inode.t
File-Slurp-9999.18/t/newline.t
File-Slurp-9999.18/t/slurp.t
File-Slurp-9999.18/t/tainted.t
File-Slurp-9999.18/t/data_scalar.t
File-Slurp-9999.18/t/pseudo.t
File-Slurp-9999.18/t/stringify.t
File-Slurp-9999.18/t/chomp.t
File-Slurp-9999.18/TODO
File-Slurp-9999.18/README
File-Slurp-9999.18/lib/
File-Slurp-9999.18/lib/File/
File-Slurp-9999.18/lib/File/Slurp.pm
File-Slurp-9999.18/MANIFEST
File-Slurp-9999.18/META.yml
File-Slurp-9999.18/Changes
File-Slurp-9999.18/extras/
File-Slurp-9999.18/extras/slurp_bench.pl
File-Slurp-9999.18/extras/slurp_article.pod
File-Slurp-9999.18/extras/FileSlurp_12.pm
File-Slurp-9999.18/Makefile.PL
CPAN.pm: Going to build U/UR/URI/File-Slurp-9999.18.tar.gz
Checking if your kit is complete...
Looks good
Writing Makefile for File::Slurp
cp lib/File/Slurp.pm blib/lib/File/Slurp.pm
Manifying blib/man3/File::Slurp.3pm
/usr/bin/make -j2 -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/append_null.t ....... ok
t/binmode.t ........... ok
t/chomp.t ............. ok
t/data_list.t ......... ok
t/data_scalar.t ....... ok
t/edit_file.t ......... ok
t/error.t ............. ok
t/error_mode.t ........ ok
t/file_object.t ....... ok
t/handle.t ............ ok
t/inode.t ............. ok
t/large.t ............. ok
t/newline.t ........... ok
t/no_clobber.t ........ ok
t/original.t .......... ok
t/paragraph.t ......... ok
t/perms.t ............. ok
t/pod.t ............... skipped: Test::Pod 1.14 required for testing POD
t/pod_coverage.t ...... skipped: Test::Pod::Coverage 1.04 required for testing POD coverage
t/prepend_file.t ...... ok
t/pseudo.t ............ ok
t/read_dir.t .......... ok
t/slurp.t ............. ok
t/stdin.t ............. ok
t/stringify.t ......... ok
t/tainted.t ........... ok
t/write_file_win32.t .. ok
All tests successful.
Files=27, Tests=295, 3 wallclock secs ( 0.18 usr 0.08 sys + 1.93 cusr 0.54 csys = 2.73 CPU)
Result: PASS
/usr/bin/make test -- OK
Running make install
Manifying blib/man3/File::Slurp.3pm
Appending installation info to /home/user/perl5lib/lib/x86_64-linux-thread-multi/perllocal.pod
Installing /home/user/perl5lib/lib/File/Slurp.pm
Installing /home/user/perl5lib/share/man/man3/File::Slurp.3pm
/usr/bin/make install -j2 -- OK
cpan>