[10368] in Perl-Users-Digest
Perl-Users Digest, Issue: 3961 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 13 11:07:50 1998
Date: Tue, 13 Oct 98 08:00:20 -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 Tue, 13 Oct 1998 Volume: 8 Number: 3961
Today's topics:
Re: ActiveState Perl evaluation...questions <jdf@pobox.com>
Alpha and MacPerl problem persists (Richard S. Holmes)
Re: Are there any "perl.newbie" group or forum? (Joergen W. Lang)
Re: Are there any "perl.newbie" group or forum? (Greg Bacon)
building perl on Windows NT with MSVC5 teds@intex.com
CGI and Perl <homer@coventry.ac.uk>
Re: CGI and Perl <michael_mongeau@stratus.com>
Creating an unreadable perl executable <mferg@hal.ddntl.didata.co.za>
Re: Creating an unreadable perl executable <ludlow@us.ibm.com>
Re: Differentiating between STDOUT and STDERR <jdf@pobox.com>
encryption (Orlando Frooninckx)
Re: I think its a greediness issue <jdf@pobox.com>
Re: Is Perl threaded <msergeant@ndirect.co.uk_NOSPAM>
Re: Mail on NT scott@softbase.com
Re: Monitoring memory use/Running out of memory (M.J.T. Guy)
Re: Need help with time function (r j huntington)
Re: Need IP Address Sort Subroutine <garry@america.net>
Newbie needs help transposing two words in a file (Bitstream)
Re: Newbie needs help transposing two words in a file <michael_mongeau@stratus.com>
Re: Odd number of elements (Jeff Schramm)
Re: Odd number of elements <jdf@pobox.com>
Re: Perl freezes when using special characters in HTML <jdf@pobox.com>
Re: Search Engine `Stop' Words (Snowhare)
stat vs -s purring@earthlink.net
Re: stat vs -s (Mike Stok)
typing test <sobocinski@msx.upmc.edu>
Re: typing test <matt@whiterabbit.co.uk>
Re: Using perldoc -m Module_name <jdf@pobox.com>
Re: which chars to escape in reg.exp? (M.J.T. Guy)
Re: which chars to escape in reg.exp? <dgris@perrin.dimensional.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 13 Oct 1998 15:55:49 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: "Ray Smith" <smithr@lexma.meitech.com>
Subject: Re: ActiveState Perl evaluation...questions
Message-Id: <m37ly4o9ay.fsf@joshua.panix.com>
"Ray Smith" <smithr@lexma.meitech.com> writes:
> 2. Debugging... When I try to use the debugger (via -d switch) to
> debug the above problem.
> a. I get a deluge of "Use of uninitialized value at
> d:\pasdebug\PerlDB.pl line 644." messages
> b. then I get a message saying "No License Key was found"
> c. When I continue the debugger exits upon the "Goto undefined
> subroutine" error.
That is not the Perl debugger. I'm guessing you installed some
third-party debugger at some point in the past, and that you have
defined the PERL5DB environment variable to point to this other
debugger.
Your message was very hard to read.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: 13 Oct 1998 10:55:02 -0400
From: rsholmes@rodan.syr.edu (Richard S. Holmes)
Subject: Alpha and MacPerl problem persists
Message-Id: <xzc7ly4wlyx.fsf_-_@rodan.syr.edu>
In article <6vu619$imp$1@clarknet.clark.net> schinder@leprss.gsfc.nasa.gov (Paul J. Schinder) writes:
>In <xzcbtnhrc3f.fsf@rodan.syr.edu> rsholmes@rodan.syr.edu (Richard S. Holmes) writes:
>
>>With some older versions of Alpha and MacPerl I had no problems
>>editing a script in Alpha and sending it to MacPerl to run. But no
>>longer -- now I get
>
>># Illegal character \012 (carriage return).
>>File 'Untitled'; Line 2
>># (Maybe you didn't strip carriage returns after a network transfer?)
...
>Open the file again. Look at Alpha's status bar (the bar that runs
>along the bottom of the screen). The kind of linebreaks that the file
>has will be indicated; it will say one of Mac, Unix or IBM. Make sure
>that the file has Mac linebreaks...
The file has Mac linebreaks.
Let me clarify: I downloaded new versions of Alpha and MacPerl,
started both, opened a new document in Alpha, typed 'print "Hello
world\n";', set Perl mode, and selected "Run the buffer" under the
Camel menu. The status bar verifies that the file has Mac
linebreaks. Perl gives the aforementioned error.
...
>>This is using Alpha 7.1 and MacPerl 5.2.0r4 on a PowerMac G3 running
>>Mac OS 8.1. Any ideas? Any FAQs I should have read? Thanks.
I get the same error on a PowerMac 7200/90 running Mac OS 7.5.5, too.
For a screen shot see <http://web.syr.edu/~rsholmes/alphaperl.JPG>.
--
- Rich Holmes
Syracuse, NY / We have more important things to do...
Newport News, VA Censure and move on! Sign the petition at
rsholmes@earthling.net <http://www.moveon.org>
------------------------------
Date: Tue, 13 Oct 1998 13:06:58 +0100
From: jwl@_munged_worldmusic.de (Joergen W. Lang)
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <1dgtg6q.i2i81g1l63mpoN@host047-210.seicom.net>
David Adler <dha@panix.com> wrote:
> On Sun, 11 Oct 1998 11:31:26 -0500, I R A Aggie
> <fl_aggie@thepentagon.com> wrote:
>
> >the Camel (Programming Perl), the Ram (Perl Cookbook) and the Owl
> >(Mastering Regular Expressions) books on my computer desk. Oh, and
> >the Rommel Papers, for a little light reading. I guess you could call
> >that the Tank Book... :)
>
> For heaven's sake, don't give O'Reilly any ideas! :-)
>
> Dave, waiting for the Brannock Device book...
mind you ! there's _germans_ reading this thread ;-))
Joergen
--
To reply by email please remove _munged_ from address Thanks !
-------------------------------------------------------------------
"Everything is possible - even sometimes the impossible"
HOELDERLIN EXPRESS - "Touch the void"
------------------------------
Date: 13 Oct 1998 14:51:48 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <6vvpe4$3t3$3@info.uah.edu>
In article <8c1zodf5mj.fsf@gadget.cscaper.com>,
Randal Schwartz <merlyn@stonehenge.com> writes:
: >>>>> "Russ" == Russ Allbery <rra@stanford.edu> writes:
:
: Russ> [...] and Perl isn't that good of a language to learn how to program in
: Russ> (yes, I know some people with strong qualifications disagree with me on
: Russ> that score...).
:
: You won't find me disagreeing. Maybe that means I don't have strong
: qualifications. :)
...or that you're just affirming the consequent. :-)
Greg
--
Improve the postal system -- mail their pay checks!
------------------------------
Date: Tue, 13 Oct 1998 13:58:28 GMT
From: teds@intex.com
Subject: building perl on Windows NT with MSVC5
Message-Id: <6vvma4$kt5$1@nnrp1.dejanews.com>
Hi,
I downloaded the latest perl from CPAN built perl using MSVC5.0.
The compile and test ran correctly. When I do
nmake install,
it starts installing perl into a directory which is not the one I
specified at the top of makefile.mk. It seems to find my existing
perl directory and stuff things in there.
The Installation finishes and then I start getting many messages like
..\installhtml: ../pod/*.pod: can't resolve L<h2xs> ...
Am I doing something wrong?
Thanks,
Ted
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 13 Oct 1998 14:23:10 +0100
From: Jonathan Homer <homer@coventry.ac.uk>
Subject: CGI and Perl
Message-Id: <Pine.OSF.3.91.981013141817.9723B-100000@leofric>
I'm new to the world of HTMl and "web" related stuff , but I understand
that it is possible to link a database to a web page via Perl (CGI).
Could any one out there please validate this , and offer any suggestions
as to any sources of info on the web that would teach me how to do this
quickly , I want to connect an Access 97 db running under NT. I do have
experience with quite a few other languages but (as mentioned) none with
Perl so I'll apologise in advance if this is a "thick" question. :-)
Many thanks
Jon.
------------------------------
Date: Tue, 13 Oct 1998 10:50:25 -0400
From: "Michael Mongeau" <michael_mongeau@stratus.com>
Subject: Re: CGI and Perl
Message-Id: <6vvp8t$847@transfer.stratus.com>
Jonathan,
I've written some CGI scripts that use Access97 databases. You'll need 2
modules: CGI.pm and Win32::ODBC.pm. They're both available at your nearest
CPAN. CGI.pm simplifies the creation of CGI programs and ODBC.pm allows
you to connect to ODBC data sources. See the documentation that comes with
both modules.
Michael Mongeau
michael_mongeau@stratus.com
Jonathan Homer wrote in message ...
>
>I'm new to the world of HTMl and "web" related stuff , but I understand
>that it is possible to link a database to a web page via Perl (CGI).
>
>
>Could any one out there please validate this , and offer any suggestions
>as to any sources of info on the web that would teach me how to do this
>quickly , I want to connect an Access 97 db running under NT. I do have
>experience with quite a few other languages but (as mentioned) none with
>Perl so I'll apologise in advance if this is a "thick" question. :-)
>
>
>Many thanks
>
>Jon.
------------------------------
Date: Tue, 13 Oct 1998 15:39:13 -0200
From: Mark Fergusson <mferg@hal.ddntl.didata.co.za>
Subject: Creating an unreadable perl executable
Message-Id: <36239041.C003F101@hal.ddntl.didata.co.za>
Hello,
How do I make an unreadable perl executable, (even with root
permissions) ? Is there some perl conversion program ?
Thanks.
--
_____________________________________________
Mark Fergusson: mferg@hal.ddntl.didata.co.za
Dimension Data:
PO Box 236, Pavillion, 3611, South Africa
(+27)-31-204-8424 (Work)
(+27)-31-204-8590 (Fax)
082-771-8519 (Cell)
------------------------------
Date: Tue, 13 Oct 1998 09:26:11 -0500
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: Creating an unreadable perl executable
Message-Id: <36236303.B36A896D@us.ibm.com>
Mark Fergusson wrote:
> How do I make an unreadable perl executable, (even with root
> permissions) ? Is there some perl conversion program ?
Luckily, the FAQ isn't unreadable (just unread).
http://www.perl.com/CPAN-local/doc/FAQs/FAQ/PerlFAQ.html#How_can_I_compile_my_Perl_progra
Also, be sure to check Dejanews. This topic has been asked and answered
many times before.
--
James Ludlow (ludlow@us.ibm.com)
Disclaimer: This isn't technical support, and all opinions are my own.
------------------------------
Date: 13 Oct 1998 15:52:21 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: vwstranathan@mailexcite.com
Subject: Re: Differentiating between STDOUT and STDERR
Message-Id: <m3af30o9gq.fsf@joshua.panix.com>
vwstranathan@mailexcite.com writes:
> What I need to be able to do though is this.
>
> print NEWSOCKET `ls -la /usr`;
> print NEWSOCKET `ls -la /foo`;
>
> And have the first line prepend each line with "STDOUT: ", and the second
> (assuming /foo doesn't exist) prepend each line with "STDERR: ".
>
> I have both STDOUT and STDERR going to the NEWSOCKET handle, it's just that I
> need to be able to let the client application know which came from where.
You'll probably want to use tied filehandles, into which you'll dup
the STDOUT and STDERR of your system process. If the preceding
sentence means nothing to you, then you have some reading to do. See
perlipc, perltie, and perlfunc for open().
I wonder why you're not using opendir/readdir.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Tue, 13 Oct 1998 13:23:07 GMT
From: Frook@mail.dma.be (Orlando Frooninckx)
Subject: encryption
Message-Id: <362353d9.102519675@193.74.210.130>
hi,
does anyone have a nice encryption function example so I can crypt
sentences before writing them to a file?
thanks,
Orlando (of@dma.be)
========================================================
Orlando Frooninckx
- - - - - - - - - - - - - - - - -
E:mail: of@lms.be - of@ping.be - Frook@mail.dma.be
URL: www.ping.be/crossbreed - bewoner.dma.be/Frook
---------------------------------------------------------------------------------------------------------
------------------------------
Date: 13 Oct 1998 15:44:09 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: Hampton Keathley <hamptonk@bible.org>
Subject: Re: I think its a greediness issue
Message-Id: <m3d87wo9ue.fsf@joshua.panix.com>
Hampton Keathley <hamptonk@bible.org> writes:
> I'm working on cleaning up a few thousand theological journal articles
> in SGML.
>
> I have to get all the footnote links out from between the foreign
> language tags.
You should immediately cease and desist in your efforts to apply
regular expressions to this problem, and instead use the HTML::Parser
module and its kin. According to the docs, HTML::Parser will work just
fine with SGML. Available at the CPAN.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Tue, 13 Oct 1998 14:15:15 +0100
From: Matt Sergeant <msergeant@ndirect.co.uk_NOSPAM>
Subject: Re: Is Perl threaded
Message-Id: <36235263.F0E53B3@ndirect.co.uk_NOSPAM>
Eeke wrote:
>
> I am using ActiveState's Perl for Win32, with Microsoft's IIS webserver,
> and connecting to various databases via ODBC. I have gotten some
> impressive performance all things considered, but am considering
> "upgrading" to using perlEx (also from ActiveState). I am tring to
> thresh out the pro's and con's of regular 'ol perl vs. perlEx. Is perl
> threaded, e.g. if two simultaneous calls come in for similar perl
> programs that require database connectivity, is one blocked before the
> other can begin ? How about perlEx ? I have been under the impression
> that good ODBC drivers are multi-threaded, but I imagine that if I use
> perlEx's BEGIN and END blocks, I will defeat that. Any suggestions or
> comments would be greatly appreciated.
It's not really to do with threads on the perl side, but threads on the
server side. Since IIS is multithreaded it's not an issue. (BTW: Don't
confuse this with threaded perl which is a whole other issue). PerlEx
will give you the best performance on IIS compared with any language
engine out there because it does one-time compilation. You should get
performance equivalent to mod_perl running apache on Linux.
If you have any more questions I recommend contacting Activestate -
since PerlEx is a commercial product they are more than willing to give
you all the marketing doobry on it.
--
<Matt/>
| Fastnet Software Ltd | Perl in Active Server Pages |
| Perl Consultancy, Web Development | Database Design | XML |
| http://come.to/fastnet | Information Consolidation |
------------------------------
Date: 13 Oct 1998 13:33:50 GMT
From: scott@softbase.com
Subject: Re: Mail on NT
Message-Id: <362356be.0@news.new-era.net>
Mike Pritchard (mikep@5circles.com) wrote:
> I want to send MAPI mail in a Perl script running on Windows NT.
You can try, but it won't work. MAPI, particularly the
Automation interface, is totally and completely
broken. Even changing e-mail clients will break it.
Don't use it.
> Are there alternatives?
USE SMTP!!! Do not use MAPI.
Scott
------------------------------
Date: 13 Oct 1998 13:30:52 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Monitoring memory use/Running out of memory
Message-Id: <6vvkmc$p7a$1@pegasus.csx.cam.ac.uk>
In article <361BFC09.9242555D@vsol.com>, Adam Morgan <amorgan@vsol.com> wrote:
>I am using Perl 5.0 Patchlevel 4 subversion 4 on Solaris 2.5.1.
>
>I have a program that says it runs out of memory, but when monitoring it
>using top it doesn't seem to get above 10meg with 100 meg free. It
>doesn't appear to consume the free memory while it grows to 10 meg
>either. I have run the same program with the same data previously and
>there has been no problem with it. Does anyone know how to monitor
>memory use in Perl? Has anyone come across this sort of problem before?
>I am using a number of hash tables in the program which I undefine
>periodically to try to conserve memory.
What error message do you get? Perl will say "Out of memory", without
actually allocating much memory, if you ask for a stupid amount,
such as with
$#x = 2000000000;
Mike Guy
------------------------------
Date: 13 Oct 1998 13:39:16 GMT
From: wolph@merlin.albany.net (r j huntington)
Subject: Re: Need help with time function
Message-Id: <6vvl64$mvd$1@news.monmouth.com>
Many thanks to all those who replied, either in this group
or by direct mail. I've now got some good ideas and starting
points. Thanks again, rh
------------------------------
Date: Tue, 13 Oct 1998 13:03:51 GMT
From: "Garry T. Williams" <garry@america.net>
Subject: Re: Need IP Address Sort Subroutine
Message-Id: <3623500F.78639264@america.net>
Joe Williams wrote:
[...]
> the most importance. Actually, you could sort on the binary number as well,
> but I assume Perl's
> built in sort routine sorts on decimal numbers written in ASCII, and that
> won't work well on this
> kind of structure. Right?
Then you run into the problem of some machines interpreting the four
byte strings as *signed* integers. That makes addresses "above"
127.255.255.255 sort low. There seems to be no portable way of using a
numeric compare of four byte strings when you want to treat them as
*unsigned* integers.
-Garry Williams
------------------------------
Date: Tue, 13 Oct 1998 13:36:59 GMT
From: bitstream@excite.com (Bitstream)
Subject: Newbie needs help transposing two words in a file
Message-Id: <6vvl2f$4er$1@fir.prod.itd.earthlink.net>
I'm a Perl newbie and am having difficulty trying to transpose two words in a
file...for example the file contains several hundred lines that look like
this:
SMTP:last.first@company.com
I need them to all be changed to:
SMTP:first.last@company.com
They do not all occur in the same locations so I can't use index as far as I
can tell....anybody have any ideas how to get them swapped around? I'd really
appreciate some insight... :)
------------------------------
Date: Tue, 13 Oct 1998 10:40:09 -0400
From: "Michael Mongeau" <michael_mongeau@stratus.com>
Subject: Re: Newbie needs help transposing two words in a file
Message-Id: <6vvolk$7m8@transfer.stratus.com>
This is a good use for regular expressions. Assuming the filehandle opened
is call F,
while (<F>) {
($last,$first,$company) = /SMTP:(\w+)\.(\w+)@(.+)/;
print "SMTP:$first.$last\@$company\n";
}
Michael Mongeau
michael_mongeau@stratus.com
Bitstream wrote in message <6vvl2f$4er$1@fir.prod.itd.earthlink.net>...
>I'm a Perl newbie and am having difficulty trying to transpose two words in
a
>file...for example the file contains several hundred lines that look like
>this:
>
>
>SMTP:last.first@company.com
>
>I need them to all be changed to:
>
>SMTP:first.last@company.com
>
>They do not all occur in the same locations so I can't use index as far as
I
>can tell....anybody have any ideas how to get them swapped around? I'd
really
>appreciate some insight... :)
------------------------------
Date: Tue, 13 Oct 1998 13:15:14 GMT
From: jschramm@feist.NOSPAM.com (Jeff Schramm)
Subject: Re: Odd number of elements
Message-Id: <389C8B242B503503.ADC586B41734B9CC.6EC690B0167950B1@library-proxy.airnews.net>
On Mon, 12 Oct 1998 15:48:25 -0700, Chris Shaw <cshaw@cadence.com>
wrote:
>"Odd number of elements in hash list at ...."
I got that the first time I did "my %foo = {};"
Change it to "my %foo;" and the warning goes away.
------------------------------
Date: 13 Oct 1998 15:29:23 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: jschramm@feist.com (Jeff Schramm)
Subject: Re: Odd number of elements
Message-Id: <m3k924oaj0.fsf@joshua.panix.com>
jschramm@feist.NOSPAM.com (Jeff Schramm) writes:
> On Mon, 12 Oct 1998 15:48:25 -0700, Chris Shaw <cshaw@cadence.com>
> wrote:
>
> >"Odd number of elements in hash list at ...."
>
> I got that the first time I did "my %foo = {};"
That's because you're assigning a single item (in this case, a
reference to an anonymous hash) to a hash. If you'd like to explicitly
initialize a hash, you may
my %foo = ();
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: 13 Oct 1998 15:40:55 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: ruud.limbeck@tip.nl (Ruud Limbeck)
Subject: Re: Perl freezes when using special characters in HTML
Message-Id: <m3g1cso9zs.fsf@joshua.panix.com>
ruud.limbeck@tip.nl (Ruud Limbeck) writes:
> As soon as there is a %-sign in the html-code, perl hangs when
> pressing the submit-button. The 'blank screen' comes instantly.
Perl does not have a submit button; your browser does. I think you're
having a problem with your web browser, and not with your Perl
script. Have you seen this document?:
http://language.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: 13 Oct 1998 14:53:38 GMT
From: snowhare@devilbunnies.org (Snowhare)
Subject: Re: Search Engine `Stop' Words
Message-Id: <6vvphi$tkc$1@nnrp1.snfc21.pbi.net>
Nothing above this line is part of the signed message.
In article <NodI+LA1NuI2EwjG@connected.demon.co.uk>,
Jerry Pank <jerryp.usenet@connected.demon.co.uk> wrote:
>I am in the middle of writing a search engine and am currently having
>great fun optimising the code. Cheering and whooping as those micro-
>seconds get whittled away. Benchmark Is my friend!
>
>I'm now at the `stop' word stage. [words the engine will ignore]
>
>Knowing for certain that many of you have been through this hoop before
>& rather than go wheel-inventing, I wonder if anyone has any sage
>advice to offer or even a recommended list of `stop' words?
Nope. It depends on what you are doing. In a very small database,
you might want to only articles of speech (the, and, a, of, ....).
In a large database you will want to perform statistical analysis
to determine what words are too common to be usefully indexed (not
surprisingly, you will find the articles of speech leading the list).
>I guess the most efficient method of word `elimination' would be a hash.
>What is more efficient, a tied hash or one constructed `on the fly'
>using __DATA__ and would this change depending on size of the data?
Stop lists are generally short enough you can keep them completely in
memory. I would keep them in a flat file that you can re-read on demand
(say when you SIGHUP) and put them in an untied hash.
>## Should really be in the Perl in Business thread I guess, anyway...##
>
>Do do any of the major search engines use Perl in a big way. I'm sure
>that would impress the PHT's and would be a valid inclusion to Johns
>page.
I wrote a full webcrawling search engine using only Perl and GDBM_File
last year: <URL:http://www.vietgate.net/>. Its main defects are that
I spend a lot of CPU power doing statistical analysis of web pages to
determine what character set and language the pages are in, my I/O
profile during index generation is lousy (not inherently - just a
near complete lack of optimization), the crawler runs in
serial single threaded mode, and it has a propensity for exceeding
file system limits for how big you can make a single file (for a truely
big engine, I would need to split the primary inverted index into
many files). These are all correctable problems that I've not
had the time to fix.
But the searches are _fast_ on a Linux based 100Mhz Pentium system. :)
Benjamin Franz
Version: 2.6.2
iQCVAwUBNiNpB+jpikN3V52xAQE2DgP/Q5TZIYwSfMT2JVkOfaubT8qd8I+EfUVA
MwlfxO7Z6Y81MN+z0tFWY7rg7nlrjASJoVojWKYILdSrh8dqgLP27C2+dJj5uAEg
5qV4kx7IcGIGaloADisW24hr1kDhbxC8VKQNZWVsVkABx5Sv+4CWS4ShdOjIL9Jd
WtWibsfeiZM=
=yRQp
-----END PGP SIGNATURE-----
------------------------------
Date: Tue, 13 Oct 1998 07:04:46 -0700
From: purring@earthlink.net
Subject: stat vs -s
Message-Id: <36235DFE.86E3F8E@earthlink.net>
what's the difference between using the `stat'
function to get file size and the file test
operator "-s".
I almost always see people suggest `stat'
instead of "-s".
----
greg strockbine
canoga park, ca
------------------------------
Date: 13 Oct 1998 14:47:39 GMT
From: mike@mike.stok.co.uk (Mike Stok)
Subject: Re: stat vs -s
Message-Id: <6vvp6b$dgf@news-central.tiac.net>
In article <36235DFE.86E3F8E@earthlink.net>, <purring@earthlink.net> wrote:
>what's the difference between using the `stat'
>function to get file size and the file test
>operator "-s".
>
>I almost always see people suggest `stat'
>instead of "-s".
most of the file test operators work with information retrieved by stat,
stat gives you a big wad of informtation back and the file test operators
give you single values (and things like -M -A and -C work in days since
the script started rather than the seconds since epoch values returned by
stat).
Which you use depends on the situation and you - if you have a background
in shell scripting then the file test operators may seem natural, if
you're used to using C library routines then using stat may seem more
natural. Using stat or the file test operators leaves stat's results in a
static buffer, perlfunc includes this:
If any of the file tests (or either the stat() or lstat()
operators) are given the special filehandle consisting of a
solitary underline, then the stat structure of the previous file
test (or stat operator) is used, saving a system call. (This
doesn't work with -t, and you need to remember that lstat() and -l
will leave values in the stat structure for the symbolic link, not
the real file.) Example:
print "Can do.\n" if -r $a || -w _ || -x _;
stat($filename);
print "Readable\n" if -r _;
print "Writable\n" if -w _;
print "Executable\n" if -x _;
print "Setuid\n" if -u _;
[...]
The perfunc docs are more accurate than my little summary, so check them
out.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: Tue, 13 Oct 1998 09:14:50 -0400
From: Richard Sobocinski <sobocinski@msx.upmc.edu>
Subject: typing test
Message-Id: <3623524A.C45207B@msx.upmc.edu>
I am interested in creating a cgi script to conduct an online typing
comprehension test. Is such a thing possible in perl? Before I go off
full-tilt with this, I'd like to get some opinions, advice, etc. from
those of you who are more knowledgable than me (that's probably all of
you now reading this).
The users will receive an audio file that they must transcribe to text.
I'm guessing that a timer would start as soon as the user tabs inside of
a textarea box and would run until she tabs outside of the textarea. I'd
then like to do some _basic_ comparison of the text with a "calibrated"
text file and provide a score. If the score exceeds a certain benchmark,
I want to save the actual transcribed file along with its associated
time and the name/email address of the user who submitted it.
This "application" will be served from a unix machine. Any ideas?
Thanks.
Rich
sobocinski@starmail.com
------------------------------
Date: Tue, 13 Oct 1998 15:03:47 +0100
From: Matt Pryor <matt@whiterabbit.co.uk>
To: Richard Sobocinski <sobocinski@msx.upmc.edu>
Subject: Re: typing test
Message-Id: <36235DC3.84434765@whiterabbit.co.uk>
Richard Sobocinski wrote:
> I'm guessing that a timer would start as soon as the user tabs inside of
> a textarea box and would run until she tabs outside of the textarea. I'd
> then like to do some _basic_ comparison of the text with a "calibrated"
> text file and provide a score. If the score exceeds a certain benchmark,
> I want to save the actual transcribed file along with its associated
> time and the name/email address of the user who submitted it.
This is possible, however you will need to use a combination of CGI and
client side scripting.
The client side script would set the timer as soon as the user enters
the textarea box (using the onFocus event handler), and stop when the
user submits his or her entry. The time taken would then be sent as a
hidden form element. A CGI application would then check the results,
and produce a score.
Matt
--
--
Matt's daily comic strip
Porridge and Fartcakes
http://www.whiterabbit.co.uk/cartoons
------------------------------
Date: 13 Oct 1998 15:59:02 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: "Ray Smith" <smithr@lexma.meitech.com>
Subject: Re: Using perldoc -m Module_name
Message-Id: <m34st8o95l.fsf@joshua.panix.com>
"Ray Smith" <smithr@lexma.meitech.com> writes:
> Most of the time when I run "perldoc -m MODULE_NAME" I get a view (via
> NotePad the local editor) of the module documentation.
No, you don't. You get the entire module, as explained in the docs for
perldoc. Simply
$ perldoc Module
to see the documentation for a module.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: 13 Oct 1998 13:04:30 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: which chars to escape in reg.exp?
Message-Id: <6vvj4u$oao$1@pegasus.csx.cam.ac.uk>
In article <g90uv6.7f6.ln@flash.net>, Tad McClellan <tadmc@flash.net> wrote:
> "character classes" are a little language within the larger
> regex language.
>
> Within char classes there are very few metachars.
>
> Only four, I think. Someone jump in if I missed any:
>
> 1) ^ (caret) is meta only if it is first in the char class
>
> 2) - (hyphen) is meta unless it is last in the char class
^^^^
first or last
>
> 3) ] (closing square bracket) is meta unless it is first in
> the char class
>
> 4) \ (backslash) is always meta
5) $ and @ introduce variable interpolation.
Mike Guy
------------------------------
Date: Tue, 13 Oct 1998 14:50:05 GMT
From: Daniel Grisinger <dgris@perrin.dimensional.com>
Subject: Re: which chars to escape in reg.exp?
Message-Id: <m3pvbwjzgk.fsf@perrin.dimensional.com>
mjd@op.net (Mark-Jason Dominus) writes:
<snip>
> 4. /^[\w.-]+@[\w.-]+\.\w+$/
>
> I would be concerned about the @. I was afraid that perl would see it
> as introducing an array to be interpolated. So I would have written:
>
> 5. /^[\w.-]+\@[\w.-]+\.\w+$/
>
> 5 is definitely what you want; it might also be the same as 4.
perlop says that @ and $ should be escaped in regular expressions
unless you want to interpolate, so backwhacking the @ is probably
a good idea. Otherwise you run the risk of hitting something
like this (which, I admit, is more than a little contrived :-)
$ perl
@a = qw/this or that/;
$" = '|';
$_ = 'or';
print qq.yup\n. if /@a/;
__END__
yup
$
I can't get @[ to interpolate, though, so both of your examples
above should be fine.
dgris
--
Daniel Grisinger dgris@perrin.dimensional.com
`By about halfway through I was beginning to guess the
ending, but it still kind of surprised me.'
David Hatunen, talking about the movie Titanic
------------------------------
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 3961
**************************************