Perl 6? Yes Please!

I love Perl. It lets me get the job done, it is wonderful, it is fantastic, it is - at times - a headache.

London.pm answered my question the other day but the sinking feeling in my gut hasn't gone away and its starting to get me down.

It was a simple problem really: I needed to dispatch a method from each of the objects in a list contained within another object.

Simple.

foreach my $object ( @{ $self->objectlist() } ) {
$object->method();}

However, due to a lack of dilligence on my part I was occasionally putting things into the list that didn't belong. Simple solution to that is stop doing it. Well, yes, but it wasn't just me, it was also other people using the classes that I was writing.

How I asked, other than an if construct examining the return value of ref() (which I don't think is all that elegant) can I determine if an object is blessed? The answer, as I now know, is pretty straightforward:

use Scalar::Utils qw ( blessed );

(Thanks Richard)

Problem solved. But still this pain in my gut. And why? Its because Perl is actually causing me to take more time here, than a language such as say, Java, or C++ would. While I'm not advocating those particular languages over Perl, what I'm saying is the concept of method signatures are time-saving.

Being able to say something like (note: this is not an assumption about what perl6 syntax may look like - I'm not qualified - so I'll leave it to Mr. Conway to interpret how it actually may appear):