in reply to how to save result in multiple files using for loop in perl

strict and warnings won't help much when commented out, as in your post. They could have:
023: for(my $o = 0; $o<$num; $o++){
024: system ("ssh a.AS1 traceroute @dude[$0] > file"+"$0.txt ");
Had you not disabled them, you would have learned right away that $0 (twice, in Ln 24) is something other than you intended; specifically, it's the full path-name of the file being executed; and not the same as the $o instantiated in Ln 23.

Granted, the error messages and warnings would have been numerous and perhaps confusing, but the appearance of the filename might have sent you looking in the right direction.

  • Comment on Re: how to save result in multiple files using for loop in perl