I have two perl scripts that use an identical (except for the variable names) eval statement using a quoted expression. I'm on a Windows platform using perl 5.6
eval "\$test_crypt =~ tr/$key/$word/";
I'm not an expert and I can't explain why I'm doing it the way I'm doing it, but if it's not quoted and back-slashed, it does not work. (I may have found it here... ;-)
I don't open any output files in either script (at least until I inserted some redirection stuff). I've attempted to redirect both STDOUT and STDERR. "print" statements before and after the redirect indicate my redirect is working, but the eval statement still appears on the monitor.
The code is too convoluted, long and poorly written to post, but I'm wondering if it may be due to some of the "use" modules I have in the script that does not output the eval to the screen... both use "strict" but one uses:
Data::Dumper;
Text::Wrap;
Text::Autoformat;
PortableReadKey;
I spent some time searching for eval, redirect etc. both here and on the net and came up empty. Any other ideas? Any help would be greatly appreciated. As it stands, the print sure slows down the script!
Thanks!
Life is short, but it's wide -- Chuck Pyle

In reply to How do I prevent unwanted print output from an eval? (RESOLVED! eval NOT THE PROBLEM!) by duggles

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.