in reply to Re: stdin erases all my files
in thread [SOLVED]open to read file, erases all my files

ok, but then why doesn't it erase my files when i change the path to './', then it behaves normally. but if i switch the path to './somewhere/' it erases the whole ./somewhere/ folder. the folder still exists but it is empty. and i cannot find the bug in my code. plus it does this for every function , procedure.(and only common things for all functions are , stdin, Term::ReadLine and eval()) i would expect that if i had a bug then other functions should not work properly but the behavior is universal. so it led me to a conclusion either something is happening during eval() operation or stdin doesn't work properly with Term::ReadLine so ....

but thnx :)

PS

even if in the folder are files that are totally unrelated with my work, they are also erased. folder gets completely erased it is like i called :rm -r ./dir/ and then mkdir ./dir/ even the existing dir's in that dir get erased...

agreed, it's gonna take me a while but i try to do it and post it

Replies are listed 'Best First'.
Re^3: stdin erases all my files
by Corion (Patriarch) on Jul 02, 2010 at 12:31 UTC

    How am I supposed to tell from your vague description?

    You need to note that your vague description is necessarily vague because if you could describe your code exactly, you would also know where the problem is. So you will need to show us the code, or at least the reduced code that still exhibits the problem but is shorter than 20 lines.

Re^3: stdin erases all my files
by bluescreen (Friar) on Jul 02, 2010 at 13:01 UTC

    Usually this kinds of problems turns to be something else that we haven't considered, and probably you already believe that is something wrong with the open ( which might be or not ) and you focus only on that.

    Try to write a shorter program that only opens a directory and see if that removes everything, ... or run your program using the debugger with perl -d your_program.pl and check if after each step the directory gets wiped out, if so you'd find the line that did it and you'd be available to write a minimal program that evidences the bug ( or new test case for perl 5.12.X :D )