[9876] in Perl-Users-Digest
Perl-Users Digest, Issue: 3469 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 17 19:08:05 1998
Date: Mon, 17 Aug 98 16:00:17 -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 Mon, 17 Aug 1998 Volume: 8 Number: 3469
Today's topics:
Re: "use vars qw(var)" -vs- "my $var" (Greg Bacon)
Re: "use vars qw(var)" -vs- "my $var" <jdf@pobox.com>
Re: "use vars qw(var)" -vs- "my $var" (Abigail)
Re: CGI on Browser (Bob Trieger)
Re: Converting to Uppercase to some Lower Case. <abarfoot@eng.auburn.edu>
Re: Downloading with perl script under IIS (Abigail)
Re: here's an implementation of diff in perl (Abigail)
how can i send out an email from cgi <xuchu@iscs.nus.edu.sg>
Re: How do you email an attached file using perl? (Abigail)
MD5 and perl <briant@packeteer.com>
PERL Problem (//ryb)
Re: PERL Problem (Alastair)
Re: PERL Problem (Bob Trieger)
Re: problem with multiple select and perl script html (Bob Trieger)
Re: Q: How to read all the file name in a directory (I R A Aggie)
Re: Q: How to read all the file name in a directory (I R A Aggie)
Re: Q: How to read all the file name in a directory (I R A Aggie)
Re: Q: How to read all the file name in a directory (Greg Bacon)
Re: Q: How to read all the file name in a directory (Greg Bacon)
Re: Random Number <grant.griffin@nospam.com>
Re: Random Number (Greg Bacon)
Win32::Console For Password Entry shawn_campbell@my-dejanews.com
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 17 Aug 1998 22:15:28 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: "use vars qw(var)" -vs- "my $var"
Message-Id: <6raa20$39o$8@info.uah.edu>
In article <35D8A39D.33E4F7F8@geoworks.com>,
Matt Armstrong <matta@geoworks.com> writes:
: What is the practical difference between "use vars qw(var)" and a "my
: $var" at file scope?
C<use vars> declares one or more dynamic (symbol table) variables.
C<my> declares one or more lexical variables. The only difference
in scoping (at file scope) is that you can see the dynamics from outside
that scope while this isn't the case for the lexicals. When talking
about Perl, I get very nervous if I say `the only way' or `there is
no way', so I'm probably forgetting something. :-)
: What package are variables placed in with "use vars?" Are they always
: place in 'main'? This seems reasonable, since the info docs say they
: are "global variable names."
They go in the current package.
: Can variables declared with "use vars" clash with other packages?
No. Packages partition the global namespace.
: What does "use vars" actually do (I already know what the documentation
: says -- namely that it'll make warnings go away -- I'd like to know why
: they go away).
It interacts with the internals in a magic way that no one (except
core hackers) needs to worry about. Be content to know that it
just works, or go read the source. :-)
: Traditionally, when using "use strict" and coming across situations
: where code was looking for an explicit package name, I just called the
: variables $main::whatever. How is "use vars" a superior solution?
It saves typing. :-) You can also sling dynamics around (and do
aliasing and lots of other fun stuff) with typeglobs, but you can't
with lexicals.
Hope this helps,
Greg
--
There are no facts, only interpretations.
-- Nietzsche
------------------------------
Date: 17 Aug 1998 18:30:23 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: Matt Armstrong <matta@geoworks.com>
Subject: Re: "use vars qw(var)" -vs- "my $var"
Message-Id: <4svbchkg.fsf@mailhost.panix.com>
Matt Armstrong <matta@geoworks.com> writes:
> What is the practical difference between "use vars qw(var)" and a
> "my $var" at file scope?
Well, the first is a syntax error -- "var" without a type specifier
like $, %, or @ is not a valid variable name. Let's assume you meant
"$var".
The first explicitly tells to compiler that there is a global variable
called "$var" in the current package. The second says that there's a
private variable called "$var" in the current scope. Other packages
can see the first var and manipulate it; they can never see the second.
> What package are variables placed in with "use vars?"
The current package. So that
package Monsoon;
use vars qw( @fig_newtons );
tells the compiler about the array @Monsoon::fig_newtons .
> Are they always place in 'main'? This seems reasonable, since the
> info docs say they are "global variable names."
All variables are global unless they're scoped with my(). Anybody can
see the package globals of any package. main is just another package,
the one you're in if you haven't said otherwise.
package P;
use vars '$x';
package R;
$P::x = 10;
package P; # we're back
print "$x\n";
> Can variables declared with "use vars" clash with other packages?
Nope.
> What does "use vars" actually do (I already know what the documentation
> says -- namely that it'll make warnings go away -- I'd like to know why
> they go away).
It makes the warnings go away. :)
It tells the compiler "Look, I know that some of these variables
appear in the following source code only once, but I promise you it's
on purpose, and that they're not just typos."
> Traditionally, when using "use strict" and coming across situations
> where code was looking for an explicit package name, I just called
> the variables $main::whatever. How is "use vars" a superior
> solution?
It's an idiomatic way of declaring (to both the compiler *and* to
maintenance programmers, such as yourself next week) that "I intend
for these to be package globals". The program doesn't run any
differently, but it sure makes a difference in how easy it is to
understand your code.
Your mission is to read perlmod, and perlfunc my() & local(). HTH.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
Date: 17 Aug 1998 22:47:38 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: "use vars qw(var)" -vs- "my $var"
Message-Id: <6rabua$p7f$2@client3.news.psi.net>
Matt Armstrong (matta@geoworks.com) wrote on MDCCCXII September MCMXCIII
in <URL: news:35D8A39D.33E4F7F8@geoworks.com>:
++ What is the practical difference between "use vars qw(var)" and a "my
++ $var" at file scope?
use vars qw /$var/; doesn't use file scoping. 'use vars' gives you
*package* variables.
++ What package are variables placed in with "use vars?" Are they always
++ place in 'main'? This seems reasonable, since the info docs say they
++ are "global variable names."
No. They are placed in the package. 'use vars' is often use for variables
like @ISA, $AUTOLOAD, @EXPORT, etc.
++ Can variables declared with "use vars" clash with other packages?
No, as they are placed in your current package.
++ What does "use vars" actually do (I already know what the documentation
++ says -- namely that it'll make warnings go away -- I'd like to know why
++ they go away).
It will use them fully qualified, hence the compiler has seen them.
So, if you later use such a variable before, the compiler will know
you didn't make a mistake.
++ Traditionally, when using "use strict" and coming across situations
++ where code was looking for an explicit package name, I just called the
++ variables $main::whatever. How is "use vars" a superior solution?
First, 'use vars' doesn't place the variables in main, but in the
current packaged. Second, it saves typing, often resulting in easier
to read code. Compare:
use vars qw /@ISA/;
@ISA = qw /Foo::Bar/;
@Flup::Fnord::Qweezle::ISA = qw /Foo::Bar/;
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: Mon, 17 Aug 1998 22:28:24 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: CGI on Browser
Message-Id: <6rab00$33m$1@strato.ultra.net>
[ posted and mailed ]
ikarydis@my-dejanews.com wrote:
-> Perl Scripts do not run on the client side, i.e Netscape Navigator or
-> Explorer but on the server side.
The above is false! Perl scripts run fine on just about any client.
-> What you need to do is either i)send the
-> script to your ISP to install it in the cgi-bin directory or ii) install a
-> web server on your machine, such as Peer Web Services or Internet Information
-> server if you use Windows NT, or Apache if you use Unix. You can also try the
-> Personal Web Server on Windows 95 but I'm not sure if it supports CGI.
Once again false. If you use CGI.pm (as everyone that knows what they are
doing, does) you can test your cgi scripts without using a browser and web
server.
HTH
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-400-1972
Ext: 1949 and let the jerk that answers know
that his toll free number was sent as spam. "
------------------------------
Date: Mon, 17 Aug 1998 16:55:27 -0500
From: andy barfoot <abarfoot@eng.auburn.edu>
To: Eric Pan <pan@part.net>
Subject: Re: Converting to Uppercase to some Lower Case.
Message-Id: <Pine.SOL.3.96.980817165440.5379I-100000@leahy.eng.auburn.edu>
s/[\w']+/\u\L$&/g
--
andy.barfoot@eng.auburn.edu
On Mon, 17 Aug 1998, Eric Pan wrote:
> I need to convert title of all my books from upper case to normal title
> sentences.
>
> For example, What is the easiest way to convert from
>
> IT'S EASY TO CONVERT
>
> to
>
> It's Easy to Convert.
>
> Thanks.
> --
> -- Eric Pan
>
>
>
>
------------------------------
Date: 17 Aug 1998 22:52:21 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Downloading with perl script under IIS
Message-Id: <6rac75$p7f$3@client3.news.psi.net>
Finn Calabro (fcalabro@aisvt.bfg.com) wrote on MDCCCXII September
MCMXCIII in <URL: news:35D8683D.2B7CEE94@aisvt.bfg.com>:
++ I need a script that will copy a document off the web (actually a Word
++ document public for our intranet) and store it on the server.
use LWP::UserAgent;
Abigail
--
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")\n-> define ("foldoc", "perl")) [0] -> print'
------------------------------
Date: 17 Aug 1998 22:41:51 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: here's an implementation of diff in perl
Message-Id: <6rabjf$p7f$1@client3.news.psi.net>
Tushar Samant (scribble@pobox.com) wrote on MDCCCXII September MCMXCIII
in <URL: news:6ra7jn$65e@tekka.wwa.com>:
++ abigail@fnx.com writes:
++ >Ilya Zakharevich (ilya@math.ohio-state.edu) wrote on MDCCCX September
++ >MCMXCIII in <URL: news:6r4lus$2as$1@mathserv.mps.ohio-state.edu>:
++ >++
++ >++ Sure not. Time to compare strings depends logarithmically on the
++ >++ length (if strings are randomly distributed, obviously this should be
++ >++ modified if there are common prefixes).
++ >
++ >Eh? If the time is sublinear, there must be characters not involved
++ >in the comparison. And if those characters are not involved - you
++ >don't know whether they are different.
++
++ True. Perhaps the desired "quality" setting might come from some
++ notion of approximate equality. For instance, two long strings
++ are equal if they are less than length 100 and equal, else we
++ pessimistically declare them unequal... This makes the
++ "comparison" constant time...
Yes, but the discussion about role lenght plays in comparison stems
from idea to compary k lines at once. So, taking an arbitrary limit
of 100 quickly degrades into uncomfortable short lines.
++ Armchair idea #2: don't redefine what your "lines" are, but
++ split up the files into chunks and concatenate optimal diffs on
++ corresponding pairs of chunks.
But that isn't helping much, as there are many places where the
chunks can start for optimal matching.
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET", "http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content)) =~ /(.*\))[-\s]+Addition/s) [0]'
------------------------------
Date: 17 Aug 1998 11:21:44 GMT
From: wings <xuchu@iscs.nus.edu.sg>
Subject: how can i send out an email from cgi
Message-Id: <6r93o8$nth11@id4.nus.edu.sg>
i did a search for relevant topics in this newsgroup. many ppl mention about
NET::SMTP module, and i went for search engine and downloaded sth called
libnet. but how to get it run? i am using NT.. o/w i think a system call to
mail program can work.
i also read the readme of libnet package and it showed the four steps:
perl Makefile.PL
make
make test
make install
but where is the 'make' in perl package? i am using ActiveWare Perl5.005.
thx for any help/suggestions.
--
wings
------
World is a book, those dont travel read only one page.
Email: xwings@usa.net, xuchu@iscs.nus.edu.sg
ICQ UIN: 1440319
http://gump.iscs.nus.edu.sg
------------------------------
Date: 17 Aug 1998 22:58:44 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: How do you email an attached file using perl?
Message-Id: <6racj4$p7f$4@client3.news.psi.net>
C. K. (ccorrigan@bradson.com) wrote on MDCCCXII September MCMXCIII in
<URL: news:6ra5qp$9ar$1@nr1.ottawa.istar.net>:
++ Hi,
++
++ How do you send an attached file with sendmail from a form in perl?
There's nothing special about an "attached" file from sendmails
point of view. There's a header, and a body. "Attached files" is
an expensive word for "well, we could have used tar or shar, but
why not do something different".
++ I'm creating a form where the user can select which file they want to send
++ and the email address they want to send it to.
Good for you.
Abigail
--
perl -weprint\<\<EOT\; -eJust -eanother -ePerl -eHacker -eEOT
------------------------------
Date: Mon, 17 Aug 1998 15:36:48 -0700
From: Brian Tiemann <briant@packeteer.com>
Subject: MD5 and perl
Message-Id: <35D8B080.B37AC7E8@packeteer.com>
Okay-- I'm probably missing something here, but yet again I'll bite:
Has anyone done an MD5 module in perl? And I don't mean MD5.pm; that's
just a perl interface to compiled C code. I mean an actual
implementation of the MD5 hashing routine in pure perl.
I'm kind of surprised that MD5.pm is as prevalent as it is, since it
seems to me that perl's entire philosophy is oriented towards
platform-independence and no precompiled code. Is it because of some
fundamental limitation in perl (hard to believe), or something about
copyrights? I've seen MD5 implemented in JavaScript and Visual Basic
now; I need to collect the whole set to win. :)
Thanks!
Brian
------------------------------
Date: Mon, 17 Aug 1998 22:19:21 GMT
From: mike@@@masterlink.REMOVE.com (//ryb)
Subject: PERL Problem
Message-Id: <91CAACDD4F94A2CF.076E8311A7030280.26D26D49A9FEDC2E@library-proxy.airnews.net>
I have PERL 5.0 on WinNT with IIS3.0
The Perl scripts run for about 5 days and then PERL stops responding.
When I reboot the machine everthing works, but in about 5 days it
quits again.
Has anyone run into this problem and have a solution?
Thanks,
W
------------------------------
Date: Mon, 17 Aug 1998 22:47:31 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: PERL Problem
Message-Id: <slrn6thgdo.4n.alastair@calliope.demon.co.uk>
//ryb <mike@@@masterlink.REMOVE.com> wrote:
>
>I have PERL 5.0 on WinNT with IIS3.0
>The Perl scripts run for about 5 days and then PERL stops responding.
>When I reboot the machine everthing works, but in about 5 days it
>quits again.
>
>Has anyone run into this problem and have a solution?
This sounds like a problem with the OS not Perl.
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: Mon, 17 Aug 1998 22:43:38 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: PERL Problem
Message-Id: <6rabsg$33m$2@strato.ultra.net>
mike@@@masterlink.REMOVE.com (//ryb) wrote:
->
-> I have PERL 5.0 on WinNT with IIS3.0
-> The Perl scripts run for about 5 days and then PERL stops responding.
-> When I reboot the machine everthing works, but in about 5 days it
-> quits again.
->
-> Has anyone run into this problem and have a solution?
Which version of perl 5.0 are you using? I run the standard win32 port
5.004_02 on my NT 4.0 servers with IIS 3.0 and the servers go for months
without problem or a reboot.
Sounds like you need to fine tune the server or upgrade your perl.
PS. don't `upgrade' to IIS 4.0, administering it remotely is nearly
impossible.
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-400-1972
Ext: 1949 and let the jerk that answers know
that his toll free number was sent as spam. "
------------------------------
Date: Mon, 17 Aug 1998 22:47:57 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: problem with multiple select and perl script html
Message-Id: <6rac4k$33m$3@strato.ultra.net>
[ posted and mailed ]
fatshit@hotmail.com wrote:
-> I have a multiple select with 16 entries, and would like to store those value
-> in an array. however only the first one comes back after submitting the
-> form. Then I changed it to check boxes, and that did'nt work either. Any
-> suggestions.
Use CGI.pm. It is extremely well documented and you should be able to solve
this problem in no time.
HTH
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-400-1972
Ext: 1949 and let the jerk that answers know
that his toll free number was sent as spam. "
------------------------------
Date: Mon, 17 Aug 1998 17:04:05 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Q: How to read all the file name in a directory
Message-Id: <fl_aggie-1708981704050001@aggie.coaps.fsu.edu>
In article <35D69B00.4431@iowegian.com>, grant.griffin@iowegian.com wrote:
+ I R A Aggie wrote:
+ > No. A car is a complex system, and has many features you may not be
+ > familiar with. Anti-lock brakes, for instance. Unless told, most people
+ > will not be able to tell you, for sure, how its done. Writing things down
+ > is an old and honored tradition of passing information, knowledge and
+ > ideas.
+ Actually, I understood about the anti-lock brakes. There wasn't
+ anything to understand, really: they just come on automatically as
+ needed when I push the pedal.
Ah, but I had a "normal" braking system. I learned to pump my brakes myself.
That defeats the purpose of the anti-lock system, which is supposed to do
the pumping action for you. When I got a car with ABS installed, it came
as a bit of a surprise that I no longer had to do the pumping, and actually
had to break myself of the habit.
+ Is there a good reason why the air conditioner should be so difficult to run
It ain't your daddy's Pontiac... :) You now have zone cooling, where he's
comfy at 68, and she's comfy at 72, sitting side-by-side. Fortunately,
I have an old fashioned...
+ You must have a slow time traveling, having to stop and read the manual
+ of each complex automobile system you rent! ;-)
I usually take a few minutes to familiarize myself with the instrument
layout before I turn the key over. Fortunately, the base knowledge of
how to operate a vehicle hasn't changed a great deal over the last 100
years.
James
------------------------------
Date: Mon, 17 Aug 1998 16:53:29 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Q: How to read all the file name in a directory
Message-Id: <fl_aggie-1708981653290001@aggie.coaps.fsu.edu>
In article <6r9ts9$nj@fridge.shore.net>, Scratchie <upsetter@ziplink.net> wrote:
+ I R A Aggie <fl_aggie@thepentagon.com> wrote:
+
+ : Ah, you mean like the baby grad-level stats course I took? where on
+ : the first day the guy next to me asked "whats a mean?" and I simply
+ : groaned?
+
+ You mean you didn't say "What kind of stupid idiot are you for coming into
+ this course without knowing what a mean is? It's you slobbering
+ wannabe-stats-mongers that are destroying our educational system!!" ???
He was paying for it, just like I was. That no one bothered to enforce the
pre-reqs wasn't his fault. Thus why one should be an informed consumer.
I'll tell you what, Art, you give me a buck for every FAQ I answer politely.
I bet I'll answer a whole bunch of 'em real politely. Unless you're Bill the
Gates in disguise, you'll go broke before I run out of clients...
+ How is he supposed to learn if all you did was groan?
I left that to whatever resources he could muster, and the instructor.
Perhaps I should just quote a Dilbert to those who choose not to read:
<---------snip and keep handy--------->
Dogbert's Tech Support
I think I know what your problem is...
Take all the parts and arrange them in neat piles. Now stand on your
chair so you can see above your cubicle wall.
Now shout "Does anybody know how to read a manual?"
<---------snip and keep handy--------->
James
------------------------------
Date: Mon, 17 Aug 1998 17:12:07 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Q: How to read all the file name in a directory
Message-Id: <fl_aggie-1708981712070001@aggie.coaps.fsu.edu>
In article <35D85077.9DD0DE55@nospam.com>, Grant Griffin
<grant.griffin@nospam.com> wrote:
+ But I submit to you that only the truly _masochistic_ would read the manual on
+ a system which is so natural and intuitive to use that you don't have to. For
Who's making you? no one here. If that's what you think "read the damn docs"
means, then you're mistaken. Badly.
+ example in reaching my "journeyman" level of Perl competancy, I have read well
+ over half of "Programming Perl" in bits and pieces--but I certainly have no
+ ambition to read it cover-to-cover.
But you do admit to having read those parts that where of interest to you.
And they where of interest to you because they shed light upon a problem
you where trying to work thru?
+ Likewise, I have no desire (or time) to
+ read all 1000+ pages of on-line Perl documentation.
That's why there are things like 'grep' around.
James
------------------------------
Date: 17 Aug 1998 22:38:11 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: Q: How to read all the file name in a directory
Message-Id: <6rabcj$39o$9@info.uah.edu>
In article <fl_aggie-1708981653290001@aggie.coaps.fsu.edu>,
fl_aggie@thepentagon.com (I R A Aggie) writes:
: I'll tell you what, Art, you give me a buck for every FAQ I answer politely.
: I bet I'll answer a whole bunch of 'em real politely. Unless you're Bill the
: Gates in disguise, you'll go broke before I run out of clients...
<AOL>Me too!!!11!!1</AOL>
Greg
--
The most incomprehensible thing about the universe is that it is
comprehensible.
-- Albert Einstein
------------------------------
Date: 17 Aug 1998 22:42:13 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: Q: How to read all the file name in a directory
Message-Id: <6rabk5$39o$10@info.uah.edu>
In article <35D5958F.7AC9@iowegian.com>,
Grant Griffin <grant.griffin@iowegian.com> writes:
: In an ideal world, any given gizmo would be so easy to use that nobody
: would _have to_ read the manual! (Not that Windows is even remotly
: _close_ to that goal.) For example, I just bought a new car. Do I want
: to read the manual? No. Did I have to? Yes. The people who designed
: the car screwed up.
Feel free to design a programming language for which a reasonable
person does not have to read the manual. Soon after, you may find
yourself a professor at MIT or Stanford or Berkeley.
Good luck, and you may now pick up your pencil.
Greg
--
When Zarathustra had spoken these words, he again looked at the
people, and was silent. "There they stand," said he to his heart;
"there they laugh: they do not understand me; I am not the mouth for
these ears. -- Nietzsche
------------------------------
Date: Mon, 17 Aug 1998 16:36:16 -0500
From: Grant Griffin <grant.griffin@nospam.com>
To: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Random Number
Message-Id: <35D8A250.72018491@nospam.com>
Jonathan Feinberg wrote:
> Also, both currently available "official" binary distributions of perl
> for win32 come with Friedl's excellent "search" script, ready to run.
> I use it constantly. Allows arbitrary regexen, and many options. For
> example:
>
> search -dir c:\perl -name *.pod -nice [Ll]owercase
>
> Some distributions of search.bat require an additional command line
> parameter, -win .
>
> Also, NT comes with the built-in FINDSTR command, like:
>
> findstr /m lowercase C:\perl\lib\pod\*.*
Well, see there, I just learned two more things! Thanks.
Still, you have to admit that newbies who immediately receive buckets of
scorn face a sort of chicken-and-egg problem here: they won't look for
grep or it's kin until told what and where it is. Perhaps if a brief
explanation of the whole grep concept, along with the ways suggested
above, were added in big letters to NathanT's "Message to New Posters",
then poor TomC and others would have less scorn to pour.
Another idea is to add a big link to the Perl FAQ and/or a search engine
(we _have_ the technology!) to some of the primary Perl web sites.
Honestly, the FAQ does not jump off the screen at you, starting from
http://www.perl.org/. (I _still_ don't know how to find it from there.)
Also, nearly everybody must visit the "Acquiring Software" page at least
once: why not link to it there. Likewise, when I look at the "Perl
Support" page, http://www.perl.org/support.html, it doesn't say, "You
should grep your documents first, then see the Perl FAQ, then master Perl,
then call us", it says, "Many of our members also answer questions in the
Usenet newsgroup comp.lang.perl.misc."
I am convinced that if The Big Guns of Perl _truly_ wanted to reduce the
"dumb question" problem, they could make a bigger dent in the problem with
much less effort simply by making the Perl web pages more slanted towards
"Read the facts first, idiot". (To TomC: My apologies, if any of of these
simple ideas get adopted, thus ruining some of your fun.)
=g2
------------------------------
Date: 17 Aug 1998 22:48:15 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: Random Number
Message-Id: <6rabvf$39o$11@info.uah.edu>
In article <35D8A250.72018491@nospam.com>,
Grant Griffin <grant.griffin@nospam.com> writes:
: I am convinced that if The Big Guns of Perl _truly_ wanted to reduce the
: "dumb question" problem, they could make a bigger dent in the problem with
: much less effort simply by making the Perl web pages more slanted towards
: "Read the facts first, idiot". (To TomC: My apologies, if any of of these
: simple ideas get adopted, thus ruining some of your fun.)
Not proclaiming myself a Big Gun, but the set of people who have control
over the content of the pages at www.perl.com has a very small
cardinality relative to the cardinality of the set of the Big Guns of
Perl. Besides, who needs the flipping web when the entire docset is
already on your machine if you have Perl?
If you give the `man perl' or `perldoc perl' (and lots of others on
other platforms) you find this very near the top:
perlfaq Perl frequently asked questions
Maybe we should change that to Perl for Dummies. :-(
Greg
--
It has been discovered that C++ provides a remarkable facility for concealing
the trival details of a program--such as where its bugs are.
-- David Keppel
------------------------------
Date: Mon, 17 Aug 1998 22:04:10 GMT
From: shawn_campbell@my-dejanews.com
Subject: Win32::Console For Password Entry
Message-Id: <6ra9cp$p41$1@nnrp1.dejanews.com>
I went to the archives for this solution. It is exactly what I need. One
problem however; if the user
enters a zero, the line-
$key = $Console->InputChar(1) || die "Error reading character";
fails. What if my user has a zero in their username or password?
Note- I have tried every other character on the keyboard, and only the zero
fails.
Any help would be greatly appreciated. Also, I am using ActiveState's vs.
5.00501, but have also tried it with the GS port.
Thanks,
Shawn Campbell
shawn.campbell@janus.com (please respond via e-mail, thanks)
> Thanks, Aldo!
>
> That did the trick. Thanks also to everyone else
that helped. Here's
> my working result:
>
> use Win32::Console;
> $Console = new Win32::Console(STD_INPUT_HANDLE)
|| die "Error creating
> console";
> $Console->Mode(ENABLE_PROCESSED_INPUT) || die
"Error setting console
> mode";
> $username = "";
> print("Enter your username: ");
> while(1) {
> $key = $Console->InputChar(1) || die "Error
reading character";
> if ($key ge "!" and $key le "~") { # ! to ~
legal
> $username .= $key;
> print("$key");
> } elsif (($key eq "\t" || $key eq "\r") &&
length($username) > 0) { #
> Tab or Enter
> print "\n";
> last;
> } elsif ($key eq "\b") { # ^H/backspace
> print "\b \b";
> chop $username;
> } elsif ($key eq "\cu") { # ^U/clearline
> print "\b \b" x length $username;
> $username = "";
> } elsif ($key eq "\e") { # escape
> exit 0;
> } else {
> ; # illegal
> }
> }
> $password = "";
> print("Enter your password: ");
> while(1) {
> $key = $Console->InputChar(1) || die "Error
reading character";
> if ($key ge "!" and $key le "~") { # ! to ~
legal
> $password .= $key;
> print("*");
> } elsif (($key eq "\t" || $key eq "\r") &&
length($password) > 0) { #
> Tab or Enter
> print "\n";
> last;
> } elsif ($key eq "\b") { # ^H/backspace
> print "\b \b";
> chop $password;
> } elsif ($key eq "\cu") { # ^U/clearline
> print "\b \b" x length $password;
> $password = "";
> } elsif ($key eq "\e") { # escape
> exit 0;
> } else {
> ; # illegal
> }
> }
> print("Username is $username and Password is
$password.\n");
Aldo Calpini wrote: > > Tom Cameron wrote: > >[...] > >I'm having
trouble with various aspects of this, mainly the strange > >behavior of the
InputChar() function and how it handles a <TAB>. I've > >written a small
loop around it, but I'm getting what I expect: > > > >use Win32::Console;
> > > >$Console = new Win32::Console(STD_INPUT_HANDLE) || die "Error
creating > >console"; > >$Console->Mode(ENABLE_LINE_INPUT) || die "Error
setting console mode"; > > just add this: > >
$Console->Mode(ENABLE_PROCESSED_INPUT) || die "Error setting console mode";
> > (pls don't ask me why, the gory details are in the Microsoft's SDK
docs). > > Bye, > Aldo Calpini > <dada@romagiubileo.it> > > "Out the
10Base-T, through the router, > down the T1, over the leased line, > off
the bridge, past the firewall, > ...nothing but Net." > -- (Author unknown)
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3469
**************************************