[24726] in Perl-Users-Digest
Perl-Users Digest, Issue: 6881 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 19 06:05:56 2004
Date: Thu, 19 Aug 2004 03:05:05 -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, 19 Aug 2004 Volume: 10 Number: 6881
Today's topics:
Re: Earthquake forecasting program Aug. 16, 2004 <bobofficers@invalid.net>
Re: Earthquake forecasting program Aug. 16, 2004 <bobofficers@invalid.net>
Re: Earthquake forecasting program Aug. 16, 2004 <bobofficers@invalid.net>
Re: Earthquake forecasting program Aug. 16, 2004 <ralph-nesbitt@sbcglobal.net>
Re: Earthquake forecasting program Aug. 16, 2004 (Oriel36)
Re: editing perl script through TEXTAREA <noreply@gunnar.cc>
Re: editing perl script through TEXTAREA <flavell@ph.gla.ac.uk>
Re: editing perl script through TEXTAREA <noreply@gunnar.cc>
Help: joining 5 LARGE text files (Stuart)
how to trace a error those generated at runtime by serv (Rushikesh Joshi)
How to upload a file from a local pc to a web server f (srini)
Re: How to upload a file from a local pc to a web serv <nobull@mail.com>
Re: howto convert a *nix DB_File to windows? <dave@nospam.com>
Re: Materializing an indirect sort using only swap <bowsayge@nomail.afraid.org>
Re: My own handy Pocket Reference notes <zen13097@zen.co.uk>
Re: Mysql->Connect and Ports <zebee@zip.com.au>
Re: Mysql->Connect and Ports <mb@uq.net.au.invalid>
Perl script to convert VC project files to Makefiles <dave@nospam.com>
trim code for mimic ls -tr <noemail@#$&&!.net>
Re: trim code for mimic ls -tr (Greg Bacon)
Re: trim code for mimic ls -tr (Anno Siegel)
Re: trim code for mimic ls -tr <bernard.el-haginDODGE_THIS@lido-tech.net>
Re: trim code for mimic ls -tr (Anno Siegel)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 18 Aug 2004 18:49:03 -0700
From: Bob Officer <bobofficers@invalid.net>
Subject: Re: Earthquake forecasting program Aug. 16, 2004
Message-Id: <da18i05ioseql894qc8s6v71eri46bqqpo@4ax.com>
Keywords: X
On Wed, 18 Aug 2004 06:24:39 GMT, in sci.geo.earthquakes, "edgrsprj"
<edgrsprj@ix.netcom.com> wrote:
>"Ethan Brown" <ethan@draupnir.gso.saic.com> wrote in message
>news:vr8ycdoegk.fsf@draupnir.gso.saic.com...
>> Earthquakes don't kill people. Stuff falling on people kills people.
>Improving
>> building codes and adhearing to these codes goes a long way in mitigating
>loss of
>> life in seismically active regions. For example, a 6.0 earthquake in
>California will
>> typically result in few, if any, deaths. The same size earthquake in a
>third-world
>> country can result in many deaths. All due to the nature of building
>construction.
>>
>
>August 18, 2004
>
>In China there are a number of groups including the official government
>group (10,000 full-time employees I believe) which attempt to focus in on
>where an earthquake is going to occur by studying a variety of data. My
It isn't yours. it was however written for you. If spent better part of a
year in comp groups begging for help. I doubt you have any idea how the
program works or what it does.
>present Perl language EM signal data processing program is intended to help
>governments etc. identify earthquake "hot spots" which they should focus on
>to see if there could be an earthquake headed for that location. In my
>opinion it already produces invaluable data. And it could do much better if
Qualify your opinion. How many different programs have you written what
sort of real research gathering have you done. Where did you get your
education?
>more sophisticated data processing routines were added.
And you have no idea what it does, or how it does, what it does.
>If you look around the Internet you will find a Web site which talks about
>the many precursors that were observed before the deadly January 16, 1995
Make sure you check the validity of any web site. I would do a journal
search looking for peer reviewed articles. Just data or claims appearing on
web sites doesn't create any validity.
<Snip>
>If people are observing precursors like that then they should be able to
>tell from when large numbers are observed that an earthquake is likely to
>follow. I am also a strong believer in improving building construction.
>But that option will not be available for very large numbers of people
>around the world for many years, if ever.
>
>Regarding Perl itself,
>
>What I am hoping to do is get some type of group of volunteer or even paid
paid by who?
>computer programmers organized to do further development work on that
Why?
It seems you like using the work of other people and then wonder why you
don't get glory.
>program. And one of the first questions to ask would be, "Is Perl the best
>language to use for such an application?"
Perl is a great scripting language.
>
>Where better to ask such a question than in a Perl Newsgroup?
Where you would be completely ignored.
You are a crank.
--
Ak'toh'di
------------------------------
Date: Wed, 18 Aug 2004 19:07:06 -0700
From: Bob Officer <bobofficers@invalid.net>
Subject: Re: Earthquake forecasting program Aug. 16, 2004
Message-Id: <vo18i01eiadc7a18avjsqog210puntbouk@4ax.com>
Keywords: X
On 18 Aug 2004 08:25:12 -0700, in sci.geo.earthquakes,
geraldkelleher@hotmail.com (Oriel36) wrote:
>Bob Officer <bobofficers@invalid.net> wrote in message news:<1v86i0908fnd4b2jbj3sm1gl6q4ov0rr3r@4ax.com>...
>> On Tue, 17 Aug 2004 06:55:50 GMT, in sci.geo.earthquakes, "edgrsprj"
>> <edgrsprj@ix.netcom.com> wrote:
>>
>> >
>> >"Jaxtraw" <jaxtraw@nospamnobigfoot.com> wrote in message
>> >news:1092684544.19111.0@ersa.uk.clara.net...
>> >> "edgrsprj" <edgrsprj@ix.netcom.com> wrote in message
>> >> news:0f1Uc.23551$nx2.17009@newsread2.news.atl.earthlink.net...
>> >> > August 16, 2004 Posted to sci.geo.earthquakes and other Newsgroups
>>
>> >>
>> >> Intriguing, but it seems to me you should test also for false negatives.
>> >> ...
>> >
>> >August 17, 2004
>> >
>> >Hi Ian, Thanks for the comments.
>> >
>> >At the moment this what might be described as "Any port in the storm
>> >technology." That means that we have a desperate situation where
>> >earthquakes are claiming lives without anything to stop that from happening.
>> >More than 25,000 people reportedly perished last December in Iran from an
>> >unexpected earthquake. And the immediate goal is to find anything at all
>> >which can help.
>> >
>> >I know of at least two promising looking technologies which are being used
>> >in China. But each of the detector units runs something like $10,000 U.S.
>> >You need multiple units to cover a given area plus all of the support
>> >personnel. And they still apparently miss an unacceptably high percentage
>> >of the destructive earthquakes.
>>
>> That means the system doesn't work...
>>
>> >One of the reasons that my program looks so attractive at the moment is the
>>
>> Only to you... but then it isn't really your program. you didn't gather the
>> data or write the computer program. You are a CRACKPOT.
>
>You do astrology for goodness sake !,you look for correlations in
Yep as a entertainment/hobby, I learned astrology as a child. I also make
mirrors for astronomical telescopes, as well as spend hours cutting gems
with little tiny facets. I don't do astrology for profit and have often
posted I don't believe in astrology. I only point out when and where I do
cold reads 99% of astrologers use cold reads and vague wide statements. I
point out Astrology is a scam. Does it bother you I can discuss astrology
and with all but the truly fanatical help them see that astrology is just a
silly superstition?
>planetary positions on human existence and that just takes a google
>search on your posting history.The poster is in no way offensive,even
Actually Google should have a very sparse history on me. 90% of every has
been done using XNA basis.
>if his data is like finding order in white noise,billions of public
>funding is going to do the same thing.
Yep, most of it will be white noise, I suspect. Since there is no one cause
for quakes, no one prediction system will work.
>http://zebu.uoregon.edu/~imamura/123/lecture-1/cmbr.html
>
>If a fraction of that money was turned to geology,departments would
>not be closed down and more immediate terrestial concerns would take
>priority much less appreceating the magnificence of the whole
>thing.The inability of geologists to make the astronomical leap as a
>natural progression of plate movement assures that
>fundamentalism,astrology and barely concealed empirical silliness will
>flourish.
I would love to see more silly superstitions left by the side. If one
fraction of the money given to churches was given to science... Humanities
lot would improve much faster than all the missionaries in the world could
have ever work.
>You produce the slogan of a crackpot on this man while guys receive
>billions for having the Earth at the center of the universe,turn it
>what way you will,that is what it amounts to when you decide an
>alternative approach to the 'past'.
Gerald. This man is a crank/crackpot. I have watched him and his actions as
he has trolled from Group to group.
<snip>
>Hermetic principle is astrology's fundamental rule, and it fails in
>every
>testing.
>
>Bob Officer
Gerald do you understand what the term "Hermetic Principle" means ...?
followed by the word it (referring to hermetic principle) "fails every
time"?
Note: The Hermetic Principle: as above, so below. Is what I was showing to
be false in the above cited article. That doesn't really sound like I am a
big supporter of astrology, does it?
Second note: Gerald should also be aware I was one of the party of 18 or so
people named in suit a few years ago by pete stapleton for telling people
that his astrology didn't work every time, and pointing out how it did work
at all.
Sigh...
--
Ak'toh'di
------------------------------
Date: Wed, 18 Aug 2004 19:09:26 -0700
From: Bob Officer <bobofficers@invalid.net>
Subject: Re: Earthquake forecasting program Aug. 16, 2004
Message-Id: <ct28i0d2pqv7sf9j6ildf4s6for1u7de03@4ax.com>
Keywords: X
On Wed, 18 Aug 2004 06:03:43 GMT, in sci.geo.earthquakes, "edgrsprj"
<edgrsprj@ix.netcom.com> wrote:
>"MichiganBob" <somebody@somewhere.com> wrote in message
>news:igyUc.1885$Rb5.1535@newssvr23.news.prodigy.com...
>> edgrsprj wrote:
>> > August 16, 2004 Posted to sci.geo.earthquakes and other Newsgroups
>> >
>> > Newsgroup Readers: I recommend that you send copies of this report to
>any
>> > government officials and researchers that you know who are interested in
>> > earthquake forecasting science.
>>
>> Do your own spamming.
>
>August 18, 2004
>
>Here is the rationale for asking that people consider sending copies of the
>report to their government officials etc.
>
>I talk with earthquake forecasting experts around the world all the time.
Sure in private e-mail, right?
You are a crank.
--
Ak'toh'di
------------------------------
Date: Thu, 19 Aug 2004 05:51:27 GMT
From: "Ralph Nesbitt" <ralph-nesbitt@sbcglobal.net>
Subject: Re: Earthquake forecasting program Aug. 16, 2004
Message-Id: <zdXUc.8794$PI4.7750@newssvr22.news.prodigy.com>
"Bob Officer" <bobofficers@invalid.net> wrote in message
news:ct28i0d2pqv7sf9j6ildf4s6for1u7de03@4ax.com...
> On Wed, 18 Aug 2004 06:03:43 GMT, in sci.geo.earthquakes, "edgrsprj"
> <edgrsprj@ix.netcom.com> wrote:
>
> >"MichiganBob" <somebody@somewhere.com> wrote in message
> >news:igyUc.1885$Rb5.1535@newssvr23.news.prodigy.com...
> >> edgrsprj wrote:
> >> > August 16, 2004 Posted to sci.geo.earthquakes and other Newsgroups
> >> >
> >> > Newsgroup Readers: I recommend that you send copies of this report
to
> >any
> >> > government officials and researchers that you know who are interested
in
> >> > earthquake forecasting science.
> >>
> >> Do your own spamming.
> >
> >August 18, 2004
> >
> >Here is the rationale for asking that people consider sending copies of
the
> >report to their government officials etc.
> >
> >I talk with earthquake forecasting experts around the world all the time.
>
> Sure in private e-mail, right?
>
>
> You are a crank.
> --
> Ak'toh'di
>
Perhaps "Cracked" is a better description.
Ralph Nesbitt
------------------------------
Date: 19 Aug 2004 02:41:36 -0700
From: geraldkelleher@hotmail.com (Oriel36)
Subject: Re: Earthquake forecasting program Aug. 16, 2004
Message-Id: <273f8e06.0408190141.76862e7@posting.google.com>
"John W. Kennedy" <jwkenne@attglobal.net> wrote in message news:<ZCKUc.23834$vc4.9055174@news4.srv.hcvlny.cv.net>...
> Oriel36 wrote:
> > All gravitational observations are based on the sidereal format which
> > is the only means to determine a geocentric/heliocentric orbital
> > equivalency.After Kepler,Galileo and others struggled for recognition
> > of the heliocentric motion of the planets,Newton reverted back to an
> > odd mixture of geocentrism and heliocentrism to get his gravitational
> > agenda to work.He used Flamsteed erroneous proof for axial
> > rotational/stellar circumpolar equivalency and morphed it into a
> > geocentric/heliocentric orbital equivalency.
> >
> >
> > "PHÆNOMENON IV.
> > That the fixed stars being at rest, the periodic times of the five
> > primary planets, and (whether of the sun about the earth, or) of the
> > earth about the sun, are in the sesquiplicate proportion of their mean
> > distances from the sun.
> >
> > http://members.tripod.com/~gravitee/phaenomena.htm
> >
> > I will put it another way,at dawn,the Earth axially rotates out of its
> > orbital shadow but if you are the minset of sunrise and sunset you
> > will place great stake in the position of the Sun in the sky and this
> > is exactly where you are at, so is everyone else thanks to Newton.In
> > the early 1920's they jettisoned Newton's geocentric/heliocentric
> > framehopping and resorted to homocentrism which is why the 'every
> > valid point is the center of the universe' is paraded today for the
> > sake of the 'laws of physics'.
>
> Yes, folks, you read it right. Not only is "Oriel36" an
> Einstein-denier, he is also a Newton-denier, as I have verified from his
> postings elsewhere.
>
> Can't we all just *plonk* him?
Grow up for goodness sake,far from denying these jokers I have a merry
old time bringing up their writings that you pretend to understand.If
anyone wishes to discover why currently people are running around
parading "every valid point is the center of the universe" as if it
were the greatest thing ever,need only go back to Newton where that
absurdity all started as "(whether of the sun about the earth, or) of
the earth about the sun".
Contempories are stuck in a celestial sphere and can't get out of
it,that is the price of the empirical science so it is not what I
deny,it is what men who know no better accept.
------------------------------
Date: Thu, 19 Aug 2004 00:11:46 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: editing perl script through TEXTAREA
Message-Id: <2oi2kiFal59kU1@uni-berlin.de>
anita wrote:
> Sorry did not mean to offend you with "Other person" remark!
No problem, I was not offended. ( I see now that my harsh comment may
have made you believe otherwise. Sorry. ;-) )
> Basically the browser sends back whatver it has DISPLAYED when I
> say submit, not what is in the source.
Yes, it does. (With the exception of what Alan let us know about
certain internationalization issues...)
> That way the conversion returns it to < before saving it again.
Suppose you mean before displaying it again...
> And if the user typed in <, that will be sent in as < and after
> conversion gets becomes &lt, so gets displayed the same as the
> used typed in.
Yep.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Thu, 19 Aug 2004 00:48:08 +0100
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: editing perl script through TEXTAREA
Message-Id: <Pine.LNX.4.61.0408190036420.3624@ppepc56.ph.gla.ac.uk>
On Wed, 18 Aug 2004, Gunnar Hjalmarsson wrote:
> Now we are talking i18n it seems...
If you want to interpret it that way, yes. But many devotees of Bill
have no idea that curly quotes, trademark signs etc. can lead to such
complications; they type them in quite happily on the client side
(there's nothing you can do to prevent them), and then when it gets to
the server side process, it's left to the programmer to pick up the
pieces. That was the issue that I was trying to bring out in this
comment.
> > On arrival at the server, of course, the server-side process can
> > have no idea whether the user typed just a curly-quote character,
> > or typed the ASCII string “ (ampersand, hash, 8, 2, 2, 0,
> > semicolon).
>
> Not even CGI.pm's param() function/method, I presume. ;-)
You know as well as I do that CGI.pm isn't telepathic: it gets fed
exactly the same data stream as any other CGI process would get fed.
It's a pity that an extension mechanism to the %xx URL encoding
definition didn't get defined in good time, to deal with this
situation unambiguously (analogous to Perl's wide character
constants).
------------------------------
Date: Thu, 19 Aug 2004 02:10:39 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: editing perl script through TEXTAREA
Message-Id: <2oi9jtFb0pbeU1@uni-berlin.de>
Alan J. Flavell wrote:
> Gunnar Hjalmarsson wrote:
>> Alan J. Flavell wrote:
>>> On arrival at the server, of course, the server-side process
>>> can have no idea whether the user typed just a curly-quote
>>> character, or typed the ASCII string “ (ampersand, hash,
>>> 8, 2, 2, 0, semicolon).
>>
>> Not even CGI.pm's param() function/method, I presume. ;-)
>
> You know as well as I do that CGI.pm isn't telepathic: it gets fed
> exactly the same data stream as any other CGI process would get
> fed.
Yep. My comment was triggered by other posts in this thread with the
usual, awfully tiresome "CGI.pm takes care of it all" message.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 19 Aug 2004 03:05:01 -0700
From: stuayre@hotmail.com (Stuart)
Subject: Help: joining 5 LARGE text files
Message-Id: <763485f6.0408190205.4606675c@posting.google.com>
Hi,
Please can anyone help me join 5 large (1.8gb) text files togeather
to create 1 very large file.
I have some code in PHP but it bombs out at 2gb (seems there is a limit
and php needs re compiling, something thats not an option for me)
I don't want to take up all the servers resources so something that uses
little memory would be very good indeed!
here's the php code if it help...
<?php
set_time_limit(14400000);
$file[0] = "file1.txt";
$file[1] = "file2.txt";
$file[2] = "file3.txt";
$file[3] = "file4.txt";
$file[4] = "file5.txt";
$target = "output.txt";
$handle = fopen($target, 'a');
foreach ($file as $var) {
$c_handle = fopen($var, 'r');
do {
$content = fread($c_handle,1000000);
fwrite($handle, $content);
} while (!empty($content));
fclose($c_handle);
}
?>
all the best
Stu
------------------------------
Date: 18 Aug 2004 23:17:09 -0700
From: rushi_asi@yahoo.com (Rushikesh Joshi)
Subject: how to trace a error those generated at runtime by server in soap::Lite
Message-Id: <a2d4901c.0408182217.5dcc4c6f@posting.google.com>
I have really no any idea how can i trace the error that are generated
at runtime.
Like invalide arguments, error in type conversion, user already
registered, user deactive..
This fault strings are generated by server but i m unable to trake it
using SOAP::Lite
I have tried to...
use SOAP::Lite +trace => 'debug';
But it is no any help full i required to realtime error traping
So any one have idea how to trace all the error that generated at
runtime .......
Your help will be greatly appreciate for me.
Thanks & Regards,
Rushikesh
Sr. Software Developer,
Mega-E-Services
------------------------------
Date: 18 Aug 2004 17:40:26 -0700
From: schimata2@yahoo.com (srini)
Subject: How to upload a file from a local pc to a web server from a html page????
Message-Id: <5fc50f33.0408181524.491cd1bc@posting.google.com>
Hi all,
I am writing a HTML/CGI perl script to attach a file from a HTML
submit form and to store that attachment in a tmeporary variable on
the web server that hosts the perl script.
snippet of code:
HTML part:
---------------
<tr><td colspan="2"> <FONT color=black>Attachment (if any):</FONT><BR>
<INPUT type="file" size=50 name="attachedfile" ALLOW="text/*">
</td></tr>
--------------
Perl code:
-----------------------------------------------
$attachedFile = $query -> param ("attachedfile");
$attachedFile=~ s/.*[\/\\](.*)/$1/;
$upload_filehandle = $query->upload("attachedfile");
$uploaddir = "C:\\Temp"; #### on web server..
$temp = $uploaddir . $attachedFile;
open UPLOADFILE, ">$temp";
close UPLOADFILE;
print "$temp";
------------------------------------------------
Now I want to capture the file attachment from a user's desktop and
upload it into a temp variable on the web server. It is giving me zero
byte sized file in the $temp variable. What am I doing wroing here?
Can some boby kindly tell me how my perl code should be modified so
that I can store the $attachedFile from the user's desktop into $temp
variable on the web server?
One more thing is that I don't want to use filefield() from CGI.pm,
though my script has CGI module. The reason is that all filefield() is
doing is to create another file browse control, which I don' want.
Thanks in advance,
Srini
------------------------------
Date: Thu, 19 Aug 2004 08:39:47 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: How to upload a file from a local pc to a web server from a html page????
Message-Id: <cg1lg7$tki$1@slavica.ukpost.com>
srini wrote:
> $upload_filehandle = $query->upload("attachedfile");
>
> $uploaddir = "C:\\Temp"; #### on web server..
>
> $temp = $uploaddir . $attachedFile;
>
> open UPLOADFILE, ">$temp";
> close UPLOADFILE;
> print "$temp";
>
> Now I want to capture the file attachment from a user's desktop and
> upload it into a temp variable on the web server. It is giving me zero
> byte sized file in the $temp variable.
You getting the CGI upload filehandle then not doing anything with it.
You are opening a file for output withouy checking for success.
You are not writing anything to that file.
You concatenate a directory name and a filename to make a full path name
and forgetting to put a directory separator character in.
> What am I doing wroing here?
It would appear you are forgetting the rule:
"You can't just make shit up and expect the computer to know what you mean".
> Can some boby kindly tell me how my perl code should be modified so
> that I can store the $attachedFile from the user's desktop into $temp
> variable on the web server?
If you want to save the stuff to a file you should read stuff from the
filehandle $upload_filehandle and write it to the other one.
But although your code appears to be writing a file you say you actually
want the content of the uploaded in a variable.
You need to get clear in your mind what you are trying to do.
If you want to slurp $upload_filehandle into a variable then do so.
(See FAQ).
You should put directory separators between directory names and filenames.
You should always, yes always, check the success of open.
------------------------------
Date: Wed, 18 Aug 2004 20:08:17 -0400
From: Dave <dave@nospam.com>
Subject: Re: howto convert a *nix DB_File to windows?
Message-Id: <4123ef85$0$21741$61fed72c@news.rcn.com>
dan baker wrote:
> "Paul Marquess" <Paul.Marquess@btinternet.com> wrote in message
>
>>If DB_File has been built with the same version of Berkeley DB on your Unix
>>box and your Windows box, the data files can be read on either.
>>---------------
>
>
> Its a different version. I use the pre-compiled stuff from activestate
> on windows, and the remote webserver has a little bit newer libs
> installed. I move the files in binary mode, but they dont seem to be
> compatible.
What version does your remote server have? I compile my own native
Windows Perl binary dist and modules from CPAN rather than use the
binaries from ActiveState, so I've also built all the necessary external
supporting libraries, including the Berkeley DB. Currently, my
$DB_File::db_ver is 4.002052.
Dave
------------------------------
Date: Thu, 19 Aug 2004 08:41:32 GMT
From: bowsayge <bowsayge@nomail.afraid.org>
Subject: Re: Materializing an indirect sort using only swap
Message-Id: <0JZUc.2471$2L3.461@newsread3.news.atl.earthlink.net>
Anno Siegel said to us:
[...]
> Since @ndx is a permutation of 0 .. 24, that is the same as
>
> @arr[ @ndx] = @str;
[...]
What what d-ya-know, it works!
Thanks.
--
my (@str) = split //,'eitrhbe ta.Jw eonerl snpu';
my (@ndx, @arr) = qw(19 22 3 15 9 21 14 17 8 5 24 0 20
4 23 7 18 10 11 16 12 2 6 13 1);
@arr[ @ndx ] = @str; print @arr, "\n";
------------------------------
Date: 19 Aug 2004 07:53:12 GMT
From: Dave Weaver <zen13097@zen.co.uk>
Subject: Re: My own handy Pocket Reference notes
Message-Id: <41245c68$0$209$db0fefd9@news.zen.co.uk>
On 18 Aug 2004 07:27:05 GMT, Abigail <abigail@abigail.nl> wrote:
> Randal L. Schwartz (merlyn@stonehenge.com) wrote on September MCMXCIII
^^^^^
I get the whole Sept'93 reference, but surely there's something wrong
there?
------------------------------
Date: 18 Aug 2004 22:32:34 GMT
From: Zebee Johnstone <zebee@zip.com.au>
Subject: Re: Mysql->Connect and Ports
Message-Id: <slrnci7m21.tnj.zebee@zeus.zipworld.com.au>
In comp.lang.perl.misc on 18 Aug 2004 15:03:29 -0700
Todd Hlavacek <toddh@lucent.com> wrote:
>
> I was wondering that since there is no mention of support for multiple
> mysql database instances in the Mysql module, I wonder if we fall back
> to DBI->connect... with the port in the arguments passed to the
> connect parameter?
>
my $dbh=DBI->connect("DBI:mysql:database=$database;host=$Host;port=$port",$username,$password)|| die "couldn't connect to master $Host, $!\n";
You may find it works better if you use a socket rather than a port if
the mysql instances are on the same machine. I've found it better
that way, eg:
my $dbh=DBI->connect("DBI:mysql:$database;mysql_socket=$socketname",$user,$password)
Zebee
------------------------------
Date: Thu, 19 Aug 2004 14:21:59 +1000
From: Matthew Braid <mb@uq.net.au.invalid>
Subject: Re: Mysql->Connect and Ports
Message-Id: <cg19t8$28n$1@bunyip.cc.uq.edu.au>
Todd Hlavacek wrote:
> Hello all,
>
> A quick question to the community. I'm trying to figure out how to
> use the Mysql->connect with multiple databases. Somewhere in Google,
> some guy said "RTFM perldoc DBD/mysql". I did and that documentation
> does not have info on accessing multiple mysql databases on different
> ports.
>
> I was wondering that since there is no mention of support for multiple
> mysql database instances in the Mysql module, I wonder if we fall back
> to DBI->connect... with the port in the arguments passed to the
> connect parameter?
>
> Just wondering...
> Thanks,
> Todd
The person who told you to RTFM was right - these are the first 7 lines of
perldoc DBD::mysql:
NAME
DBD::mysql - MySQL driver for the Perl5 Database Interface (DBI)
SYNOPSIS
use DBI;
$dsn = "DBI:mysql:database=$database;host=$hostname;port=$port";
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
What are you missing here?
To spell it out for you:
my $one_db =
DBI->connect("DBI:mysql:database=FirstDB;host=FirstHost;port=3306");
my $two_db =
DBI->connect("DBI:mysql:database=SecondDB;host=SecondHost;port=9999");
Don't forget your usernames and passwords and you're set.
------------------------------
Date: Wed, 18 Aug 2004 19:33:39 -0400
From: Dave <dave@nospam.com>
Subject: Perl script to convert VC project files to Makefiles
Message-Id: <4123e767$0$21742$61fed72c@news.rcn.com>
Does anyone know of an existing Perl script that is capable of parsing
Micro$oft's VC workspace/project (e.g., .dsw, .dsp, .sln,
.vcproj, etc.) files and generating nmake-compatible Makefiles? I have
the free VS.NET 2003 command-line tools with optimizing C/C++ compiler
on my Windows machine, along with the SDK headers. However, often
authors will distribute their source code with the IDE project files and
autoconf scripts for *nix/cygwin.
Dave
------------------------------
Date: Wed, 18 Aug 2004 18:04:12 -0500
From: Fred <noemail@#$&&!.net>
Subject: trim code for mimic ls -tr
Message-Id: <pan.2004.08.18.23.04.11.833371@#$&&!.net>
I was wanting to de-bloat this code. The objective was to mimic the ls
–tr UNIX command and store those files, sorted by time, into a list. I
found bits and pieces of code here, and added my own, and the result given
below does work, but I’m afraid it’s very inefficient.
I would welcome helpful criticisms
#!/usr/local/bin/perl -w
use strict;
use warnings;
my($dir) = $ARGV[0] ? $ARGV[0] : '.';
opendir(DIR, $dir) or die("Cannot open directory '$dir': $!");
my @final;
my $cat; #why this is named this is a long story, ok?
my @list;
my(%times) = map {$_, (stat("$dir/$_"))[10]}
grep(!/^\.{1,2}$/, readdir(DIR));
print "The youngest LOG file in $dir is: ";
foreach my $key(keys %times)
{
if ( $key =~ /LOG/ ) {
push ( @list, "$times{$key}");
}
}
my @articles = sort {$b <=> $a} @list;
foreach $cat(@articles){
foreach my $key(keys %times) {
if ( $cat == $times{$key} ){
push (@final, $key);
}
last if($cat == $times{$key})
}
}
print "$final[0]";
exit 0;
------------------------------
Date: Wed, 18 Aug 2004 23:20:03 -0000
From: gbacon@hiwaay.net (Greg Bacon)
Subject: Re: trim code for mimic ls -tr
Message-Id: <10i7p138fuit2b5@corp.supernews.com>
In article <pan.2004.08.18.23.04.11.833371@#$&&!.net>,
Fred <noemail@#$&&!.net> wrote:
: I was wanting to de-bloat this code. The objective was to mimic the ls
: -tr UNIX command and store those files, sorted by time, into a list. I
: found bits and pieces of code here, and added my own, and the result
: given below does work, but I'm afraid it's very inefficient.
: [...]
You could use the code below:
#! /usr/local/bin/perl
use strict;
use warnings;
my $dir = shift || ".";
opendir my $dh, $dir or die "$0: opendir $dir: $!";
my @sorted = map $_->[0],
sort { $a->[1] <=> $b->[1] }
map /^\.\.?$/ ? () : [$_, -M "$dir/$_"],
readdir $dh;
print $_, "\n" for @sorted;
Why reinvent the wheel? Why not simply read the output of ls -t?
Greg
--
VMS must die!
------------------------------
Date: 19 Aug 2004 08:30:53 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: trim code for mimic ls -tr
Message-Id: <cg1oft$iro$1@mamenchi.zrz.TU-Berlin.DE>
Fred <noemail@#$&&!.net> wrote in comp.lang.perl.misc:
> I was wanting to de-bloat this code. The objective was to mimic the ls
> –tr UNIX command and store those files, sorted by time, into a list. I
> found bits and pieces of code here, and added my own, and the result given
> below does work, but I’m afraid it’s very inefficient.
It looks to me that all you want is the youngest file (of a certain
type) in a directory. That can be done in a linear pass over the
files without sorting.
> #!/usr/local/bin/perl -w
> use strict;
> use warnings;
> my($dir) = $ARGV[0] ? $ARGV[0] : '.';
> opendir(DIR, $dir) or die("Cannot open directory '$dir': $!");
From this point, continue like this:
my ( $youngest, @files) = grep /LOG/, grep !/^\.\.?$/, readdir( DIR) or
die "No LOG files in $dir";
-M $youngest < -M $_ or $youngest = $_ for @files;
print "The youngest LOG file in $dir is: $youngest\n";
Anno
------------------------------
Date: Thu, 19 Aug 2004 10:47:00 +0200
From: "Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net>
Subject: Re: trim code for mimic ls -tr
Message-Id: <Xns954A6E2B3D220elhber1lidotechnet@62.89.127.66>
anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:
[...]
> It looks to me that all you want is the youngest file (of a
> certain type) in a directory. That can be done in a linear pass
> over the files without sorting.
>
>> #!/usr/local/bin/perl -w
>> use strict;
>> use warnings;
>> my($dir) = $ARGV[0] ? $ARGV[0] : '.';
>> opendir(DIR, $dir) or die("Cannot open directory '$dir': $!");
>
> From this point, continue like this:
>
> my ( $youngest, @files) = grep /LOG/, grep !/^\.\.?$/,
> readdir( DIR) or
[...]
Is the check for present and parent directories necessary? They won't
pass /LOG/ anyway.
--
Cheers,
Bernard
------------------------------
Date: 19 Aug 2004 09:20:50 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: trim code for mimic ls -tr
Message-Id: <cg1rdi$kal$1@mamenchi.zrz.TU-Berlin.DE>
Bernard El-Hagin <bernard.el-haginDODGE_THIS@lido-tech.net> wrote in comp.lang.perl.misc:
> anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:
>
> [...]
>
> > It looks to me that all you want is the youngest file (of a
> > certain type) in a directory. That can be done in a linear pass
> > over the files without sorting.
> >
> >> #!/usr/local/bin/perl -w
> >> use strict;
> >> use warnings;
> >> my($dir) = $ARGV[0] ? $ARGV[0] : '.';
> >> opendir(DIR, $dir) or die("Cannot open directory '$dir': $!");
> >
> > From this point, continue like this:
> >
> > my ( $youngest, @files) = grep /LOG/, grep !/^\.\.?$/,
> > readdir( DIR) or
>
> [...]
>
>
> Is the check for present and parent directories necessary? They won't
> pass /LOG/ anyway.
Oh, right, I didn't notice. It may make sense to put a general -f
test in its place.
Anno
------------------------------
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 6881
***************************************