in reply to Re^5: perl eval
in thread perl eval

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^7: perl eval
by Corion (Patriarch) on Jul 05, 2010 at 19:01 UTC
    #my $param = 'egal("7006","7006")'; #eval print $param; egal("7006","7006"); sub egal () { };

    dies for me, with quite an instrutive message. What does it do for you?

      I am not getting any message.

        Oh - sorry - I should test my postings. You're not running with warnings, otherwise, you would have seen the following warning:

        > perl -w tmp.pl main::egal() called too early to check prototype at ..\tmp.pl line 3.

        What I meant to post was this:

        #my $param = 'egal("7006","7006")'; #eval print $param; sub egal () { }; egal("7006","7006");

        which outputs

        > perl -w tmp.pl Too many arguments for main::egal at ..\tmp.pl line 7, near ""7006")" Execution of ..\tmp.pl aborted due to compilation errors.

        Which is what also happens in your eval but which you never output because you never check for that. See previous posts on what to do.

      Have you run my second piece of code.. What is it's output??