in reply to Re^2: How do I prevent unwanted print output from an eval?
in thread How do I prevent unwanted print output from an eval? (RESOLVED! eval NOT THE PROBLEM!)

It just looks like the results of the eval are being printed to the screen.

It makes no sense for that eval to do so, and I can't reproduce it. The following produces no output to the screen.

use strict; use warnings; my $test_crypt = "NK JNK YJ YAK ZPCCTK GDKQ YAK YNJ NJVQY PUSKUYPJUQ J +R AMZGUPYL - VJZGUYPX TJSK GUC DMUOJNCKV. -- GUCVK ZGMVJPQ"; my $key = 'something'; my $word = 'PUSKUYPJUQ'; eval "\$test_crypt =~ tr/$key/$word/";

So far, we've only received unverifiable claims on your part. Please provide us the means of reproducing your results.

The code is too convoluted, long and poorly written to post

Yet you're sure it's eval's fault...

Replies are listed 'Best First'.
Re^4: How do I prevent unwanted print output from an eval?
by Anonymous Monk on Aug 27, 2008 at 12:08 UTC
    First an apology: I'm sorry to have troubled all of you. I appreciate very much the opportunity to come here for help and now that I've found the problem, I am indeed contrite!

    Second and explanation:
    I found it... I thought I had commented out all of my print statements but there was just one in a subroutine that I did not notice was being called and it was printing the $test_crypt variable. The subroutine call was a bit further down in the code and I simply didn't see it.

    Third a thank you:
    Thanks for all of your inputs. This one was particularly enlightening. I just put these few lines in a subroutine and surrounded it with print statements and it was immediately obvious that the print was coming from somewhere else. I didn't ever really say that I was sure it was eval's fault, I did consider it a suspect, but your reply coupled with some of the others helped me pin it down. I have to confess that I was a bit slighted after yesterday's replies sort of talked down to me a bit, but now I realize that it was well-deserved!!! ;-)

    A sincere thanks to all of you!! I'll try to improve my postings (and testing methods) when I need help again.

    Doug
      jeez... another screwup... I didn't notice that I wasn't logged in so the above reply from anonymous monk actually came from me (duggles)

      sorry...

      Life is short, but it's wide -- Chuck Pyle