in reply to seeking eval enlightenment

eval can either eval a block of (already compiled) code, or a string of code (that's not compiled yet). You seem to want to eval a string, but you are using the eval block syntax. Use parens "()" instead of curly braces "{}".

Replies are listed 'Best First'.
Re: Re: seeking eval enlightenment
by geekgrrl (Pilgrim) on May 03, 2004 at 23:13 UTC
    Thank you!
    I changed it to:
    eval $code;
      Don't forget to check $@ afterwards. As pointed out in eval, in addition to evaluating code, eval traps errors and puts them into $@. So minor typos etc will get trapped, and can cause puzzling failures.
        i left out that line of code -
        it follows with:
        die "$@ $code" if $@;
        thanks for the reminder though.