Mailing List Archive

Simple question about "use Catalyst"
I ran catalyst.pl to create a new app (at least I think that's how I did it - it was a couple of days back now),
and when I opened the main pm file, near the top was:

use Catalyst::Runtime 5.80;

I'd just installed Catalyst 5.90101 via cpanm, so wasn't sure why 5.80 was written there (for compatibility reasons?),
so as I modify the script to suit my purposes, I've changed it to:

use Catalyst::Runtime 5.90101;

...does it do anything, or make any difference?
What was the significance of 5.80 being written there?
Should I have left it as it was?
Re: Simple question about "use Catalyst" [ In reply to ]
On Mon, 2015-10-19 at 14:21 +0100, Andrew wrote:

> I ran catalyst.pl to create a new app (at least I think that's how I
> did it - it was a couple of days back now),
> and when I opened the main pm file, near the top was:
>
> use Catalyst::Runtime 5.80;
>
> I'd just installed Catalyst 5.90101 via cpanm, so wasn't sure why 5.80
> was written there (for compatibility reasons?),
> so as I modify the script to suit my purposes, I've changed it to:
>
> use Catalyst::Runtime 5.90101;
>
> ...does it do anything, or make any difference?

It means anyone else who uses your application (and/or any other
machines you install it on yourself) will also have to have the newer
version of Catalyst installed.

If your app doesn't need any features that are in 5.9 but not in 5.8,
and you're not releasing it to the public, then it's probably not worth
changing it, but it won't hurt either way. If you are releasing it to
the public, changing it will cause problems for other people who are
still running 5.8 on their machines.

If your app does need features that are only in 5.9 and you're releasing
it to the public, then of course you must change it, so anyone else
installing your app knows what libraries they'll need to
install/upgrade.



_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
Re: Simple question about "use Catalyst" [ In reply to ]
My guess, it makes sure you run at least v5.80 possibly because older
versions are not supported anymore. I am sure someone will correct me
if I am wrong.

http://perldoc.perl.org/functions/use.html

"If the VERSION argument is present between Module and LIST, then the
use will call the VERSION method in class Module with the given
version as an argument. The default VERSION method, inherited from the
UNIVERSAL class, croaks if the given version is larger than the value
of the variable $Module::VERSION"

On 19 October 2015 at 15:21, Andrew <catalystgroup@unitedgames.co.uk> wrote:
>
> I ran catalyst.pl to create a new app (at least I think that's how I did it
> - it was a couple of days back now),
> and when I opened the main pm file, near the top was:
>
> use Catalyst::Runtime 5.80;
>
> I'd just installed Catalyst 5.90101 via cpanm, so wasn't sure why 5.80 was
> written there (for compatibility reasons?),
> so as I modify the script to suit my purposes, I've changed it to:
>
> use Catalyst::Runtime 5.90101;
>
> ...does it do anything, or make any difference?
> What was the significance of 5.80 being written there?
> Should I have left it as it was?
>
>
>
> _______________________________________________
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>

_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
Re: Simple question about "use Catalyst" [ In reply to ]
On Mon, 19 Oct 2015 14:21:15 +0100
"Andrew" <catalystgroup@unitedgames.co.uk> wrote:
> What was the significance of 5.80 being written there?

It's a general feature of perl, not specific to Catalyst.

As your most probably already know, when you say::

use Some::Module qw(some thing);

it behaves as if you had written::

BEGIN {
require Some::Module;
if (Some::Module->can('import')) {
Some::Module->import(qw(some thing));
}
}

When you write::

use Some::Module 1.3;

it behaves something like::

BEGIN {
require Some::Module;
Some::Module->VERSION(1.3);
}

The ``UNIVERSAL::VERSION`` method throws an exception if (in this
case) the ``$Some::Module::VERSION`` variable has a value less than
what was passed (``1.3``). So you're essentially saying "use this
module, at least this version, or die".

--
Dakkar - <Mobilis in mobile>
GPG public key fingerprint = A071 E618 DD2C 5901 9574
6FE2 40EA 9883 7519 3F88
key id = 0x75193F88

Mal: "You got all kinds of learning, and you make me look a fool
without even trying, and yet here I am with a gun to your head. That's
cause I got people with me, people who trust each other, and do for
each other, and ain't always looking for an advantage."

Saffron: "Promise me you're going to kill me soon."
--Episode #6, "Our Mrs Reynolds"