in reply to Pre-evaluate string parameter

Oh, damn, I had defined the log function with empty parentheses like so:

sub log() { ... }

Theres no helping a true idiot,
Thanks!!

Replies are listed 'Best First'.
Re^2: Pre-evaluate string parameter
by AnomalousMonk (Archbishop) on Oct 20, 2011 at 21:35 UTC
        (original post)
    I am trying to call a function using an interpolated string as the parameter.
    Can it be done like this ...?
    I am using strict ...

       
    (subsequent post)
    ... I had defined the log function with empty parentheses ...

    shiftee: If you had originally posted the error message reported by Perl (and the code around-about the indicated line number), the humble monks might have avoided a dead-end side-trip along the path to giving you a pertinent answer to your question.

    >perl -wMstrict -le "sub foo () { print 'hi, i am foo'; } ;; main::foo('this is an argument'); " Too many arguments for main::foo at -e line 1, near "'this is an argum +ent')" Execution of -e aborted due to compilation errors.
Re^2: Pre-evaluate string parameter
by GrandFather (Saint) on Oct 20, 2011 at 20:11 UTC

    Short version: Don't use prototypes.

    Longer version: Prototypes don't do what you think they do so you shouldn't use them until you have read the perlsub documentation and really understand what's going on. Then you will know that most the time prototypes are not what you want.

    True laziness is hard work