"Here people are helpfully corrected if they publish something wrong, some learn, some ignore and repeat ad nauseam.

Who is the one who is repeating the same things here? It's not me. It's you. You claim that my code is unsafe. Prove it. You say my OS isn't safe. Prove it. Just because you repeat a statement hundreds of times that it isn't safe doesn't make it true. Just because some high ranking person says it doesn't make it true. Have you actually installed Windows XP on a computer and followed my guide on how to secure it? My guess is you haven't! People are repeating the same words like a robot without any testing or proof.

Okay. Let's move on. Let's look at the following Perl code and show me why it's unsafe. I am not a Perl expert, so I don't claim to know whether it's safe or not. But if you show me proof that this code can be exploited, then I will believe you:

print "\nEnter full name of file to try to read: "; my $F = <STDIN>; $F =~ tr`<>*%$?\x00-\x1F\"\|``d; local *FILE; open FILE, "<$F" or die "\nError: Cannot open file - $F\n"; print <FILE>; close FILE;

The above code runs fine on Perl 5.004 and TinyPerl 5.8. I have tested it. It works as intended without errors or warnings.


In reply to Re^7: I prefer not to run the latest version of Perl because: by harangzsolt33
in thread I prefer not to run the latest version of Perl because: by hippo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.