[33122] in Perl-Users-Digest
Perl-Users Digest, Issue: 4398 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 24 21:09:22 2015
Date: Tue, 24 Mar 2015 18:09:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 24 Mar 2015 Volume: 11 Number: 4398
Today's topics:
Re: An error on page 142 of The Camel Book. <m@rtij.nl.invlalid>
Re: An error on page 142 of The Camel Book. <whynot@pozharski.name>
Re: An error on page 142 of The Camel Book. <rweikusat@mobileactivedefense.com>
Re: An error on page 142 of The Camel Book. <rweikusat@mobileactivedefense.com>
Re: An error on page 142 of The Camel Book. <hjp-usenet3@hjp.at>
Re: An error on page 142 of The Camel Book. <rweikusat@mobileactivedefense.com>
Re: An error on page 142 of The Camel Book. (Seymour J.)
Re: An error on page 142 of The Camel Book. <rweikusat@mobileactivedefense.com>
Re: An error on page 142 of The Camel Book. <kaz@kylheku.com>
Re: An error on page 142 of The Camel Book. (Seymour J.)
running Perl scripts w/o extension on Windows 7 jomarbueyes@hotmail.com
Re: running Perl scripts w/o extension on Windows 7 <gravitalsun@hotmail.foo>
Re: running Perl scripts w/o extension on Windows 7 <news@todbe.com>
sqlite in-memory as Hash <gravitalsun@hotmail.foo>
Re: sqlite in-memory as Hash <peter@makholm.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 24 Mar 2015 11:13:02 +0100
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: An error on page 142 of The Camel Book.
Message-Id: <eup7ub-1m1.ln1@news.rtij.nl>
On Mon, 23 Mar 2015 15:47:06 -0700, $Bill wrote:
> On 3/23/2015 14:37, Kaz Kylheku wrote:
>>
>> I can just see it. You are a crazy moron if you use *. The natural
>> thing is always one or more:
>>
>> R+
>>
>> Furthermore, in the rare cases you need zero or more, you can do this:
>> do this:
>>
>> (R+)?
>>
>> So the whole Kleene Star zero-or-more stupidity is never necessary. :)
>
> Nothing in the world is 'necessary' if there is an equivalent
> alternative. ;)
Perl isn't necessary, we can just use portable shell. I mean how hard can
it be to write something which is portable over WinNT, bourne and z/OS
shell?
M4
------------------------------
Date: Tue, 24 Mar 2015 09:51:55 +0200
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: An error on page 142 of The Camel Book.
Message-Id: <slrnmh25sr.ic4.whynot@orphan.zombinet>
with <meq540$kb$3@dont-email.me> $Bill wrote:
> On 3/23/2015 14:37, Kaz Kylheku wrote:
>> I can just see it. You are a crazy moron if you use *. The natural
>> thing is always one or more:
>>
>> R+
>>
>> Furthermore, in the rare cases you need zero or more, you can do
>> this: do this:
>>
>> (R+)?
>>
>> So the whole Kleene Star zero-or-more stupidity is never necessary.
>> :)
> Nothing in the world is 'necessary' if there is an equivalent
> alternative. ;)
To some definition of equivalence (correcting *captures* to *groups*,
btw):
Compiling REx ".*"
Final program:
1: STAR (3)
2: REG_ANY (0)
3: END (0)
anchored(MBOL) implicit minlen 0
Compiling REx "(?:.+)?"
Final program:
1: CURLYX[0] {0,1} (6)
3: PLUS (5)
4: REG_ANY (0)
5: WHILEM (0)
6: NOTHING (7)
7: END (0)
minlen 0
Omitting $` $& $' support.
EXECUTING...
Freeing REx: ".*"
Freeing REx: "(?:.+)?"
--
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom
------------------------------
Date: Tue, 24 Mar 2015 15:02:17 +0000
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: An error on page 142 of The Camel Book.
Message-Id: <87y4mml9qe.fsf@doppelsaurus.mobileactivedefense.com>
Kaz Kylheku <kaz@kylheku.com> writes:
> On 2015-03-23, Shmuel Metz <spamtrap@library.lspace.org.invalid> wrote:
>> In <87h9tcd9h7.fsf@doppelsaurus.mobileactivedefense.com>, on
>> 03/22/2015
>> at 09:10 PM, Rainer Weikusat <rweikusat@mobileactivedefense.com>
>> said:
>>
>>>As I wrote in the original postings, loops come in two kinds,
>>>'execute 0 or more times' and 'execute 1 or more times' and I
>>>advocate picking the one which makes the most sense in any given
>>>situation, regardless of what a compiler might or might not be
>>>capable of.
>>
>> Over the past half century, I've encounter "0 or more" more often than
>> "1 or more".
>
> However, the difference is a big deal in scanning and parsing. E.g. in regex
> we have * (zero or more) versus + (one or more).
>
> So that could partially explain the fuss being made over this in a Perl
> newsgroup.
>
> I can just see it. You are a crazy moron if you use *. The natural
> thing is always one or more:
>
> R+
>
> Furthermore, in the rare cases you need zero or more, you can do this:
> do this:
>
> (R+)?
Both * and + are shorthand notation for certain regex quantifiers. The
general form is
R{n,m}
which means 'match the regex R at least n and m times. If n is omitted,
it's assumed to be 0 and omitting m means 'as many times as you can'. *
is thus the same as {0,} and + the same as {1,} (and ? is
{0,1}). Considering this,
(R+)?
is really the same as
(R{1,}){0,1}
a rather bizarre construct.
But I wasn't trying to make an argument in favour of "my pidgin perl is
better than your pidgin perl" but rather against pidginization of
programming languages, especially insofar it stops being a matter of
personal convenience ("this subset of $language is enough to enable me
to get my problems solved") but aspires to become normative instead,
usually based on some kind of "the boss may not alway be right but he's
always going to be the boss" argument: This subset is good enough for
me, therefore, it has to be good enough for you, too, and the very fact
that our opinions differ hints strongly at a dangerous defect of your
mind/ personality, as evidenced by the fact I'm the boss and you're not.
------------------------------
Date: Tue, 24 Mar 2015 17:27:12 +0000
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: An error on page 142 of The Camel Book.
Message-Id: <87r3sel30v.fsf@doppelsaurus.mobileactivedefense.com>
"G.B." <bauhaus@futureapps.invalid> writes:
> On 23.03.15 17:37, Kaz Kylheku wrote:
>> The intent seems to be to give requirements for a pair of looping constructs;
>> however, I cannot infer any of the actual requirements.
>
> This isn't unexpected if there are no (mainstream?) languages
> that have such loops; I would be repeating the existing
> definitions from the established apparatus to which you have
> been alluding.
> But, frankly, I find it difficult to give examples of
> something that I do not know to exist?
> I'll try again, adding more context. This is about syntax,
> and its meaning in terms of control flow, not states.
>
> "I'd like a loop (one of two) that, I think, would be sufficiently
> different. It can be left at only one point such that:
>
> - this point is syntactically identifiable
> - there is only one piece of syntax for that
> - the loop never needs dummy variables"
>
> 0. This kind of loop should have one exit.
As I already tried to point out: Any looping-construct satisfies this
condition because the exit point is always after the loop body. That's
something other than code causing the loop to exit, either explicitly
because a loop control verb was being user or implicitly because the
state of the loop condition changed in a way which causes it to exit.
That's something you can have in any language today by simply not using
the any facility capable of causing a loop to exit other than the one
implicitly provided by the loop condition BUT this means you'll have to
make all code which changes or examines 'state information' continuation
of the loop depends on part of the loop condition which will result in a
certain amount of contorion.
Eg, revisiting the example which print the first 10 10 character blocks
of input available from stdin unless the amount of available data is
less than 100 chars,
---------
$/ = \10;
while (<>) {
printf("%s\n-\n", $_);
$. == 10 and last;
}
---------
One of the conditions has to be checked before a particular piece of
output was printed and the other afterwards. This can be rewritten as
---------
$/ = \10;
while ($. < 10 && ($_ = <>)) {
printf("%s\n-\n", $_);
}
---------
thus satisfying your requirement but this makes the code less clear:
From the $. < 10, one can infer that the loop is supposed to exit ten
blocks of output were processed and $_ now needs to be assigned to
explicitly. Was this fiction, It would be regarded as creating suspense
because 'exit after doing it for 10 times" is communicated pior to
communicatintg what is supposed to be done. 'Suspense' is nothing but
'lack of clarity' in this context: Expectations are raised because
insufficient information regarding what to expect is available.
OTOH, the first loop just states
$. == 10 and last;
after the code which does one thing.
------------------------------
Date: Tue, 24 Mar 2015 19:44:52 +0100
From: "Peter J. Holzer" <hjp-usenet3@hjp.at>
Subject: Re: An error on page 142 of The Camel Book.
Message-Id: <slrnmh3c54.hr6.hjp-usenet3@hrunkner.hjp.at>
On 2015-03-23 11:14, G.B. <bauhaus@futureapps.invalid> wrote:
> On 23.03.15 00:41, Rainer Weikusat wrote:
>> BTW, a possible counter-argument for all of this I think I should
>> mention:
>
> Loops show so much of history which has found followers, I think,
> who want to be served.
> I'd like a loop (one of two) that, I think, would be sufficiently
> different. It can be left at only one point such that:
>
> - this point is syntactically identifiable
> - there is only one piece of syntax for that
> - the loop never needs dummy variables
So, something like
for (;;) {
...
last unless condition;
...
}
except that the language enforces that there is only one «last unless»
statement in the loop and and no other construct which might cause the
loop to terminate?
> Does this combination exist in any language?
Not in any language I know.
One could define syntax like this:
loop BLOCK CONDITION BLOCK
And then write something like
loop
{
...
}
i < n
{
...
}
One could even make both blocks optional and write
loop i < n {
...
}
or
loop {
...
} i < n
to get traditional while and do/while loops.
(making the syntax unambiguous is left as an exercise for the reader)
I have occasionally written loops where there is exactly one exit point
and it is somewhere in the middle. I'm not convinced that such loops are
frequent enough to warrant a special syntax.
hp
--
_ | Peter J. Holzer | Fluch der elektronischen Textverarbeitung:
|_|_) | | Man feilt solange an seinen Text um, bis
| | | hjp@hjp.at | die Satzbestandteile des Satzes nicht mehr
__/ | http://www.hjp.at/ | zusammenpaßt. -- Ralph Babel
------------------------------
Date: Tue, 24 Mar 2015 19:24:10 +0000
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: An error on page 142 of The Camel Book.
Message-Id: <87mw32kxlx.fsf@doppelsaurus.mobileactivedefense.com>
"Peter J. Holzer" <hjp-usenet3@hjp.at> writes:
[...]
> I have occasionally written loops where there is exactly one exit point
> and it is somewhere in the middle.
"I have occasionally left my house by sitting down in front of the
tele"?
There's a paper written Dijkstra in 1970 titled 'Notes on Structured
Programming' containing a section 'On understanding programs' where
various control flow abstractions are introduced. The simplest one,
introduced on page 26, is just a sequence of steps. On page 27 follow
two flowcharts for 'if ? do S1' and 'if ? then S1 else S2', generalized
to a multiway conditional on the next page followed by the sentence
"These flowcharts share the property that they have a single entry at
the top and a single exit at the bottom [...] They can again be
interpreted (by disregarding what is inside the dotted line) as
single action in a sequential computation".
But an if - else statement only has a single exit 'at the bottom'
insofar this to the point where execution continues after it as a
'naive' implementation would could look like this:
if !? then goto 1:
S1
goto 2:
1:
S2
2:
and the goto after the 'if true' section would count as second exit if
this term referred to the innards of the construct itself (which are
supposed to be disregarded). On the next page, flowcharts for two
looping constructs are presented, again claiming that they have 'a
single entry at the top and a single exit at the bottom' despite they
are
while ? do S
and
repeat S until ?
and interpreting 'exit' as some property of the implementation ought to
lead to the conclusion that one exits at the top and the other at the
bottom (or one exits either at the top or at the bottom and the other at
the bottom). But this interpretation doesn't make the least bit of sense
because the property Dijkstra is interested in is that these 'building
blocks' can function as steps in a sequence, not where J Random Machine
Code Hacker might instruct his compiler to place the gotos (or believe
his compiler would place the gotos) used the implement the construct.
The paper is available here:
http://www.cs.utexas.edu/users/EWD/ewd02xx/EWD249.PDF
------------------------------
Date: Tue, 24 Mar 2015 17:38:47 -0400
From: Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid>
Subject: Re: An error on page 142 of The Camel Book.
Message-Id: <5511d967$3$fuzhry+tra$mr2ice@news.patriot.net>
In <87r3sel30v.fsf@doppelsaurus.mobileactivedefense.com>, on
03/24/2015
at 05:27 PM, Rainer Weikusat <rweikusat@mobileactivedefense.com>
said:
>As I already tried to point out: Any looping-construct satisfies
>this condition because the exit point is always after the loop
>body.
That's not true for, e.g., for nested loops. Even if you prohibit
statements like last it is not true in general.
--
Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel>
Unsolicited bulk E-mail subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail. Reply to
domain Patriot dot net user shmuel+news to contact me. Do not
reply to spamtrap@library.lspace.org
------------------------------
Date: Tue, 24 Mar 2015 21:57:19 +0000
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: An error on page 142 of The Camel Book.
Message-Id: <87iodqkqio.fsf@doppelsaurus.mobileactivedefense.com>
"$Bill" <news@todbe.com> writes:
> On 3/23/2015 04:14, G.B. wrote:
>> On 23.03.15 00:41, Rainer Weikusat wrote:
>>> BTW, a possible counter-argument for all of this I think I should
>>> mention:
>>
>> Loops show so much of history which has found followers, I think,
>> who want to be served.
>> I'd like a loop (one of two) that, I think, would be sufficiently
>> different. It can be left at only one point such that:
>>
>> - this point is syntactically identifiable
>> - there is only one piece of syntax for that
>> - the loop never needs dummy variables
>>
>> Does this combination exist in any language?
>> (2 loop constructs, of which one is of this kind.)
>>
>> I'm glad that Perl has efficient iterators so that I can mostly
>> drop "for(;;)".
>
> If there were a finite number of for(;;)'s, that would leave more
> for the rest of us that actually like them. ;)
"I like it" is a weak argument in favour of using a programming language
construct. Eg, I like
for ($/ = \10; <>; $. - 10 or last) {
print("$_\n-\n");
}
a lot better than
$/ = \10;
while (<>) {
print("$_\n-\n");
$. == 10 and last;
}
OTOH, I suspect using for to express a loop with two exit conditions
checked in this way will be even better at tripping up people who
instictively recite
for ($i = 0; $i < 12; $i++) {
}
in any plight (and take two Paracetamol with that) than the while-loop
would, IOW, I wouldn't use this in real code despite I like it. I also
like recursion and whenever I'm just banging something out, it will
likely end up as set of recursive functions. But this is again bound to
cause head-scratching, hence, when there's an easy, non-recursive
solution, the final code will end up with that.
That said, I think the risk that the world will run out of Marmite
anytime soon is rather low.
.... now back to writing stupid HTTP header formatting code ...
------------------------------
Date: Tue, 24 Mar 2015 22:12:13 +0000 (UTC)
From: Kaz Kylheku <kaz@kylheku.com>
Subject: Re: An error on page 142 of The Camel Book.
Message-Id: <20150324134619.11@kylheku.com>
On 2015-03-24, Rainer Weikusat <rweikusat@mobileactivedefense.com> wrote:
> Kaz Kylheku <kaz@kylheku.com> writes:
>> On 2015-03-23, Shmuel Metz <spamtrap@library.lspace.org.invalid> wrote:
>>> In <87h9tcd9h7.fsf@doppelsaurus.mobileactivedefense.com>, on
>>> 03/22/2015
>>> at 09:10 PM, Rainer Weikusat <rweikusat@mobileactivedefense.com>
>>> said:
>>>
>>>>As I wrote in the original postings, loops come in two kinds,
>>>>'execute 0 or more times' and 'execute 1 or more times' and I
>>>>advocate picking the one which makes the most sense in any given
>>>>situation, regardless of what a compiler might or might not be
>>>>capable of.
>>>
>>> Over the past half century, I've encounter "0 or more" more often than
>>> "1 or more".
>>
>> However, the difference is a big deal in scanning and parsing. E.g. in regex
>> we have * (zero or more) versus + (one or more).
>>
>> So that could partially explain the fuss being made over this in a Perl
>> newsgroup.
>>
>> I can just see it. You are a crazy moron if you use *. The natural
>> thing is always one or more:
>>
>> R+
>>
>> Furthermore, in the rare cases you need zero or more, you can do this:
>> do this:
>>
>> (R+)?
>
> Both * and + are shorthand notation for certain regex quantifiers. The
> general form is
>
> R{n,m}
That's one possible view.
On the other hand, in the pure theory of formal languages, finite automata and
regular expression, Unixisms such as this don't exist.
All there is is alternation, catenation, and repetition.
R{n,m} is a syntactic sugar which denotes something like:
RRR...RRRR?R?R?R?R?...R?R?R?R?
^^^^^^^^^
n reps ^^^^^^^^^^^^^^^^^^^^^
m - n reps
But actually the ? operator also isn't defined; R? is represented as (R|):
disjunction with an empty match.
The reason extra sugars don't exist in the theory is that they are not
necessary in order to establish the equivalence between regular expressions and
other representations like finite automata, and to derive further results.
Fewer operators means fewer cases to deal with.
Also, if we are performing a syntax-directed translation of R{n,m} to an
ordinary NFA graph, it actually has to be expanded to the to
RRR...RRRR(R|)(R|)...(R|) form first, or else directly to the unfolded graph
structure which that denotes. The representation has no provision for
"transition through here at least n times, but no more than m".
------------------------------
Date: Tue, 24 Mar 2015 18:32:48 -0400
From: Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid>
Subject: Re: An error on page 142 of The Camel Book.
Message-Id: <5511e610$4$fuzhry+tra$mr2ice@news.patriot.net>
In <87iodqkqio.fsf@doppelsaurus.mobileactivedefense.com>, on
03/24/2015
at 09:57 PM, Rainer Weikusat <rweikusat@mobileactivedefense.com>
said:
>I also like recursion and whenever I'm just banging something out,
>it will likely end up as set of recursive functions. But this is
>again bound to cause head-scratching,
I wish that I didn't believe you, but I guess that recursion is too
new[1] for the hoi paloi to grasp it.
[1] It's been less than 3/4 centuries since LISP, and not much more
than half a century since ALGOL 60.
--
Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel>
Unsolicited bulk E-mail subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail. Reply to
domain Patriot dot net user shmuel+news to contact me. Do not
reply to spamtrap@library.lspace.org
------------------------------
Date: Tue, 24 Mar 2015 10:00:26 -0700 (PDT)
From: jomarbueyes@hotmail.com
Subject: running Perl scripts w/o extension on Windows 7
Message-Id: <e967953e-eaa6-4b62-95fa-e1595b9a7ab2@googlegroups.com>
Hi,=20
I wrote several Perl scripts under Linux (using X11 on Mac OS X). Because L=
inux does not require an extension, I did not use one. Now I need to use th=
ose scripts on Windows 7 computers with the Perl that comes with Strawberry=
. I added my scripts directory to the path and PERL5LIB environment variabl=
es and restarted the computer. However, when I tried to run a script from a=
command-line window by simply typing=20
commandName <CR>
I got the error message:
'commandName' is not recognized as an internal or external command, operabl=
e program or batch file.
Is there a way to make Perl scripts w/o extension be recognized as executab=
le? Adding the extension .pl is not a good option because most of the time =
I do the development under Linux and 'rsync' the script directories to the =
Windows machine.
Thank you in advance for any help,
Jomar
------------------------------
Date: Tue, 24 Mar 2015 21:17:54 +0200
From: George Mpouras <gravitalsun@hotmail.foo>
Subject: Re: running Perl scripts w/o extension on Windows 7
Message-Id: <mesd9d$77o$1@news.grnet.gr>
On 24/3/2015 7:00 μμ, jomarbueyes@hotmail.com wrote:
> 'commandName' is not recognized as an internal or external command, operable program or batch file.
>
> Is there a way to make Perl scripts w/o extension be recognized as executable? Adding the extension .pl is not a good option because most of the time I do the development under Linux and 'rsync' the script directories to the Windows machine.
>
use this
perl.exe commandName
------------------------------
Date: Tue, 24 Mar 2015 17:05:50 -0700
From: "$Bill" <news@todbe.com>
Subject: Re: running Perl scripts w/o extension on Windows 7
Message-Id: <mesu3q$cju$1@dont-email.me>
On 3/24/2015 10:00, jomarbueyes@hotmail.com wrote:
> Hi,
>
> I wrote several Perl scripts under Linux (using X11 on Mac OS X). Because Linux does not require an extension, I did not use one. Now I need to use those scripts on Windows 7 computers with the Perl that comes with Strawberry. I added my scripts directory to the path and PERL5LIB environment variables and restarted the computer. However, when I tried to run a script from a command-line window by simply typing
>
> commandName <CR>
>
> I got the error message:
>
> 'commandName' is not recognized as an internal or external command, operable program or batch file.
>
> Is there a way to make Perl scripts w/o extension be recognized as executable? Adding the extension .pl is not a good option because most of the time I do the development under Linux and 'rsync' the script directories to the Windows machine.
>
> Thank you in advance for any help,
I haven't associated Perl to any file extensions on Windows, so all my scripts
are run by explicitly stating the Perl exe )which I aliased to 'p'). So for
me it would be:
p <scriptname>
The disadvantage there is <scriptname> must be in the current dir or be preceded
by it's repository dir name (a couple of which I have aliased in my shell like 'foo'
or 'bin').
p $foo/<scriptname>
Not a real solution, just an alternative.
------------------------------
Date: Tue, 24 Mar 2015 13:15:02 +0200
From: George Mpouras <gravitalsun@hotmail.foo>
Subject: sqlite in-memory as Hash
Message-Id: <mergvk$l9b$1@news.grnet.gr>
#!/usr/bin/perl
use strict; use warnings; use feature qw/say/;
use DBI;
my $dbh= DBI->connect('dbi:SQLite:dbname=:memory:', undef, undef,
{AutoCommit=>1, RaiseError=>1, PrintError=>0, sqlite_unicode=>1});
$dbh->do('CREATE TABLE "Hash1" ("key" TEXT NOT NULL ON CONFLICT
REPLACE, "value" TEXT, PRIMARY KEY ("key"))');
my $sth_put = $dbh->prepare_cached('INSERT OR REPLACE INTO Hash1
VALUES(?1,?2)');
my $sth_get = $dbh->prepare_cached('SELECT value FROM Hash1 WHERE key =
?1');
my $sth_exists = $dbh->prepare_cached('SELECT value FROM Hash1 WHERE
key = ?1');
sub Put ($$) { $sth_put->execute($_[0],$_[1]) }
sub Get ($) { $sth_get->execute($_[0]); $sth_get->fetchrow_array }
sub Exists ($) { $sth_exists->execute($_[0]); defined
$sth_get->fetchrow_array ? 1:0 }
Put('k1','v1');
Put('k2','v2');
say Get('k1');
say Get('k2');
say 'key k1 exists' if Exists('k1');
$sth_exists->finish;
$sth_get->finish;
$dbh->disconnect;
------------------------------
Date: Tue, 24 Mar 2015 13:32:41 +0100
From: Peter Makholm <peter@makholm.net>
Subject: Re: sqlite in-memory as Hash
Message-Id: <87d23y8tjq.fsf@vps1.hacking.dk>
George Mpouras <gravitalsun@hotmail.foo> writes:
> Put('k1','v1');
> Put('k2','v2');
>
> say Get('k1');
> say Get('k2');
And using tied variable you can make it look like a real hash.
It even already exists on CPAN in a couple of implementations:
- SQLite_File
- Tie::DBI
- Tie::Hash::DBD
//Makholm
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 4398
***************************************