in reply to System command problem in perl

1) don't use the shell
my @args = ( $^X, qw' -pi -e ', $perlprogram, 'test.txt' ); system {$args[0]} @args;

2) What is your expected output? Where do you want to add # that isn't happening

Replies are listed 'Best First'.
Re^2: System command problem in perl
by tod222 (Pilgrim) on Nov 26, 2010 at 21:07 UTC
    system {$args[0]} @args;

    No, don't use system just to run perl when the task can be simply done in a single Perl script. See jwkrahn's response below.