Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Colon Operator/Seperator

by tomazos (Deacon)
on Oct 06, 2005 at 19:56 UTC ( #498030=perlquestion: print w/replies, xml ) Need Help??

tomazos has asked for the wisdom of the Perl Monks concerning the following question:

I was looking through the perldoc for Test::Class and came across something I hadn't seen before...

package Example::Test; use base qw(Test::Class); use Test::More; sub subtraction : Test { is( 2-1, 1, 'subtraction works ); };

What is that strange colon doing between subtraction and Test - and what is it up to?

Can someone tell me what it is called and which Perl man page documents it?


Replies are listed 'Best First'.
Re: Colon Operator/Seperator
by Zaxo (Archbishop) on Oct 06, 2005 at 20:06 UTC

    It marks the start of the attribute list for subtraction. Also see perlsub. Test::Class provides the handler for the Test attribute.

    Perl operators and punctuation are context-driven, overlapping, and overloaded to the gills. That's why it's so much fun :-) Just like a human language.

    After Compline,

Re: Colon Operator/Seperator
by runrig (Abbot) on Oct 06, 2005 at 20:02 UTC

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://498030]
Approved by muba
Front-paged by kwaping
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2023-12-01 00:29 GMT
Find Nodes?
    Voting Booth?

    No recent polls found