#!/usr/bin/perl use strict; use warnings; my $file = '....'; # Command with special characters. my $pid = open my $kid => "-|"; die "fork() failed: $!\n" unless defined $pid; unless ($pid) { exec {$file} $file or die "exec() failed: $!\n"; } while (<$kid>) { print; } __END__