#!/usr/bin/perl # https://perlmonks.org/?node_id=1222734 use strict; use warnings; use Path::Tiny; my $lookuptxtfile = 'd.lookuptxtfile'; path($lookuptxtfile)->spew(<slurp; print "\n"; # end setup for testing do # actual code { local ($^I, @ARGV) = ('', $lookuptxtfile); print s/The action failed./failed_build/gr while <>; }; # end actual code :) print path($lookuptxtfile)->slurp; # debug print