Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
P is for Practical
 
PerlMonks  

Re: subrefs, IPC and gnuplot's tkcanvas

by alpha (Scribe)
on Dec 29, 2006 at 11:44 UTC ( [id://592247]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to subrefs, IPC and gnuplot's tkcanvas

try eval(). basically, do FILE = eval `cat FILE`;
  • Comment on Re: subrefs, IPC and gnuplot's tkcanvas

Replies are listed 'Best First'.
Re^2: subrefs, IPC and gnuplot's tkcanvas
by zentara (Cardinal) on Dec 29, 2006 at 12:54 UTC
    I tried eval, but get errors like
    my $gnuplot = eval \$buffer->($canvas); #OUTPUT: #Undefined subroutine &main::sub {
    or
    my $gnuplot = eval \$buffer; $gnuplot->($canvas); # OUTPUT # Use of uninitialized value in subroutine entry at .... # Undefined subroutine &main:: called at ./zz-std.....

    I'm not really a human, but I play one on earth. Cogito ergo sum a bum
      eval($buffer), not \$buffer. same with $buffer->($canvas).
        Thanks, it was as simple as
        my $can = $canvas; eval($buffer);
        I did need to convert the name $canvas to $can.

        While I was waiting for your reply, I also found that this worked

        use Sub::Install; Sub::Install::install_sub({ code => sub {eval $buffer}, into => main::, as => 'foo' }); &foo($canvas);
        Thanks again.

        I'm not really a human, but I play one on earth. Cogito ergo sum a bum

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://592247]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.