Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Im not sure id call my use of ampersand an operator here. If i have the following

my $code=sub{print "hi\n";}; &{$code};
the &{} part references the code section of its contents and calls it, much like if i have
my $var='hi'; my $ref=\$var; ${$ref}='there'; print "$var\n";
the ${}part references the scalar section of its contents allowing me to set it with the assign statement.

as for subs not existing, remember that for at least 1 and up to 5 times the call succeeded and the sub/coderef did exist, and at the end of MainLoop the sub/coderef still exists.

To show that the coderef still exists and is valid if i changed the "debug" statment at the end to

if ( $tkxfsr->{after}{$afterid}{sub}) { print 'sub:'.$tkxfsr->{after}{$afterid}{sub}."\n"; &{$tkxfsr->{after}{$afterid}{sub}}(); &{$tkxfsr->{after}{$afterid}{sub}}; }
on ubuntu it still fails as it did before but now it prints out the next two items in the queue after printing 'sub:'.....

Edit:add output

encapulated sub=0 SCMD 1527954135_123_c1 hi LIST 1527954135_123_c1 hi 1---------- LIST 1527954135_123_c1 hi 2---------- LIST 1527954135_123_c1 hi 3---------- sub:CODE(0x9cdda24) LIST 1527954135_123_c1 hi 4---------- LIST 1527954135_123_c1 hi 5----------

In reply to Re^2: Tkx after coderef problem by huck
in thread Tkx after coderef problem by huck

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (3)
    As of 2019-11-11 20:02 GMT
    Find Nodes?
      Voting Booth?
      Strict and warnings: which comes first?

      Results (63 votes). Check out past polls.