[12075] in Perl-Users-Digest
Perl-Users Digest, Issue: 5675 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 15 18:07:22 1999
Date: Sat, 15 May 99 15:00:20 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 15 May 1999 Volume: 8 Number: 5675
Today's topics:
$var interpolation in regular expressions <hensh@math.msu.edu>
[ANNOUNCE] New version of Tk::ObjScanner <domi@barrayar.grenoble.hp.com>
[ANNOUNCE] new Version of Tk::TreeGraph <domi@barrayar.grenoble.hp.com>
ANN: announcing snarfnews 0.7 beta jm7@netnoteinc.com
ANNOUNCE: Data::Locations 5.2 <sb@sdm.de>
ANNOUNCE: DbFramework-1.10 paul@miraclefish.com
ANNOUNCE: first beta of libxml <ken@bitsko.slc.ut.us>
ANNOUNCE: Mail::POP3Client 2.0 (Sean Dowd)
Announce: Parse-Yapp-0.31 released <desar@club-internet.fr>
ANNOUNCE: Proc::ProcessTable 0.07 (Daniel J Urist)
ANNOUNCE: Tangram 0.08 - Object Persistence in Relation <jll@skynet.be>
ANNOUNCE: WWW::Babelfish 0.02 (Daniel J Urist)
Graphics::Simple 0.03 - C-64-like simple drawing tuomas_lukka@my-dejanews.com
Re: Help: I find tutorial & doc <swarren@www.wwwdotorg.org>
Re: indentionless here document ? (<<-) <gellyfish@gellyfish.com>
Li ngua::EN::NameParse-0.03 <kimaryan@ozemail.com.au>
Re: Need help to modify email checker. <swarren@www.wwwdotorg.org>
Re: regexp problem <aperrin@mcmahon.qal.berkeley.edu>
Re: regexpr - WHY???? - HELP!!! <swarren@www.wwwdotorg.org>
Saving regularly a web page <amig@csi.com>
Re: Saving regularly a web page ajs@ajs.com
Re: Saving regularly a web page <gellyfish@gellyfish.com>
Re: Small amount of Perl CGI script work needed for sit <gellyfish@gellyfish.com>
standard array and associative array bing-du@tamu.edu
Re: standard array and associative array (Michel Dalle)
Re: using emacs with perl for win32 Kai.Grossjohann@CS.Uni-Dortmund.DE
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 15 May 1999 17:34:48 -0500
From: "Rick Hensh" <hensh@math.msu.edu>
Subject: $var interpolation in regular expressions
Message-Id: <7hkpbe$bt1$1@msunews.cl.msu.edu>
According to (Win32 version) Learning Perl the following should work:
$missOne = "\t[\-0-9]+\t[\-0-9]+\t[\-0-9]+\t(.+\b0[^\n])";
if (/$missOne/) {
stuff;
}
I've tested the regex directly and so I know that it works. Did I
misunderstand how var interpolation works in this case?
thanks
ricky
------------------------------
Date: 15 May 1999 19:58:08 GMT
From: Dominique Dumont <domi@barrayar.grenoble.hp.com>
Subject: [ANNOUNCE] New version of Tk::ObjScanner
Message-Id: <7hkjkg$cqi$1@play.inetarena.com>
Hello
I've just uploaded to CPAN a new version of Tk::ObjScanner. It now
relies on HList to display an object attributes instead of
Data::Dumoer. So it's much user friendly for complex objects.
Here's the README file :
The scanner provide a GUI to scan the attributes of an object. It can
also be used to scan the elements of a hash or an array.
The scanner is a composite widget made of a HList and a text window
(actually a L<TK::ROText>). This widget acts as a scanner to the
object (or hash ref) passed with the 'caller' parameter. The scanner
will retrieve all keys of the hash/object and insert them in the
HList.
When the user double clicks on a key, the corresponding value will be added
in the HList.
If the value is a scalar, the scalar will be displayed in the text window.
(Which is handy if the value is a multi-line string)
Cheers
PS: perl ! (that was for Randall's filter on clpa ;-)
--
Dominique_Dumont@grenoble.hp.com
------------------------------
Date: 15 May 1999 19:58:02 GMT
From: Dominique Dumont <domi@barrayar.grenoble.hp.com>
Subject: [ANNOUNCE] new Version of Tk::TreeGraph
Message-Id: <7hkjka$cqh$1@play.inetarena.com>
Hello
I've uploaded to CPAN a new perl module to draw Tree graph on a
Tk::Canvas widget.
The interface is now much simpler since you can draw the tree by specifying
only the node. TreeGraph will automatically draw the arrows.
Here's an extract of the README file:
Tk::TreeGraph is a Canvas specialized to draw trees on a Canvas using
arrows and nodes. A node is simply some text imbedded in a rectangular
shape.
TreeGraph is able to draw the following items:
- node: some text in a rectangular shape.
- direct arrow: an arrow to go from one node to the following one.
- slanted arrow: an arrow to make a new branch
- shortcuts arrow: an arrow to represent a shortcut between 2 nodes from
different branches.
Starting from version 1.007, all coordinates are handled by the
object. Hence drawing the tree is much simpler.
Starting from version 1.008, you don't need to draw the direct and
slanted arrows yourself, the object will do it for you when you add a
node.
Hence drawing the tree is even more simple.
Suggested DSLI line in the Ptk module list:
Tk::TreeGraph bdpO Widget to draw a tree in a Canvas DDUMONT
Cheers
--
Dominique_Dumont@grenoble.hp.com
------------------------------
Date: 15 May 1999 19:56:26 GMT
From: jm7@netnoteinc.com
Subject: ANN: announcing snarfnews 0.7 beta
Message-Id: <7hkjha$cps$1@play.inetarena.com>
This message is to announce the 0.7 beta release of snarfnews, a perl
script run on your PalmPilot's hotsync machine which will retrieve news
stories automatically from various news websites and convert them into
either PalmPilot DOC or text format.
HTTP and local files, using the file:/// protocol, are both supported.
Multiple types of sites can be snarfed:
1-level sites, where the text to be converted is all present on one
page, (such as Slashdot, Linux Weekly News, BluesNews, NTKnow, Ars
Technica);
2-level sites, where the text to be converted is linked to from a Table
of Contents page (such as Wired News, BBC News, and I, Cringely);
3-level sites, where the text to be converted is linked to from a Table
of Contents page, which in turned is linked to from a list of issues
page (such as PalmPower or New Scientist).
In addition sites that post news as items on one big page, such as
Slashdot, Ars Technica, and BluesNews, are supported using diff.
It even trims out sidebar tables automatically, by making the assumption
that tables < 30% of the average browser width are not part of the news
story.
The script should run easily on most UNIX variants that support perl, as
well as the Win32 platform, even Windows 95 (tested with ActivePerl
5.00502 build 509).
You may ask, "why not just use 'lynx -dump' and 'makedoc'?" Well,
snarfnews has several advantages:
* it will follow links, and has a sophisticated set of mechanisms
to follow the right links and use the "printing version" of a story;
* it can use heuristics to trim out irrelevant tables;
* the HTML rendering code is optimised for viewing on a PalmPilot,
by trimming all images (even their ALT tags), forms, and extraneous
headers and footers (based on the .site file).
* it's portable to UNIX, Win32 and any other perl-supporting platform
(as long as makedoc is available).
In short, it's pretty neat.
Pick up snarfnews (or read the full README) at the following URL:
http://www.penguinpowered.com/~jmason/software/snarfnews/
--j.
------------------------------
Date: 15 May 1999 19:57:26 GMT
From: Steffen Beyer <sb@sdm.de>
Subject: ANNOUNCE: Data::Locations 5.2
Message-Id: <7hkjj6$cq8$1@play.inetarena.com>
Unfortunately I found a nasty little bug in versions 5.0 and 5.1 of
my module "Data::Locations", wherefore I am announcing
=========================================
Package "Data::Locations" Version 5.2
=========================================
This package is available for download either from my web site at
http://www.engelschall.com/u/sb/download/
or from any CPAN (= "Comprehensive Perl Archive Network") mirror server:
http://www.perl.com/CPAN/authors/id/STBEY/
Prerequisites:
--------------
Perl version 5.004 (subversion 0) or higher.
What's new in version 5.2:
--------------------------
+ Fixed a bug in method "read()" which prevented empty lines
to be read back in list context (empty lines were mistaken
for the end-of-file marker).
+ When an item in a location has the value "undef", the method
"read()" now returns the empty string instead. You would have
mistaken this for the end-of-file marker in previous versions.
Abstract:
---------
Data::Locations is a virtual file manager which allows you to write and
read data (text and binary) to and from virtual files (think of bubbles).
Moreover, this manager allows you to (recursively) define "magic" insertion
points in these virtual files (bubbles inside other bubbles) which can be
filled in (inflated) later (through a "straw", i.e., the object's reference),
at any convenient time and in any order you like. Since this software acts
purely in memory, there is no slowing down through costly file input/output
(i.e., no temporary files).
Legal issues:
-------------
This package with all its parts is
Copyright (c) 1997, 1998, 1999 by Steffen Beyer.
All rights reserved.
This package is free software; you can redistribute it and/or
modify it under the same terms as Perl itself, i.e., under the
terms of the "Artistic License" or the "GNU General Public License".
Please refer to the files "Artistic.txt" and "GNU_GPL.txt" in
this distribution for details!
Author's note:
--------------
I would be very pleased over *ANY* kind of feedback, questions,
suggestions, donations ;-) and so on, since unfortunately none of
you lazy bums ;-) (for exceptions to this see the "CREDITS.txt"
file in this distribution!) hardly ever writes me.
This feedback is essential for me in order to know wether this
module is useful, to estimate how many people use it and for
what (essential to assess the potential impact an incompatible
change may have, for instance), where its problems and weak-
nesses lie, what should be improved, what additional features
would be useful, etc.
Even e-mail with an empty body and just a subject line such as
"I'm using Data::Locations" would help!
Thank you very much in advance!
In any case, I hope you will find this module beneficial,
share and enjoy!
Yours sincerely,
--
Steffen Beyer <sb@engelschall.com>
http://www.engelschall.com/u/sb/whoami/
http://www.engelschall.com/u/sb/download/
http://www.perl.com/CPAN/authors/id/STBEY/
http://www.oreilly.de/catalog/perlmodger/bnp/
------------------------------
Date: 15 May 1999 19:51:21 GMT
From: paul@miraclefish.com
Subject: ANNOUNCE: DbFramework-1.10
Message-Id: <7hkj7p$clu$1@play.inetarena.com>
file: $CPAN/authors/id/P/PS/PSHARPE/DbFramework-1.10.tar.gz
size: 37057 bytes
md5: eab185af3a310f4dd521352f83e52226
DbFramework is a collection of classes for manipulating DBI databases.
The classes are loosely based on the CDIF Data Model Subject Area.
This module will help you to
- Present data model objects (tables, columns) as HTML
- Add persistency to your Perl objects
- Manipulate DBI databases through an HTML forms interface
Tested configurations:
OS Driver Database
================ ========================== ===================
RedHat Linux 5.1 Msql-Mysql-modules-1.21_15 Mysql 3.22.14-gamma
Msql-Mysql-modules-1.21_15 Msql 2.0.8
DBD-Pg-0.91 PostgreSQL 6.4.2
RELEASE 1.10
Added support for PostgreSQL.
--
paul@miraclefish.com
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: 15 May 1999 19:55:43 GMT
From: Ken MacLeod <ken@bitsko.slc.ut.us>
Subject: ANNOUNCE: first beta of libxml
Message-Id: <7hkjfv$cms$1@play.inetarena.com>
libxml is now available on CPAN. libxml is a collection of smaller
modules, utilities, examples, and documentation for use with the major
XML modules XML::Parser, XML::DOM, XML::Grove and others.
<http://www.perl.org/CPAN/modules/by-module/XML/>
This release is the first development, or beta, release.
Contributions to libxml are very welcome.
This beta contains the PerlSAX proposal, two working implementations
of PerlSAX, a PerlSAX handler, demo converters PerlSAX->SAX and
SAX->PerlSAX, and Data::Grove. More details below.
In the future there will be a ``stable'' line and a ``development''
line for libxml, this 0.01beta is the first in a ``development'' line.
If you have a module or document that you've developed that you want
to go into libxml, please get in touch with me.
Discussion and development of libxml occurs on the Perl-XML mailing
list. You can join the Perl-XML mailing list by sending an email
message to ListManager@ActiveState.com with the ``Subscribe Perl-XML''
in the body of your message. Archives and web subscription are
available from the Mailing Lists page at ActiveState:
<http://www.activestate.com/support/mailing_lists.htm>
libxml currently contains the following modules:
XML::Parser::PerlSAX BETA
XML::Parser::PerlSAX is a Perl SAX parser using XML::Parser
(which uses James Clark's Expat XML Parser).
XML::Handler::Sample BETA
XML::Handler::Sample is a Perl SAX handler that simply prints
out the event names as they are parsed by a SAX parser. It
can be used for debugging or as a template for building new
handlers. XML::Handler::Sample contains handlers for all
known parser events.
XML::ESISParser BETA
XML::ESISParser is a validating Perl SAX parser using James
Clark's `nsgmls' SGML/XML Parser. ESISParser supports both
XML and SGML document instances. Unless you need validation,
you should probably be using XML::Parser::PerlSAX or
XML::Parser.
XML::ESISParser and XML::Grove obsolete the
SGML::SPGroveBuilder and SGML::Grove modules.
Data::Grove BETA
Data::Grove::Tied BETA
Data::Grove::Visitor BETA
Data::Grove and it's helpers provide a base class for deeply
nested or directed graph structures. Used by XML::Grove (and
others soon).
XML::SAX2Perl BETA
XML::Perl2SAX BETA
SAX2Perl and Perl2SAX are SAX Parser<->DocumentHandler
filters. These modules translate parse events between the
Java/CORBA style SAX methods and Perl style SAX methods.
HTML-rendered PODs are also available at:
<http://bitsko.slc.ut.us/~ken/perl-xml/>
--
Ken MacLeod
ken@bitsko.slc.ut.us
------------------------------
Date: 15 May 1999 19:57:33 GMT
From: dowd@spam-free.home.com (Sean Dowd)
Subject: ANNOUNCE: Mail::POP3Client 2.0
Message-Id: <7hkjjd$cq9$1@play.inetarena.com>
Version 2.0 of Mail::POP3Client is now available on CAPN.
http://www.perl.com/CPAN/authors/id/SDOWD/
What's new in version 2.0:
--------------------------
+ changed to hash-style constructor. See the inline doco.
This will be the only supported constructor in later
versions.
+ changed underlying socket code to use IO::Socket. Timeout
settings on the socket are now supported so you can make
sure that POP accesses do not hang.
+ added tests (use POPTESTACCOUNT environment variable to use:
'% POPTESTACCOUNT=userid:password:host make test')
+ module passes strict
+ you can construct a Mail::POP3Client object which does not
auto-connect (by not passing in a USER and PASSWORD) and
then connect manually
------------------------------
Date: 15 May 1999 19:55:50 GMT
From: Francois Desarmenien <desar@club-internet.fr>
Subject: Announce: Parse-Yapp-0.31 released
Message-Id: <7hkjg6$cn6$1@play.inetarena.com>
Parse-Yapp-0.31 has just been uploaded to CPAN. It should be
available soon on your nearest CPAN mirror.
This release is essentially a bugfix release. Feedback is highly
appreciated.
If you have ideas on how to improve Parse::Yapp, don't hesitate
to email me.
Enjoy,
Frangois Disarminien
Here is the README file:
Parse::Yapp - Parse::Yapp Yet Another Perl Parser compiler
Compiles yacc-like LALR grammars to generate Perl OO parser modules.
COPYRIGHT
(c) 1998-1999 Francois Desarmenien, all rights reserved.
(see the Copyright section in Yapp.pm for usage and distribution rights)
IMPORTANT NOTES
THIS IS BETA SOFTWARE.
Though it has been tested a lot, there are probably bugs in it ;-)
The BETA status does not reflect the quality of the code, but the possible
changes in the generated parser modules.
I need FEEDBACK for every problem or bug you could encounter so I can fix
them in the next release. Comments are welcome too.
But I also need FEEDBACK if you use it and have it work fine so I can step
to production releases. Just drop me a mail.
The Parse::Yapp pod section is the main documentation and it assumes
you already have a good knowledge of yacc. If not, I suggest the GNU
Bison manual which is a very good tutorial to LALR parsing and yacc's
grammar syntax.
The documentation is only a draft and should be rewritten (I think).
Any help on this issue would be very welcome.
DESCRIPTION
This is the beta release 0.31 of the Parse::Yapp parser generator.
It lets you create Perl OO fully reentrant LALR(1) parser
modules (see the Yapp.pm pod pages for more details) and has
been designed to be functionnaly as close as possible to yacc,
but using the full power of Perl and opened for enhancements.
REQUIREMENTS
Requires perl5.004 or better :)
It is written only in Perl, with standard distribution modules,
so you don't need any compiler nor special modules.
INSTALLATION
perl Makefile.PL
make
make test
make install
WARRANTY
This software comes with absolutly NO WARRANTY of any kind.
I just hope it can be useful.
FEEDBACK
Send feedback, comments and bug reports to:
Francois Desarmenien
desar@club-internet.fr
------------------------------
Date: 15 May 1999 19:51:00 GMT
From: durist@world.std.com (Daniel J Urist)
Subject: ANNOUNCE: Proc::ProcessTable 0.07
Message-Id: <7hkj74$cln$1@play.inetarena.com>
I have just uploaded Proc::ProcessTable 0.13 to CPAN.
Proc::ProcessTable is a perl module to provide a consistent
object-oriented interface to the process table on different
Unices. Thanks to the efforts of W. Phillip Moore, IRIX is now
supported, in addition to Linux, Solaris, AIX, HPUX and FREEBSD.
--
Dan Urist
durist@world.std.com
http://www.world.std.com/~durist
------------------------------
Date: 15 May 1999 19:57:42 GMT
From: Jean-Louis Leroy <jll@skynet.be>
Subject: ANNOUNCE: Tangram 0.08 - Object Persistence in Relational Databases
Message-Id: <7hkjjm$cqa$1@play.inetarena.com>
Tangram-0.08.tar.gz has entered CPAN as
file: $CPAN/authors/id/J/JL/JLLEROY/Tangram-0.08.tar.gz
size: 30256 bytes
md5: 607c3172b38dac0c511b9af67fc183a0
DESCRIPTION
Tangram is an object-relational mapper. It makes objects persist in
relational databases, and provides powerful facilities for retrieving
and filtering them.
Tangram fully supports object-oriented programming, including
polymorphism, multiple inheritance and collections.
It does so in an orthogonal fashion, that is, it doesn't require your
classes to implement support functions nor inherit from a utility
class.
Jean-Louis Leroy
http://ourworld.compuserve.com/homepages/jl_leroy/
------------------------------
Date: 15 May 1999 19:57:00 GMT
From: durist@world.std.com (Daniel J Urist)
Subject: ANNOUNCE: WWW::Babelfish 0.02
Message-Id: <7hkjic$cq1$1@play.inetarena.com>
I've just uploaded a simple module to interface to the Babelfish
translation server. Its main added value is that it tries to break up
text into small enough chunks for Babelfish to swallow.
>From the documentation:
SYNOPSIS
use WWW::Babelfish;
$obj = new WWW::Babelfish( 'agent' => 'Mozilla/8.0' );
die( "Babelfish server unavailable\n" ) unless defined($obj);
$french_text = $obj->translate( 'source' => 'English',
'destination' => 'French',
'text' => 'My hovercraft is full of eels');
die("Could not translate: " . $obj->error) unless defined($french_text);
@languages = $obj->languages;
--
Dan Urist
durist@world.std.com
http://www.world.std.com/~durist
------------------------------
Date: 15 May 1999 19:58:25 GMT
From: tuomas_lukka@my-dejanews.com
Subject: Graphics::Simple 0.03 - C-64-like simple drawing
Message-Id: <7hkjl1$cqk$1@play.inetarena.com>
Graphics::Simple is a module that emulates something like the graphics
API provided by Commodore-64 or VIC-20 in Perl:
use Graphics::Simple;
line(50,50,150,150);
line(10,10,290,10);
line(10,290,290,290);
circle(50,50,25);
This can be rendered on a variety of devices, currently an X window
(using the Gnome Canvas, requiring a recent gnome and gnome-perl interface:
gnome-perl on the Gnome CVS, the CPAN module is out of date)
or postscript.
See the pod documentation in Simple.pm for details on the operations
provided.
NOTE that this module is alpha-state - only a few primitives are supported
and things may still change - but additional developers are most welcome
to hack on it. Just note - keep it simple.
The module is on CPAN.
Tuomas
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sat, 15 May 1999 21:54:46 GMT
From: "Stephen Warren" <swarren@www.wwwdotorg.org>
Subject: Re: Help: I find tutorial & doc
Message-Id: <G2m%2.48$fx5.179@news.rdc1.sfba.home.com>
<armchair@my-dejanews.com> wrote in message
news:7hjpl3$vh3$1@nnrp1.deja.com...
> In article <7hb5q1$n8s$1@fe1.cs.interbusiness.it>,
> "Sauro Sgatti" <sauro@fol.it> wrote:
> > Where I find tutorial and document of Perl?
> > I know perl.org and CPAN site.
>
> http://www.ncsa.uiuc.edu/General/Training/PerlIntro/
> http://agora.leeds.ac.uk/nik/
For you *both*
As far as Web-sites go, http://www.perl.com/ is a good starting point. It
has good Perl content itself and various links list good books etc. etc.
Assuming you already have Perl installed, you might also start with
perldoc:
perldoc perl
This is the definitive reference to Perl... This main page lists the rest
of the perldoc files available. Suppose you elect to read perlfaq from
this list, you can simply:
perldoc perlfaq
--
Stephen Warren, Snr Systems Engineer, Technology House, San Francisco
mailto:swarren@techhouse.com http://www.techhouse.com/
mailto:swarren@wwwdotorg.org http://www.wwwdotorg.org/
MIME, S/MIME and HTML mail are acceptable
------------------------------
Date: 15 May 1999 21:19:28 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: indentionless here document ? (<<-)
Message-Id: <7hkod0$2n9$1@gellyfish.btinternet.com>
On Fri, 14 May 1999 20:36:47 GMT Stephen Warren wrote:
> Tom Christiansen <tchrist@mox.perl.com> wrote in message
> news:373c3732@cs.colorado.edu...
>> [courtesy cc of this posting sent to cited author via email]
>>
>> In comp.lang.perl.misc, renenyffenegger@my-dejanews.com writes:
>> :Is there any feature in perl to remove tabs at the
>> :beginning of a line in a here document, similar
>> :to the <<-EOHD in a shell script.
>
> In fact, this very discussion was had in this newsgroup not more than a
> day or two ago.
>
> The answer lies in the FAQ (although some variations are also in the
> recent news articles)
>
I'm convinced that Tom knows this already - of course I might be wrong.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 15 May 1999 19:56:43 GMT
From: "Kim Ryan" <kimaryan@ozemail.com.au>
Subject: Li ngua::EN::NameParse-0.03
Message-Id: <7hkjhr$cpt$1@play.inetarena.com>
DESCRIPTION
This module takes as input a person or persons name in
free format text such as,
Mr AB & M/s CD MacNay-Smith
MR J.L. D'ANGELO
Estate Of The Late Lieutenant Colonel AB Van Der Heiden
and attempts to parse it. If successful, the name is broken
down into components and useful functions can be performed like :
- converting upper or lower case values to name case (Mr AB MacNay )
- creating a personalised greeting or salutation (Dear Mr MacNay )
- extracting the names individual components (Mr,AB,MacNay )
- determining the type of format the name is in (Mr_A_Smith )
If the name cannot be parsed you have the option of cleaning the name
of bad characters, or extracting any portion that was parsed and the
portion that failed.
This module can be used for analysing and improving the quality of
lists of names.
------------------------------
Date: Sat, 15 May 1999 21:35:59 GMT
From: "Stephen Warren" <swarren@www.wwwdotorg.org>
Subject: Re: Need help to modify email checker.
Message-Id: <3Nl%2.45$fx5.50@news.rdc1.sfba.home.com>
Blue <mrblue@pd.jaring.my> wrote in message
news:7hjeej$k1j$1@news5.jaring.my...
> My form-mail (not written by me, I am one cgi-idiot) contains the
> portion shown below to check for email input in a form. Can you
> please tell me what it actually checks for?
Your best bet on this is to read the Perl documentation:
perldoc perlre
> if ($FORM{'email'}) {
> unless ($FORM{'email'} =~ /\w+@\w+.\w+/)
I can't quite see the second line being a complete Perl statement, but...
Here's what it does. The Perl code fragment:
s unless b ;
will execute s unless b is true. You can read more about unless at:
perldoc perlsyn
the section under "Simple Statements" would be a good starting point. The
code fragment:
$FORM{'email'}
simply reads a value out of hash %FORM (an odd name for a hash; upper case
variable names aren't often used...). The code fragment:
=~ /\w+@\w+.\w+/
takes this value and performs a pattern match against the
regular-expression between //. You can read more about this operator at:
perldoc perlop
under 'm/PATTERN/'. Basically, it evaluates to a true value if the
expression before =~ is a match for this regular expression, else
evaluates for a false value. As far as the regular expression goes...
\w matches any 'word' character. Read more at perldoc re.
. matched any character.
@ matches a literal @
So, we're checking if the entered email address matches a word, followed
by @ followed by a word, followed by any single character, followed by a
word. Note that the author of your script probably meant to use '\.'
instead of '.' to match a literal full-stop/dot/period in the email
address.
> Is it possible to modify it so that it only accept the email input when
...
>
> (a) there is "@" and .....
> (b) there is EITHER "tm.net.my" OR "jaring.my"
To update the script to your needs, you simply need to update the regular
expression between // to be more-specific about what follows the @:
=~ /^\w+@(.*\.jaring\.my|tm\.net\.my)$/
The | in the regex checks if the text matches either the data before or
after the |. I've used () to limit the scope of | to just the actual text
we want it to apply to. The () are used quite like in math here; they
aren't required to be in the data... I also added ^ and $ to make sure we
match the entire email address, not some sub-part of it.
Hope this helps.
--
Stephen Warren, Snr Systems Engineer, Technology House, San Francisco
mailto:swarren@techhouse.com http://www.techhouse.com/
mailto:swarren@wwwdotorg.org http://www.wwwdotorg.org/
MIME, S/MIME and HTML mail are acceptable
------------------------------
Date: Sat, 15 May 1999 14:25:55 -0700
From: Andrew Perrin <aperrin@mcmahon.qal.berkeley.edu>
To: Mile Andric <andricm@cs.pdx.edu>
Subject: Re: regexp problem
Message-Id: <373DE663.FA7F0C70@mcmahon.qal.berkeley.edu>
[posted and sent via e-mail]
I'm sure others will come up with more elegant solutions, but this will
work:
#!/usr/local/bin/perl -w
use strict;
my($line, @words);
$line = q{this isn't a word};
@words=split(' ',$line);
foreach (@words) {
print "$_\n" if /^[b-df-hj-np-tv-z]+[^']*$/i;
}
Among your problems, I think, is that ' indicates a word boundary in perl
(since \w is [a-zA-Z0-9_], so using \b as the separator causes problems. I
don't think that's the only problem though. Also note that backslashing '
isn't necessary.
ap
Mile Andric wrote:
> I have a string of words that might have an apostrophe (') in them.
> However, I just need to extract words that have one or more consonants
> in the beginning of the word and that don't have apostrophe in the body
> of the word.
> For example in line: "this isn't a word", I need first and fourth word,
> but not second or third.
> So far I tried various combinations but it seems that greedy property is
> what is preventing
> me from match. Here is one (of many) versions of regexp I tried:
>
> $text=~s/\b([b-df-hj-np-tv-z]+)([^\']*)/$2$3$1/gi ;
>
> $text contains the entire line, the first cluster of consonants is
> supposed to be find with
> [b-df-hj-np-tv-z]+ followed by zero or more characters that are not an
> apostrophe (')
> Yet for the words such as isn't that have a vowel in the beginning this
> doesn't work.
> Perl somehow matches that apostrophe and consonant after it as a new
> word, I think.
> I don't understand why is this happening and how to avoid words that
> have a special character (such as apostrophe) in the body of the word.
> Please help.
--
-------------------------------------------------------------
Andrew J. Perrin - NT/Unix/Access Consulting - (650)938-4740
aperrin@mcmahon.qal.berkeley.edu (Remove the Junk Mail King)
http://www.geocities.com/SiliconValley/Grid/7544/
-------------------------------------------------------------
------------------------------
Date: Sat, 15 May 1999 21:49:28 GMT
From: "Stephen Warren" <swarren@www.wwwdotorg.org>
Subject: Re: regexpr - WHY???? - HELP!!!
Message-Id: <IZl%2.47$fx5.80@news.rdc1.sfba.home.com>
K.Posern <posern@informatik.uni-marburg.de> wrote in message
news:373D7633.B5BB7DEB@informatik.uni-marburg.de...
>
> Here is the code:
>
> while ("bla_HQD___blub_MEDICIN" =~
> /(H)([^\1])([^\1\2])([^\1\2\3])([^\1\2\3\4])\4([^\1\2\3\4\5])/g) {
> print "MATCH='$&'\n"
> print "1=$1, 2=$2, 3=$3, 4=$4, 5=$5, 6=$6.\n";
> }
>
> I expect, he shouldn't (!!), he should find a string,
> - that Begins with an "H", =(H)
> - that goes on with an character R different from the first char
> "H", =([^\1])
> - that goes on with an character S different from the first two
> chars ("H" & X), =([^\1\2])
> - that goes on with an character T different from the first three
> chars ("H" & X & Y), =([^\1\2\3])
> - that goes on with an character U _DIFFERENT_ from the first four
> chars ("H" & X & Y & Z), =([^\1\2\3\4])
> - that goes on with the fourth character, =(\4)
> - that goes on with an character V different from the first five
> chars ("H" & R & S & T & U & V), =([^\1\2\3\4\5])
Just a note: There's no string that matches what you hoped that regex
meant... There is only one H in the data, so any match would have to start
there.
Then you hoped you'd get a sequence of another four characters, where each
character was different from any preceding characters:
$1 H
$2 Q
$3 D
$4 _
$5 ... would have to be _ too...
But, as Andrew Johnson stated, the syntax isn't quite right anyway.
--
Stephen Warren, Snr Systems Engineer, Technology House, San Francisco
mailto:swarren@techhouse.com http://www.techhouse.com/
mailto:swarren@wwwdotorg.org http://www.wwwdotorg.org/
MIME, S/MIME and HTML mail are acceptable
------------------------------
Date: Sat, 15 May 1999 22:43:34 +0200
From: Isaac Keslassy <amig@csi.com>
Subject: Saving regularly a web page
Message-Id: <373DDC76.FCFD636F@csi.com>
Hi,
I want to save a web page regularly and automatically on my server (for
instance, to save http://www.perl.com each 30 minutes), in order to
avoid waiting the page when I want it (i'll be able to make
http://localhost/perl.html and i'll get it).
A suggestion ?
Thanks in advance,
Isaac
------------------------------
Date: Sat, 15 May 1999 21:37:30 GMT
From: ajs@ajs.com
Subject: Re: Saving regularly a web page
Message-Id: <7hkpeq$jpl$1@nnrp1.deja.com>
In article <373DDC76.FCFD636F@csi.com>,
Isaac Keslassy <amig@csi.com> wrote:
> I want to save a web page regularly and automatically on my server
> (for instance, to save http://www.perl.com each 30 minutes), in
> order to avoid waiting the page when I want it (i'll be able to make
> http://localhost/perl.html and i'll get it).
The word is "caching", and you can search on the engine of your choice
for caching services. There's no point in your doing this on your own,
unless you really need to, as plenty of people already are.
If you feel that you really need to look into wget (a stand-alone
utility) or LWP (a perl module).
-AJS
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: 15 May 1999 21:26:58 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Saving regularly a web page
Message-Id: <7hkor2$2nc$1@gellyfish.btinternet.com>
On Sat, 15 May 1999 22:43:34 +0200 Isaac Keslassy wrote:
> Hi,
>
> I want to save a web page regularly and automatically on my server (for
> instance, to save http://www.perl.com each 30 minutes), in order to
> avoid waiting the page when I want it (i'll be able to make
> http://localhost/perl.html and i'll get it).
>
perl -MLWP::Simple -e'getprint("http://ww.perl.com")'
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 15 May 1999 22:09:03 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Small amount of Perl CGI script work needed for site.
Message-Id: <7hkr9v$2ni$1@gellyfish.btinternet.com>
On Fri, 14 May 1999 23:53:51 GMT Eric Bohlman wrote:
>
> If for privacy reasons you don't want
> to maintain identifiable records of recipients
>
In the UK you would have to register any system that retain such records
or be in breach of the law. Potentailly of course this could force me
to register my mail log as well but no-one has got in on this yet.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 15 May 1999 20:24:51 GMT
From: bing-du@tamu.edu
Subject: standard array and associative array
Message-Id: <7hkl6h$h2q$1@nnrp1.deja.com>
Hello there,
I need to write a sub routine that is able to handle both standard array
and associative array.
If the parameter passed in is a standard array, then convert it to some
sort of associative array first and then continue processing. If the
parameter passed in is already an associative array, then skip
the conversion step and continue processing.
My question is how to use if, while or whatever to differentiate a
standard array from an associative array at the beginning of the sub
routine?
Any suggestions will be greatly appreciated,
Bing
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Sat, 15 May 1999 21:37:57 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: standard array and associative array
Message-Id: <7hkpdv$9pk$1@xenon.inbe.net>
In article <7hkl6h$h2q$1@nnrp1.deja.com>, bing-du@tamu.edu wrote:
>Hello there,
>
>I need to write a sub routine that is able to handle both standard array
>and associative array.
>
>If the parameter passed in is a standard array, then convert it to some
>sort of associative array first and then continue processing. If the
>parameter passed in is already an associative array, then skip
>the conversion step and continue processing.
>
>My question is how to use if, while or whatever to differentiate a
>standard array from an associative array at the beginning of the sub
>routine?
Larry Rosler used the following in a recent posting :
sub extremes { # Return N extreme-valued elements of array or hash.
my ($ref, $n, $num, $max) = @_;
my $ref_type = $ref && ref $ref || "";
my $hash = $ref_type eq 'HASH' ? 1 : $ref_type eq 'ARRAY' ? 0 :
die "First argument '$ref' must be a reference to array or hash.\n";
..
So $hash is 1 if it is a hash, and 0 if it is an array...
That should probably help you out,
Michel.
------------------------------
Date: 15 May 1999 22:50:00 +0200
From: Kai.Grossjohann@CS.Uni-Dortmund.DE
Subject: Re: using emacs with perl for win32
Message-Id: <vafu2tecb2f.fsf@petty.cs.uni-dortmund.de>
(1) Compile script
See (2).
(2) Run script
You can type M-x compile RET. After this, enter the command line
as if from the shell to run the script, providing any and all
command line arguments as appropriate.
If the script produces stuff that looks like a compiler error
message, you can use M-x next-error RET (C-x `) to go to the right
position in the script as well as the output buffer.
(3) Syntax highlighting
I do the following and get syntax highlighting for all modes which
support it:
(setq font-lock-maximum-decoration t)
(global-font-lock-mode 1 t)
Maybe you would like to use cperl mode for Perl scripts, it is an
improved Perl mode. Put the following line in your ~/.emacs file:
(require 'cperl-mode)
kai
--
Abort this operation? [Abort] [Cancel]
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 5675
**************************************