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

I am sorry but i tried both of the suggested options but unfortunately none of them worked. Any more tips will seriously be appreciated. Thanks

#!/usr/bin/perl use strict; use warnings; my $test= ("C:\Users\Gxtech\Downloads\ostinato-bin-win32-0.5.1 (2)\ost +inato-0.5.1"); my $program = system( "vi $test");

Replies are listed 'Best First'.
Re: Calling Software/Applications from Perl Script
by hdb (Monsignor) on Jul 26, 2013 at 13:04 UTC

    Replace double quotes with single quotes:

    my $test='C:\Users\Gxtech\Downloads\ostinato-bin-win32-0.5.1 (2)\ostin +ato-0.5.1';
Re: Calling Software/Applications from Perl Script
by 2teez (Vicar) on Jul 26, 2013 at 14:11 UTC

    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

      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
Re: Calling Software/Applications from Perl Script
by mtmcc (Hermit) on Jul 26, 2013 at 15:00 UTC
    Have you tried all of these approaches?
Re: Calling Software/Applications from Perl Script
by Anonymous Monk on Jul 26, 2013 at 13:03 UTC