[11792] in Perl-Users-Digest
Perl-Users Digest, Issue: 5392 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 15 15:10:40 1999
Date: Thu, 15 Apr 99 12:00:18 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 15 Apr 1999 Volume: 8 Number: 5392
Today's topics:
Re: Can I write a #!-style interpreter with Perl ? (Andrew Allen)
Re: Database structure for a search engine <howitgolook@my-dejanews.com>
Re: does this directory exist jewing@eng.utoledo.edu
Re: FAQ 1.11: What's the difference between "perl" and <cassell@mail.cor.epa.gov>
FREE Certifications Offered Online to perl programmers ludlow1435@my-dejanews.com
Re: Hash symbol '%' a stylized what? (Kevin R. Boyce)
Re: how can i send perl -c output to a file instead of (Bart Lateur)
Re: How do I delete text in a file? <cassell@mail.cor.epa.gov>
Re: How do I delete text in a file? <cassell@mail.cor.epa.gov>
Re: need to modify 'discus' scripts/config files <cassell@mail.cor.epa.gov>
Re: Perl Regex Q? <uri@home.sysarch.com>
perlcc on NT <partha@mihy.mot.com>
Re: position in s///g? (Andrew Allen)
Re: Q: Convert two newlines to \n<p> <aqumsieh@matrox.com>
reading in dir names into an array. <dscapin@harris.com>
Re: Retrieving info after POSTing from a perl script joemoore@att.com
Re: Scalar length and general Perl questions <cassell@mail.cor.epa.gov>
Re: TPJ still shipping? <xeno@bigger.aa.net>
Re: Trying to get the cgi script to print the date last <cassell@mail.cor.epa.gov>
Re: Why a complex numbers package? <cassell@mail.cor.epa.gov>
win32 script to dos exe <kimntodd@dontspamus.execpc.com>
Writing to syslog on Linux <thriveni@prodigy.net>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 15 Apr 1999 16:55:40 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Can I write a #!-style interpreter with Perl ?
Message-Id: <7f55mc$1r2$1@fcnews.fc.hp.com>
Jorma Laaksonen (jorma.laaksonen@hut.fi) wrote:
: Hello!
: Currently, I have a text parser named /my-script-dir/parser written in
: Perl. It reads and processes standard input and works as such fine.
: I.e., I can use it: "/my-perl-script-dir/parser < textfile".
: I can also run it with "/usr/bin/perl /my-perl-script-dir/parser textfile".
: But, what I now would like to be able to do is to write the input
: to the script as a script like:
: *** #! /my-perl-script-dir/parser
: ***
: *** here are the input lines...
: *** ...
: I have "chmod +x"'d this file and tried to run it. It seems to me that
: the lines end up to be processed by /bin/csh, not by my Perl script.
: The parser script /my-script-dir/parser simply begins like:
: *** #! /usr/bin/perl
: Is this a FAQ? Any advise? Is there a general solution to this
: problem? I'm using Linux 2.0.36 on an i686.
#! interpreters must be "real" executables (not scripts). Just write
yourself a little C program that execs (see the exec man page)
perl my-perl-interpreter-script <arguments passed in>
and call it "parser". For extra credit, you may want to try embedding
your perl script in the parser (perhaps as a string?) so it can be run
using 'perl -x', so you only need one file that is both your
executable _and_ your perl script.
Andrew
------------------------------
Date: Thu, 15 Apr 1999 17:03:59 GMT
From: howitgolook <howitgolook@my-dejanews.com>
Subject: Re: Database structure for a search engine
Message-Id: <7f565p$qi2$1@nnrp1.dejanews.com>
I'm not sure how many web pages I will need to store as yet.
Could you tell me a bit more about inverted indexes?
If I'm doing a flat search, would there be any way to optimize the process?
Or could I just search sequentially?
Thanks in advance.
In article <YLMQ2.700$MQ1.8146@typhoon-sf.pbi.net>,
snowhare@long-lake.nihongo.org (Benjamin Franz) wrote:
> In article <7f01b5$ctg$1@nnrp1.dejanews.com>,
> howitgolook <howitgolook@my-dejanews.com> wrote:
> >Can anyone suggest a database structure I should use if I am writing a search
> >engine?
> >
> >I wish to record URL, Date Modified, Title, Keywords, Description, and
> >possibly some or all of the text on the page.
> >
> >Should I use text files to store the data? What database structure would
> >facilitate efficient (fast!) searching?
>
> You didn't indicate how many (presumably web pages) things you are going
> to be storing in your system. Up to about 1,000 a flat search is fast enough.
> Beyond that you will want to look into inverted indexes.
>
> --
> Benjamin Franz
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 15 Apr 1999 13:48:06 -0400
From: jewing@eng.utoledo.edu
Subject: Re: does this directory exist
Message-Id: <37162656.2A8D684D@eng.utoledo.edu>
Philip Newton wrote:
> Others have already told you about -d. Perhaps a few comments about
> coding style, then.
Thanks for the tips, you can be doing something wrong for a while and never
know it.
John
------------------------------
Date: Thu, 15 Apr 1999 10:24:53 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: FAQ 1.11: What's the difference between "perl" and "Perl"?
Message-Id: <371620E5.4643E5B3@mail.cor.epa.gov>
Tom Christiansen wrote:
>
> [snip of FAQ 1.11]
> not. But never write "PERL", because perl isn't really an acronym,
> aprocryphal folklore and post-facto expansions notwithstanding.
Uh-oh. Larry Rosler may be right after all. Tom is backing him up
on the 'acronym' issue. I know this isn't relevant to c.l.p.m.
except insofar as this is certainly 'misc', but I would like to know.
Did Larry Wall name the language Perl and then make up a retro-acronym
after the fact? And if so, why didn't someone stop us from picking
on Larry Rosler over this topic? :-)
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Thu, 15 Apr 1999 17:18:31 GMT
From: ludlow1435@my-dejanews.com
Subject: FREE Certifications Offered Online to perl programmers
Message-Id: <7f570u$r8d$1@nnrp1.dejanews.com>
Dear perl Programmer,
Through April, TekMetrics has extended its free service of perl
certifications conducted through it's internet-based CAT engine. Simply go
to http://www.tekmetrics.com/cert/certtop.html to order your free
certification. You can either elect to take the test right away, or come
back later, using the PIN you are provided when you order.
To qualify as a Certified perl Programmer, you must pass the examination with
a score of 2.75 or higher. To be certified as a Master perl Programmer, you
must obtain a score of 4.00 or higher. At the end of the test, your score
will be provided (with a scoring range of 1-5). Once certified, you can add
the logo associated with the test (standard or master logo, depending on how
well you do) to your resume or website. Furthermore, those that pass prior
to 4/19 will be mailed a certificate, once again, at no cost (after which
time their may be a nominal fee for the shipping of the certificates).
There's no catch. We're simply trying to prove a concept during a beta
trial period. Thus far, the feedback has been extremely positive!
Why bother getting certified by TekMetrics?
1) More and more corporations recognize TekMetrics Certifications as an
indication not only of the technical workers knowledge level, but also as an
indicator that they were willing to demonstrate their skills to them.
2) It's free and it's fun. They won't be free forever, but they are now.
So take advantage of them. Furthermore, those who have completed the tests
generally indicate that they enjoyed the experience and considered both the
delivery of the test and the items themselves to be of high quality.
3) Over 4000 technical workers from around the world are ordering our
certifications each week, and that number is steadily rising.
4) Strut your stuff. See if you are good enough to make the top 10 list.
5) Find out both your strengths and weaknesses in perl. At the end of the
test, you can request specifics on how you did, by subtopic. And yes, that
too is free.
All we ask for in return is your feedback at the end of the exam. We will
be continually focusing on the improvement of the delivery of the test and
quality of the questions. Any feedback you can provide, positive or
negative, will help us greatly.
Another FAQ is, "How do you know the person who supposedly took the test was
actually the same person? What if it was his hotshot perl Programmer
brother, sister, or friend? In other words, what is to prevent him from
cheating?" Our solution: we allow employers to spotcheck the technical
workers with a short test at no cost at their corporate locations, if they
so choose. Corporations have unanimously applauded this solution.
Lastly, data you provide in the certification process is not used without
your permission other than to store your certification record and verify to
valid employers at their request. We do, however, publish names on our site
in a Top Ten Scores list for each category, but no addresses, phone numbers,
email, etc.. are shown. For more information, see our privacy statement at
http://www.tekmetrics.com/cert/privacy.html
Well, that's pretty much it! We're trying to establish a new cost-effective
and convenient alternative to today's certification environment. During
this beta trial period, you will be the benefactor of this fun and
challenging experience.
If you have any questions/concerns regarding the perl certification, please
contact Deborah Manley at <mailto:deborah.manley@tekmetrics.com>.
Good luck and thank you!
Ann Marie Ludlow
TekMetrics, Inc.
www.tekmetrics.com <http://www.tekmetrics.com>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 15 Apr 1999 12:45:23 -0400
From: Kevin.R.Boyce@gsfc.nasa.gov (Kevin R. Boyce)
Subject: Re: Hash symbol '%' a stylized what?
Message-Id: <Kevin.R.Boyce-1504991245230001@muffin.gsfc.nasa.gov>
In article <7eue2d$bb5$1@towncrier.cc.monash.edu.au>,
damian@cs.monash.edu.au (Damian Conway) wrote:
> Anyway, didn't you guys fight a war several hundred years ago
> so you wouldn't have to worry about British knighthoods and the
> like? Maybe we should be working out how to win him the
> Congressional Medal of Honour?
Harumph. That's 'Congressional Medal of Honor' to you, mate!
-----
Bloody Strines...
:-) for the humor-impaired
--
keV ----------- Kevin.R.Boyce@gsfc.nasa.gov
Her children are the legacy, in their failure to be chained;
An everlasting mutiny of flowers when it rains.
--Roy Harper
------------------------------
Date: Thu, 15 Apr 1999 17:38:05 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: how can i send perl -c output to a file instead of STDERR
Message-Id: <3717220b.4866574@news.skynet.be>
Manida Ivan wrote:
>Abigail, that's a great one :)
>Did you ever thought about publishing a Perl tips book? I'd buy it :)
It would be a very thin book. Many lines would look like:
FAQ
:-)
Bart.
------------------------------
Date: Thu, 15 Apr 1999 10:38:36 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: How do I delete text in a file?
Message-Id: <3716241C.3E0F69A4@mail.cor.epa.gov>
Carlos Ramirez wrote:
>
> Try:
>
> local $/;
> open TEXT, ">$textfile" or die;
> open HTML,$filename or die;
It's good to check your returns, like this. But you can get more info
back if you use the $! variable too.
> $file = <HTML>;
> $file =~ s/\<[^\>]+\>/ /g;
Umm, why are you backwhacking the angle brackets? Perl doesn't use
< and > as special regex characters. And most certainly not in
character classes. So presumably you mean:
$file =~ s/<[^>]*>//g;
But this still isn't right. This does not work in the general
case. It doesn't handle quoted angle brackets, or HTML comments.
It doesn't handle entities properly either, which may mess up the
text output.
> print TEXT $file;
>
Hence the reference to the FAQ made by other posters.
> OR
>
> I have tried the HTML::Parse but currently it has problems with parsing
> tables and forms. Although I know there are other modules that handle forms
> and tables. But if you want to completely take out all html tags...this should
> do the job.
I disagree. And besides, HTML::Parse is deprecated in foavor of
HTML::Parser.
Sorry to be so difficult when you are trying to help someone, but
it is important to be as accurate as possible here. Just look at
the number of times soemone else has needed to correct some gaffe
of mine. Please don't take it personally.
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Thu, 15 Apr 1999 10:53:01 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: How do I delete text in a file?
Message-Id: <3716277D.6B3FCD52@mail.cor.epa.gov>
Sys Adm 89806 Manager of programing development and Intranet Resources
wrote:
>
> [Posted and mailed]
>
> In article <xkfk8vhlm0j.fsf@valdemar.col.hp.com>,
> Eric The Read <emschwar@rmi.net> writes:
> > ruben@llinderman.dental.nyu.edu (Sys Adm 89806 Manager of programing development and Intranet Resources) writes:
> >> You cound write the function.
> >
> > Generally a bad idea, especially when someone's already done it for you.
> > HTML is moderately complicated, and a simple regex will *not* do it for
> > you; you must write a parser. Which is silly, given that HTML::Parser
> > exists already.
>
> General - it is NOT a bad idea, especially for a BEGINNER as it teaches
> them how to program. Learning HOW to do something is more important
> than just DOING IT.
Ruben, please don't take this personally. This is a part of a general
effort in this newsgroup to make sure that highly accurate info goes out
to posters, who may not have a clue when an error creeps into someone's
reply.
And I'm going to side with Eric on this. Writing one's own code is a
good thing. But re-inventing the wheel - and producing something made
of
stone that's barely circular - is hardly optimal. This is what Larry
Wall has called 'False Impatience'.
Making an attempt to understand someone else's code can be more useful
[at least for me] than taking a whack from ground zero. Especially
in an area where there are detailed rules governing how things work.
I would recommend rather that the original poster write his/her own
code to use HTML::Parser, and hence gain some understanding of the use
of modules.. not to mention CPAN.
> >> Here is a start
> >>
> >> sub htmlbegone{
> >> s/<.*>//g #correct this - it is greedy
> >
> > And wrong. perldoc perlfaq9, "How do I remove HTML from a string?":
> >
> Actually - this is more or Less CORRECT.
No, it is less correct and more incorrect. It fails even if you fix
the greediness. Read the cited FAQ for some reasons why. Or other
posts in this thread.
> > Many folks attempt a simple-minded regular expression approach, like
> > s/<.*?>//g, but that fails in many cases because the tags may continue
> > over line breaks,
>
> ALL OF WHICH can be addressed as one LEARNS to join lines, change the default
> string and glob settings, etc. LEARNING how to program is what a newbie
> needs to do, not to jump right into a bunch of CSPAN modules which they have
> no clue to how they work.
But writing a convoluted regex which takes days to debug, in order to
handle the next step [say, embedded HTML comments], is not necessarily
productive. And regexen are *hard* if one has no prior experience.
> > Read the FAQ for better solutions.
> >
> > -=Eric
> >
>
> Try to be a little more polite when you have have a worthing contribution -
>
> at least when you answer anything I write.
As I said earlier, please try not to take this personally. Helping
others is why any of us answers quesitons on this ng. Getting it
right is more important than acquiescing meekly and doing someone a
disservice. You can call that False Politeness. :-)
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Thu, 15 Apr 1999 10:06:03 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: need to modify 'discus' scripts/config files
Message-Id: <37161C7B.97C41744@mail.cor.epa.gov>
parv wrote:
>
> David Cassell wrote:
> >
> > parv wrote:
> ...
> > > of course, i could sit for few hours, and do it myself...but, then,
> > > being lazy is one of three virtues of a perl programmer
> ...
> > ...when Larry said that laziness is the first great virtue of a
> > programmer, he meant "the quality that makes you go to great effort
> > to reduce overall energy expenditure." Not the quality that makes
> > you go to *no* effort to reduce your personal energy expenditure
> > while increasing overall energy expenditure for everyone else. :-)
>
> may be i was not clear...i was thinking on the why-reinvent-the-wheel
> line.
I didn't mean to be *too* grumpy. :-)
But if it has been done by one of the Perl gurus, it is likely to be
at CPAN. Check out the modules. If it has been hacked together by
J. Random User, it could be anywhere on the web.. and it might be worth
every penny you paid for it. Or less. Some of the free scripts I have
seen on the web looked great, and some looked like they had been
written by an angry C++ programmer who was out to destroy the Perl
community by perpetrating bad, broken code on the unsuspecting.
But YMMV.
Good luck. you may need it,
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: 15 Apr 1999 13:59:28 -0400
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: Perl Regex Q?
Message-Id: <x7zp49n4sf.fsf@home.sysarch.com>
>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
LR> In article <x74smhoo59.fsf@home.sysarch.com> on 15 Apr 1999 12:16:02 -
LR> 0400, Uri Guttman <uri@home.sysarch.com> says...
>> >>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
LR> In article <ohm4f7.7p7.ln@magna.metronet.com> on Thu, 15 Apr 1999
LR> 08:37:12 -0400, Tad McClellan <tadmc@metronet.com> says...
LR> ...
>> >> : last if ($Line =~ m{\w:/});
>> >>
>> >> And if you want to allow more than a single word character
>> >> before the colon, then you need to say so :-)
>> >>
>> >> last if ($Line =~ m{\w+:/});
>>
LR> Why? I don't see any start anchor there, so the two regexes
LR> would match identically.
>>
>> as my other post says, the + version will fail for hosts with name
>> length of 1.
LR> Why is that? 'x:' matches either regex, doesn't it?
add a little braino and watch your thoughts go down the drain!!
why i thought + is > 1 i have no idea. must be very groggy today. in any
case it is not needed (nor is \w as i said for a clean df).
:-)
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Thu, 15 Apr 1999 18:07:33 +0530
From: Ramanujam Parthasarathi <partha@mihy.mot.com>
Subject: perlcc on NT
Message-Id: <3715DD8D.82FDDE2B@mihy.mot.com>
Hi
I would like to know the equivalent of 'perlcc' on NT ('perlcc' usually
comes on Unix).
Thanks for the info.
Regards,
Partha
------------------------------
Date: 15 Apr 1999 17:40:09 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: position in s///g?
Message-Id: <7f589p$1r2$2@fcnews.fc.hp.com>
Ilya Zakharevich (ilya@math.ohio-state.edu) wrote:
: [A complimentary Cc of this posting was sent to Andrew Allen
: <ada@fc.hp.com>],
: who wrote in article <7f3aqk$eos$1@fcnews.fc.hp.com>:
: > Is there a way to get the position in a substitution. pos() only
: > works in m//g. I'm trying to do something like:
: >
: > $a="0520001250025";
: > $b="weasgnkweplhk";
: > $a=~/0/substr($b,pos($a)-1,1)/ge;
: >
: > which obviously doesn't work.
: Adding to other suggestions, note that
: $a=~/0(?{pos})/substr($b,$^R-1,1)/ge;
: should work with bleeding-edge Perls.
corrected version:
$a=~s/0(?{pos($a)})/substr($b,$^R-1,1)/ge;
^ ^^^^
But even that doesn't work. At least not on 5.005_02 (is that bleeding
edge enough?). Looks like 'pos' _never_ gets set during a s///,
regardless of whether it's in the left side or right side.
Andrew
------------------------------
Date: Thu, 15 Apr 1999 11:56:54 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Q: Convert two newlines to \n<p>
Message-Id: <x3y1zhlc1x5.fsf@tigre.matrox.com>
bart.lateur@skynet.be (Bart Lateur) writes:
>
> Ala Qumsieh wrote:
>
> >open TXTFILE, "txt" or die "$!";
> >undef $/;
> >while (<TXTFILE>){
> > s/\n\n/\n<p>/g;
> > print;
> >}
>
> Funny that, a while loop. While it's body will be executed only ONCE.
>
> Bart.
Ooops :-)
But it still works ;-)
------------------------------
Date: Thu, 15 Apr 1999 13:07:23 -0400
From: George <dscapin@harris.com>
Subject: reading in dir names into an array.
Message-Id: <37161CCB.760E121E@harris.com>
I was using the command @array = <*.jpg> to read all jpg files in the
current directory into the array. This worked fine until I put the
program on a server (NT). I was developing on win98. How come this
command won't work on the NT server? What is another way of doing
this. Thank you.
George
------------------------------
Date: Thu, 15 Apr 1999 17:06:17 GMT
From: joemoore@att.com
Subject: Re: Retrieving info after POSTing from a perl script
Message-Id: <7f56a2$qlp$1@nnrp1.dejanews.com>
You need to include a comma after POST.
I always quote "POST" as well.
In article <37042D0B.76B5439F@BLAHNOSPAMBLAHxwebdesign.com>,
Ketan Patel <ketanp@BLAHNOSPAMBLAHxwebdesign.com> wrote:
> my $response = $ua->request(POST
> "http://www.bu.edu/link/bin/uiscgi_studentlink",
> [Semester => 'FALL 99',
> CollegeCd => 'CAS',
> Dept => 'CS',
> Course => '113 ',
> Section => 'A2',
> MaxGetNbr => '1',
> StartKey => 'FALL 99CASCS113 A2',
> applpath => 'univschr.pl']);
> Error Message:
> --------------
> % perl5 post.cgi
> String found where operator expected at post.cgi line 7, near "POST
> "http://www.bu.edu/link/bin/uiscgi_studentlink""
> (Do you need to predeclare POST?)
> syntax error at post.cgi line 7, near "POST
> "http://www.bu.edu/link/bin/uiscgi_studentlink""
> Execution of post.cgi aborted due to compilation errors.
>
> Any ideas what the problem could be??
>
> Thanks for the help!
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 15 Apr 1999 11:59:48 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Scalar length and general Perl questions
Message-Id: <37163724.9270D1BE@mail.cor.epa.gov>
Aidan Rogers wrote:
>
> I have a slight problem with a scalar. I'm inserting a value into a table
> in MySQL, which has an auto_increment field. This basically means I can
> tell it to insert 0, and it will instead take the next highest number and put
> that in the table instead. I can then get that number by calling a method.
> However, the number seems to be too big for a scalar to handle, and so it
> needs to be treated as a string. Any ideas on how to do this? Here is an
> example of the code.
>
> my $query = "INSERT INTO foo VALUES (0, 'Test')";
> my $sth = $dbh->query($query) or warn "Can't $query\n";
> my $id = $sth->insertid;
>
> The insertid method returns the number I was talking about. However instead
> of getting a 13 digit number, I get a 10 digit number. Any ideas on how
> to get the real number?
Are you making sure that your integer will fit in storage? On many
machines, Perl is compiled with an integer that will hold up to 2**32
-1.
That's 4,294,967,295. 10 digits. Perhaps you're getting an overflow.
Have you checked to see what happens if you use Math::BigInt or if
you translate your number to a string of digits long enough to hold what
you require?
> Secondly, and less importantly, does anyone know where to send suggestions
> for changes/improvements to the Perl language to? I have a few ideas that I'd
> like someone who is involved in developing Perl to look over and ridicule :)
>
> Thanks in advance,
You're a braver man than I am. :-)
If you look in the FAQ [perlfaq1] you'll find a ref to where you can get
info about Perl developments.
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: 15 Apr 1999 17:10:47 GMT
From: Xeno Campanoli <xeno@bigger.aa.net>
Subject: Re: TPJ still shipping?
Message-Id: <7f56in$3a1$1@slave3.aa.net>
Greg McCann <gregm@well.com> wrote:
: Wappinger Mary wrote:
:>
:> Is The Perl Journal still shipping? I ordered a year's subscription and
:> all the back issues almost a month ago, and I have yet to receive them.
:> Mail to Mr. Orwant doesn't seem to be getting me anywhere.
I asked for back issues that got lost in the mail after some address
change confusion, and I got all the three issues I requested a couple of
days ago with no problem. Thanks very much to Mr. Orwant. Keep up the
good work. Sincerely, Xeno
:>
:> Has anyone else successfully purchased TPJ?
You mean the company, or the magazine? A year or so ago I ordered a five
year subscription, so whatever happens, I am expecting them to be around
for a while.
--
Xeno Campanoli
Email: xeno@aa.net (Web pages: http://www.aa.net/~xeno)
------------------------------
Date: Thu, 15 Apr 1999 11:06:34 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Trying to get the cgi script to print the date last updated rates!
Message-Id: <37162AAA.B42D7D7B@mail.cor.epa.gov>
Loans2001 wrote:
>
> [snip]
>
> $yr += 1900;
This is correct. Good. But if you want to print only the last two
digits in $outstr you may want to mod the year by 100 instead.
> #if ($mon=12) {
> # $mon=1;
> #}
Presumably you just want $mon++; so you have a month number between
1 and 12.
>
> $outstr = "3/$day/$yr at ".sprintf("%.2d",$hour).':'.sprintf("%.2d", $min);
>
> # print '/'. $day.'/'.$yr.' at '.sprintf("%.2d",$hour).':'.sprintf("%.2d",
> min);
> print $outstr;
>
> #<-- End Code -->
>
> This code prints a "1" in front of the date ie 4-18-99 so 14/18/99
Neither of these prints a '1' in front of the date for me.
What version of Perl are you using?
Is there some code you haven't shown us which might be putting a '1'
into the output stream, and which just has not been printed on a
previous line because your buffer hasn't been flushed?
Once you've incremented $mon by 1 [as above], you should be fine using
sprintf as you did with the $hour and $min . But printf might be a
little less effort here.
>
> Why does it print a silly "1"?
>
> That's the current problem.
I can't tell from the code you have supplied. Sorry.
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Thu, 15 Apr 1999 11:39:09 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Why a complex numbers package?
Message-Id: <3716324D.33ADD7C3@mail.cor.epa.gov>
Matthew B. Kennedy wrote:
>
> Can anyone tell me when they last used the complex numbers package in a Perl
> script?
Last fall.
> Coming from an engineering background, I find it amuzing to consider that an
> implementation of complex numbers might be useful in this sort of language.
> Does this package exist in the standard set merely because it could be
> written?
Well, clearly it wouldn't be there if it *couldn't* be written. :-)
It's there because it's a convenient tool for a convenient language.
> I might be too cynical, but I'd love to hear where it may have been used in
> a script. Examples please, if you got 'em.
>
> Matt :-)
I can't find the code - probably because it was too short to bother
archiving. But I was working in Humongo Statistical Analysis Monolith
(tm)
and I found that some of my calculations were throwing errors at
boundary cases. There wasn't a convenient way to look at the complex
plane in HSAM(tm), and I didn't want to take the time to code it up
in S-Plus or xlisp-stat. So I did it in 5 or 10 lines of Perl and got
the output I wanted. Nothing brilliant or even interesting. Just
efficient and convenient and workable.
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Thu, 15 Apr 1999 12:17:25 -0500
From: "End User" <kimntodd@dontspamus.execpc.com>
Subject: win32 script to dos exe
Message-Id: <7f58ld$kga$1@ffx2nh3.news.uu.net>
I would like to use perl to create a wrapper for a series of batch files
that I use for doing unattended NT installations. The cool thing here is
that I can impliment logic more easily in perl, and also prompt the
installer for real information (as opposed to Y/N choices, etc).
My question is this: can I write the script ( that gathers all the variables
and passes them to the dos batch process ) on NT, and by using perlapp, have
that exe run under dos? this assumes that there are not registry or ENV${"
"}; kind of stuff.
Thanks in advance,
--
Todd Hayward
Global Analyst, Systems Engineer
MCSE, Compaq ACT
noc at bakernet dot com
------------------------------
Date: Thu, 15 Apr 1999 14:42:00 -0400
From: "Thriveni Bhakta" <thriveni@prodigy.net>
Subject: Writing to syslog on Linux
Message-Id: <7f5bj5$2o8m$1@newssvr04-int.news.prodigy.com>
I have not been abel to write to syslog using Perl on Linux.
The versions that I've tried so far
1. Red Hat Linux 5.2
2. Linux Mandrake 5.3
Is this a known problem ?
Any suggestions/solutions ?
Thanx,
Thriveni
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 5392
**************************************