i wrote perl script that take argument from command line and print simple line with this argument. this is the code:
#!/usr/bin/perl -w
use Getopt::Long;
use strict;
my $aviad;
GetOptions(
"aviad:s" => \$aviad,
);
if($aviad){
printf ("aaa: $aviad\n");
}
else{
printf("error\n");
}
i dont know why,but when i type the scriptname in command line like that:
./abc.pl aviad 4
i got error
instead of aaa:4
Why it happened? and how can i solve it?