I hate really short modules. They should be pasted into your code. It makes it easy to see what it's doing, and it eliminates a file operation. But how about when you install a new version of Perl and you want the latest version of the module to be used? I'm way ahead of you, buddy. I got something better--auto-updating snippets.
I figure I'll do it will a source filter, but I don't know how yet. I'd make "snippet" a new function. It would take two arguments:
Arg1: The serial number of a snippet from the official, online (hopefully with a load-balanced network of mirrors) snippet library, or your private snippet library. The serial number would include an extension indicating the version number.
Arg2: "update" or blank to indicate whether you want to check for an update or whether you included the snippet that you want used. If blank, the serial number would act as a comment, telling you where the snippet came from and reminding you that you could make it auto-update. The update feature would be recommended for occasional use or a local snippet library that itself would need to be updated and would hopefully become core.
The "snippet" function could optionally be followed by the current or prior version of the snippet itself. If the update parameter was used, the function would be replaced with the snippet from the library, and if you included the snippet in the code, it would be deleted. If the serial number refers to an old version, an alert wll be issued.
If I do this, you all must contribute to my snippet library (recommended max length per snippet will be announced), and you all must use it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Auto-updating snippets.
by blokhead (Monsignor) on Jul 16, 2004 at 00:48 UTC | |
|
Re: Auto-updating snippets.
by TilRMan (Friar) on Jul 16, 2004 at 00:44 UTC | |
|
Ingenious
by sleepingsquirrel (Chaplain) on Jul 16, 2004 at 04:25 UTC | |
|
Re: Auto-updating snippets.
by dws (Chancellor) on Jul 16, 2004 at 00:19 UTC | |
| |
|
Re: Auto-updating snippets.
by gellyfish (Monsignor) on Jul 16, 2004 at 11:41 UTC | |
|
Re: Auto-updating snippets.
by Solo (Deacon) on Jul 16, 2004 at 03:02 UTC | |
by FoxtrotUniform (Prior) on Jul 16, 2004 at 03:07 UTC | |
| |
|
Re: Auto-updating snippets.
by exussum0 (Vicar) on Jul 16, 2004 at 20:25 UTC | |
|
Re: Auto-updating snippets.
by fraktalisman (Hermit) on Jul 19, 2004 at 21:06 UTC |