Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

notation of a sub.

by jbrugger (Parson)
on Jul 19, 2005 at 04:41 UTC ( #475964=perlquestion: print w/replies, xml ) Need Help??

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

Hi fellow monks,
Recently i'm playing with catalyst and came to the following notation of a sub, that i've never seen:
sub default : Private { ... or: sub show : Regex('^(\w+)\.html$') {
Now i can guess what Private or Regex means ;-) but i don't understand the notation, a sub named default or show and than a : as delimiter to what?

Can anyone please explain?

"We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.

Replies are listed 'Best First'.
Re: notation of a sub.
by Zaxo (Archbishop) on Jul 19, 2005 at 04:48 UTC
      Well, I read the pointed documentation but still can't figure out how does it works. Any thoughs?

      Igor S. Lopes - izut
      surrender to perl. your code, your rules.
Re: notation of a sub.
by CountZero (Bishop) on Jul 19, 2005 at 06:21 UTC
    Catalyst needs those attributes to decide which sub to call when it parses the URL. You can see it working very nicely if you run the included script. In its debug-output you see it building your packages and subs linked to the URLs it understands.

    Very nice application this Catalyst. Pity only the docs are not (yet) up to standard.


    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2021-09-25 00:16 GMT
Find Nodes?
    Voting Booth?

    No recent polls found