Skip Menu |

This queue is for tickets about the constant-tiny CPAN distribution.

Report information
The Basics
Id: 85061
Status: resolved
Priority: 0/
Queue: constant-tiny

People
Owner: SAPER [...] cpan.org
Requestors: mst [...] shadowcat.co.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.01



Subject: Module should explain why it's better than plain declaration
Date: Sun, 5 May 2013 16:22:18 +0000
To: bugs-constant-tiny [...] rt.cpan.org
From: Matt S Trout <mst [...] shadowcat.co.uk>
My first thought when I looked at this was - why not just do: sub DEBUG () { 0 } I'm assuming you have a reason. Seems like it might be worth documenting that. -- Matt S Trout - Shadowcat Systems - Perl consulting with a commit bit and a clue http://shadowcat.co.uk/blog/matt-s-trout/ http://twitter.com/shadowcat_mst/ Email me now on mst (at) shadowcat.co.uk and let's chat about how our Catalyst commercial support, training and consultancy packages could help your team.
Subject: Re: [rt.cpan.org #85061] Module should explain why it's better than plain declaration
Date: Sun, 5 May 2013 19:40:47 +0200
To: bug-constant-tiny [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Matt S Trout wrote via RT: Show quoted text
> My first thought when I looked at this was - why not just do: > > sub DEBUG () { 0 } > > I'm assuming you have a reason. Seems like it might be worth documenting that.
Hmm, is it more clear if I say that adding "use constant::tiny" before any other "use constant" statement forbids Unicode names, and therefore gives a kind of warranty on the memory footprint of the process? Sure, you can manually write the sub for each constant, but that's a bit tedious if you have many of them. constant::tiny is just a small hack to keep using the normal way to write constants in Perl "use constant …" and have a stricter control on names and memory. As I partially said in the doc, the code for the module was written as a proof of concept after a mail from Olivier Mengué on p5p, complaining about the then increased memory footprint of constant.pm. His use case was Perl code embedded in a device with small amount of memory I think. In my current job, I have code executed in Asterisk as AGI, so memory footprint, though not vital, still is nice to keep low. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.