in reply to File Stricture Help

Also, since you've declared all (top level/main) vars with 'my', which is a good thing, the var @files is not global, so it has nothing in it in the delfiles() sub...

Replies are listed 'Best First'.
Re^2: File Stricture Help
by Anonymous Monk on May 14, 2008 at 06:51 UTC
    The  @files lexical variable is declared in file scope, and so will be "visible" within the subroutine and will have the expected content.

    That said, it would still be most preferable to pass the list of file paths-and-names to the subroutine as an argument list!