[17078] in Perl-Users-Digest
Perl-Users Digest, Issue: 4490 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 2 11:09:55 2000
Date: Mon, 2 Oct 2000 08:05:14 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <970499113-v9-i4490@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 2 Oct 2000 Volume: 9 Number: 4490
Today's topics:
Re: Add on <yanick@babyl.sympatico.ca>
CGI script to enter info into MySql database <michael.segulja@sgi-lsi.com>
Re: die() ignores tied STDERR? <iltzu@sci.invalid>
Re: File upload testing if it's there <godzilla@stomp.stomp.tokyo>
Hash array with multiple indexes <haf@autra.noXX>
Re: Hash array with multiple indexes <jeffp@crusoe.net>
Re: How to get length of scalar? <iltzu@sci.invalid>
How to realize new or malloc in perl i0519@my-deja.com
Re: How to realize new or malloc in perl <bmb@ginger.libs.uga.edu>
How to use GDBM's reorganize()? <cg@schlund.de>
Re: Is this is Regexp bug? (Anno Siegel)
Re: Is this is Regexp bug? <bart.lateur@skynet.be>
Re: Just Another Perl Hacker <amonotod@netscape.net>
Latest Dave Roth book - any reviews ? (Michel Dalle)
moving files and chmod via perl <pete@alphanetcoms.co.uk>
multiple file scoping <brew@theMode.com>
New posters to comp.lang.perl.misc <gbacon@cs.uah.edu>
Re: Regex comparing street addresses <godzilla@stomp.stomp.tokyo>
Re: Regex comparing street addresses <godzilla@stomp.stomp.tokyo>
regexp unexp. returns status instead of pattern <chris_beaudette@my-deja.com>
Re: regexp unexp. returns status instead of pattern <jeffp@crusoe.net>
Re: regexp unexp. returns status instead of pattern (John J. Trammell)
Re: Result of functions in child processes (Martien Verbruggen)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 02 Oct 2000 14:32:54 GMT
From: Yanick Champoux <yanick@babyl.sympatico.ca>
Subject: Re: Add on
Message-Id: <q01C5.28226$vZ.1572707@news20.bellglobal.com>
kily@my-deja.com wrote:
: Hello,
Hullo,
: I'm wondering for a script which can read a file
: containing two columns seperated by unknown number of tabulation or
: space, then delete the first column (which is a complete name of
: unsers). The second column is the user-ID as: 008253A, 008256X,...etc.
: I want script to be able to delete the first two charecters and
: transform majuscule (A, X, B,...etc) to minuscules ones.
#! /usr/bin/perl -p
/.*\s../;$_=lc$'
__END__
I would have written that as a one-liner, but my $@%$!$ shell
keep whining over $'. *sigh*
Joy,
Yanick
--
($_,$y)=('Yhre lo .kePnarhtretcae', '(.) (.)');
$y=~s/\(/(./gwhile s/$y/$2$1/xg;print # @
# `---'
------------------------------
Date: Mon, 02 Oct 2000 14:52:06 GMT
From: Michael Segulja <michael.segulja@sgi-lsi.com>
Subject: CGI script to enter info into MySql database
Message-Id: <8ra7el$lcu$1@nnrp1.deja.com>
I am building a very simple (I mean VERY simple) help desk system for
my company. It's basically an excersice for me to learn Perl. I have
a MySql database created with one table. I created a web page with
fields to enter first and last name, phone extension, and a description
of the problem. My table has the following fields (not showing syntax
here, just what fields are in the database):
id INT(4) AUTO_INCREMENT
FirstName VARCHAR(15)
LastName VARCHAR(25)
PHONE INT(4)
PROBLEM text
My perl script has the following code:
# Connect to the database.
my $dbh = DBI->connect("DBI:mysql:database=$db;host=$host",
$user, $password, {RaiseError => 1} );
# Insert data into table hdInfo
my $sth=$dbh->prepare("INSERT INTO hdInfo
VALUES (?,?,?,?,?)" );
$sth->execute('1',$firstname,$lastname,$phone,$problem) ||
die "failed";
$sth->finish();
#Disconnect from database.
$dbh->disconnect();
The $firstname, $lastname, etc. variables come from the webpage form.
I can succesfully connect to the database and enter the data into the
fields based on what is entered on the form. My problem is that I had
to enter a '1' in my cgi script for the first id field in the database,
even though I have it set as AUTO_INCREMENT. I don't know how to write
my Perl code so that the id field increments each time a record is
stored in the database, and the rest of the fields are filled out
according to the variables gotten from the webpage form.
Can somebody help me out? I really appreciate any advice and/or help.
Thanks,
Michael Segulja
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 2 Oct 2000 14:59:08 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: die() ignores tied STDERR?
Message-Id: <970498435.26691@itz.pp.sci.fi>
In article <slrn8tgp4k.jr6.mgjv@martien.heliotrope.home>, Martien Verbruggen wrote:
>
>That last one looks like a bug. perl should never segfault.
Not even "unpack p => rand() while 1;"?
Sorry. Just couldn't resist. I know what you meant.
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla | "By promoting postconditions to
and its pseudonyms - | preconditions, algorithms become
do not feed the troll. | remarkably simple." -- Abigail
------------------------------
Date: Mon, 02 Oct 2000 07:06:46 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: File upload testing if it's there
Message-Id: <39D89676.35B67529@stomp.stomp.tokyo>
Nicked Condom wrote:
> yorktown5425@my-deja.com wrote:
> > He wrote under other fake names:
(snipped)
Couldn't help but notice both of you, actually
one of you pretending to be both of you, ever
so carefully removed your previous hateful sexist
remarks you directed at me and, at all women.
Embarrassed, Frank?
Godzilla!
--
Dr. Kiralynne Schilitubi ¦ Cooling Fan Specialist
UofD: University of Duh! ¦ ENIAC Hard Wiring Pro
BumScrew, South of Egypt ¦ HTML Programming Class
------------------------------
Date: Mon, 02 Oct 2000 15:17:07 +0200
From: "P.Eftevik" <haf@autra.noXX>
Subject: Hash array with multiple indexes
Message-Id: <39D88AD3.F1DCDFD4@autra.noXX>
I have an associative array with strings as indexes.
What I'd like to do is to use substrings as indexes as well.
E.g. if 'mystring' is a valid index, I will need to index the array
by means
of 'mystr' also.
I wonder if there are techniques to accomplish this.
Thanx for all hints.
PEftie
Navia
Norway
------------------------------
Date: Mon, 2 Oct 2000 10:06:50 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Hash array with multiple indexes
Message-Id: <Pine.GSO.4.21.0010020958310.12979-100000@crusoe.crusoe.net>
On Oct 2, P.Eftevik said:
>I have an associative array with strings as indexes.
>What I'd like to do is to use substrings as indexes as well.
>
>E.g. if 'mystring' is a valid index, I will need to index the array
>by means
>of 'mystr' also.
>
>I wonder if there are techniques to accomplish this.
The module Text::Abbrev will probably assist you here. It converts a list
of strings to a hash with abbreviation-to-full-string conversions. Then
you would use your other hash normally:
use Text::Abbrev;
%hash = (
people => 10,
trees => 3,
treasures => 2,
);
%abbrev = abbrev keys %hash;
print $hash{$abbrev{tree}}; # 3
print $hash{$abbrev{treasu}}; # 2
print $hash{$abbrev{p}}; # 10
print $hash{$abbrev{tre}}; # undef
The reason the key 'tre' doesn't exist in the %abbrev hash is because it
is not a UNIQUE leading string. Does 'tre' map to 'trees' or 'treasures'?
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
------------------------------
Date: 2 Oct 2000 14:47:17 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: How to get length of scalar?
Message-Id: <970497438.23772@itz.pp.sci.fi>
In article <slrn8tg8dc.e2u.dha@panix6.panix.com>, David H. Adler wrote:
>On Sun, 01 Oct 2000 19:03:48 GMT, David Steuber
><nospam@david-steuber.com> wrote:
>
>>As for on-topic posts, I've tried to post to comp.lang.perl and
>>cross-post to comp.lang.perl.misc (or modules) as clp has less traffic
>>than clpm.
>
>There's a reason for this. Said reason is that c.l.p *no longer
>exists* (cf. Crazy Vaclav, some simpsons episode that I can't be
>bothered to look up the code for...)
>
[snip]
>
>By definition, off-topic rants should not appear in *any*
>newsgroup... :-) (1/2).
It occurs to me that a newsgroup that does not exist, despite frequent
claims to the contrary, is a rather fitting place for off-topic posts.
Of course, there is already a newsgroup for precisely that purpose, to
which I have crossposted and set followups.
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
"Maybe I shouldn't be singing this song / Ranting and raving and
carrying on / Maybe they're right when they tell me I'm wrong...
NAAAAH!" -- Denis Leary, _Asshole_
------------------------------
Date: Mon, 02 Oct 2000 13:10:10 GMT
From: i0519@my-deja.com
Subject: How to realize new or malloc in perl
Message-Id: <8ra1fe$hc3$1@nnrp1.deja.com>
Hi,
I want to new some object in perl.
Could andbody please give me some advice?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 2 Oct 2000 11:02:53 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: How to realize new or malloc in perl
Message-Id: <Pine.A41.4.21.0010021055560.14510-100000@ginger.libs.uga.edu>
On Mon, 2 Oct 2000 i0519@my-deja.com wrote:
> Hi,
> I want to new some object in perl.
> Could andbody please give me some advice?
Hmmm,
The phrasing of your question makes me wonder if you've done a lot of
programming in Perl. If not, you may have to start with more basic
documentation. Otherwise, you might find useful information in the
following places:
perlref Perl references
perlreftut Perl references short introduction
perldsc Perl data structures intro
perllol Perl data structures: lists of lists
perltoot Perl OO tutorial
perlobj Perl objects
perlbot Perl OO tricks and examples
A short answer is that how you instantiate an object in Perl depends on
how the class is implemented.
Brad
------------------------------
Date: Mon, 02 Oct 2000 16:26:08 +0200
From: Carsten Gaebler <cg@schlund.de>
Subject: How to use GDBM's reorganize()?
Message-Id: <39D89B00.A9CECB9@schlund.de>
Hi!
Could someone explain to me how to use gdbm's reorganize() function?
I've tried this:
use GDBM_File;
$dbf = tie(%db, "GDBM_File", "$file", O_RDWR, 0644);
$dbf->reorganize();
untie(%db);
But the database's size doesn't change.
Regards
Carsten.
------------------------------
Date: 2 Oct 2000 13:38:37 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Is this is Regexp bug?
Message-Id: <8ra34t$660$1@lublin.zrz.tu-berlin.de>
Glyndwr <glynFOOdwr@FSCKdeleteEmeD.co.uk> wrote in comp.lang.perl.misc:
>"Bart Lateur" <bart.lateur@skynet.be> wrote in message
>news:2pqgtscou2esb51u9gr6f65o8l5ohln15q@4ax.com...
>> Glyndwr wrote:
>>
>> > if ($_ =~ /^[a-zA-Z0-9.\-]+@[a-z-A-Z0-9.\-]+/)
>>
>> You forgot a backslash in front of the '@'.
>
>I didn't think '@' was a metacharacter in regexps? Mind you, I always have
>trouble remembering what is and isn't a metacharacter...
>/me digs out Perl Bookshelf CD
>"The list of metacharacters is: \ | ( ) [ { ^ $ * + ? ."
@ must be escaped in all double-quotish strings of which regexes are
just one example. This *may* be how a string from a variable ended
up as part of the regex, though I don't really see it happening.
Who knows what this secure_perl does.
Anno
------------------------------
Date: Mon, 02 Oct 2000 13:42:26 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Is this is Regexp bug?
Message-Id: <3d3htsklu2ndu94i9ub6ghdo6ru4pdtdc3@4ax.com>
Glyndwr wrote:
>> You forgot a backslash in front of the '@'.
>
>I didn't think '@' was a metacharacter in regexps? Mind you, I always have
>trouble remembering what is and isn't a metacharacter...
>/me digs out Perl Bookshelf CD
>"The list of metacharacters is: \ | ( ) [ { ^ $ * + ? ."
>
>So, possibly not that.
Not exactly... regexes are interpolated as double quotish strings.
$pat = '\d+';
$_ = "There are 99 bottles of beer on the wall";
/($pat)/ and print "Found '$1'\n";
-->
Found '99'
So even though '@' is not a metacharacter, it, plus what follows, is
interpolated as an array.
@pat = ('\d+', '[A-Z]');
$" = '|';
print qr/@pat/;
-->
(?-xism:\d+|[A-Z])
What's the contents of @[ anyway? Nothing, AFAIK.
Guess what. I tried your pattern, and it works (under 5.6). That is
surprising: it shouldn't have worked. Well, you forgot a anchoring '$'
at the end. And remove the hyphen between 'z' and 'A'.
$_ = 'me@home-net.com';
/^[a-zA-Z0-9.\-]+@[a-zA-Z0-9.\-]+$/ and print 'match';
-->
match
But a backslash in front of the '@' definitely doesn't hurt.
--
Bart.
------------------------------
Date: Mon, 02 Oct 2000 14:40:04 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: Just Another Perl Hacker
Message-Id: <8ra6o3$klo$1@nnrp1.deja.com>
In article <m1bsx731f9.fsf@halfdome.holdit.com>,
merlyn@stonehenge.com (Randal L. Schwartz) wrote:
> >>>>> "Graham" == Graham Wood <graham.wood@iona.com> writes:
>
> Graham> It obviously isn't infinite or you wouldn't have finished
reading it.
>
> Nor would I have finished writing it. :)
>
In the hope that it may be appendable, I submit:
$_="074117115116032097110111116104101114".
"032080101114108032104097099107101114044";
for ($i=0; $i < length(); ($i+=3))
{ print chr(substr($_, $i, 3)); }
amonotod
--
`\|||/ amonotod@
(@@) netscape.net
ooO_(_)_Ooo________________________________
_____|_____|_____|_____|_____|_____|_____|_____|
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 02 Oct 2000 14:05:50 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Latest Dave Roth book - any reviews ?
Message-Id: <8ra4pl$k99$1@news.mch.sbs.de>
I saw that the new Dave Roth book (Win32 Perl Scripting : The
Administrator's Handbook) was announced on his website now :
http://www.roth.net/books/handbook/
Anyone else had a look at it yet ?
Michel.
------------------------------
Date: Mon, 2 Oct 2000 15:30:27 +0100
From: "pete" <pete@alphanetcoms.co.uk>
Subject: moving files and chmod via perl
Message-Id: <39d8a195.0@energise.enta.net>
Hi,
I'm looking for the perl commands which moves a file to another directory to
be followed by a chmod to stop people from reading/writing/executing the
file.
This must be done within a perl script.
Thanks for any response.
Bye,
Pete
------------------------------
Date: Mon, 02 Oct 2000 14:34:01 GMT
From: Bruce Schiller <brew@theMode.com>
Subject: multiple file scoping
Message-Id: <t11C5.1189$bt.18346@news3.voicenet.com>
Is there a way to use lexical variables (my declarations) across multiple
files or am I restricted to using fully qualified global declarations
using local? I want to use strict vars.
The way I interpreted the docs I thought this might work:
{
my $var;
require 'afile.pl';
...
}
but the $var in afile.pl is still different from this one.
Thanks,
brew
--
==========================================================================
Strange Brew (brew@theMode.com)
Check out my Musician's Online Database Exchange (The MODE Pages)
http://www.TheMode.com
==========================================================================
------------------------------
Date: Mon, 02 Oct 2000 14:38:18 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: New posters to comp.lang.perl.misc
Message-Id: <sth7eq6aqvm192@corp.supernews.com>
Following is a summary of articles from new posters spanning a 7 day
period, beginning at 25 Sep 2000 15:49:39 GMT and ending at
02 Oct 2000 23:41:07 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" email address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 2000 Greg Bacon.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Totals
======
Posters: 184 (40.4% of all posters)
Articles: 317 (19.9% of all articles)
Volume generated: 536.8 kb (18.5% of total volume)
- headers: 250.8 kb (5,052 lines)
- bodies: 281.6 kb (9,685 lines)
- original: 188.6 kb (6,991 lines)
- signatures: 4.1 kb (112 lines)
Original Content Rating: 0.670
Averages
========
Posts per poster: 1.7
median: 1.0 post
mode: 1 post - 121 posters
s: 1.8 posts
Message size: 1734.0 bytes
- header: 810.1 bytes (15.9 lines)
- body: 909.7 bytes (30.6 lines)
- original: 609.3 bytes (22.1 lines)
- signature: 13.2 bytes (0.4 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
12 31.3 ( 10.5/ 20.8/ 15.2) "Mark Carruth" <mcarruth@talk21.com>
12 17.7 ( 9.1/ 8.6/ 3.7) "Cameron Elliott" <celliot@tartarus.uwa.edu.au>
9 12.3 ( 8.5/ 3.8/ 1.5) Drew Simonis <dsimonis@fiderus.com>
8 14.9 ( 5.8/ 9.1/ 3.7) ebohlman@omsdev.com
6 14.1 ( 5.0/ 9.1/ 6.4) mari <mari@civil.columbia.edu>
5 8.6 ( 3.9/ 4.8/ 2.7) "Brian Kelly" <reedfish@ix.netcom.com>
5 8.1 ( 4.2/ 4.0/ 1.2) "Randy Harris" <harrisr@bignet.net>
5 7.0 ( 4.1/ 2.9/ 1.8) jim_marshall2268@hotmail.com
4 10.4 ( 3.9/ 6.5/ 4.4) Daniel Bohling <dbohling@newsfactor.com>
4 8.6 ( 2.7/ 5.9/ 2.3) Rand25@juno.com
These posters accounted for 4.4% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
31.3 ( 10.5/ 20.8/ 15.2) 12 "Mark Carruth" <mcarruth@talk21.com>
17.7 ( 9.1/ 8.6/ 3.7) 12 "Cameron Elliott" <celliot@tartarus.uwa.edu.au>
14.9 ( 5.8/ 9.1/ 3.7) 8 ebohlman@omsdev.com
14.1 ( 5.0/ 9.1/ 6.4) 6 mari <mari@civil.columbia.edu>
12.8 ( 3.8/ 9.0/ 8.8) 4 Torsten Schindler <Torsten.Schindler@ccc.uni-erlangen.de>
12.3 ( 8.5/ 3.8/ 1.5) 9 Drew Simonis <dsimonis@fiderus.com>
11.3 ( 3.6/ 7.7/ 3.5) 4 yorktown5425@my-deja.com
10.4 ( 3.9/ 6.5/ 4.4) 4 Daniel Bohling <dbohling@newsfactor.com>
9.2 ( 3.3/ 4.0/ 0.4) 3 zaphod@TruckLoad2000.com
9.0 ( 4.8/ 3.5/ 2.1) 3 Anonymous <anonymous@anonymous.anonymous>
These posters accounted for 4.9% of the total volume.
Top 10 Posters by OCR (minimum of three posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.977 ( 8.8 / 9.0) 4 Torsten Schindler <Torsten.Schindler@ccc.uni-erlangen.de>
0.956 ( 1.6 / 1.7) 4 joshfeingold@my-deja.com
0.740 ( 1.3 / 1.7) 3 vlad_the_impaler24@my-deja.com
0.730 ( 15.2 / 20.8) 12 "Mark Carruth" <mcarruth@talk21.com>
0.716 ( 1.7 / 2.4) 3 Scott Laughton <scottl@sympac.com.au>
0.697 ( 6.4 / 9.1) 6 mari <mari@civil.columbia.edu>
0.685 ( 0.7 / 1.0) 3 Paul Spandler <p.m.spandler@bton.ac.uk>
0.678 ( 4.4 / 6.5) 4 Daniel Bohling <dbohling@newsfactor.com>
0.654 ( 1.9 / 2.9) 4 "Dave" <dave@marballs.co.uk>
0.623 ( 1.2 / 1.9) 3 "MASTER" <Master@sdswebspace.com>
Bottom 10 Posters by OCR (minimum of three posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.470 ( 1.2 / 2.6) 3 phillip.smith@sympatico.ca
0.455 ( 3.5 / 7.7) 4 yorktown5425@my-deja.com
0.446 ( 0.7 / 1.7) 4 Young Chi-Yeung Fan <yf32@cornell.edu>
0.428 ( 3.7 / 8.6) 12 "Cameron Elliott" <celliot@tartarus.uwa.edu.au>
0.411 ( 3.7 / 9.1) 8 ebohlman@omsdev.com
0.393 ( 2.3 / 5.9) 4 Rand25@juno.com
0.384 ( 1.5 / 3.8) 9 Drew Simonis <dsimonis@fiderus.com>
0.313 ( 1.2 / 4.0) 5 "Randy Harris" <harrisr@bignet.net>
0.311 ( 0.6 / 2.0) 3 "Frank Sonnemans" <fs.mail@wanadoo.be>
0.102 ( 0.4 / 4.0) 3 zaphod@TruckLoad2000.com
25 posters (13%) had at least three posts.
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
97 alt.perl
40 comp.lang.perl
34 comp.lang.perl.modules
12 alt.comp.perlcgi.freelance
5 alt.html
5 alt.comp.lang.superlang
5 comp.lang.javascript
3 comp.lang.perl.moderated
3 alt.www.webmaster
2 han.comp.lang.perl
Top 10 Crossposters
===================
Articles Address
-------- -------
12 "Mark Carruth" <mcarruth@talk21.com>
9 "vladimir y. plotnikov" <vlad@sas.nsk.su>
5 "Daniel Longest" <dajr4@vt.edu>
5 "Nick Emblow, President IT Not Just Bears" <emblow@ozlinx.com.au>
4 "Jonathan Wong" <wongjonk@hotmail.com>
4 webmaster@digital-espresso.com
3 zaphod@TruckLoad2000.com
3 Matthew Leonhardt <bubby_titch@hotmail.com>
3 "Bengt-Arne Fjellner" <Bengt-Arne.Fjellner@tt.luth.se>
3 "Kevin Matassa" <kmatassa@jetform.com>
------------------------------
Date: Mon, 02 Oct 2000 06:41:00 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Regex comparing street addresses
Message-Id: <39D8906C.52489E67@stomp.stomp.tokyo>
Peter Sundstrom wrote:
> Godzilla! wrote:
> >Peter Sundstrom wrote:
> >> I'm having problems trying to get the correct regex
> >> to perform an address comparison.
> >Here ya go. Working code. Only tests I have made on
> >this script is what you see for input data. Output
> >is precisely per your parameters.
> Not quite.
> 'APARTMENT 4567A 4B SMITH ST'
> This should produce a same result.
This is not within your given parameters
exemplified by your cited examples.
"...precisely per your parameters."
Reading comprehension problem or a problem
of playing games with everyone?
You are welcome for my time and effort, arsehole.
Godzilla!
------------------------------
Date: Mon, 02 Oct 2000 06:46:58 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Regex comparing street addresses
Message-Id: <39D891D2.56D8DEEB@stomp.stomp.tokyo>
"Alan J. Flavell" wrote:
> On Sun, 1 Oct 2000, Anonymous wrote:
> > Quite frequently, before I post, I will actually
> > click my cursor at a line start, and manually
> > count how many characters are present.
> Heavens - don't you have a computer to do that for you?
Screw off Flavell. You have a well earned and long documented
history for being amongst the worst of trolls within USENET
and, you daily spend hours spreading discontent and hatred
every chance you get. I am not interested in playing your
ignorant hateful troll game. Go to Hades you sociopath.
Godzilla!
--
Dr. Kiralynne Schilitubi ¦ Cooling Fan Specialist
UofD: University of Duh! ¦ ENIAC Hard Wiring Pro
BumScrew, South of Egypt ¦ HTML Programming Class
------------------------------
Date: Mon, 02 Oct 2000 13:07:04 GMT
From: crb <chris_beaudette@my-deja.com>
Subject: regexp unexp. returns status instead of pattern
Message-Id: <8ra19k$h2j$1@nnrp1.deja.com>
greetings.
i'm writing a perl script and have a regular expression that is
occasionally matching. but when it matches, it returns a status of "1"
instead of the pattern matched. what am i doing wrong?
here's the expression and supporting script:
-----------------------------------------------
foreach $logfile ( @logfiles ) {
$_ = $logfile;
print "default param = ", $_, "\n";
local ($namebase) = s/(.+)\..+/$1/; ### <<<<---- regexp
print "namebase = '", $namebase, "'\n";
local( $tempfile ) = $namebase . ".tmp\n";
print "tempfile = ", $tempfile, "\n";
...
}
-----------------------------------------------
the output is as follows:
-----------------------------------------------
default param = update_compile.bak
namebase = '1'
tempfile = 1.tmp
-----------------------------------------------
note that i've also tried:
local ($namebase) = s/(\w)\.\w/$1/;
to the same result.
any ideas???
thanks!
~~crb
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 2 Oct 2000 09:58:23 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: regexp unexp. returns status instead of pattern
Message-Id: <Pine.GSO.4.21.0010020956480.12979-100000@crusoe.crusoe.net>
[posted & mailed]
On Oct 2, crb said:
>i'm writing a perl script and have a regular expression that is
>occasionally matching. but when it matches, it returns a status of "1"
>instead of the pattern matched. what am i doing wrong?
m// returns the $1, $2, etc. variables in list context.
s/// returns the number of times it subsituted.
> local ($namebase) = s/(.+)\..+/$1/; ### <<<<---- regexp
(Maybe you want my() instead of local() here?)
Change this to:
s/(.+)\..+/$1/;
my $namebase = $1;
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
------------------------------
Date: 2 Oct 2000 15:00:10 GMT
From: trammell@nitz.hep.umn.edu (John J. Trammell)
Subject: Re: regexp unexp. returns status instead of pattern
Message-Id: <slrn8tgef9.ls4.trammell@nitz.hep.umn.edu>
On Mon, 02 Oct 2000 13:07:04 GMT, crb <chris_beaudette@my-deja.com> wrote:
>
>i'm writing a perl script and have a regular expression that is
>occasionally matching. but when it matches, it returns a status of "1"
>instead of the pattern matched. what am i doing wrong?
> local ($namebase) = s/(.+)\..+/$1/; ### <<<<---- regexp
From 'perldoc perlop':
s/PATTERN/REPLACEMENT/egimosx
Searches a string for a pattern, and if found,
replaces that pattern with the replacement text and
returns the number of substitutions made. Otherwise
it returns false (specifically, the empty string).
I don't think you're doing what you think you're doing. :-)
--
John J. Trammell
johntrammell@yahoo.com
------------------------------
Date: Tue, 3 Oct 2000 00:55:14 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Result of functions in child processes
Message-Id: <slrn8th4u2.jr6.mgjv@martien.heliotrope.home>
On Mon, 02 Oct 2000 14:32:34 +0200,
Torsten Schindler <Torsten.Schindler@ccc.uni-erlangen.de> wrote:
> Hello,
>
> How can I get the result of my function afunc back from the child
> process?
# perldoc perlipc
You will have to do something with files, pipes, fifos, sockets or
something like that. Alternatively, you can dabble with shared memory
segments if you really feel like it, although this application hardly
warrants the trouble.
Martien
--
Martien Verbruggen |
Interactive Media Division |
Commercial Dynamics Pty. Ltd. | What's another word for Thesaurus?
NSW, Australia |
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 4490
**************************************