in reply to How to open an editor from your Perl script?

Use system instead of backticks:

ken@ganymede: ~/tmp $ cat > pm_vi_from_perl.txt Line 1 Line 2 Line 3 ken@ganymede: ~/tmp $ perl -Mstrict -Mwarnings -e 'my $f = q{./pm_vi_from_perl.txt}; syste +m(vi => $f);' ken@ganymede: ~/tmp $ cat pm_vi_from_perl.txt Line 1 Added after system() called Line 2 Here also: Added after system() called Line 3 ken@ganymede: ~/tmp $

-- Ken

Replies are listed 'Best First'.
Re^2: How to open an editor from your Perl script?
by dr.jekyllandme (Sexton) on Jul 24, 2012 at 01:31 UTC
    Thank you, worked like a charm.

      The reason behind system command is ..it just spawns a different shell and runs seperately.In system you can get the exit status as 0 --> Success or Any other positive value --> ie error codes.

      Again..you can play these opening file in editors in Tk.sounds to be little complex.