Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

This is not the correct explanation. Deparse helps:

unexpected OP_METHSTART at /usr/share/perl5/B/Deparse.pm line 1674. unexpected OP_METHSTART at /usr/share/perl5/B/Deparse.pm line 1674. sub BEGIN { require v5.38.0; () } use warnings; use strict; no feature ':all'; use feature ':5.38'; use experimental ('class'); BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x5 +5\x55\x55\x55\x55\x55\x55\x55\x55\x51\x55"} use feature 'class'; { package Gear; ; sub ratio : method { XXX; return $chainring / $cog; } sub gear_inches : method { XXX; return ratio(*$rim + $tire * 2); } } say 'Gear'->new('chainring', 52, 'cog', 11, 'rim', 26, 'tire', 1.5)->g +ear_inches;

(I had to modify the code a bit because I don't have 5.40)

So it takes everything that comes after the method name as the argument, so the * is interpreted as a glob dereference.

Note that B::Deparse also struggles with the new class feature.


In reply to Re^2: Using perlclass 'methods' by kikuchiyo
in thread Using perlclass 'methods' by drudgesentinel

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, 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?
    Username:
    Password:

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

    How do I use this?Last hourOther CB clients
    Other Users?
    Others exploiting the Monastery: (4)
    As of 2024-09-15 02:47 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      The PerlMonks site front end has:





      Results (21 votes). Check out past polls.

      Notices?
      erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.