in reply to Pentesting tool

Exactly what it says. You're reading a name from STDIN, you do not remove a newline, and try to use this as a name of a file to open.

Unless you have an actual filename containing such a newline, it's going to fail.

And since you're not checking the return value of open, you're now presented with a message you don't know where it comes from, and have to come here and ask.

Please, next time, help yourself, and check the return value of open.

Replies are listed 'Best First'.
Re^2: Pentesting tool
by Sketch- (Initiate) on Jul 04, 2011 at 13:10 UTC
    Ok thanks and sorry. Also I managed to get it working by using chomp on $list. I'll check the return of open just for educational. purposes though
      ... I managed to get it working by using chomp on $list.

      I'm sure you realize this, but just in case: chomp removes a trailing record-separator sequence (newline by default), if present, from a string.

      I'll check the return of open just for educational. purposes though [sic] [emphasis added]

      To reiterate JavaFan's earnest plea, do yourself an enormous favor and always check the return status of open or any other operation having a 'status' that can be checked! What you will learn is that this practice is a good way to avoid headaches.