Several things puzzle me about this. The first is your post title, which implies there is a problem with stdin. What makes you think that erasing files is connected with stdin in anyway? By the way, none of the code shows stdin being used.
Behaviour of file IO is operating system dependant, although judging from your mention of
rm -r I guess you are working with some sort of UNIX or Linux. Opening a directory for write on such platforms should return error EISDIR (is a directory), although opening for read is allowed.
So, what ways can the files be erased? I'm guessing you do not have anything as blatent as
unlink glob('dir/*'); or an
opendir/
readdir/
closedir loop.
However there can be some confusion surrounding the <
thing > notation in Perl, in that it can mean a
glob construct, or it can mean a read from a file handle. Maybe worth checking your syntax on such instructions.
It sounds that the entire directory list is being erased somehow, but, thinking out of the box, maybe the files were renamed? A dot '.' prefix to the filename would effectively hide the files, so
ls -a might be worth a go.
Other than that, run the program under strace(1) or truss(1) to see the kernel calls.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.