in reply to Re: Strange warning message regarding filehandle in an "open" statement
in thread Strange warning message regarding filehandle in an "open" statement

gah, while open(INPUT, "$filename") is "correct", just use open(INPUT, $filename).

Better yet, use open(INPUT, '<', $filename) to safely handle inputs of the form >bla or rm -rf / |.

Replies are listed 'Best First'.
Re^3: Strange warning message regarding filehandle in an "open" statement
by punkish (Priest) on Sep 24, 2004 at 21:48 UTC
    ikegami's advice is correct. jtgault, Just do away with the quotes.

    Other monks have also advised correctly. The error is precisely because jtgault has declared INPUT via the open command but not used INPUT anywhere further in your program. Do something with that INPUT and that warning will go away.

    And, finally, my advise is also correct (albeit a bit tangential) -- if, jtgault, you use single quotes, you will not be able to open your file, however, if you use double quotes, or as ikegami is suggesting, then you will be successful.

    Update: added "jtgault" so it doesn't seem like I am correcting/advising ikegami when actually I advising jtgault. ;-)