in reply to Recieving input during runtime..

Modules such as Getopt::Long provide many features for processing command line arguments if that's what you are looking for.

"I can do it easily by using <STDIN>..However, problem is i want to create an executable, that asks for some input data"

Are you saying you can't use <STDIN> from a packaged executable?

Replies are listed 'Best First'.
Re^2: Recieving input during runtime..
by tej (Scribe) on Nov 30, 2010 at 10:57 UTC

    I tried using <STDIN>, however, when i run exe, it doesnt ask me for any input.

    If i run script normally through command prompt it works fine. However according to requirements i need to convert it into an executable.

      Well I tried a very basic example:

      #!/usr/bin/perl use strict; use warnings; print "Please enter an output file name: "; my $outputfile = <STDIN>; chomp($outputfile); print "User input: $outputfile\n";

      and converted it to an executable using pp:

      pp -o inputtest inputtest.pl

      Which runs as follows:

      Please enter an output file name: testfile.txt User input: testfile.txt

      Perhaps if you showed an example of your code and how you converted it to an executable someone would be able to help.

      How are you creating the executable? If you are using something like perl2exe with the -gui option, you won't see anything written to STDERR, for example.