[27047] in Perl-Users-Digest
Perl-Users Digest, Issue: 8956 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 15 06:05:50 2006
Date: Wed, 15 Feb 2006 03:05:05 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 15 Feb 2006 Volume: 10 Number: 8956
Today's topics:
Re: Arrays <scobloke2@infotop.co.uk>
Keith Keller, coward, currys favour 45a66654r@h44444l.com
Modules <b_wayne@freeguestforum.com>
Re: Modules <noreply@gunnar.cc>
Re: Modules <bernard.el-haginDODGE_THIS@lido-tech.net>
The inverse problem: generate all instances of a regexp (See Website For Email)
Re: The inverse problem: generate all instances of a re (Anno Siegel)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 15 Feb 2006 09:49:59 +0000 (UTC)
From: Ian Wilson <scobloke2@infotop.co.uk>
Subject: Re: Arrays
Message-Id: <dsutg7$rif$1@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com>
Frank J. Russo wrote:
Please don't top-post.
<snip: discussion of data structures>
>
> Followup question: I am feverishly going thru my books / notes / and
> documentation but have not located how do I write to a file and read in from
> a file a HASH?
>
> I know how to use files I am doing that now but not with a hash.
You can do this with "tie" - see perldoc -f tie. It can be an efficient
way to provide persistent storage for a hash in a "dbm" type of
database. Tie can be used for lots of other things but in the past I
found dbm type databases were a natural fit to Perl hashes.
Don't confuse dbm type databases with SQL relational databases, dbm
databases are very much simpler and very rudimentary. However I always
found dbm to be very useful and efficient.
The older, now deprecated, way to do this was with "dbmopen". See
perldoc -f dbmopen.
Here's an example from
http://www.uic.edu/depts/accc/seminars/perlii/ties.html
use DB_File;
use Fcntl;
tie %h, "DB_File", "file.dat", O_RDWR|O_CREAT, 0600, $DB_HASH;
## Use %h normally. Results are reflected in file.dat
...
untie %h;
------------------------------
Date: Wed, 15 Feb 2006 05:19:09 GMT
From: 45a66654r@h44444l.com
Subject: Keith Keller, coward, currys favour
Message-Id: <hRyIf.2636$_D5.229014@news20.bellglobal.com>
Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> trolled:
> What is google, and why aren't you using it to find out what gam_server
> is?
Google is a database that keeps track of what it is that you are
looking for. Google is not your friend. Google is evil.
You curry favour with those in the comp.lang.perl.misc by hiding
your pgp in your headers. But you curry favour with friends in
alt.os.linux.slackware by arguing that it is not necessary to bury
pgp in your headers.
You are a coward and a hypocrite.
Again, you are a coward and a hypocrite and a small man who goes
through life kissing some asses and fearing others. You are shit
and you deserve nothing more in life than the bottom of my shoes.
Bugger off.
cordially, as always,
rm
------------------------------
Date: Wed, 15 Feb 2006 09:47:28 +0100
From: <b_wayne@freeguestforum.com>
Subject: Modules
Message-Id: <tFBIf.13$r76.1503315@news.salzburg-online.at>
Hi,
I am new with programming in perl. I was wondering, if there is an archive
with perl modules which can be downloaded and used as well as a description
of the functionalities of the modules.
mfg Bruce
-----
b_wayne@freeguestforum.com
------------------------------
Date: Wed, 15 Feb 2006 09:50:40 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Modules
Message-Id: <45g8esF6j5igU1@individual.net>
b_wayne@freeguestforum.com wrote:
> I am new with programming in perl. I was wondering, if there is an archive
> with perl modules which can be downloaded and used as well as a description
> of the functionalities of the modules.
What happened when you googled for
perl modules
??
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Wed, 15 Feb 2006 09:56:25 +0100
From: "Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net>
Subject: Re: Modules
Message-Id: <Xns976B651E83279elhber1lidotechnet@10.232.40.227>
<b_wayne@freeguestforum.com> wrote:
> Hi,
>
> I am new with programming in perl. I was wondering, if there is an
> archive with perl modules which can be downloaded and used as well
> as a description of the functionalities of the modules.
www.cpan.org
--
Cheers,
Bernard
------------------------------
Date: Tue, 14 Feb 2006 22:43:03 -0800
From: "Andrei Alexandrescu (See Website For Email)" <SeeWebsiteForEmail@moderncppdesign.com>
Subject: The inverse problem: generate all instances of a regexp
Message-Id: <Iupuns.1J37@beaver.cs.washington.edu>
I wonder how this could be done elegantly. Given a regular expression
$re, write a function Generate($) that returns a list of all possible
strings that could match $re. If the set is infinite, die with an error
message.
For example, if $re = '(debug|release)/progname\.(c|h)', Generate($re)
should return four strings:
'debug/progname.c'
'debug/progname.h'
'release/progname.c'
'release/progname.h'
If, on the other hand, $re = '(debug/release)/.*\.(c|h)' then
Generate($re) should die.
Any ideas on how to do that in a clever manner? (The only way that I
think of is to parse $re and use recursion etc.)
Andrei
------------------------------
Date: 15 Feb 2006 09:57:05 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: The inverse problem: generate all instances of a regexp
Message-Id: <dsutth$am2$1@mamenchi.zrz.TU-Berlin.DE>
Andrei Alexandrescu (See Website For Email) <SeeWebsiteForEmail@moderncppdesign.com> wrote in comp.lang.perl.misc:
> I wonder how this could be done elegantly. Given a regular expression
> $re, write a function Generate($) that returns a list of all possible
> strings that could match $re. If the set is infinite, die with an error
> message.
>
> For example, if $re = '(debug|release)/progname\.(c|h)', Generate($re)
> should return four strings:
>
> 'debug/progname.c'
> 'debug/progname.h'
> 'release/progname.c'
> 'release/progname.h'
>
> If, on the other hand, $re = '(debug/release)/.*\.(c|h)' then
> Generate($re) should die.
>
> Any ideas on how to do that in a clever manner? (The only way that I
> think of is to parse $re and use recursion etc.)
MJD discusses this problem extensively in his _Higher Order Perl_. The
solution presented there deals with the problem of infinitely many
solutions by giving an iterator. That is a function that doesn't try
to give you all solutions at once, but returns another solution each
time you call it.
Anno
--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
------------------------------
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:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#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 V10 Issue 8956
***************************************