Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks, I am recently working in Perl-CGI. I need help to open vi editor in perl cgi script to edit a file and provide the user options to modify things in vi editor(definitely I need to use Vi editor). So pls help. Thanks in advance
  • Comment on Open Vieditor using perl/perl cgi script

Replies are listed 'Best First'.
Re: Open Vieditor using perl/perl cgi script (OT)
by LanX (Saint) on Sep 11, 2014 at 09:04 UTC
    That's neither a Perl nor a CGI (server side) question.

    You could suggest to your user to use Firefox (client side) and to install something like the it's all text add on.

    Like this he can easily edit content in any text area with any editor of his choice.

    HTH

    Cheers Rolf

    (addicted to the Perl Programming Language and ☆☆☆☆ :)

Re: Open Vieditor using perl/perl cgi script
by Anonymous Monk on Sep 11, 2014 at 06:39 UTC
    vi editor does not run in browser, so, if that is what you have in mind, it won't work :)

    if you had something else in mind, what is it?

      first thanks for your reply. I want to open vi editor separately externally to open a file which is the output of Perl. This file I need to open in vi editor so that user can use the functions of editor to change anything he want to and upload the file back to original one
        What happens if the user doesn't have vi installed on their machine?
        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

        So you want something like:

        my $file= "/tmp/file-to-edit"; # Let the user edit the file system("vi $file") == 0 or die "Uhoh: $? / $!"; # Now, reupload the file to the website (however)