Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Managing capture

by LanX (Bishop)
on Feb 19, 2013 at 11:58 UTC ( #1019533=note: print w/replies, xml ) Need Help??


in reply to Managing capture

What about a pragma to always start a method with

my ($self, $arg1,...) = @_;

???

Why did you think that $self is automatically provided?

> So...is this madness?

Closures are an essential part of Perl's strength, unlikely anybody will help to cripple the language.

You might either consider changing to another OO frmework or using snippets in your IDE (like yasnippet in emacs) to facilitate writing methods.

Cheers Rolf

Replies are listed 'Best First'.
Re^2: Managing capture
by jbert (Priest) on Feb 19, 2013 at 13:02 UTC

    > Closures are an essential part of Perl's strength, unlikely anybody will help to cripple the language.

    They are a powerful feature sure. A *pragma* (or cpan module) which allows people to declare their intent more clearly doesn't change the default behaviour for people who don't use it.

    The same argument applies to other pragmas (strict/warnings etc).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1019533]
help
Chatterbox?
[Corion]: A good morning everybody!
Corion watches with pleasure that Future::AsyncAwait now also works on 5.16. I think 5.14 is a good baseline for "modern" Perl, and that's only one release away from 5.16
[Corion]: (and I really like the async and await keywords as they do away with lots of anonymous subroutines)

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2018-01-24 08:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (256 votes). Check out past polls.

    Notices?