[24214] in Perl-Users-Digest
Perl-Users Digest, Issue: 6406 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 15 14:05:53 2004
Date: Thu, 15 Apr 2004 11:05:06 -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 Thu, 15 Apr 2004 Volume: 10 Number: 6406
Today's topics:
Re: 'my' array variables avoid memory leaks? <nobull@mail.com>
Re: Earthquake and tornado data evaluation Perl program <1usa@llenroc.ude>
Re: Earthquake and tornado data evaluation Perl program <edgrsprj@ix.netcom.com>
Re: file access trouble <EatMeSpammers_cwtart@commpay.tv>
Re: how to do a reverse ip lookup of a DNS server ? <nobull@mail.com>
Re: One question <spamtrap@dot-app.org>
Re: One question <jgibson@mail.arc.nasa.gov>
Re: One question <edgrsprj@ix.netcom.com>
Re: question about substr <tore@aursand.no>
Re: question about substr <EatMeSpammers_cwtart@commpay.tv>
Re: question about substr <bmb@ginger.libs.uga.edu>
Re: question about substr <nobull@mail.com>
Re: regexpr question is w2 taken <ittyspam@yahoo.com>
strange side-effect (bug?) in Net::SMTP (Ian D.)
The big rush <edgrsprj@ix.netcom.com>
Re: Tough (for me) regex case <jwkenne@attglobal.net>
Re: Two mini-golfish problems <bmb@ginger.libs.uga.edu>
Re: Two mini-golfish problems <xxala_qumsiehxx@xxyahooxx.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 15 Apr 2004 18:11:28 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: 'my' array variables avoid memory leaks?
Message-Id: <u9ad1d5fpb.fsf@wcl-l.bham.ac.uk>
yashgt@yahoo.com (Yash) writes:
> Also, by making the array my, do you think the array would be
> overwritten? or would it be deallocated and reallocated for the new
> iteration?
Conecptually it's deallocated and reallocated. Implementationally it
may get overwritten if perl thinks it is safe to do so. But you
shouldn't need to worry about this. From a Perl programmer's point of
view it's deallocated and reallocated.
------------------------------
Date: 15 Apr 2004 16:21:06 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude>
Subject: Re: Earthquake and tornado data evaluation Perl program Apr. 14, 2004
Message-Id: <Xns94CC7DA59E551asu1cornelledu@132.236.56.8>
"edgrsprj" <edgrsprj@ix.netcom.com> wrote in
news:V8xfc.7581$l75.1096@newsread2.news.atl.earthlink.net:
> "A. Sinan Unur" <1usa@llenroc.ude> wrote in message
> news:Xns94CBCB008812asu1cornelledu@132.236.56.8...
>> "edgrsprj" <edgrsprj@ix.netcom.com> wrote in
>> news:YZcfc.7030$zj3.3864@newsread3.news.atl.earthlink.net:
>>
>> Well, your program managed to make me cry. Just two samples:
>
> And it should make you cry, but for a reason which I suspect you are
> not considering.
...
> Do you see any expert computer programmers whose lives are threatened
> by earthquakes who are rushing to do any of those things in my
> suggestion list?
...
Of course not. You have not explained what you want your program to do in
any concrete terms. Without that, it is hard to find people with enough
free time to waste on trying to decipher piles POS code like:
$offset = $offset + 5, $pr[2] = 2, $db[2][$num] = 1*(substr $qwlin[$num
- 1], $offset, $pr[2]), $dbm[2] = 'glon';
I have briefly looked through your web site. There is no clear
explanation of what algorithm you are trying to implement.
The distinct impression I get is that you guys are a bunch of
numerologists. While you should feel free to do whatever you want with
your free time, I have better things to do. In the mean time, if you can
come up with a clear description of the algorithms you want to implement
etc, then I am sure there will be plenty of help given in this group.
Sinan.
--
A. Sinan Unur
1usa@llenroc.ude (reverse each component for email address)
------------------------------
Date: Thu, 15 Apr 2004 17:54:44 GMT
From: "edgrsprj" <edgrsprj@ix.netcom.com>
Subject: Re: Earthquake and tornado data evaluation Perl program Apr. 14, 2004
Message-Id: <E%zfc.9506$zj3.7276@newsread3.news.atl.earthlink.net>
"A. Sinan Unur" <1usa@llenroc.ude> wrote in message
news:Xns94CC7DA59E551asu1cornelledu@132.236.56.8...
> "edgrsprj" <edgrsprj@ix.netcom.com> wrote in
> news:V8xfc.7581$l75.1096@newsread2.news.atl.earthlink.net:
> The distinct impression I get is that you guys are a bunch of
> numerologists. ...
First of all, there are no "you guys." But as I said in my first note, I
feel that it is vitally important that some "you guys" group does get
started. This project is so complex and it covers so many areas of science
that in order for it to get developed as quickly as possible some group
would have to keep track of all of its different parts. There is the
computer program side. There is a precursor data collection side. It
relies heavily on geophysics, celestial mechanics, ocean science,
electronics, and probably meteorology. How could one person or even a small
group of people be an expert in so many fields and keep track of all of
those things?
That program does not involve "numerology." And it does not involve
astrology. It represents good old-fashioned, straightforward classical
Western culture physics.
Here is what the program does in essence, and this explanation and quite a
bit of additional explanation information can be found on my 302.html Web
page.
The data mentioned here are not real. And the specific sun and moon
longitude comparison tests discussed here are not actually used in the data
evaluation program. They are simply providing an easily understood example
of how the program works.
It is widely believed that earthquakes occur when fault zones have enough
strain energy stored in them as the result of tectonic plate movements etc.
that their rock layers fracture and release some of that stored energy in
the form of an earthquake. Some researchers including me believe that many
earthquakes do not simply occur at random times. The fault zone is given a
final push over the edge by the daily earth bending, stretching, and
compression forces associated directly and/or indirectly with the
gravitational pulls of the sun and the moon. My program and another one at
my Web site called a Wave Chart spreadsheet program attempt to identify the
times when those bending forces etc. are most likely to trigger an
earthquake or produce some type of precursor signal. The following is an
example of the types of calculations which the program does.
A powerful earthquake occurs in Location A when the moon is directly above
30W longitude and the sun is directly above 10W longitude.
Less than an hour later a powerful earthquake occurs in Location B when the
moon is directly above 40W longitude and the sun is directly above 20W
longitude.
That information for both of those earthquakes is stored in the data
evaluation program's earthquake database file.
Some time later a warning signal is detected. And people suspect that it
might be signaling that a powerful aftershock is approaching for either that
Location A earthquake or the one in Location B.
When the warning signal time is entered into the data evaluation program it
shows that the moon was directly above 40W longitude at the time that the
warning signal was detected. And the sun was directly above 10W longitude.
The sun longitude matched the Location A earthquake. And the moon longitude
matched the Location B earthquake. So, where is the program proposing that
the expected aftershock will most likely occur, Location A or Location B?
Within the program are importance or "weight" factors which are given to
comparison tests such as those two. And just for the purposes of this
example I will say that those weight factors are set so that the moon
longitude is regarded as being 2.5 times as important to earthquake
triggering and warning signal generation processes as the sun longitude. So
when the program outputs the test results it would give that Location B
earthquake location a probability rating of 100 and that Location A
earthquake location a probability rating of 40. In other words, the program
is proposing that the expected aftershock is more likely to be for the
Location B earthquake.
There is much room for improvement in the program's actual comparison tests.
But the very basic ones which it is presently using work for at least some
earthquakes. And they represent both a valuable earthquake data evaluation
resource and a good starting place for future efforts.
And once again, the last part of the following Web page explains what needs
to be done.
http://www.freewebz.com/eq-forecasting/301.html
It is particularly important that I learn if the program will run on other
systems besides Windows XP and 98. And a response to another note says that
it will. It is even more important that those sun and moon position
subroutines get added to it. A retired professional computer programmer who
is developing a compiled Basic version of the program has volunteered to add
them. But that would probably take him a while as he is concentrating on
getting his Basic version running. I really don't personally care about
what the program code look like. As long as the numbers it generates are
accurate that is adequate. Better looking code can always be produced if
the program can be shown to be of value.
The views expressed here are personal opinions rather than absolute
certainties.
------------------------------
Date: Thu, 15 Apr 2004 10:09:13 -0500
From: "Chuck" <EatMeSpammers_cwtart@commpay.tv>
Subject: Re: file access trouble
Message-Id: <kAxfc.986$KG2.1513@reggie.win.bright.net>
Bob,
I got my script working - there was a problem with my path settings. Thanks
for the help.
--
regards,
Chuck
"Bob Walton" <invalid-email@rochester.rr.com> wrote in message
news:40794924.6020701@rochester.rr.com...
> Chuck wrote:
>
> > Bob,
> >
> > Tried your suggestion - did not make any difference - my script does not
> > create the NEW file. Using ActiveState latest version.
> >
> >
>
> Well, here is the exact source I ran (verbatim with yours except for the
> file names and better die messages), along with the exact output:
>
> D:\junk>type junk444.pl
> use strict;
> use warnings;
>
> my $text1;
> my $text2;
>
> my $OldFile = "d:/junk/junk444.txt";
> my $NewFile = "d:/junk/junk444a.txt";
>
> open(OLD, '<', $OldFile) or die "Oops, couldn't open $OldFile, $!";
> open(NEW, '>', $NewFile) or die "Oops, couldn't open $NewFile, $!";
>
> while (<OLD>) {
> $text1 = substr($_,0,5);
> $text2 = crypt(substr($_,5,8),substr($_,13,2));
> print NEW "$text1 $text2 /n";
> }
>
> close OLD or die "$!\n";
> close NEW or die "$!\n";
> rename($NewFile,$OldFile) or die "$!\n";
>
> D:\junk>type junk444.txt
> asdflkjsdflkjsdflksdflkjsdflkj
> weroiuwqeroiuweroiwueroiuwerqweoiu
> xcvzxcvmnzxcvxzcvxzcvzxcmbnxczvmnbw
>
> D:\junk>perl junk444.pl
>
> D:\junk>type junk444.txt
> asdfl sdT3lI5wcQc1Y /nweroi weI0TeB.6rg/o /nxcvzx xzOM.vGz4CsCs /n
> D:\junk>ver
>
> Windows 98 [Version 4.10.2222]
>
>
> D:\junk>perl -v
>
> This is perl, v5.8.0 built for MSWin32-x86-multi-thread
> (with 1 registered patch, see perl -V for more detail)
>
> Copyright 1987-2002, Larry Wall
>
> Binary build 806 provided by ActiveState Corp. http://www.ActiveState.com
> Built 00:45:44 Mar 31 2003
>
>
> Perl may be copied only under the terms of either the Artistic License
> or the
> GNU General Public License, which may be found in the Perl 5 source kit.
>
> Complete documentation for Perl, including FAQ lists, should be found on
> this system using `man perl' or `perldoc perl'. If you have access to the
> Internet, point your browser at http://www.perl.com/, the Perl Home Page.
>
>
> D:\junk>
>
> The junk444a.txt file does not appear, since it was renamed over top of
> the original junk444.txt file, which is now gone.
>
> HTH.
> --
> Bob Walton
> Email: http://bwalton.com/cgi-bin/emailbob.pl
>
------------------------------
Date: 15 Apr 2004 18:13:45 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: how to do a reverse ip lookup of a DNS server ?
Message-Id: <u965c15fli.fsf@wcl-l.bham.ac.uk>
"PHP2" <gp@nospm.hr> writes:
> how to do a reverse ip lookup of a DNS server ?
> I mean when I check server IP that I see all domains connected to this IP on
> the server..
>
> http://www.whois.sc/ has same function..
I think you are confused. DNS databases, reverse DNS databases and
WHOIS databases all contain related data and sometimes they are
generated from each other or from a common source database. However
they are not the same databases.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Thu, 15 Apr 2004 12:17:52 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: One question
Message-Id: <Lv-dnXk_Hu85KOPdRVn-hg@adelphia.com>
edgrsprj wrote:
> Q: Can anyone else get that program to run on their computer?
With some tweaking, yes. I'm using a Mac with Mac OS X - Basically a UNIX
system using the standard UNIX Perl.
I needed to make it executable (chmod), add a #! line at the beginning, and
convert line-endings from DOS to UNIX style in the script and all the text
input files. I also commented out the definition of $programdirectory and
the related chdir.
After that, it ran without error and produced a output in results.out. As I
expected, since I'm not using Windows, it couldn't run Notepad to display
the output file.
I have no idea whether the output is accurate. I can email you the
results.out file if you'd like.
> found can run a little slow (but it is free, so I can't complain).
If you're thinking of distributing this as an open source effort, you should
consider SourceForge.net. It's also free, and has a couple of features
you'll find immediately useful:
1. Many fast mirrors to host your downloadable files.
2. A "project help needed" area.
> So, will the program run on other operating systems such as Unix etc.?
Yes, but it takes a bit of effort.
A serious question for you - are Macs very common in your community? I've
heard that they're very popular among researchers and academics. If so, I
think I can help you by writing a friendly GUI version.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Thu, 15 Apr 2004 09:37:52 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: One question
Message-Id: <150420040937523216%jgibson@mail.arc.nasa.gov>
In article <X8xfc.7583$l75.5918@newsread2.news.atl.earthlink.net>,
edgrsprj <edgrsprj@ix.netcom.com> wrote:
> In my first note I asked an important question. So far there have not been
> any answers.
>
> Q: Can anyone else get that program to run on their computer?
>
[snipped]
>
> So, will the program run on other operating systems such as Unix etc.?
Here is what I get on my Mac running Mac OS 10.2.8 and perl 5.8.2:
Jim 64% perl -c ETDPROG.pl
ETDPROG.pl syntax OK
Jim 65% perl ETDPROG.pl
Assigning values to the initial program variables
Loading the earthquake and warning signal database file
Loading the test data file
Extracting data from the earthquake and warning signal data file
Extracting datalines from the testdata file
program error
Jim 66% perl -v
This is perl, v5.8.2 built for darwin
Copyright 1987-2003, Larry Wall
Perl may be copied only under the terms of either the Artistic License
or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to
the
Internet, point your browser at http://www.perl.com/, the Perl Home
Page.
------------------------------
Date: Thu, 15 Apr 2004 17:54:46 GMT
From: "edgrsprj" <edgrsprj@ix.netcom.com>
Subject: Re: One question
Message-Id: <G%zfc.9507$zj3.7041@newsread3.news.atl.earthlink.net>
"Sherm Pendley" <spamtrap@dot-app.org> wrote in message
news:Lv-dnXk_Hu85KOPdRVn-hg@adelphia.com...
> edgrsprj wrote:
Many, many thanks.
Yes, I would be interested in seeing the results.out file, and if it is not
proprietary information to you, the testdata.txt file that you used and also
the copy of the program that you managed to get running. I would need the
testdata.txt file so that I could duplicate what you did and see if your
output numbers match mine. I am sure that they do. Regarding the program
itself, I am simply interested in seeing what changes might need to be made
to get it to run on a UNIX machine. The last time I was on a UNIX system
myself was more than a decade ago.
The program does not really open the results.out file using Notepad.exe.
What it does is tell Windows to open the file using whatever text editor a
person's system is set to use to open a .out extension file. Most people
would probably have to define that extension for Windows. And you only need
to do that once. I have my own system set to use Wordpad.exe to open files
like that. If you change the result.out output file name in the
testdata.txt file to results.txt then for most people Windows will use
Notepad.exe to open the file. If you change it to results.doc then
Microsoft Word for Windows would probably try to open it etc.
>If you're thinking of distributing this as an open source effort, you
should
consider SourceForge.net. It's also free, and has a couple of features
you'll find immediately useful:
I am going to take a look at that site. I seem to remember visiting it in
the past for some reason. I am also looking for a free Web site which lets
you do CGI work. Another part of this project involves having a Web site
where people in different countries can send earthquake precursor data to
have it processed, stored, and made available to researchers around the
world. There are quite a few free CGI capable sites out there. But two
that I contacted a while back never responded.
The earthquake group which maintains the following Turkey area Web site is I
believe planning on doing something like that. But I have not seen them
make much progress with that lately.
http://www.dohad.org/html/en.asp
>A serious question for you - are Macs very common in your community? I've
heard that they're very popular among researchers and academics. If so, I
think I can help you by writing a friendly GUI version.
My normal work is in the physical sciences, mostly industry. The majority
of scientists that I know probably use a PC with Windows unless they need to
do programming professionally. They just want to read their e-mail etc. So
they buy whatever they can find on the store shelf which is the least
expensive. Some people who have specific preferences like to work with
Macs.
If you would like to communicate regarding another version of the program
then I am "all ears." One goal is to have a Web site where different
language versions are stored for free downloads. With more people involved
the necessary program routines such as the sun and moon location generation
subroutines are more likely to get created.
Finally, one of the reasons I am discussing this project in a computer
programming Newsgroup is because computer programmers actually like to get
things done on a realistic time scale. My colleagues in science who are the
ones who really should be doing this work tend to move with the speed of
cold syrup. I was fairly certain from past discussions that it would be
computer programmers who would be making most of the initial progress. But
I needed to get people something they could actually work on. And homely as
it might be, that downloadable program does represent something people can
work on.
------------------------------
Date: Thu, 15 Apr 2004 17:48:37 +0200
From: Tore Aursand <tore@aursand.no>
Subject: Re: question about substr
Message-Id: <pan.2004.04.15.15.48.13.677848@aursand.no>
On Thu, 15 Apr 2004 10:04:37 -0500, Chuck wrote:
> I am a new perl learner and have a question about substr
> [...]
Does it really take longer to check the documentation than to post a
message here _and_ wait for an answer?
Please use the documentation as much as possible, and in this case:
perldoc -f substr
> Does the starting string position x in substr("string",x,y) need to be
> set to zero to start reading at the 1st postion or set to one?
"Everything" is zero-based in Perl;
my $orig = 'abcd';
my $ex_1 = substr( $orig, 0, 4 ); # 'abcd'
my $ex_2 = substr( $orig, 1, 4 ); # 'bcd'
> I found some examples that seem to show it both ways - am I assuming
> correctly that the starting postion parameter is always one less than
> the position you want to start at?
Don't _assume_ anything when it's so easy to look it up in the Perl
documentation.
And your statement is wrong, as I read it: The index (position) of the
first character in a string is 0, not 1.
--
Tore Aursand <tore@aursand.no>
"To cease smoking is the easiset thing I ever did. I ought to know,
I've done it a thousand times." (Mark Twain)
------------------------------
Date: Thu, 15 Apr 2004 11:48:06 -0500
From: "Chuck" <EatMeSpammers_cwtart@commpay.tv>
Subject: Re: question about substr
Message-Id: <l1zfc.991$KG2.1780@reggie.win.bright.net>
I checked the docs and the book "perl in a nutshell" and found two different
examples with conflicting data - that is why I posted here - I am a new
"perl" programmer - not a new programmer and would not have asked for
information if I could have found it elsewhere. I have been programming for
over 30 years and have never encountered such a bunch of self-centered
arrogant pricks as you guys in this newsgroup. Don't assume that each new
poster here is a wet-behind-the-ears computer geek.
--
regards,
Chuck
"Tore Aursand" <tore@aursand.no> wrote in message
news:pan.2004.04.15.15.48.13.677848@aursand.no...
> On Thu, 15 Apr 2004 10:04:37 -0500, Chuck wrote:
> > I am a new perl learner and have a question about substr
> > [...]
>
> Does it really take longer to check the documentation than to post a
> message here _and_ wait for an answer?
>
> Please use the documentation as much as possible, and in this case:
>
> perldoc -f substr
>
> > Does the starting string position x in substr("string",x,y) need to be
> > set to zero to start reading at the 1st postion or set to one?
>
> "Everything" is zero-based in Perl;
>
> my $orig = 'abcd';
> my $ex_1 = substr( $orig, 0, 4 ); # 'abcd'
> my $ex_2 = substr( $orig, 1, 4 ); # 'bcd'
>
> > I found some examples that seem to show it both ways - am I assuming
> > correctly that the starting postion parameter is always one less than
> > the position you want to start at?
>
> Don't _assume_ anything when it's so easy to look it up in the Perl
> documentation.
>
> And your statement is wrong, as I read it: The index (position) of the
> first character in a string is 0, not 1.
>
>
> --
> Tore Aursand <tore@aursand.no>
> "To cease smoking is the easiset thing I ever did. I ought to know,
> I've done it a thousand times." (Mark Twain)
------------------------------
Date: Thu, 15 Apr 2004 12:46:20 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: question about substr
Message-Id: <Pine.A41.4.58.0404151245460.12678@ginger.libs.uga.edu>
On Thu, 15 Apr 2004, Chuck wrote:
> I am a new perl learner and have a question about substr
>
> Does the starting string position x in substr("string",x,y) need to be set
> to zero to start reading at the 1st postion or set to one? I found some
> examples that seem to show it both ways - am I assuming correctly that the
> starting postion parameter is always one less than the position you want to
> start at?
What did you see when you tried it?
------------------------------
Date: 15 Apr 2004 17:48:08 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: question about substr
Message-Id: <u9ekqp5gs7.fsf@wcl-l.bham.ac.uk>
"Chuck" <EatMeSpammers_cwtart@commpay.tv> writes:
> I am a new perl learner and have a question about substr
The first thing to try: perldoc -f substr
> Does the starting string position x in substr("string",x,y) need to be set
> to zero to start reading at the 1st postion or set to one?
You could answer this yourself by reading the aforementioned
documentation - at least as far as the second sentence.
> I found some examples that seem to show it both ways
Studying examples of function use should always be used in addition to
not in place of reading the description of the function in the
reference manuals.
> am I assuming correctly that the starting postion parameter is
> always one less than the position you want to start at?
No, not always, you can change it but as the aforementioned
documentation says "don't do that".
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Thu, 15 Apr 2004 11:54:44 -0400
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: regexpr question is w2 taken
Message-Id: <20040415114419.V10444@dishwasher.cs.rpi.edu>
On Thu, 15 Apr 2004, Richard Bell wrote:
> I'm a bit new to perl and am trying to emulate the behavior of a free
> text search engine that has a feature
>
> is w2 taken
>
> taken to mean the word 'is' within 2 words of the word 'taken' where
> the distance (2) and the words ('is', 'taken') are arbitrary.
>
> I've a variable that looks like this
>
> 'one two three four and so on words seperated by spaces that goes on
> and on and on and on for a very long way'
>
> that I'm tring to process.
>
> I'm having a problem finding a regular expression that handles this
> case. Something like
>
> "\bis\b(what goes here){0,2}\btaken\b"
>
> Can someone point me in the right direction?
>
> I assume that $pos will point to the last character matched. Is this
> correct? How can I know the index of the first character matched? Can
> I know what '(what goes here)' matched? How? As part of this
> process, I'm trying to track what characters in the string were
> matched by a number of regular expressions by getting $pos and keeping
> a bit map of the characters matched.
>
[untested]
if ($string =~ /\b$first\s+(\w+\s+){0,2}$second\b/){
print "Found $first within two words of $second\n";
print "Separated by '$1'\n";
}
This is assuming, of course, that Perl's definition of 'word' is
acceptable to you. If not, you might want to replace the \w+\s+ above
with something like
[a-zA-Z[:punct:]]+\s+
or, to just say "0, 1, or 2 of any sequences of non-whitespace followed by
whitespace:
\S+\s+
Hope this helps
Paul Lalli
------------------------------
Date: 15 Apr 2004 08:36:44 -0700
From: id2001@cablelabs.com (Ian D.)
Subject: strange side-effect (bug?) in Net::SMTP
Message-Id: <1276a5f0.0404150736.9a08005@posting.google.com>
This is perl, version 5.005_02 built for sun4-solaris
I have an array that is wiped out when calling Net::SMTP->new. Here
is a debug from it. Note my array is intact at line 356, but after a
'next', it is gone:
main::check_mailservers(./conchk:356):
356: $smtp = Net::SMTP->new('ondar',Timeout=>10,Debug=>0);
DB<2> x @MAILSERVERS
0 ARRAY(0x6ea244)
0 'sendmail'
1 'ondar'
2 'nobody@cablelabs.com'
3 'nobody@localhost'
4 150
DB<3> n
main::check_mailservers(./conchk:357):
357: $td=tv_interval($t0);
DB<3> x @MAILSERVERS
0 undef <======= WHAT THE HECK JUST HAPPENED???
A bug?
Ian
------------------------------
Date: Thu, 15 Apr 2004 15:54:05 GMT
From: "edgrsprj" <edgrsprj@ix.netcom.com>
Subject: The big rush
Message-Id: <xeyfc.9208$zj3.8946@newsread3.news.atl.earthlink.net>
April 15, 2004
As I said in another note, the forecasting technology which I have developed
was discussed in detail in a presentation which was made to a scientific
group in the People's Republic of China in late December of 2003.
My Perl program which is now available for downloads and examination and use
did not exist at that time. And so it could not be given to the people at
that conference. It is my understanding that there will be another
conference in that country some time next month. And I believe that my
program will be made available to scientists there at that time. Hopefully
its code will be in better shape by then.
Also hopefully, by that time it will contain routines for generating the
types of sun and moon position data which are crucial to its operation. It
is my understanding that subroutines for doing that have already been
written in Perl. And I myself already have those types of subroutines which
are written in Fortran and C. But I do not know if I will have time to get
anything along those lines running in the program myself before that
conference.
I was a little disappointed that Chinese scientists attending that December
conference did not immediately get to work on creating a computer program
running which would generate the type of data which my present program
produces. However from the feedback that I got, when my technology was
discussed at the conference people liked it. But even though companies in
China appear to be good at manufacturing personal computers it sounds to me
like they are not yet very big on developing computer programming
applications for things such as forecasting earthquakes. I was surprised to
learn that.
Anyway, that approaching conference is one reason that I am in something of
a rush to get this technology developed as quickly as possible. I
understand that there are something like 10,000 people working full-time in
earthquake forecasting programs in China. And there is also probably a
small army of volunteers there who help collect precursor data etc. Within
a few months quite a few people in that country might have my computer
program running in some form on their systems.
------------------------------
Date: Thu, 15 Apr 2004 17:22:03 GMT
From: "John W. Kennedy" <jwkenne@attglobal.net>
Subject: Re: Tough (for me) regex case
Message-Id: <%wzfc.66560$467.13837169@news4.srv.hcvlny.cv.net>
Dave Cross wrote:
> ActivePerl is Perl. It is am implementation of the Perl language.
> Therefore it uses regular expressions in the way defined by Perl.
More than that, ActivePerl is (/inter alia/) perl.
--
John W. Kennedy
"Compact is becoming contract,
Man only earns and pays."
-- Charles Williams. "Bors to Elayne: On the King's Coins"
------------------------------
Date: Thu, 15 Apr 2004 13:23:43 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: Two mini-golfish problems
Message-Id: <Pine.A41.4.58.0404151319110.12678@ginger.libs.uga.edu>
On Wed, 14 Apr 2004, Bill wrote:
> J Krugman wrote:
>
> > OK, here's a little problem that I'd like to propose in the Perl
> > golf (mini-golf?) vein.
> >
>
> > Given a string $x that we may assume contains no newline characters,
> > split it into chunks of $n characters long separated my newlines.
> > E.g. if $n == 2,
> >
> > 'fu'
> > 'fubar' ---> 'ba'
> > 'r'
> >
> > What's the most succinct Perl to achive this end-result?
>
> Remember: succint, maintainable, fast. Choose 2 of 3 :)
>
> anyhow...
>
> $x = 'fubar';
> $x=~s/(..)/$1\n/g;print $x;
>
>
But OP did mention $n ...
sub _ {(my$x=$_[0])=~s/(.{$_[1]})/$1\n/g;$x}
print _ fubar=>2
Brad
------------------------------
Date: Thu, 15 Apr 2004 17:31:24 GMT
From: "Ala Qumsieh" <xxala_qumsiehxx@xxyahooxx.com>
Subject: Re: Two mini-golfish problems
Message-Id: <MFzfc.22979$I_3.8410@newssvr27.news.prodigy.com>
"Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de> wrote in message
news:c5lb7m$32i2h$1@ID-231055.news.uni-berlin.de...
> That should be:
>
> $x=~s/(..?)/$1\n/g;
The title does say "golf":
$x=~s/..?/$&
/g;
:-)
--Ala
------------------------------
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 6406
***************************************