in reply to Delete txt file in a previous file

What is your current working directory when run by the webserver? I bet it's not what you think it is. So then when you do "../", it's looking in the wrong place, so of course it won't find anything. The glob comes back empty (because no files match the expression), so the loop is skipped, and nothing is output.

Replies are listed 'Best First'.
Re^2: Delete txt file in a previous file
by stavros (Novice) on Aug 10, 2011 at 19:39 UTC
    Well it is ..Server\htdocs\cgi-bin. And inside cgi-bin i have the script glob.pl.I suppose it is the right one.As you can see i i use glob for collecting the txt files from the location Server\htdocs\Results where inside Results are supposed to be the txt.
      The current working directory is not necessarily the same directory as where your program is stored. This is a common problem when running on web servers. Don't use relative path names (like ../) use absolute path names instead.