Re: [Catalyst] ACL Error: deny_access_unless

2009-06-04 Thread Tomas Doran
On 3 Jun 2009, at 20:18, Gordon Stewart wrote: http://omni.state51.co.uk/~t0m/MyApp.tgz - there is your tarball back, with git history of everything I did for your perusal. I cannot seem to download the tarball from your site. Did you give me an internal website? No, that's my

[Catalyst] best practice: where to put constants

2009-06-04 Thread Jarom Smith
Hi all: This is probably my lack of Perl knowledge showing... but where would be the best-practice place to put constants in my code? I'm talking about magic numbers that I use internally but need to reference in multiple locations of the code. Things like VENDOR_COMMIT = 1,

Re: [Catalyst] best practice: where to put constants

2009-06-04 Thread Tomas Doran
Jarom Smith wrote: In the end, this is what I decided to do because I have relatively few of these guys (so far) and I'd rather have them thrown together all in one place than spread all over the system. But I'm wondering if there is a best practice? I don't want to put them in the config

Re: [Catalyst] best practice: where to put constants

2009-06-04 Thread Alejandro Imass
Although I think there is no best practice as such, I mean there are many ways to do this in Perl in general, but Catalyst offers the nice feature of the main config file in YAML, so I keep all my constants and configuration values there. YAML is so powerful that IMHO it's the best place not ony

Re: [Catalyst] best practice: where to put constants

2009-06-04 Thread Jarom Smith
I thought about putting constants in $c-config, but decided not to mostly because it would allow a malicious (or ignorant) user to completely screw up my app. A constant should be, uh... constant! I have been resisting learning YAML, mostly because I am learning so many new things right now

Re: [Catalyst] best practice: where to put constants

2009-06-04 Thread Lance A. Brown
Alejandro Imass wrote: Although I think there is no best practice as such, I mean there are many ways to do this in Perl in general, but Catalyst offers the nice feature of the main config file in YAML, so I keep all my constants and configuration values there. YAML is so powerful that IMHO

Re: [Catalyst] best practice: where to put constants

2009-06-04 Thread Tomas Doran
Jarom Smith wrote: But out of curiosity... in your opinion, what *would* be the best practice way of doing what I'm trying to achieve? (or was your comment Not sure this is the 'best practice' way of doing what you're trying to achieve referring to my way of doing things, and your opinion of

Re: [Catalyst] best practice: where to put constants

2009-06-04 Thread Alejandro Imass
OT Yeah well, that is [TIMTOWTDI] the beauty of the Perl world, is precisely that the is not _one_ best practice. Apart from Conway's PBPs which a) apply to mostly any language anyway, and b) are just that: _recommended_ PBPs, so it really doesn't contradict _the_ Zen of Perl (pun intended),

Re: [Catalyst] best practice: where to put constants

2009-06-04 Thread Alejandro Imass
Yes of course, makes sense. Besides constants should use constant also. Nevertheless, it is quite common to confuse/abuse constants with 'configuration constants' which should go perfectly in your main yaml config file. My bad for not clarifying this. On Fri, Jun 5, 2009 at 11:44 AM, Lance A.

Re: [Catalyst] best practice: where to put constants

2009-06-04 Thread Ian Wells
2009/6/4 Tomas Doran bobtf...@bobtfish.net: use constant {    THING_FOO = 0,    THING_BAR = 1, }; As we steadily go offtopic, I thought use Readonly was preferred over use constant nowadays? Not that I remember the arguments why. Anyone else have an opinion here? -- Ian.

Re: [Catalyst] best practice: where to put constants

2009-06-04 Thread John Napiorkowski
--- On Thu, 6/4/09, Tomas Doran bobtf...@bobtfish.net wrote: From: Tomas Doran bobtf...@bobtfish.net Subject: Re: [Catalyst] best practice: where to put constants To: The elegant MVC web framework catalyst@lists.scsys.co.uk Date: Thursday, June 4, 2009, 11:31 AM Jarom Smith wrote: In

Re: [Catalyst] best practice: where to put constants

2009-06-04 Thread Jarom Smith
Hi John: You lost me. I could probably figure out what you are saying, but would you be willing to send some sample code illustrating what you're talking about? That would be very helpful to me, and possibly others. Thanks! jarom smith tech go-to guy John Napiorkowski wrote: I do

Re: [Catalyst] best practice: where to put constants

2009-06-04 Thread Mihai Bazon
I'm doing pretty much the same thing, although I dislike the fact that declaring/exporting constants tends to be very verbose. You have to name those constants both in use constant and when declaring them in EXPORT_OK and/or EXPORT_TAGS. The following sample is what suits me best for now:

Re: [Catalyst] best practice: where to put constants

2009-06-04 Thread Bill Moseley
On Thu, Jun 04, 2009 at 10:23:11AM -0700, Jarom Smith wrote: You lost me. I could probably figure out what you are saying, but would you be willing to send some sample code illustrating what you're talking about? That would be very helpful to me, and possibly others. Thanks! Jarom, To

[Catalyst] Plugin::Authentication apparently not reading config

2009-06-04 Thread Jason McIntosh
Howdy all, I'm quite perplexed about some behavior from Plugin::Authentication. I'm trying to get a Catalyst app running on a new machine, but Authentication isn't reading any realms from my config. The config file is definitely getting read otherwise, and I can see my authentication realms