Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3317168
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:33:20+00:00 2026-05-17T22:33:20+00:00

In the summary of differences between Perl 5 and Perl 6, it is noted

  • 0

In the summary of differences between Perl 5 and Perl 6, it is noted that the wantarray function is gone:

wantarray() is gone

wantarray is gone. In Perl 6, context
flows outwards, which means that a
routine does not know which context it
is in.

Instead you should return objects that
do the right thing in every context.

Could someone provide an example of how such an object is created?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:33:21+00:00Added an answer on May 17, 2026 at 10:33 pm

    I think 2 examples might be:


    http://perlcabal.org/syn/S13.html#Type_Casting

    A class may define methods that allow it to respond as if it were a routine, array, or hash. The long forms are as follows:

    method postcircumfix:<( )> ($capture) {...}
    method postcircumfix:<[ ]> (**@slice) {...}
    method postcircumfix:<{ }> (**@slice) {...}
    

    Those are a bit unwieldy, so you may also use these short forms:

    method &.( $capture ) {...}
    method @.[ **@slice ] {...}
    method %.{ **@slice } {...}
    

    Also, I think this might be relevant though less so: http://perlcabal.org/syn/S12.html

    Search for:

    You may write your own accessors to override any or all of the autogenerated ones.

    So you return an object which has several context-specific accessors.


    Interestingly enough, it started out with Perl6 replacing “wantarray” with a generic “want”: RFC 98 (v1) context-based method overloading, circa 2000, also at http://dev.perl.org/perl6/rfc/21.html . I’m not sure why/when the change was made.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Where can I get a summary of differences between ActionScript 3.0 strict and standard
Write a branchless function that returns 0, 1, or 2 if the difference between
What exactly is the difference between Proc Means and Proc Summary ? Many sites
What's the difference between Debug.Print and Debug.WriteLine ? The summary of both in MSDN
Can anyone give me a quick summary of the differences please? To my mind,
Am I correct in assuming that the only difference between "windows files" and "unix
I want to have summary of difference between two files. Expected output is count
I'm new to C++ and trying to figure out the differences between pointer and
After moving a file into another directory I cannot display the differences between two
Summary: I want a horizontal row of ImageButtons to scale down evenly to fit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.