Thanks tye. I think I'm getting confused...must be age senility. I appreciate your patience and attempt to help me and appologize in advance for not letting this drop...but I am confused.

I thought the author of the book was trying to show me a way to *not* create a real file (i.e., to *not* create the &SDTOUT file)...only create the log file...but still effectively re-direct SDTOUT without using the select($logfile) which only works as long as the programmer doesn't do an explicit print to SDTOUT (e.g., print SDTOUT "Hello, world\n" which would would not print to the log file, but rather would print to SDTOUT).

But if the open creates &SDTOUT then the programmer has to invest in additional code to delete that file...which seems like that would defeat the intentions...IMHO.

But in addition, based upon what you wrote, I'm still confused about why the 2-arguent version of open *without* the space between the direction and the & would *not* create the file, but with the space it does. Why does the lack of the space prevent the creation of the file?

I think I'm also confused about the purpose of the anpersand (i.e., the &)...I thought it was a special symbol or prefix...that wouldn't get interpreted as a part of the filename, but rather was necessary to *prevent* the interpretation of SDTOUT as a file name. So...since I obviously don't understand the true nature of the & symble, can you enlighten me as to what *is* it's purpose.

DarkLord1 Looking for Redemption in the Monastery

In reply to Re^4: "Pro Perl's" Redirecting Filehandles - Unexpected Result (why) by DarkLord1
in thread "Pro Perl's" Redirecting Filehandles - Unexpected Result by DarkLord1

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.