in reply to @ARGV: two different types of arguments

You are confusing two different modes of operation - parsing command line arguments and prompting for user input then processing it.

@ARGV is initialized with the arguments passed on the command line when your script is executed. You do not need to prompt for the values - it is too late for the user to change the values in any case.

The prompt/process mode uses STDOUT (in exactly the way your code demonstrates) to prompt the user for input at run time. Your code should then use <STDIN> to get a line of response from the user. For example you could write:

print STDOUT "enter the name of the beacon\n"; my $beacon = <STDIN>; ...

You may then want to chomp $beacon to remove the trailing line end sequence and possibly validate the user provided value in some fashion.


Perl is environmentally friendly - it saves trees