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
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,
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
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
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
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
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
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),
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.
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.
--- 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
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
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:
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
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
15 matches
Mail list logo