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

Hey

I wish to open my perl script by double clicking on it(by opening I mean the command prompt window ,asking for user input not the code ) , but when i do it , the command prompt quickly closes without giving the user time to input anything . In short I can't find a reason why I can't open the script by double clicking on it

Replies are listed 'Best First'.
Re: opening perl script by clicking on it
by davido (Cardinal) on Jul 01, 2013 at 06:24 UTC

    Show some code so that we know what you're doing.


    Dave

      #!/bin/perl -w use strict; use warnings; my @array_A; # array initialization as array_X where X corresponds to +column of csv my @array_B; use Text::CSV; print " Hello please enter the name of your csv file "; print "\n"; my $filename = <>; chomp $filename; @array= data ($filename,0); # funcn call ...

      the problem is at this line use Text::CSV;

        And what do you see when you open a command prompt and execute the script within it, so that when the script terminates the window doesn't close? (I assume you'll probably see an error message, which we will need to know about.)


        Dave

Re: opening perl script by clicking on it
by pvaldes (Chaplain) on Jul 01, 2013 at 11:57 UTC

    Quote the second use warnings and add a: use diagnostics; line. Run again and show us the message.

    i want to make it like an utility , click and execute

    see gtk or tcl. You can create windows, clickable buttons, etc, in a little oldfashion, but relatively simple style

Re: opening perl script by clicking on it
by Anonymous Monk on Jul 01, 2013 at 06:21 UTC
    this happens because of use Text::CSV which i am using in my program . it is windows 32 , even from cmd I can't run it . I am using padre , if I run it from there then I can run it
Re: opening perl script by clicking on it
by zork42 (Monk) on Jul 01, 2013 at 17:20 UTC
    please tell me how should I install this cpan
    It depends on the perl you are using
    Which Perl are you using? ActiveState's ActivePerl or something else?
    If you do not know, type "perl -v" (without the ""s) in a command prompt and post the results here.