Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: How to open an editor from your Perl script?

by kcott (Parson)
on Jul 24, 2012 at 00:56 UTC ( #983268=note: print w/ replies, xml ) Need Help??


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


Comment on Re: How to open an editor from your Perl script?
Download Code
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://983268]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2013-05-24 11:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best material for plates (tableware) is:









    Results (505 votes), past polls