in reply to Calling Software/Applications from Perl Script

Hi, Orion13,
Use function system like so:

... my @command = ('vi', $test); system(@command) == 0 or die "could not '@command': $?";
In addition to what has been said before now, please.

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me

Replies are listed 'Best First'.
Re^2: Calling Software/Applications from Perl Script
by Orion13 (Initiate) on Jul 26, 2013 at 14:37 UTC

    Thanks a lot i tried what you suggested but it says vi is not internal or external command , operable program or batch file.

    #!/usr/bin/perl use strict; use warnings; my $test= 'C:\Users\Gxtech\Downloads\ostinato-bin-win32-0.5.1 (2)\osti +nato-0.5.1'; my @command = ('vi', $test) ; System(@command) == 0 or die "could not '@command':$";
      ... it says vi is not internal or external command , operable program or batch file.

      If 'it' (your system) says vi is not installed on the system (or not accessible from your path), you're going to have to address that issue before system will be of any use to you. (And BTW: It's  system (lower-case 's') and not 'System'; let's not stumble down that rabbit-hole!)

      Update:

      System(@command) == 0 or die "could not '@command':$";
      Also, it should be  $? and not plain "$" at the end of the die message. See perlvar, esp. the "Error Variables" sub-section.

      vi is a screen-oriented text editor originally created for the Unix/Linux operating system. Not installed on Win OS by default. Though there are several way to get to install and use it on Win OS. I found this online using google. It might be of help Install vi/vim on Win OS
      Check it out.

      If you tell me, I'll forget.
      If you show me, I'll remember.
      if you involve me, I'll understand.
      --- Author unknown to me