[10414] in Perl-Users-Digest
Perl-Users Digest, Issue: 4007 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 19 10:22:12 1998
Date: Mon, 19 Oct 98 07:13:55 -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, 19 Oct 1998 Volume: 8 Number: 4007
Today's topics:
Re: call functions from within regexes (Tad McClellan)
CGI quandaries <marty@catnmoose.com>
Re: Continuing s/// from the last position. <antti.boman***NOSP@M***helsinki.fi>
Re: Continuing s/// from the last position. <erhmiru@erh.ericsson.se>
Re: encryption <erhmiru@erh.ericsson.se>
Re: File I/O <newsonly@usa.net>
Re: File I/O <jdf@pobox.com>
Re: I'm new, but know what I need (William D. Reardon)
Re: Need help with perl pgm (Tad McClellan)
Re: Need help with perl pgm (Tad McClellan)
Re: Need help with perl pgm (Larry Rosler)
New posters to comp.lang.perl.misc <gbacon@cs.uah.edu>
Re: PERL and SQL (Linux) (William D. Reardon)
Perl Y2K copmliance <ron@hejdeman.freeserve.co.uk>
Re: Perl Y2K copmliance (I R A Aggie)
Re: Perl, dynamic loading, SCO OS 5 <Peter.Eckhardt@transcom.de>
Re: Perl, dynamic loading, SCO OS 5 <bw@cs3.ecok.EDU>
Re: Re: CreateObject doesn't work via my browser nicolaslecart@my-dejanews.com
Re: serial port IO? module? <jdf@pobox.com>
Re: serial port IO? module? <tchrist@mox.perl.com>
Re: Shell commands <tchrist@mox.perl.com>
Re: Slow Sort (complex hashes sub-thread) <alexis@danae.demon.co.uk>
Re: sorting <dfan@thecia.net>
Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
Re: Variables in m// <erhmiru@erh.ericsson.se>
Re: what is strlen() in perl? <erhmiru@erh.ericsson.se>
Re: what is strlen() in perl? (Larry Rosler)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 19 Oct 1998 07:38:32 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: call functions from within regexes
Message-Id: <8sbf07.qo.ln@flash.net>
Avshi Avital (avitala@macs.biu.ac.il) wrote:
: is there some way of calling a function from within a regular expression?
No.
There is, however, a way to call a function from within the
replacement part of a substitution (which is not a regular
expression).
: e.g- s/^(.*?) .*$/<time=&foo($1)>/
s/^(.*?) .*$/ '<time=' . &foo($1). '>'/e;
^
^
BTW: if you want to match anything except a space, it would be
better to write that directly:
s/^([^ ]*) .*$/ '<time=' . &foo($1). '>'/e;
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 19 Oct 1998 08:00:18 -0400
From: Marty Landman <marty@catnmoose.com>
Subject: CGI quandaries
Message-Id: <362B29D2.97EF82A1@catnmoose.com>
I have some questions and comments/guesses based on my limited
experience regarding my logging programs for my site. I am finding that
using SSI to call my log pgm from within an SHTML file gives me a valid
HTTP_REFERRER field but will not accept an argument which would allow me
to know that the page is being hit.
i.e. <!--#exec cgi="./cgi-bin/count.cgi"--> works, but if I do
...count.cgi?page=first... then it won't work, I get an invalid
directive msg which I presume is from the server.
So I wrote a logging pgm invoked as an image tag which spits out a 1x1px
gif file and does accept an argument, it even logs it. Now on telnet I
can see it work and also on a browser (NE4.05) w/o an argument. But
once I add the argument if I look an NE3 I get a big old broken link,
although the parm is evidently passed to my pgm and the pgm runs since
the log is appropriately updated... nonetheless with the parm I get a
server error, w/o the parm it runs fine.
Am I running into a restriction on my server? It seems like I can only
successfully parameterize a CGI call when it's in a link. The nature of
logging would seem to be passive since I want to know when someone gets
to a page, they don't necessarily have to DO anything once they get
there. But I can't seem to use a parameterized CGI call for such a
passive situation.
Sorry about my ignorance, I've probably come further than I should have
w/o reading the Camel book, Amazon assures me it's in the mail. Any
leads would be appreciated.
--
Marty Landman Cat 'n Moose Web Site Design & Development
Living Glass http://www.catnmoose.com/livinglass
Web Safe Color Picker http://www.catnmoose.com/wsc.shtml
Tic-Tac-Toe http://www.catnmoose.com/tictac.shtml
------------------------------
Date: Mon, 19 Oct 1998 14:37:11 +0200
From: "Antti Boman" <antti.boman***NOSP@M***helsinki.fi>
Subject: Re: Continuing s/// from the last position.
Message-Id: <70f87b$o2e$1@hiisi.inet.fi>
I wrote:
>Btw, I posted my opinion to the wishlist of Perl, let's see if they agree
or
>not.
I got a response telling that 99% of the code is already implemented, and
I'm free to do the rest. I suppose I will handle it as soon as I get a few
days out of my 20 hour workdays :)
-a
------------------------------
Date: 19 Oct 1998 14:03:03 +0200
From: Michal Rutka <erhmiru@erh.ericsson.se>
Subject: Re: Continuing s/// from the last position.
Message-Id: <la4st0pxmw.fsf@erh.ericsson.se>
"Antti Boman" <antti.boman***NOSP@M***helsinki.fi> writes:
> I wrote:
> >Btw, I posted my opinion to the wishlist of Perl, let's see if they agree
> or
> >not.
> I got a response telling that 99% of the code is already implemented, and
> I'm free to do the rest. I suppose I will handle it as soon as I get a few
> days out of my 20 hour workdays :)
You can simply regain some days by stoping, for some while, reading
c.l.p.m. ;-)
Michal
------------------------------
Date: 19 Oct 1998 13:35:33 +0200
From: Michal Rutka <erhmiru@erh.ericsson.se>
To: stanley@skyking.OCE.ORST.EDU
Subject: Re: encryption
Message-Id: <la7lxwpywq.fsf@erh.ericsson.se>
stanley@skyking.OCE.ORST.EDU (John Stanley) writes:
> I have seen reports describing the hardware to decypher DES messages
> using 56 bit key spaces. Seven hours, wasn't it? Or was it three?
I haven't heard about those times. Can you point me at those reports?
The best I know is 56 hours. Nevertheless,
if somebody can break DES in 3 hours, then he can easily earn $20000.
See html://www.rsa.com/rsalabs/des2/html/continued.html
> That's what most people would call "breaking" a cypher. That's how
> David Kahn used the term in his book "The Code Breakers".
Three hours is still too much for an online attack. Anyway, even 56 hours
attack is not easy. Read on on the RSA page:
html://www.rsa.com/rsalabs/faq/html/3-2-2.html
> The only "breaking" of crypt I have seen is by exhaustive searches. If
> it was being done, you would expect that Crack would use it.
Michal
------------------------------
Date: Mon, 19 Oct 1998 08:22:40 -0400
From: "Bob L." <newsonly@usa.net>
Subject: Re: File I/O
Message-Id: <37GW1.319$H9.63920@proxye1.nycap.rr.com>
Hi and thanks.
If I can not use +> to open the file for reading and writing, how then can
I:
1. open a text file
2. lock it so no other script can open it.
3. read the contents
4. parse the contents, locating a counter, add 1 to the counter
5. write the contents to the file
6. close the file - and it will be unlocked when it is closed.
open, read, close, process the data, open with write access, write then
close works just fine. When I change it the above items 1-6 where the file
stays open during processing but is locked that's when the file is not
written to.
Any idea's on how I can do this? It should not be that hard and in fact
should be something easy, I would assume.
Bob
Eugene Sotirescu <eugene@vertical.net> wrote in message
362ac42a.0@news.dca.net...
>
>Bob L. wrote in message ...
>
>>2. I trid using +> when I open the file for read and write but for some
>>reason it will not write the counters to the file. Any idea why?
>>
>>Thank you very much.
>
>
>Bob,
>
>don't use +>
>
>It is equivalent to:
> sysopen (FH, $file, O_RDWR|O_TRUNC|O_CREAT);
>i.e., it will clobber your existing file.
>
>
------------------------------
Date: 19 Oct 1998 15:35:14 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: "Bob L." <newsonly@usa.net>
Subject: Re: File I/O
Message-Id: <m3r9w4fze5.fsf@joshua.panix.com>
"Bob L." <newsonly@usa.net> writes:
> 1. open a text file
> 2. lock it so no other script can open it.
> 3. read the contents
> 4. parse the contents, locating a counter, add 1 to the counter
> 5. write the contents to the file
> 6. close the file - and it will be unlocked when it is closed.
You forgot
0. RTFM
perlfaq5: "I still don't get locking. I just want to increment the
number in the file. How can I do this?"
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Mon, 19 Oct 1998 13:36:05 GMT
From: wdr1@pobox.com (William D. Reardon)
Subject: Re: I'm new, but know what I need
Message-Id: <F12ts6.87n@midway.uchicago.edu>
In article <36283B60.39A10BCB@usadowntheloo.com>,
Dominic <forgetit@usadowntheloo.com> wrote:
>I'd like some help:
>
>Sites giving an overview of the perl language instruction set.
>
>A site showing a "how to" of getting a script to pass the information it
>collects from the form off the Web page and to invoke a .exe
>program.(which uses it)
Well, you're asking for two different things there, Dom. :)
If you want a detailed reference of Perl, check out the man/html pages
that came with your system, specifically perlfunc & perlob. Or, if
you're going to be getting into Perl seriously, I'd highly recommend
picking up a copy of _Perl Programming_.
As for a "How-to", try searching around the other man/html
pages as well too. The FAQ's & www.perl.com have a lot
of great of info too. If you're buying the above book, you'll do well
to get the _Perl Cookbook_ as well. It's a great book - while I still
find it useful now, I *really* wish it had been around when I was
first learning Perl.
Keep in mind Perl does a lot of different things on a lot of
different systems for a lot of different people. (Or put more succinctly,
Perl does a lot. :) Consequently, it often helps to detail future
problems a bit more.
>I'd like to set up an online database. I have MS Access. Help please!
>What do I need to learn?
A few things in Perl, and a few things outside of Perl:
Outside of Perl:
[These apply regardless of what lang you're using]
----------------
o Get a webserver up & running.
(I'd recommend Apache over IIS, at least initially)
o Get CGIs up & running
o Learn HTML (for creating your web pages)
o Learn SQL (for interacting w/ your database)
Inside of Perl
--------------
o Become comfortable with modules. Check out www.cpan.org.
Great timesaver.
o Get Perl talking to Access. Check out either Win32::ODBC or
DBI::ODBC modules.
o Learn how to write CGIs. Check out the CGI.pm module
Personally, I'd try getting everything working independently
first, then tying the whole ball of wax together; it'll help pin down
any problems.
Good Luck!
-Bill
--
William Reardon ---- http://www.nhma.com/~wdr1/ ---- wdr1@pobox.com
I wish I was the radio song, the one that you couldn't turn up
------------------------------
Date: Mon, 19 Oct 1998 07:44:52 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Need help with perl pgm
Message-Id: <48cf07.qo.ln@flash.net>
Lisa Digregorio (VLHW15A@prodigy.com) wrote:
: while ($line = <InFile>)
^^^^^^^^^^^^^^^^
That is not '-w clean'.
You should always use the -w switch.
It should generate no warnings.
: if ($line = ~/(a|e|i|o|u) {2}/)
^
^ spaces are significant in regexen
That matches a vowel followed by 2 spaces...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 19 Oct 1998 07:41:03 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Need help with perl pgm
Message-Id: <v0cf07.qo.ln@flash.net>
Lisa Digregorio (VLHW15A@prodigy.com) wrote:
: open (InFile, "Hw3.dat") || die;
^^
^^
I expect that stands for "homework"?
: Code doesn't work. Help please. Need this by tomorrow.
The purpose of homework is to help you learn.
If you don't want to learn, drop the class.
You won't learn if we do it for you...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 19 Oct 1998 06:39:07 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Need help with perl pgm
Message-Id: <MPG.1094e0d7971f09209898c4@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <MPG.1094ae4b5d07e8749898c3@nntp.hpl.hp.com> on Mon, 19 Oct
1998 03:03:32 -0700, Larry Rosler <lr@hpl.hp.com> says...
> [Posted to comp.lang.perl.misc and copy mailed.]
>
> In article <70et3a$70ai$1@newssvr04-int.news.prodigy.com> on 19 Oct 1998
> 08:26:18 GMT, Lisa Digregorio <VLHW15A@prodigy.com> says...
> ...
> > Code doesn't work. Help please. Need this by tomorrow.
>
> Or else what? What makes you think your teacher doesn't read this
> newsgroup also?
Having diagnosed this request correctly, I received a plaintive letter
from Lisa explaining how much preparation she had done and how stymied
she was, and imploring me to help. As my first response might well have
foreclosed any others, I'll do it. "Just This Once."
> #!/usr/bin/perl
Even (especially?) for homework, you should use the '-w' flag. And
use strict;
> print "Content-type: text/html\n\n";
One space will do, but I don't think it matters.
> open (InFile, "Hw3.dat") || die;
By convention, filehandles are written as all capitals. And you get
credit for checking the result of the 'open', but none for not printing
$! which would give the reason why it failed.
> $count = 0;
my $count = 0;
> while ($line = <InFile>)
> {
Strictly,
my $line;
while (defined($line = <InFile>))
But I don't much care. I *would* OTOH leave out $line entirely and use
the default $_ here and everywhere else.
> chop ($line);
> $count+=1;
'chomp' is more appropriate, and '$count++;' is more idiomatic.
> if ($line = ~/(a|e|i|o|u) {2}/)
> {
> print "This word contains two vowels in succession \n" %s,
> $line;
> }
Finally, to the regex questions!
if ($line =~ /[aeiou]{2}/)
The match-binding operator is '=~', not '= ~' (which is an assignment
followed by a bit-wise complement).
A simple alternation among single characters is far better expressed as
a character class. And the space before the quantifier {2} means 'match
two spaces', not two vowels.
The '%s' in the print statement is a syntax error. Perhaps Lisa was
thinking of printf, but it would still be wrong.
> if ($line = ~/ [aeiou] && [aeiou]/)
> {
> print "The word has exactly two vowels anywhere in the word
> \n";
> }
if ($line =~ /^[^aeiou]*[aeiou][^aeiou]*[aeiou][^aeiou]*$/)
Hmmm. Now we have the character class correct, but not much else. And
nothing prints the datum.
> if ($line = ~/\b a|e|i|o|u \b/)
> {
> print "The word begins and ends with the same vowel \n";
> }
if ($line =~ /^([aeiou]).*\1$/)
Lisa: Your teacher deserves credit for reasonably instructive
questions. I don't know about you, though :-). But at least you'd
better test it all before submitting your homework, because I didn't
bother to.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 19 Oct 1998 13:39:24 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: New posters to comp.lang.perl.misc
Message-Id: <70ffec$ckv$4@info.uah.edu>
Following is a summary of articles from new posters spanning a 7 day
period, beginning at 12 Oct 1998 13:25:24 GMT and ending at
19 Oct 1998 11:15:49 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" email address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 1998 Greg Bacon. All Rights Reserved.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Totals
======
Posters: 216 (45.1% of all posters)
Articles: 317 (22.2% of all articles)
Volume generated: 464.5 kb (19.8% of total volume)
- headers: 215.0 kb (4,452 lines)
- bodies: 242.1 kb (7,941 lines)
- original: 190.2 kb (6,462 lines)
- signatures: 7.2 kb (164 lines)
Original Content Rating: 0.786
Averages
========
Posts per poster: 1.5
median: 1.0 post
mode: 1 post - 154 posters
s: 1.2 posts
Message size: 1500.6 bytes
- header: 694.5 bytes (14.0 lines)
- body: 781.9 bytes (25.1 lines)
- original: 614.4 bytes (20.4 lines)
- signature: 23.2 bytes (0.5 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
7 9.6 ( 5.4/ 4.1/ 2.9) "Tim Hicks" <tim.hicks@iname.com>
7 10.4 ( 4.1/ 5.0/ 3.4) rsholmes@rodan.syr.edu (Richard S. Holmes)
6 11.5 ( 4.6/ 5.5/ 2.7) Matt Sergeant <msergeant@ndirect.co.uk_NOSPAM>
5 7.8 ( 3.4/ 4.4/ 2.7) ruud.limbeck@tip.nl (Ruud Limbeck)
5 7.4 ( 3.7/ 3.8/ 1.6) Dmitri Levitin <dmitri@sw-systemekarlhickl.de>
4 3.7 ( 2.0/ 1.6/ 1.3) wolph@merlin.albany.net (r j huntington)
4 5.3 ( 2.7/ 2.6/ 2.6) john_aldiscon@my-dejanews.com
4 4.7 ( 2.5/ 2.2/ 1.9) "John P. Scrimsher" <john_scrimsher@ex.cv.hp.com>
4 10.6 ( 3.1/ 6.9/ 2.0) "David L. Hawley" <dlhawley@user2.teleport.com>
4 4.7 ( 2.9/ 1.8/ 1.8) mark@doddx.com
These posters accounted for 3.5% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
11.5 ( 4.6/ 5.5/ 2.7) 6 Matt Sergeant <msergeant@ndirect.co.uk_NOSPAM>
10.6 ( 3.1/ 6.9/ 2.0) 4 "David L. Hawley" <dlhawley@user2.teleport.com>
10.4 ( 4.1/ 5.0/ 3.4) 7 rsholmes@rodan.syr.edu (Richard S. Holmes)
9.6 ( 5.4/ 4.1/ 2.9) 7 "Tim Hicks" <tim.hicks@iname.com>
8.6 ( 2.0/ 6.6/ 3.6) 3 ilya@ns1.foothill.net (Ilya)
7.8 ( 3.4/ 4.4/ 2.7) 5 ruud.limbeck@tip.nl (Ruud Limbeck)
7.4 ( 3.7/ 3.8/ 1.6) 5 Dmitri Levitin <dmitri@sw-systemekarlhickl.de>
5.9 ( 1.4/ 4.5/ 4.5) 2 ultrabyte@my-dejanews.com
5.3 ( 1.4/ 3.2/ 0.3) 2 alain samoun <alain@sonic.net>
5.3 ( 1.5/ 3.8/ 3.3) 2 Stephen Palmer <slpalmer@NOSPAM.flex.net>
These posters accounted for 3.5% of the total volume.
Top 10 Posters by OCR (minimum of three posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
1.000 ( 1.8 / 1.8) 3 Ed <emills@harris.com>
1.000 ( 2.6 / 2.6) 3 hladik3@hladik.cz
1.000 ( 0.8 / 0.8) 3 ok1ago@aol.com (Ok1aGo)
1.000 ( 2.5 / 2.5) 3 Lee Musgrave <lee@juno.ltd.uk>
1.000 ( 2.6 / 2.6) 4 john_aldiscon@my-dejanews.com
1.000 ( 1.8 / 1.8) 4 mark@doddx.com
0.868 ( 1.9 / 2.2) 4 "John P. Scrimsher" <john_scrimsher@ex.cv.hp.com>
0.786 ( 1.3 / 1.6) 4 wolph@merlin.albany.net (r j huntington)
0.785 ( 0.6 / 0.7) 3 "Robin Bank" <rbank@csf.edu>
0.767 ( 2.0 / 2.5) 3 "Mikkel K." <mtk@egmont-kol.dk>
Bottom 10 Posters by OCR (minimum of three posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.767 ( 2.0 / 2.5) 3 "Mikkel K." <mtk@egmont-kol.dk>
0.733 ( 0.6 / 0.8) 3 hawkwynd@adelphia.net (Hawkwynd)
0.696 ( 3.4 / 5.0) 7 rsholmes@rodan.syr.edu (Richard S. Holmes)
0.696 ( 2.9 / 4.1) 7 "Tim Hicks" <tim.hicks@iname.com>
0.620 ( 2.7 / 4.4) 5 ruud.limbeck@tip.nl (Ruud Limbeck)
0.541 ( 3.6 / 6.6) 3 ilya@ns1.foothill.net (Ilya)
0.521 ( 1.0 / 2.0) 3 modred@shore.net (Garth Sainio)
0.485 ( 2.7 / 5.5) 6 Matt Sergeant <msergeant@ndirect.co.uk_NOSPAM>
0.423 ( 1.6 / 3.8) 5 Dmitri Levitin <dmitri@sw-systemekarlhickl.de>
0.292 ( 2.0 / 6.9) 4 "David L. Hawley" <dlhawley@user2.teleport.com>
19 posters (8%) had at least three posts.
Top 10 Crossposters
===================
Articles Address
-------- -------
9 xnrrrtmitina@europe.com
4 ilya@ns1.foothill.net (Ilya)
4 Francois Besnier <fbesnier@home.com>
2 Bruce Schuck <hd-fxsts@liii.com>
2 simon@caleddon.jasmine.org.uk (Simon Brooke)
2 peter_michalica@hp.com (Peter Michalica)
2 Matt Sergeant <msergeant@ndirect.co.uk_NOSPAM>
2 "Gavin Kuiper" <gk@clara.net>
2 Ivan Strougatski <strougatski@clara.net>
2 Oleg Waisberg <Oleg_Waisberg@Health.Lmig.ca>
------------------------------
Date: Mon, 19 Oct 1998 13:38:55 GMT
From: wdr1@pobox.com (William D. Reardon)
Subject: Re: PERL and SQL (Linux)
Message-Id: <F12twv.8Dw@midway.uchicago.edu>
In article <modred-1710980726160001@mrlbma-01-230.port.shore.net>,
Garth Sainio <modred@shore.net> wrote:
>In article <36286299.48D6@edoc.co.za>, info@edoc.co.za wrote:
>> I must expand my PERL horizon to SQL.
>>
>> I'm Running Linux, and would like to know if there is somewhere a
>> FAQ/HowTo or similar?
>>
>> Or could somebody give me a good start?
>
>If you have to access an existing database then you should looking into
>the DBI module (perldoc DBI should get you started).
You'll probably also need a database engine of sorts. Try
mSQL or MySQL.
-Bill
--
William Reardon ---- http://www.nhma.com/~wdr1/ ---- wdr1@pobox.com
I wish I was the radio song, the one that you couldn't turn up
------------------------------
Date: Mon, 19 Oct 1998 14:12:29 +0100
From: "Ron Hejdeman" <ron@hejdeman.freeserve.co.uk>
Subject: Perl Y2K copmliance
Message-Id: <70fdqa$hnh$1@newsreader2.core.theplanet.net>
Hi,
Anyone out there know if perl is Y2K compliant on Suns and Win-95 ?
BR,
Ron.
____________________________________________________________________________
_
_/_/_/ _/_/ _/_/ _/ Ron Hejdeman
_/ _/ _/ _/ _/ _/ _/ Email: hejdeman@acapella.co.uk
_/_/_/ _/ _/ _/ _/ _/ Tel: +44 (0) 1703 769008
_/ _/ _/ _/ _/ _/ _/ Fax: +44 (0) 1703 768612
_/ _/ _/_/ _/ _/_/ Mobile: +44 (0) 802 591928
Acapella Limited
Delta House, Chilworth Research Centre, Southampton, SO16 7NP, England
____________________________________________________________________________
__
------------------------------
Date: Mon, 19 Oct 1998 09:33:25 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Perl Y2K copmliance
Message-Id: <fl_aggie-1910980933250001@aggie.coaps.fsu.edu>
In article <70fdqa$hnh$1@newsreader2.core.theplanet.net>, "Ron Hejdeman"
<ron@hejdeman.freeserve.co.uk> wrote:
+ Anyone out there know if perl is Y2K compliant on Suns and Win-95 ?
As far as I understand things, perl itself has no internal representation
for time. As such, it is Y2K safe.
The culprit comes from us humans doing the wrong thing with the data that
can be obtained regarding the current year. Please make a Dejanews search
on Y2K in clpm...
James
------------------------------
Date: Mon, 19 Oct 1998 13:51:31 +0200
From: Peter Eckhardt <Peter.Eckhardt@transcom.de>
To: Darrell Styner <dstyner@telalink.net>
Subject: Re: Perl, dynamic loading, SCO OS 5
Message-Id: <362B27C3.8D7B440E@transcom.de>
Dynamic Loading works nicely. I will send you an e-mail
with the config.
Peter
Darrell Styner schrieb:
>
> I can't get Perl (latest version: 5.005_02) to compile in such a way as to
> support autoloading of modules. I'm using the SCO OpenServer Development
> System (ver 5.1.0Ac) under OpenServer 5.0.4p with release supplement
> 504.0.1.a. Perl builds and runs just fine, but when I try to run a script
> that uses DB_File.pm I get:
>
> "Can't load module DB_File, dynamic loading not available in this perl.
> (You may need to build a new perl executable which either supports dynamic
> loading or has the DB_File module statically linked into it.)"
>
> I've tried to do both, but haven't had any luck (I get failed links and
> core dumps). Does anyone have a clue as to how to get this to work? It
> seems like there must be other people using SCO systems as web servers who
> need this functionality.
>
> --
> Darrell Styner
> dstyner@telalink.net
------------------------------
Date: 19 Oct 1998 12:27:51 GMT
From: Bill Walker <bw@cs3.ecok.EDU>
Subject: Re: Perl, dynamic loading, SCO OS 5
Message-Id: <70fb87$6g2$1@sunhub-tulsa.onenet.net>
In comp.unix.sco.misc Peter Eckhardt <Peter.Eckhardt@transcom.de> wrote:
> Dynamic Loading works nicely. I will send you an e-mail
> with the config.
Would you consider just posting it ? I doubt it is very long, and I
suspect there is a lot of interest.
73 de Bill W5GFE
------------------------------
Date: Mon, 19 Oct 1998 12:25:04 GMT
From: nicolaslecart@my-dejanews.com
Subject: Re: Re: CreateObject doesn't work via my browser
Message-Id: <70fb2v$oro$1@nnrp1.dejanews.com>
Thank you Matt for your answer,
but if i create a CSV file (from my excel file), i loose the properties of
the excel file (Author, Title, Organisation , Date,....). But my main
objective is to read ,in a directorie on the server, the properties of all
the Excel files. And then i can make a HTML page with a board containing 3
columns (Author, Title, Organisation, Date) witch indicate the documents
available.
Note that the name of the Excel files are not enough and i need the
Author, Title, Organisation informations.
Regards,
Nicolas
In article <3624949E.67F036AC@ndirect.co.uk_NOSPAM>,
Matt Sergeant <msergeant@ndirect.co.uk_NOSPAM> wrote:
> nicolaslecart@my-dejanews.com wrote:
> >
> > Hello,
> >
> > i wrote a simple cgi script which just read the properties
> > of an Excel document.
> >
> > When i run it under a dos window ("perl scipt.pl") it works very well;
> > But when i excute it via my browser, the function
> > CreateObject can't create an Excel object instance, and i don't know why
:-(((
>
> [snip]
>
> > What the cause of this trouble ?? are my browser or my web server
> > misconfigured?
>
> No. A web server can't run a GUI application - who would use the GUI?
>
> Create a CSV file instead using one of the many modules to do that from
> the CPAN.
>
> --
> <Matt/>
>
> | Fastnet Software Ltd | Perl in Active Server Pages |
> | Perl Consultancy, Web Development | Database Design | XML |
> | http://come.to/fastnet | Information Consolidation |
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 19 Oct 1998 15:37:10 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: Peter Griessl <griessl@ihs.ac.at>
Subject: Re: serial port IO? module?
Message-Id: <m3ogr8fzax.fsf@joshua.panix.com>
Peter Griessl <griessl@ihs.ac.at> writes:
> I need to talk to an external device connected to the serial
> port using XON/XOFF flow control and I want to do this out
> of perl
perlfaq8: "How do I read and write the serial port?"
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: 19 Oct 1998 13:40:53 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: serial port IO? module?
Message-Id: <70ffh5$ree$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, Peter Griessl <griessl@ihs.ac.at> writes:
:I need to talk to an external device connected to the serial
:port using XON/XOFF flow control and I want to do this out
:of perl (since the application is written in perl).
Just open the device as a regular file and do as thou wilt. You'll
probably need to open O_RDWR and sprinkle your code with arcane ioctls
throughout. The perlfaq8 manpage has an entry entitled `How do I read
and write the serial port?', which may be of some benefit to you.
My best advice is to get your hands on C code that does what you
want done, and then transliterate this into Perl.
--tom
--
Interestingly enough, since subroutine declarations can come anywhere,
you wouldn't have to put BEGIN {} at the beginning, nor END {} at the
end. Interesting, no? I wonder if Henry would like it. :-) --lwall
------------------------------
Date: 19 Oct 1998 13:35:02 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Shell commands
Message-Id: <70ff66$ree$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, mjd@op.net (Mark-Jason Dominus) writes:
:>system() is not a command.
:
:I don't see why not. I think `command' is a common locution for any
:function or subroutine which is used primarily for its side effects.
:I also think that if you were to study usage in this newsgroup, you'd
:see that that's how people use it:
:
: the `system' command
: the `print' command
: the `mkdir' command
Actually, I use the term `system commands', but what I mean
the *arguments* to system(), not the function itself. That is,
those things that would be typed as `commands' directly
into the system shell.
The manual would appear to support this convention. I have
marked the relevant lines with an arrow in the margin.
SYSTEM(3) Linux Programmer's Manual SYSTEM(3)
NAME
---> system - execute a shell command
SYNOPSIS
#include <stdlib.h>
int system (const char * string);
DESCRIPTION
---> system() executes a command specified in string by calling
/bin/sh -c string, and returns after the command has been
completed. During execution of the command, SIGCHLD will be
blocked, and SIGINT and SIGQUIT will be ignored.
Or under SunOS:
SYSTEM(3) SunOS 4.1.3 Programmer's Manual SYSTEM(3)
NAME
---> system - issue a shell command
SYNOPSIS
system(string)
char *string;
DESCRIPTION
system() gives the string to sh(1) as input, just as if
---> the string had been typed as a command from a terminal.
The current process performs a wait(2V) system call, and
waits until the shell terminates. system() then returns
the exit status returned by wait(2V). Unless the shell was
interrupted by a signal, its termination status is contained
in the 8 bits higher up from the low-order 8 bits of the
value returned by wait().
--tom
--
break; /* don't do magic till later */
--Larry Wall in stab.c from the perl source code
------------------------------
Date: 19 Oct 1998 12:01:24 GMT
From: Alexis Huxley <alexis@danae.demon.co.uk>
Subject: Re: Slow Sort (complex hashes sub-thread)
Message-Id: <f12ped.2rf@danae.demon.co.uk>
> are you sure it is the sort that kills you and not the printf? a sort of
> 27k items like you show should not be killer. the printf on the
> otherhand could be since it is much less efficient than print.
Yes, I'm sure it is the sort. The alternative method - whereby I open a
pipe to Unix's sort command goes through an indentical printf call, but
as explained, the Unix sort one is much faster.
>> ($dev, $inode, $i) = split($;, $key);
> up you code. i notice you are using the old perl4 convention of hashes
> with comma separated lists of keys being made into pseudo array. this
> should be done with multilevel hashes ...
I use comma separated keys instead of a hash of hashes (which I think
is what you mean by 'multilevel') because I can't see a more efficient
way to get the set of keys back from a particular value. I realise it's
a Perl 4 style thing, but If you look at page 270 of the Perl 5 Camel book,
then what I am trying to do is akin to given the value "bart", I want to know
the keys for it are "Simpsons" and "kid". And I can't see an easy and
efficient way to do that with a hash of hashes.
> ... as they won't have any problems with potential data use of $;
$dev, $inode and $i are always numeric, so no problem there.
> also you use main:: which incurs an extra symbol table lookup (i am not
> sure if this is runtime or compile time). ...
I would imagine it's compile time.
>> foreach $key (sort {$main::names{$a} cmp $main::names{$b}} (keys %main::names)) {
> ... again it is cluttered code because of all the main::
What I actually wanted to do (a long time ago), was make the variables
%names and %attribs "file static" (a la "C") *WITHOUT* turning the file
into a package. But I couldn't work out how to do that in Perl, so I wound
up making them global. perl's "-w" option then complained that a package
name was missing, so I just prefixed them with "main::" and it was happy.
I'm sure there is a better way do to it. What's the neatest way to make
a variable "file static" without turning the file into a package? -
I'm reluctant to make a package out of the functions that access these
strutures because it makes running different versions of the programs
on the same system cleaner.
>> printf $out_handle [ long hideous printf snipped ]
> save a large amount of time since you are just printf'ing string and
Yes, the printf is messy, I agree. It will get replaced by a print-join
later, but since it's certainly not the printf that causes the problem, it
can wait :-)
Alexis
PS Uri, sorry about anti-spam mail you must have got; I've added you to my
whitelist now.
--
Alexis Huxley
alexis@danae.demon.co.uk
email key: 549812
------------------------------
Date: 19 Oct 1998 07:49:00 -0400
From: Dan Schmidt <dfan@thecia.net>
Subject: Re: sorting
Message-Id: <87pvbo22mr.fsf@razumovsky.thecia.net>
dblack@pilot.njin.net (David Alan Black) writes:
| You could create a hash of comparison subroutines, and then stack them
| as needed/requested:
|
| #!/usr/local/bin/perl -w
|
| my %sr = ( age => sub { $a->{age} <=> $b->{age} },
| name => sub { $a->{name} cmp $b->{name} },
| );
|
| my @people = ( { name => "David", age => 39 },
| { name => "Someone", age => 38 },
| { name => "Same Age", age => 39 },
| );
|
|
| # By age, then name:
| print map { "$_->{age} $_->{name}\n" }
| sort { &{$sr{age}} } sort { &{$sr{name}} } @people;
|
|
| It has the merit of developer efficiency, at least....
I think that you think this does a two-key sort, with the primary
key being 'age' and the secondary key being 'name'. But it doesn't
actually do that, since 'sort' is not stable; that is, it doesn't
guarantee that two elements with equal keys will end up in the same
order when sorted as they were originally. So the work of your
'name' sort will be thrown away.
So to do a multikey sort, you really want to use a single comparison
routine and look at both keys within it.
--
Dan Schmidt -> dfan@alum.mit.edu, dfan@thecia.net
Honest Bob & the http://www2.thecia.net/users/dfan/
Factory-to-Dealer Incentives -> http://www2.thecia.net/users/dfan/hbob/
Gamelan Galak Tika -> http://web.mit.edu/galak-tika/www/
------------------------------
Date: 19 Oct 1998 13:39:08 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <70ffds$ckv$3@info.uah.edu>
Following is a summary of articles spanning a 7 day period,
beginning at 12 Oct 1998 13:25:24 GMT and ending at
19 Oct 1998 11:15:49 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" email address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 1998 Greg Bacon. All Rights Reserved.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Excluded Posters
================
perlfaq-suggestions\@mox\.perl\.com
Totals
======
Posters: 479
Articles: 1425 (641 with cutlined signatures)
Threads: 403
Volume generated: 2343.1 kb
- headers: 1024.4 kb (20,213 lines)
- bodies: 1213.6 kb (38,404 lines)
- original: 815.7 kb (28,237 lines)
- signatures: 103.7 kb (2,379 lines)
Original Content Rating: 0.672
Averages
========
Posts per poster: 3.0
median: 1 post
mode: 1 post - 281 posters
s: 5.9 posts
Posts per thread: 3.5
median: 2 posts
mode: 1 post - 126 threads
s: 4.8 posts
Message size: 1683.8 bytes
- header: 736.1 bytes (14.2 lines)
- body: 872.1 bytes (27.0 lines)
- original: 586.2 bytes (19.8 lines)
- signature: 74.5 bytes (1.7 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
67 92.3 ( 51.2/ 33.1/ 20.1) Tom Phoenix <rootbeer@teleport.com>
53 92.6 ( 51.3/ 41.2/ 24.9) Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
48 84.3 ( 31.4/ 47.3/ 31.2) lr@hpl.hp.com (Larry Rosler)
32 60.3 ( 30.6/ 26.9/ 16.5) John Porter <jdporter@min.net>
31 37.3 ( 16.5/ 20.7/ 14.5) mjd@op.net (Mark-Jason Dominus)
28 57.0 ( 17.0/ 35.6/ 15.5) Uri Guttman <uri@camel.fastserv.com>
24 44.0 ( 14.7/ 29.3/ 19.1) tadmc@flash.net (Tad McClellan)
23 25.8 ( 14.6/ 9.4/ 5.8) Jonathan Feinberg <jdf@pobox.com>
21 43.2 ( 17.3/ 21.5/ 8.0) abigail@fnx.com
21 38.3 ( 16.0/ 17.2/ 9.0) rjk@coos.dartmouth.edu (Ronald J Kimball)
These posters accounted for 24.4% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
92.6 ( 51.3/ 41.2/ 24.9) 53 Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
92.3 ( 51.2/ 33.1/ 20.1) 67 Tom Phoenix <rootbeer@teleport.com>
84.3 ( 31.4/ 47.3/ 31.2) 48 lr@hpl.hp.com (Larry Rosler)
60.3 ( 30.6/ 26.9/ 16.5) 32 John Porter <jdporter@min.net>
57.0 ( 17.0/ 35.6/ 15.5) 28 Uri Guttman <uri@camel.fastserv.com>
44.0 ( 14.7/ 29.3/ 19.1) 24 tadmc@flash.net (Tad McClellan)
43.2 ( 17.3/ 21.5/ 8.0) 21 abigail@fnx.com
38.3 ( 16.0/ 17.2/ 9.0) 21 rjk@coos.dartmouth.edu (Ronald J Kimball)
37.3 ( 16.5/ 20.7/ 14.5) 31 mjd@op.net (Mark-Jason Dominus)
35.6 ( 16.9/ 14.5/ 9.9) 20 mgjv@comdyn.com.au (Martien Verbruggen)
These posters accounted for 25.0% of the total volume.
Top 10 Posters by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.993 ( 3.1 / 3.2) 8 fl_aggie@thepentagon.com (I R A Aggie)
0.954 ( 6.3 / 6.6) 6 Andrew Johnson <ajohnson@gatewest.net>
0.941 ( 18.8 / 20.0) 6 Greg Bacon <gbacon@cs.uah.edu>
0.904 ( 7.6 / 8.4) 5 "Xah" <xah@best.com>
0.866 ( 9.1 / 10.5) 9 gebis@fee.ecn.purdue.edu (Michael J Gebis)
0.866 ( 4.9 / 5.6) 6 "Doyle Johnson" <sales@madm.com>
0.853 ( 3.6 / 4.2) 6 Ala Qumsieh <aqumsieh@tigre.matrox.com>
0.812 ( 10.6 / 13.1) 11 tchrist@mox.perl.com (Tom Christiansen)
0.808 ( 4.5 / 5.5) 5 aml@world.std.com (Andrew M. Langmead)
0.779 ( 5.9 / 7.6) 6 wyndo@cxo.com
Bottom 10 Posters by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.421 ( 2.6 / 6.1) 9 Rick Delaney <rick.delaney@shaw.wave.ca>
0.417 ( 1.2 / 3.0) 7 bart.mediamind@ping.be (Bart Lateur)
0.404 ( 1.5 / 3.7) 6 mjtg@cus.cam.ac.uk (M.J.T. Guy)
0.391 ( 4.5 / 11.4) 12 Matt Pryor <matt@whiterabbit.co.uk>
0.383 ( 3.2 / 8.4) 10 Mark Cain <mark@uninetwork.com>
0.381 ( 3.1 / 8.2) 6 Shawn Corey <shawn@magma.ca>
0.373 ( 8.0 / 21.5) 21 abigail@fnx.com
0.372 ( 1.6 / 4.3) 5 ced@bcstec.ca.boeing.com (Charles DeRykus)
0.367 ( 3.8 / 10.3) 15 jwl@_munged_worldmusic.de (Joergen W. Lang)
0.363 ( 1.2 / 3.4) 5 Tk Soh <r28629@email.sps.mot.com>
67 posters (13%) had at least five posts.
Top 10 Threads by Number of Posts
=================================
Posts Subject
----- -------
57 Are there any "perl.newbie" group or forum?
36 The space deletion woes...
31 Sorry
26 Are there no PERL experts out there?? Is there no one who can solve this??
24 Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
22 Perl Cookbook - is this the best perl book?
21 encryption
20 sorting hack
18 which chars to escape in reg.exp?
16 Slow Sort?
These threads accounted for 19.0% of all articles.
Top 10 Threads by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Subject
-------------------------- ----- -------
123.3 ( 51.6/ 66.5/ 40.1) 57 Are there any "perl.newbie" group or forum?
55.9 ( 27.8/ 24.7/ 15.6) 36 The space deletion woes...
47.7 ( 23.2/ 22.8/ 14.4) 31 Sorry
47.0 ( 19.8/ 24.0/ 14.6) 26 Are there no PERL experts out there?? Is there no one who can solve this??
44.6 ( 16.0/ 26.5/ 16.5) 22 Perl Cookbook - is this the best perl book?
36.0 ( 21.8/ 12.5/ 6.5) 24 Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
34.9 ( 14.9/ 17.8/ 10.0) 20 sorting hack
34.7 ( 11.1/ 22.3/ 13.9) 16 Slow Sort?
33.4 ( 14.5/ 17.0/ 9.9) 21 encryption
30.2 ( 7.6/ 22.3/ 10.3) 10 I have a few elementary Perl problems
These threads accounted for 20.8% of the total volume.
Top 10 Threads by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.908 ( 7.3/ 8.0) 6 command line regexp replace question
0.887 ( 4.4/ 5.0) 6 Mimicing 'tail -f' functionality in Perl
0.846 ( 11.6/ 13.7) 9 Statistics for comp.lang.perl.misc
0.823 ( 2.2/ 2.7) 5 Compressing and Uncompressing
0.797 ( 3.0/ 3.8) 6 Reference to a sort function
0.792 ( 2.0/ 2.6) 6 Combining two @array's
0.784 ( 2.4/ 3.1) 5 NET::FTP problem
0.774 ( 3.7/ 4.8) 6 sorting file entries by time
0.767 ( 4.0/ 5.2) 6 Need to Cut Mem use
0.761 ( 3.3/ 4.3) 5 PERl and HTACCESS authentication
Bottom 10 Threads by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.525 ( 1.4 / 2.7) 6 a camel?
0.519 ( 6.5 / 12.5) 24 Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
0.518 ( 2.1 / 4.0) 7 email with windows 98 perl script?
0.515 ( 4.8 / 9.4) 8 Too stupid
0.503 ( 8.1 / 16.1) 14 Continuing s/// from the last position.
0.463 ( 10.3 / 22.3) 10 I have a few elementary Perl problems
0.450 ( 3.1 / 6.8) 5 Checking file size and date in Perl Win32
0.450 ( 2.7 / 6.0) 5 Differentiating between STDOUT and STDERR
0.400 ( 4.5 / 11.2) 9 comp.lang.perl.win32??
0.335 ( 1.7 / 4.9) 5 replacing
74 threads (18%) had at least five posts.
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
16 comp.lang.perl.modules
11 comp.lang.perl
8 comp.unix.admin
8 comp.unix.questions
4 comp.sys.sequent
4 be.comp
4 be.comp.internet
4 alt.perl
4 comp.lang
4 tw.bbs.comp.lang.perl
Top 10 Crossposters
===================
Articles Address
-------- -------
9 xnrrrtmitina@europe.com
5 tadmc@flash.net (Tad McClellan)
4 ilya@ns1.foothill.net (Ilya)
4 "Garry T. Williams" <garry@america.net>
4 dragnovich@my-dejanews.com
4 Francois Besnier <fbesnier@home.com>
4 rjk@coos.dartmouth.edu (Ronald J Kimball)
3 builderlive@cnet.com (CNET Builder.com Live!)
3 Marc Bernstein <mb@cup.hp.com>
3 Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
------------------------------
Date: 19 Oct 1998 14:39:24 +0200
From: Michal Rutka <erhmiru@erh.ericsson.se>
To: dfc@phys.ufl.edu
Subject: Re: Variables in m//
Message-Id: <la3e8kpvyb.fsf@erh.ericsson.se>
"Daniel F. Crisman" <dfc@phys.ufl.edu> writes:
> Is there any way to tell m// (or s///) to ignore the special regex values
> of characers in variables.
>
> As an example I would like $b to match to $a in this code:
> ############
> $a = 'o+o';
> $b = $a;
> $b =~ /$a/;
> # This last line returns false
$b =~ /\Q$a/;
This will return true.
Michal
------------------------------
Date: 19 Oct 1998 15:10:59 +0200
From: Michal Rutka <erhmiru@erh.ericsson.se>
To: mjb@voodoo.ca.boeing.com
Subject: Re: what is strlen() in perl?
Message-Id: <lazpasofx8.fsf@erh.ericsson.se>
Mehdi Beygi <mjb@voodoo.ca.boeing.com> writes:
> How do I get the strlen of $str ?
> is there something like 'c' language: n = strlen(pStr); where pStr is
> a char pointer?
Use length()
>
> and then is there a way to do character replacement by indexing? I know
> I can use substr() in perl but was
> wonder if there is something similar to 'c' like:
> char str[] = "hello world";
> str[0] = 'H';
> str[6] = 'W';
in Perl substr() is lvalue, therefore you can do:
substr($str,0,1) = 'H';
substr($str,6,1) = 'W';
However, in Perl you should forget about C and do e.g.:
$str =~ s/^.| ./\U$&/g;
which will give you "Hello World".
> and now str is "Hello World"
>
> Perl is wonderful!
What so wonderful about it?
Michal
> thanks
>
> --
> Mehdi Beygi mjb@voodoo.ca.boeing.com
> BoGart Development
> 206-544-9151
>
> [2 <text/html; us-ascii (7bit)>]
------------------------------
Date: Mon, 19 Oct 1998 06:51:20 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: what is strlen() in perl?
Message-Id: <MPG.1094e3b7f5d42c2c9898c5@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <lazpasofx8.fsf@erh.ericsson.se> on 19 Oct 1998 15:10:59
+0200, Michal Rutka <erhmiru@erh.ericsson.se> says...
> Mehdi Beygi <mjb@voodoo.ca.boeing.com> writes:
...
> > char str[] = "hello world";
> > str[0] = 'H';
> > str[6] = 'W';
...
> However, in Perl you should forget about C and do e.g.:
>
> $str =~ s/^.| ./\U$&/g;
>
> which will give you "Hello World".
$str =~ s/(\w+)/\u$1/g;
seems more idiomatic and general, and avoids slowing the program down
with $&.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
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 4007
**************************************