[9237] in Perl-Users-Digest
Perl-Users Digest, Issue: 2832 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 10 16:07:24 1998
Date: Wed, 10 Jun 98 13:00:29 -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 Wed, 10 Jun 1998 Volume: 8 Number: 2832
Today's topics:
Re: [META] hypersensitivity <upsetter@ziplink.net>
Re: accessing a:\ <jdporter@min.net>
Bitwise Operations jharris01@my-dejanews.com
Re: Capitalizing acronyms (Re: Is PERL case sensitive?) <postmaster@castleamber.com>
Re: Command line substitution thru subdirectories <xuming@emai.unc.edu>
Re: Command line substitution thru subdirectories bjohnsto@usa.net
Re: Command line substitution thru subdirectories <upsetter@ziplink.net>
Re: Command line substitution thru subdirectories <upsetter@ziplink.net>
Re: Command line substitution thru subdirectories <upsetter@ziplink.net>
Re: Command line substitution thru subdirectories <tchrist@mox.perl.com>
Re: Complete newbie question: Please help if possible! <angst@scrye.com>
Re: Document contains no data? <angst@scrye.com>
Re: efficient comparisons (Andre L.)
Error Trapping with Net::FTP?? (Wayne C. McCullough)
http protocol (Breeze Pecorino)
Re: Need to plot charts (gif format ?) from ascii data (John Stanley)
Re: Need to plot charts (gif format ?) from ascii data (Chris Nandor)
Re: Need to plot charts (gif format ?) from ascii data (John Stanley)
Re: Number of digits in a string (Matt Knecht)
Re: Number of digits in a string <tchrist@mox.perl.com>
Re: Number of digits in a string (Tom Harrington)
Re: Number of digits in a string <jdporter@min.net>
Re: Number of digits in a string (Joel Coltoff)
Perl database driver spiegler@cs.uri.edu
Perl on NT using iis 4.0 <yong@lynxhub.ho.att.com>
Re: RECOMMEND A PERL BOOK/RESOURCES ?? ralanfox@hotmail.com
Re: Run an batch via perl on NT <angst@scrye.com>
Re: Sorry for seperate posts <angst@scrye.com>
Re: Sorry for seperate posts <jdporter@min.net>
Re: stumped! inconsistent results of DB search (D. Pinaula)
Re: Win32: File glob causes floppy to chatter <michael.n.burr@boeing.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 10 Jun 1998 18:52:54 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: [META] hypersensitivity
Message-Id: <6lmkm6$ssc@fridge.shore.net>
Greg Bacon <gbacon@cs.uah.edu> wrote:
: : You know, there was a time when I used to auto-select your posts.
: :
: : *plonk*
: It's really disheartening to see such a high population of
: hypersensitive crybabies in this newsgroup. I'll be glad when the first
: of July has come and gone.
Yeah, after all, anybody who dares to (a) attempt to use Perl on Win95 and
(b) post a question regarding it to this newsgroup *deserves* to get 10
tons of shit dumped on their head, right?
--Art
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.ziplink.net/~upsetter/ska/calendar.html
--------------------------------------------------------------------------
------------------------------
Date: Wed, 10 Jun 1998 19:04:45 GMT
From: John Porter <jdporter@min.net>
Subject: Re: accessing a:\
Message-Id: <357EDA4A.10F6@min.net>
"Abigail" wrote:
>
> Tom Christiansen (tchrist@mox.perl.com) wrote on MDCCXLIV September
> MCMXCIII in <URL: news:6lm96u$e1j$4@csnews.cs.colorado.edu>:
> ++ I use ||. Larry stands by or. You heard both voices.
>
> Which is exactly the Perl way. If Perl offers you more than one way to
> do something [1], don't ask which is better. If one method was better
> than the other, Perl wouldn't have given you a choice.
>
> [1] With the exception of deprecated ways which are only maintained for
> backwards compatability reasons.
Sure; but if Larry has his way, '||' will be deprecated soon enough.
At least to hear Tom tell it.
John Porter
------------------------------
Date: Wed, 10 Jun 1998 19:48:29 GMT
From: jharris01@my-dejanews.com
Subject: Bitwise Operations
Message-Id: <6lmnue$bj9$1@nnrp1.dejanews.com>
I just dove into PERL and have a question that is not in the FAQ.
I fully understand what takes place in a "bitwise and" or a "bitwise or" my
problem is I can't visualize when you would use something like this.
Any examples would be appreciated!
Thanks,
Jeremy
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 10 Jun 1998 19:30:56 GMT
From: "John Bokma" <postmaster@castleamber.com>
Subject: Re: Capitalizing acronyms (Re: Is PERL case sensitive?)
Message-Id: <01bd94a6$a180d9a0$02521e0a@tschai>
jimbo@soundimages.co.uk wrote in article
<u67i9kbdf.fsf@JIMBOSNTSERVER.i-have-a-misconfigured-system-so-shoot-me>...
> Tom Phoenix <rootbeer@teleport.com> writes:
> >
> > On Sat, 6 Jun 1998, REUBEN LOGSDON wrote:
> >
> > > PERL is an acroynm for "Practical Extraction and Report Language".
It's
> > > common practice to capitalize acronyms.
> >
> > You're right, but once the acronym becomes a word (such as laser,
scuba,
> > or zip code) the caps are dropped. Thus the FAQ turns out to be correct
> > once again. :-)
>
> Reuben remains correct. Although an acronym becomes a noun through
> common usage, which is a beautiful feature of English, it still
> retains it's origin as an acronym. This would certainly remain an
> entry in any dictionary including Perl as an entry. Thus, using the
> form PERL, while seemingly a problem with cultural fanatics, would
> remain perfectly resonable. The form Perl may be the accepted and/or
> acceptable form of usage but the form PERL is not incorrect or
> inaccurate within the acronym context under any circumstance.
All-caps are constants, perl is far from constant.
John
--
------------------------------------------------------------------
C A S T L E A M B E R Software Development (Java/Perl/C/CGI)
http://www.castleamber.com/ john@castleamber.com
NEW: http://www.binaries.org/ Guide to Program Binaries & Pictures
------------------------------
Date: Wed, 10 Jun 1998 13:30:03 -0400
From: Xuming Wang <xuming@emai.unc.edu>
Subject: Re: Command line substitution thru subdirectories
Message-Id: <357EC29A.676B2A72@emai.unc.edu>
[no courtesy cc of this posting sent to cited author via email]
Tom Christiansen wrote:
>
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc,
> Xuming Wang <xuming@emai.unc.edu> writes:
> :> However, feel free to ask...
> :
> :yeah, but I won't post any testing results anymore (I guess this can also make
> :my life a LOT easier).
>
> But apparently you will post private mail to a public forum.
wrong again. your "courtesy" cc or private mails send to me get killed
automaticly.
--
Xuming Wang
------------------------------
Date: Wed, 10 Jun 1998 18:44:00 GMT
From: bjohnsto@usa.net
Subject: Re: Command line substitution thru subdirectories
Message-Id: <6lmk5g$6a5$1@nnrp1.dejanews.com>
In article <6lm8c8$e1j$2@csnews.cs.colorado.edu>,
tchrist@mox.perl.com (Tom Christiansen) wrote:
>
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc, abigail@fnx.com writes:
> :Of course. Or one uses Find::File to emulate find. I'm just pointing
> :out the algorithm. Porting to once specific OS is left as an exercise
> :for the reader.
>
> Moreover, the find2perl command takes arguments identical
> to the standard find utility.
>
> Why don't the C++ groups ever get questions like, "How do
> use C++ on all the files in all my directories recursively?"
I have actually written a class that does this in C++.
> Why don't the shell groups ever get questions like, "How do
> use the shell on all the files in all my directories recursively?"
People who have shell probably have find.
> Why don't the Fortran groups ever get questions like, "How do
> use Fortran on all the files in all my directories recursively?"
No one (no one I know) uses Fortran on projects like this.
> So why do we? Are we special? Who are we attracting? Is it
> time to change the honey?
Perl is good for dealing with the results of a query like this.
> --tom
Tom I wish I was using a decent operating system, but I am using Windows 95.
I know how to install and use a decent operating system but I am not allowed
to at work. It seems that you are fortunate in having these excellent tools
at your disposal. I have the Cygnus tools but they are pretty flaky on
win95.
I don't really care if you are short with people, but I don't see the purpose
of your comments. What are you trying to achieve? Suggestions involving
find2perl, the perl Find function and the availability of tools for win32
seemed more practical to me. Maybe some day you will end up being in an
imperfect environment and having to do things with a hammer which would be
better done with screw driver.
As for the drinking thing I drink quite often and maybe you could enjoy one.
A nice glass of wine with dinner, or a cool beer on a hot day can be quite
nice. Cocktails can be delicious too.
Brendan Johnston
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 10 Jun 1998 18:50:20 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Command line substitution thru subdirectories
Message-Id: <6lmkhc$ssc@fridge.shore.net>
Tom Christiansen <tchrist@mox.perl.com> wrote:
: [courtesy cc of this posting sent to cited author via email]
: In comp.lang.perl.misc,
: gebis@albrecht.ecn.purdue.edu (Michael J Gebis) writes:
: :You know, there was a time when I used to auto-select your posts.
: Oh, I'm so very sorry. I'll make sure to write someone a free text editor
: next time they want to edit a file in perl, a free typsetter next time
[snip]
Nobody's asking you to do any of those things. It's just that some of us
were taught by our mothers not to say anything when we had nothing good to
say.
You think Windows 95 sucks? Fine. Don't use it. Don't bother to answer
questions relating to it. But is it really necessary to insult someone
just because they are working on it? Just ignore them, and maybe you would
have more time to work on getting the online docs up to date.
--Art
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.ziplink.net/~upsetter/ska/calendar.html
--------------------------------------------------------------------------
------------------------------
Date: 10 Jun 1998 19:00:10 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Command line substitution thru subdirectories
Message-Id: <6lml3q$pd@fridge.shore.net>
Abigail <abigail@fnx.com> wrote:
: Of course not. Otherwise, if we need to list all the requirements
: necessary to run a perl program, the actual answer to the question
: would be buried in a long list of requirements.
Look. He posted that he was running Perl on Windows 95 and asked a
question. Giving him a response that requires unix tool not usually
available on Win95 indicates either carelessness or malice on the part of
the respondant.
Did it ever occur to you that there might be Perl newbies on this group
who know next to nothing about Unix?
--Art
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.ziplink.net/~upsetter/ska/calendar.html
--------------------------------------------------------------------------
------------------------------
Date: 10 Jun 1998 18:56:06 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Command line substitution thru subdirectories
Message-Id: <6lmks6$ssc@fridge.shore.net>
Tom Christiansen <tchrist@mox.perl.com> wrote:
: But apparently you will post private mail to a public forum.
He did nothing of the sort. He paraphrased you.
--Art
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.ziplink.net/~upsetter/ska/calendar.html
--------------------------------------------------------------------------
------------------------------
Date: 10 Jun 1998 19:40:04 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Command line substitution thru subdirectories
Message-Id: <6lmnek$41u$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Scratchie <upsetter@ziplink.net> writes:
:Did it ever occur to you that there might be Perl newbies on this group
:who know next to nothing about Unix?
That's not our fault.
--tom
--
/* Force them to make up their mind on "@foo". */
--Larry Wall, from toke.c in the v5.0 perl distribution
------------------------------
Date: 10 Jun 1998 18:04:36 GMT
From: angst <angst@scrye.com>
Subject: Re: Complete newbie question: Please help if possible!
Message-Id: <6lmhrk$ohu$1@jelerak.scrye.com>
ProjectPHE <projectphe@aol.com> wrote:
: about javascript recently (actually after I started learning about perl). But
: since it has to be in perl, I can't get my mind around it. : ( Is there a
: good samaritan out there who can either show me an example or point me towards
: the right direction? I don't want to have to learn another programming
: language just for this one script, if possible, but I guess I can if necessary.
: : )
If you don't wish to learn a programming language in order to write a
program in that language, you're more than welcome to hire someone to do it
for you. My personal rate is $75/hour.
--
Erik Nielsen <eln@rmci.net>
mail to above (rather than header address) is answered significantly faster.
this post != views of anyone at all, really
"You are like...unix GOD" -- local tech support
------------------------------
Date: 10 Jun 1998 18:06:39 GMT
From: angst <angst@scrye.com>
Subject: Re: Document contains no data?
Message-Id: <6lmhvf$ohu$2@jelerak.scrye.com>
Dom Franco <dfranco@inav.net> wrote:
: I recently downloaded and installed the Omnihttpd server on my
: computer. When I try to run simple Perl scripts locally I get the
: message "Document contains no data." What does this mean?
: Thanks
I'm sure if you really tried, you could be a little more vague, but it would
be difficult.
I would suggest you read some documentation on Perl, and, more importantly
it seems if I'm catching the tone of the question right, on CGI. There
are several good resources for CGI programming on the net. I would bet
your problem lies with your misunderstanding of CGI. Hence, it is
only tangentially related to perl.
--
Erik Nielsen <eln@rmci.net>
mail to above (rather than header address) is answered significantly faster.
this post != views of anyone at all, really
"You are like...unix GOD" -- local tech support
------------------------------
Date: Wed, 10 Jun 1998 13:41:31 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: efficient comparisons
Message-Id: <alecler-1006981341310001@dialup-367.hip.cam.org>
In article <6ll38m$gk2@newsops.execpc.com>, Deva Seetharam <devs@usa.net> wrote:
> I am sure about the relative efficiency of this code.
> But, it is concise.
>
> @sortedArray = sort {$x <=> $y} @ar;
>
> $sortedArray[0] will be min;
> $sortedArray[$#sortedArray] will be max;
>
> hope that helps and makes sense.
> Sorry, if not efficient enough for you.
Well,
@sortedArray = sort {$a <=> $b} @ar;
might be more efficient, as it might actually work. :-)
A.L.
------------------------------
Date: 10 Jun 1998 19:33:52 GMT
From: wayne@Glue.umd.edu (Wayne C. McCullough)
Subject: Error Trapping with Net::FTP??
Message-Id: <6lmn30$p7h$1@hecate.umd.edu>
Does anyone have any suggestions for how to trap errors while useing
Net::FTP?
I am writing an app where the user can enter in most of the FTP information
(host, user, pwd, files, etc.), so I want to be able to give the user
an informative error when things go wrong. Like "Invalid Host name" or
"invalid login/password"
As far as I can tell, most of the commands don't return anything, regardless
of if the worked or not. Occasionally $! is set, but the error message
tends to lack usefull information. (I see "Bad File Number." a lot, even
when it is for an invalid user/password...)
Is there some way to trap errors out of Net:FTP so that I can tell the user
what they did wrong?
Thank you very much...
W
------------------------------
Date: 10 Jun 1998 18:31:31 GMT
From: bpecorin@mailer.fsu.edu (Breeze Pecorino)
Subject: http protocol
Message-Id: <6lmje3$2v3$1@news.fsu.edu>
I am running a perl5 program that creates a socket to the http protocol
on another machine. I have this working for two other protocols (smtp &
pop3). The problem is that when I run it with www-http it dies after
trying to connect the socket. I have added www-http as the daemon name in
the services file. I can telnet acns.fsu.edu www-http, but I can't use
www-http in my program? I have tried restarting the machine. Do I need
to add www-http to the inetd.conf? Any help would be appreciated.
Thanks in advance,
Breeze
--
Breeze Pecorino
Acedemic Computing & Network Services
Florida State University
------------------------------
Date: 10 Jun 1998 18:23:18 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Need to plot charts (gif format ?) from ascii data
Message-Id: <6lmium$ss5$1@news.NERO.NET>
In article <pudge-1006981332500001@dynamic174.ply.adelphia.net>,
Chris Nandor <pudge@pobox.com> wrote:
>In article <6lmf66$r6a$1@news.NERO.NET>, stanley@skyking.OCE.ORST.EDU
>(John Stanley) wrote:
>
># In article <6lk6gm$dvs$1@thefuture.qualcomm.com>,
># Vinit Jindal <vjindal@qualcomm.com> wrote:
># >Is there a freeware / shareware utility available that I can use to
># >plot charts from ascii data.
>#
># Not perl. Find thee gnuplot or plotxy.
>
>People do it in perl all the time. PGPLOT. GIFgraph.
Of course they do. They do all sorts of things in perl that are already
written. As Tom has said, perl is based on tools, and using perl as a
hammer for every solution leaves you screwed. Gnuplot already does
plotting. Plotxy already does plotting. Neither leaves you stuck with a
GIF as the only form of output. Why reinvent the wheel?
I had exactly this sort of application requirement not too long ago.
Neither module you mention was as simple as simply passing the data to
gnuplot. By using gnuplot, I didn't have to worry about explicitly
drawing axes and determining ranges and all sorts of other details. I
got to concentrate on the data. As I recall, the modules as then
presented didn't deal at all well with non-monotonic data. And I also
remember that the text was much better in both gnuplot and plotxy.
Maybe they've improved since then. I don't know, I am not in the habit
of rewriting apps that are already written.
------------------------------
Date: Wed, 10 Jun 1998 18:30:07 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Need to plot charts (gif format ?) from ascii data
Message-Id: <pudge-1006981424260001@dynamic174.ply.adelphia.net>
In article <6lmium$ss5$1@news.NERO.NET>, stanley@skyking.OCE.ORST.EDU
(John Stanley) wrote:
# In article <pudge-1006981332500001@dynamic174.ply.adelphia.net>,
# Chris Nandor <pudge@pobox.com> wrote:
# >In article <6lmf66$r6a$1@news.NERO.NET>, stanley@skyking.OCE.ORST.EDU
# >(John Stanley) wrote:
# >
# ># In article <6lk6gm$dvs$1@thefuture.qualcomm.com>,
# ># Vinit Jindal <vjindal@qualcomm.com> wrote:
# ># >Is there a freeware / shareware utility available that I can use to
# ># >plot charts from ascii data.
# >#
# ># Not perl. Find thee gnuplot or plotxy.
# >
# >People do it in perl all the time. PGPLOT. GIFgraph.
#
# Of course they do. They do all sorts of things in perl that are already
# written. As Tom has said, perl is based on tools, and using perl as a
# hammer for every solution leaves you screwed. Gnuplot already does
# plotting. Plotxy already does plotting. Neither leaves you stuck with a
# GIF as the only form of output. Why reinvent the wheel?
If GIF is sufficient, then who cares? What are you afraid of?
Anyway, it is easier, more controllable, and more portable to call
libraries directly with modules/XS than to call external programs.
The point is that for some purposes, you CAN do it in Perl, and do it
well. You denied this fact. I was simply correcting you.
Sure, if these solutions are insufficient, or if you like gunplot, then by
all means, use what works. But you can do it in Perl, and you can do it
well, and easily.
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: 10 Jun 1998 19:58:46 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Need to plot charts (gif format ?) from ascii data
Message-Id: <6lmohm$1rc$1@news.NERO.NET>
In article <pudge-1006981424260001@dynamic174.ply.adelphia.net>,
Chris Nandor <pudge@pobox.com> wrote:
>If GIF is sufficient, then who cares? What are you afraid of?
You mean, if GIF is sufficient, who cares that doing it with gnuplot is
easier? And where did you get this crap about being afraid?
>Anyway, it is easier, more controllable, and more portable to call
>libraries directly with modules/XS than to call external programs.
Sorry, but I found gnuplot and plotxy to be both much easier and more
controllable. Portability is only an issue if you intend on moving
something from platform to platform. It is ridiculous to avoid an easy
solution that doesn't run on every platform if you are never going to
run it on every platform.
>The point is that for some purposes, you CAN do it in Perl, and do it
>well. You denied this fact. I was simply correcting you.
No, not denied. Just told him not to use perl. And not for all
purposes, but for the explicit one he was asking about.
>Sure, if these solutions are insufficient, or if you like gunplot, then by
>all means, use what works. But you can do it in Perl, and you can do it
>well, and easily.
You can do it in perl, but not easily. And not without reinventing the
wheel.
------------------------------
Date: Wed, 10 Jun 1998 18:40:24 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: Number of digits in a string
Message-Id: <sqAf1.13$34.462474@news2.voicenet.com>
Vincent M. Probasco <probavm@cat.com> wrote:
>I have a script where the user needs to input a number. I need to check
>to make sure that
> this number has exactly six digits. I looked in the camal manual and
>all I could find was how
>to count the number of distinct charaters in a string using tr//. Any
>help with this would be greatly
>appreciated. Thanks,
print "It's got 6 digits!\n"
unless (($number < 100_000) || ($number > 999_999));
Works nicely if you're only using decimel integers.
Of course, you could use tr/// as well. I'm sure you'll see plenty of
replies telling you to RTF[FM] concerning it.
--
Matt Knecht - <hex@voicenet.com>
"496620796F752063616E207265616420746869732C20796F7520686176652066
617220746F6F206D7563682074696D65206F6E20796F75722068616E6473210F"
------------------------------
Date: 10 Jun 1998 18:48:05 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Number of digits in a string
Message-Id: <6lmkd5$ske$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, "Vincent M. Probasco" <probavm@cat.com> writes:
:I have a script where the user needs to input a number. I need to check
:to make sure that
: this number has exactly six digits.
$n =~ /^\d{6}$/
--tom
--
echo "ICK, NOTHING WORKED!!! You may have to diddle the includes.";;
--Larry Wall in Configure from the perl distribution
------------------------------
Date: 10 Jun 1998 18:56:40 GMT
From: tph@longhorn.uucp (Tom Harrington)
Subject: Re: Number of digits in a string
Message-Id: <6lmkt8$2um1@eccws1.dearborn.ford.com>
Vincent M. Probasco (probavm@cat.com) wrote:
: I have a script where the user needs to input a number. I need to check
: to make sure that
: this number has exactly six digits. I looked in the camal manual and
: all I could find was how
: to count the number of distinct charaters in a string using tr//. Any
: help with this would be greatly
: appreciated. Thanks,
At a first cut, I'd try:
if((length($thestring)==6) && ($thestring =~ /^\d+$/)) ...
Which checks both the lenght and the contents to make sure that the
string contains nothing but the number.
--
Tom Harrington --------- tph@rmii.com -------- http://rainbow.rmii.com/~tph
"Oh, write of me not 'Died in bitter pains,' But 'Emigrated to
another star!'" -Helen Hunt Jackson
Cookie's Revenge: ftp://ftp.rmi.net/pub2/tph/cookie/cookies-revenge.sit.hqx
------------------------------
Date: Wed, 10 Jun 1998 19:11:31 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Number of digits in a string
Message-Id: <357EDBE0.2FC1@min.net>
Vincent M. Probasco wrote:
>
> I have a script where the user needs to input a number. I need to check
> to make sure that
> this number has exactly six digits. I looked in the camal manual and
> all I could find was how
> to count the number of distinct charaters in a string using tr//. Any
> help with this would be greatly
> appreciated. Thanks,
What, are you saying Llama doesn't talk about the length() built-in
function?
Or are you under the misapprehension that it doesn't work on numbers?
Remember, perl converts a number to a string if you try to use it
like a string (such as passing it to length()).
hth,
John Porter
------------------------------
Date: Wed, 10 Jun 1998 19:49:09 GMT
From: joel@wmi0.wmi.com (Joel Coltoff)
Subject: Re: Number of digits in a string
Message-Id: <6lmnup$4p2@netaxs.com>
In article <6lmkt8$2um1@eccws1.dearborn.ford.com>,
Tom Harrington <tph@rmi.net> wrote:
>
>At a first cut, I'd try:
>
>if((length($thestring)==6) && ($thestring =~ /^\d+$/)) ...
>
>Which checks both the lenght and the contents to make sure that the
>string contains nothing but the number.
And doesn't check for commas as in 123,456. Of course some people
on the other side of the pond use a different character to separate
the digits of numbers greater than 999.
--
Joel Coltoff
I'd explain it, but there's a lot of math. -- Calvin
------------------------------
Date: Wed, 10 Jun 1998 19:17:54 GMT
From: spiegler@cs.uri.edu
Subject: Perl database driver
Message-Id: <6lmm52$90s$1@nnrp1.dejanews.com>
Hi,
I'm a newer Perl programmer with a question...
I want to design a project using Perl scripts to perform CGI tasks in the
following way. We want a user to enter info to a form in a web browser to be
able to access graphical files from a database. That browser will push the
form data to a web server that will capture the query specifics and extract
the files of interest from the database and return it to the user as embedded
images in a web page.
I was told that this can be done by writing or recycling a database driver in
Perl that could query the database. Unfortunately, I know virtually nothing
about this process or how to do it. Can folks point me to some conceptual and
implementation information on how to approach this? On the web or in print is
fine.
I did a search on the web for a database driver, but don't understand enough
about what I am trying to accomplish to make sense of what I uncovered at
this point. I'm looking for more basic help with how to approach this
problem, I think.
I understand a bit about CGI and some Perl. I'm not sure how to interact with
theDB at this point.
Any help?
Thanks, Scott
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 10 Jun 1998 15:31:08 +0100
From: Yong Gao <yong@lynxhub.ho.att.com>
Subject: Perl on NT using iis 4.0
Message-Id: <357E98AB.4C6AF935@lynxhub.ho.att.com>
Folks,
I used Perl 5.003 on NT 4.0 and IIS4.0 for CGI purpose. Following code
works fine by using Perl xxx.pl and under cgi directory in IIS4.0 it
didn't work, taking the back tick out, this will work. As I got more
information, I tried using IIS2.0 and back tick worked. worked. Could
someone help me?
Thanks
Young my email is yong@lynxhub.att.com
select STDOUT; $|=1;
use strict;
print"Content-type: test/html\n\n";
print"<HTML> <BODY>";
my $information;
$information=`route print`;
if ($? != 0) {
print("failed in exec"); }
else {
print "directory is $information";
}
print"</BODY> <HTML>";
exit 0;
~
------------------------------
Date: Wed, 10 Jun 1998 18:40:36 GMT
From: ralanfox@hotmail.com
Subject: Re: RECOMMEND A PERL BOOK/RESOURCES ??
Message-Id: <6lmjv4$60c$1@nnrp1.dejanews.com>
In article <357BDEBF.4779@hotkey.net.au>,
Stephan Carydakis <step@hotkey.net.au> wrote:
>
> Hello All,
> I have a background in COBOL(yeah, yeah, i've heard most of the jokes!)
> but am very interested in Perl.
(Sincker)
>
> My wife bought me "Programming Perl" for Christmas, and I've been trying
> to learn Perl from this book. I realise its a tad beyond me(the "Grade
> Example" is still awesome in my books!) and am wondering if anyone could
> point me in the direction of a good Intermediate book that teaches Perl.
>
Also take a look at 'Learning Perl' from Oreilly. For web resoures -- try
http://perl.miningco.com.
>
Best of luck
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 10 Jun 1998 18:08:07 GMT
From: angst <angst@scrye.com>
Subject: Re: Run an batch via perl on NT
Message-Id: <6lmi27$ohu$3@jelerak.scrye.com>
fabrice besson <fabrice_besson@non-hp-france-om1.om.hp.com> wrote:
: The directory which contains x.html and y.pl
: are protected with and account administrator.
: The both file are everyone (full control).
: Why this command does not run correctly on the browser
: Probably a problem of right to execute this command ????
Sounds like a problem with execute permissions on the web server. If I were
you, I'd see what the documentation for your web server software has to say
about it.
--
Erik Nielsen <eln@rmci.net>
mail to above (rather than header address) is answered significantly faster.
this post != views of anyone at all, really
"You are like...unix GOD" -- local tech support
------------------------------
Date: 10 Jun 1998 18:09:36 GMT
From: angst <angst@scrye.com>
Subject: Re: Sorry for seperate posts
Message-Id: <6lmi50$ohu$4@jelerak.scrye.com>
HtmlPlace.Com <htmlmail@htmlplace.com> wrote:
: I have searched all my local book store for "Programming Perl" "The
: Camel Book" and "The Llama Book" and nobody in this little side street
: town has them or can order them is there a place I can buy them directly
: or indirectly through a phone number rather than giving my credit card
: number online ?
O'Reilly's order number, according to the back of the blue camel, is
800-889-8969.
--
Erik Nielsen <eln@rmci.net>
mail to above (rather than header address) is answered significantly faster.
this post != views of anyone at all, really
"You are like...unix GOD" -- local tech support
------------------------------
Date: Wed, 10 Jun 1998 19:06:33 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Sorry for seperate posts
Message-Id: <357EDAB3.563F@min.net>
HtmlPlace.Com wrote:
>
> I have searched all my local book store for "Programming Perl" "The
> Camel Book" and "The Llama Book" and nobody in this little side street
> town has them or can order them is there a place I can buy them directly
> or indirectly through a phone number rather than giving my credit card
> number online ?
Computer Literacy Bookshops: 800-789-8590
john Porter
------------------------------
Date: Wed, 10 Jun 1998 18:07:52 GMT
From: pinaula@email.unc.edu (D. Pinaula)
Subject: Re: stumped! inconsistent results of DB search
Message-Id: <357ec975.14313664@news.unc.edu>
On Wed, 10 Jun 1998 15:49:27 GMT, pinaula@email.unc.edu (D. Pinaula)
wrote:
>I'm hoping someone can help explain the odd results I get from a
>search of a flat-text file from an HTML form using checkboxes and one
>using a textbox.
*snip*
Some folks have been kind enough to email me possible solutions to my
problem (thanks!), but so far, no luck.
The most frequent assumption is that the checkbox search is returning
a @terms array that has no white space, making the split statement
useless. I should have said that the checkbox values all have a
trailing space, such that the array is apparently identical in both
search cases: terms separated by spaces.
I've posted the HTML results of the same search and the differing
results on a chopped-down version of the database, if that would help
clarify.
For the successful keyword search:
http://www.unc.edu/depts/jersaslc/good_res.htm
and the incomplete checkbox search:
http://www.unc.edu/depts/jersaslc/bad_res.htm
Thanks to those who've already tried to help, and thanks in advance to
those who might be able to solve the problem.
D. Pinaula
University of North Carolina at Chapel Hill
------------------------------
Date: Wed, 10 Jun 1998 18:47:09 GMT
From: Michael Burr <michael.n.burr@boeing.com>
Subject: Re: Win32: File glob causes floppy to chatter
Message-Id: <357ED4AD.119@boeing.com>
Jonathan Feinberg wrote:
>
> > I've noticed that every file glob causes the "A" drive to chatter as
> > if a seek is being done on it - only problem is I'm reading the C
> > drive!
>
> Patient: Doctor, it hurts when I do this.
> Doctor: Don't do that!
>
> Don't use globs on a box with a broken OS; use
> opendir/readdir/closedir.
Thanks for the input Jonathon - I am aware that readdir is an option.
However, I'm more interested in exactly why file globbing causes this
behavior. The blue camel book (p 55) states:
"The pattern is matched against the files in the current directory..."
Now Win95 may be broken... but it's certainly able to read the current
directory without doing seeks on non-related disks!
I think it may have something to do with the fact that globs start a new
process - but new processes typically don't cause disk seeks at start-up
(even on this broken OS). So I'm still looking for a more in-depth
understanding of what's going on.
--
Michael N. Burr, Programmer/Analyst
ALS Spares, Desktop Applications
M/S 35-62 (206) 662-5978
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.
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 2832
**************************************