Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: user input file

by torres09 (Acolyte)
on Jun 19, 2013 at 13:47 UTC ( #1039779=note: print w/ replies, xml ) Need Help??


in reply to Re: user input file
in thread user input file

I am working on windows , not unix so there will be no invocation . I tried your way but it does not work , may be because of OS


Comment on Re^2: user input file
Re^3: user input file
by MidLifeXis (Prior) on Jun 19, 2013 at 13:51 UTC

    If you drag a csv file on to the script, it can be configured to read the file name from @ARGV. How are you planning to have the user invoke it?

    --MidLifeXis

      I am working on Padre , here the script has been written so I wish that user should input the file name on command prompt , when we run it . In padre we have an option to run the script , which gives a cmd with result on it , we can also give inputs from cmd as well

        If you want the user to type the file name into the interactive terminal that Padre spawns, then you should assign the file name from STDIN - see I/O Operators in perlop. That code will probably look like:
        my $filename = <>; chomp $filename; open(FILE,"<", $filename) or die "Open failed for $filename: $!"; + my @lines=<FILE>;
        The chomp is necessary because your input will have a trailing newline which is not in the file name.

        #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2014-10-23 04:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (124 votes), past polls