Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: ypne

by jwkrahn (Abbot)
on Jul 04, 2006 at 11:29 UTC ( [id://559147]=note: print w/replies, xml ) Need Help??


in reply to ypne

23 sub increm 24 { $mid = ($mi + $gap) % 60; }
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.
44 if (open CAC, "+>", "cache.html") {
You are only writing to the CAC filehandle so there is no point in opening the file for reading as well.
51 my $filetobecopied = "cache.html."; 52 my $newfile = "nmapresult.html."; 53 copy($filetobecopied, $newfile) or die "File cannot be cop +ied.";
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.
40 chdir "$pathofnmap"; 42 chdir "C:/Documents and Settings/Wxp/Documenti/pubz";
Like open() and copy() in your program, you should verify that chdir() worked correctly.
55 close NMAP;} else {die "Impossibile aprire Nmap $!\n"}}
When using close with a piped open you should verify that the filehandle closed correctly.

You may also want to peruse the style guide for tips on formatting your code. :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://559147]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (None)
    As of 2024-05-23 15:39 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found