in reply to Problem with adding variable from array
note that $ARGV[1] is the second command line argument to the script and $ARGV[3] is the fourth. Since you don't mention anything about how you're supplying the arguments the problem is probably there somewhere.$node = ("$ARGV[1]"); $interface = ("$ARGV[3]");
Also note that you usually don't want to quote array lookups, it will work here since the values are strings.
In my opinion
is cleaner.$node = $ARGV[1]; $interface = $ARGV[3];
Update: if you're wondering what's going on adding something like this just behind the argument assignment might help:
warn "Supplied arguments: ",join(",",map { "'$_'" } @ARGV); warn "Node is '$node', interface is '$interface'.";
|
|---|