Why ampersands you ask? Because I started programming in perl late last century :), and that's how you called procedural functions back then. Today I call OO methods via $obj-<method(), but I still call procedural functions the old fashioned way.

"As iron sharpens iron, so one man sharpens his friend." So I'm open being brought into the 21st century. :) Perhaps I should read "Modern Perl"?

To your point, and the point of the other anonmonk, I am slightly perplexed on how to call my own web service. I did try:
$self->on(json => sub...
but the affects were still the same in that output from the anonymous procedure called, or methods called from inside that anonymous procedure, etc. was being saved until the procedure ended, not being delivered as it was produced. (I stripped down my code to produce this simplified example. I would be happy to repost using "on(json" if you'd like.)


In reply to Re^2: real-time output from Mojolicious WebSockets? by BroFish
in thread real-time output from Mojolicious WebSockets? by BroFish

Title:
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, details, 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, summary, 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.