Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

notation of a sub.

by jbrugger (Parson)
on Jul 19, 2005 at 04:41 UTC ( [id://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?
Thanks

"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 your_app_server.pl 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.

    CountZero

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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-09-13 21:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (21 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.