use strict; use warnings; open my $ifh, '>', 'test.txt' or die; print $ifh "Hello world\n"; close $ifh; system ('test.txt'); exit 0;