# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #125539] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=125539 >
<masak> what's the idiomatic way to call a MAIN multi from another? <japhb> masak: nextsame? <lizmat> masak: samewith(...) <tadzik> samwich() <japhb> Oh interesting, I just directly call MAIN with the appropriate args. * japhb wonders if that was once a backwards compat hack or something ... I've forgotten why I did it that way now. * masak tries samewith <masak> ooh, interesting. that fails, with "Could not find 'self'"! <lizmat> ah, of course <masak> of course? <lizmat> samewith is for methods... <masak> m: multi MAIN() { samewith('foo') }; multi MAIN('foo') { "foo'd you!" } <camelia> rakudo-moar 2904f3: OUTPUT«Could not find 'self' in sub MAIN [...] <masak> how is samewith for methods? <jnthn> I don't see why it coudln't handle subs too <jnthn> I mean, callwith etc does <masak> right. I was surprised about "only for methods". <jnthn> I don't immediately see why we can't liberalize it to all routines <masak> lizmat: mind if I submit a rakudobug for it not working with subs? <lizmat> I don't :-) * masak submits rakudobug