use strict; use warnings; my $include_file = 'include.pl'; my $wibble; eval do { open(my $fh, '<', $include_file) or die("Unable to open include \"$include_file\": $!\n"); local $/; <$fh> }; die $@ if $@; print $wibble;