You shouldn't define subroutines that only have side effects. In other words, increm() returns a value and you should use that returned value to assign to the variable $mid.23 sub increm 24 { $mid = ($mi + $gap) % 60; }
You are only writing to the CAC filehandle so there is no point in opening the file for reading as well.44 if (open CAC, "+>", "cache.html") {
The file you opened is "cache.html" but the file you are trying to copy is "cache.html.", notice the difference in the file names.51 my $filetobecopied = "cache.html."; 52 my $newfile = "nmapresult.html."; 53 copy($filetobecopied, $newfile) or die "File cannot be cop +ied.";
Like open() and copy() in your program, you should verify that chdir() worked correctly.40 chdir "$pathofnmap"; 42 chdir "C:/Documents and Settings/Wxp/Documenti/pubz";
When using close with a piped open you should verify that the filehandle closed correctly.55 close NMAP;} else {die "Impossibile aprire Nmap $!\n"}}
You may also want to peruse the style guide for tips on formatting your code. :)
In reply to Re: ypne
by jwkrahn
in thread ypne
by LordScinawa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |