Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Colon Operator/Seperator

by tomazos (Deacon)
on Oct 06, 2005 at 19:56 UTC ( [id://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?

-Andrew.

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,
    Zaxo

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

Log In?
Username:
Password:

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
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2025-06-17 19:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.