in reply to How do I prevent unwanted print output from an eval? (RESOLVED! eval NOT THE PROBLEM!)
eval doesn't output anything to the screen. Maybe this is part of an error message because $key or $word is undefined or one of the three vars isn't declared with my.
Could you post exactly what you see on the screen? Are there any error messages in a logfile (if this is CGI stuff) ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do I prevent unwanted print output from an eval?
by duggles (Acolyte) on Aug 26, 2008 at 21:35 UTC | |
I hope this helps to explain the problem... This is the cryptogram being worked on
After finding the most productive letter patterns in the quote, the eval translates the quote trying one word at a time, testing to see if valid words can be made out of the rest of the quote using that translation. None of that work is being sent to the screen, just the results at the bottom of the loop. Small case letters have been translated for the test. Upper case letters are the original as they are $test_crypt. The first shown here tries "inventions" and is successful in verifying all the rest of the words can be solved using the translation (in this example: $key = "inventions" $word = PUSKUYPJUQ) Screen output:
(The next line is a normal print statement which I DO want to print at the bottom of the loop.)
The second word in the quote is then tried. In this case we start with $key = "something" $word = PUSKUYPJUQ and progress through $key = "gunpowder $word = PUSKUYPJUQ and on to the end In the above loop there was only one match to try. In this next one there's a pretty good list of words to test. This next block is generated by each successive execution of the eval statement in the loop.
All failed except "gunpowder". The point is there is no print statement and there appears to be no error to be reported. It just looks like the results of the eval are being printed to the screen. As I mentioned in a reply to a previous answer, this is executing in a cmd window on a Windows machine. Thanks for your help! Doug
Life is short, but it's wide -- Chuck Pyle
| [reply] [d/l] [select] |
by ikegami (Patriarch) on Aug 26, 2008 at 22:30 UTC | |
It makes no sense for that eval to do so, and I can't reproduce it. The following produces no output to the screen.
So far, we've only received unverifiable claims on your part. Please provide us the means of reproducing your results.
Yet you're sure it's eval's fault... | [reply] [d/l] [select] |
by Anonymous Monk on Aug 27, 2008 at 12:08 UTC | |
Second and explanation:
Third a thank you: A sincere thanks to all of you!! I'll try to improve my postings (and testing methods) when I need help again. Doug | [reply] |
by duggles (Acolyte) on Aug 27, 2008 at 12:12 UTC | |
by jethro (Monsignor) on Aug 26, 2008 at 22:45 UTC | |
You say "(The next line is a normal print statement which I DO want to print at the bottom of the loop.)". I would have liked to see that print statement. And a lot more. We can't help you with code we can't see You seem so dead set on that eval line as the culprit (or some modules) that you discount any other code to have something to do with it. Big mistake. Or you don't want to show the code. In that case you have to use the perl debugger and single step through your loop. You will see exactly which statement produces this unwanted output | [reply] |