in reply to eval sub

One thing that seems strange is that you've specified a no-arguments prototype (the empty parentheses in the definition sub mySub() {...}), though you're then trying to call the routine with a parameter ( mySub("hello world") ) ...

Normally, this would throw a "Too many arguments for..." error, but presumably the error message doesn't show up due to the eval. Have you checked $@?

Any reason to not just say sub mySub {...} ?

Replies are listed 'Best First'.
Re^2: eval sub
by samip (Novice) on Oct 09, 2008 at 20:37 UTC
    almut, sorry I skipped the other question. There is no reason to not just say sub mySub {...}. I was just trying a million different things when I couldn't get the eval <string> to work with "". I just left it in there in the test script I posted.