Komodo and program arguments

167 views Asked by At

I have a problem with Komodo. In debugging options I have provided program arguments (a string "21") and then in my main program I have this instruction:

$ik = <STDIN>;

print $ik."L";

BUT the program waits for my input "4" in a separate console and doesn't use "21".

enter image description here

enter image description here

1

There are 1 answers

0
Dave Cross On

The script arguments option that you're filling in passes command-line parameters to your program. These command-line arguments can be accessed inside your program via the @ARGV array.

my $ik = $ARGV[0];

Or

# Removes the first argument from @ARGV and returns it
my $ik = shift @ARGV;

Or

# Outside of a subroutine, shift() used @ARGV by default
my $ik = shift;

But that's not how your program expects to receive its input.

$ik = <STDIN>;

This reads the first record from the STDIN filehandle, which is expected to be passed to your program using I/O indirection.

$ ./my_program < some_input_file

Or piped from the output of another program.

$ some_other_process | ./my_program

If no redirected input is supplied, your program will, as you have seen, stop and wait for you to supply input.

I don't use Komodo, so I don't know if it has an option to supply input to STDIN.