[8935] in Perl-Users-Digest
Perl-Users Digest, Issue: 2553 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 11 05:09:17 1998
Date: Mon, 11 May 98 02:00:44 -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, 11 May 1998 Volume: 8 Number: 2553
Today's topics:
(1) Esperanto: Ivy Kellerman-6 nord@aol.com
(1) Esperanto: Ivy Kellerman-7 nord@aol.com
(1) Esperanto: Ivy Kellerman-8 nord@aol.com
(1) Esperanto: Ivy Kellerman-9 nord@aol.com
Re: a header for `Mail me copies' or `Do not mail me co (John Stanley)
Can i get help PLs? manish@plexustech.net
Re: CGI file writes? (Martien Verbruggen)
Cons and MD5 on NT? kin@c-cube.com
Re: Does Perl have a IDE?I don't like command line. <rra@stanford.edu>
Re: Email Authentication maurice@hevanet.com
Re: Email Authentication maurice@hevanet.com
Help! Perl for Win32 Build 316 socket 'connect' questio <ngai@att.com>
Re: if ($string eg "y") or if ($string == "y") <info@atig.fr>
Re: Local GUI Perl Apps via DHTML (Tad McClellan)
need help capturing error <cagreen@sprint.ca>
Re: need help capturing error (Martien Verbruggen)
OO question: reference to a method? redmonds@acf2.nyu.edu
Re: OO question: reference to a method? <zenin@bawdycaste.org>
Re: Perl output for a gif image <Tony.Curtis+usenet@vcpc.univie.ac.at>
running a perl script <kroney@aloha.net>
Scanning Perl scripts for Y2K problems steven.chau@ssmb.com
Re: Stripping HTML Tags from a file (Tad McClellan)
Re: Stripping HTML Tags from a file (Tad McClellan)
substitution of text?? <andrew@iaccess.com.au>
Translate UNIX shell script into Perl - $100 for best p (Kevin Aylward)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 11 May 1998 05:19:02 GMT
From: nord@aol.com
To: ent Jones <102252.3271@compuserve.com>
Subject: (1) Esperanto: Ivy Kellerman-6
Message-Id: <6j61o6$4pi$1@nnrp1.dejanews.com>
A COMPLETE GRAMMAR OF ESPERANTO
-- THE INTERNATIONAL LANGUAGE --
By Ivy Kellerman
NEW YORK: BOSTON: CHICAGO
D.C. HEATH AND COMPANY
Revision of 1910 Edition [1931]
-----------------------------------------------------------------------------
---------------
LESSON I
COMBINATIONS OF CONSONANTS
6. Each consonant, in a combination of two or more
consonants, is pronounced with its full value, whether within a
word or at its beginning. There are no silent letters.
a. Thus, both consonants are clearly sounded in the groups
kn, kv, gv, sv, in such words as knabo, kvin, gvidi, sviso.
b. The consonants kz, as in ekzisti, ekzameno, must not be
modified to the gz or ks represented by x in exist, execute.
c. The combination sc, as in escepte, scias, is equivalent
to the combination sts in last said, first song, pronounced
together rapidly. The s in a word beginning with sc may be
sounding with the end of the preceding word, if that word ends in
a vowel, as mis-cias for mi-scias.
d. The n and g are pronounced separately in the combination
ng, in such words as lingvo, angulo, producing the sound of ng
heard in linger, not that in singer.
e. Each of two similar letters is clearly sounded, as
interrilato, ellasi, like inter-relate, well-laid.
-----------------------------------------------------------------------------------
Posted by Robert E. Nordlander
nord@aol.com, nord2@juno.com
To: alt.usage.english, comp.lang.perl.misc, sci.lang.translation, sci.lang
cc: Kent Jones <102252.3271@compuserve.com>
May 11, 1998
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Mon, 11 May 1998 05:22:28 GMT
From: nord@aol.com
To: Kent Jones <102252.3271@compuserve.com>
Subject: (1) Esperanto: Ivy Kellerman-7
Message-Id: <6j61uk$4vg$1@nnrp1.dejanews.com>
A COMPLETE GRAMMAR OF ESPERANTO
-- THE INTERNATIONAL LANGUAGE --
By Ivy Kellerman
NEW YORK: BOSTON: CHICAGO
D.C. HEATH AND COMPANY
Revision of 1910 Edition [1931]
-----------------------------------------------------------------------------
---------------
LESSON I
SYLLABLES
7. Each word contains as many syllables as it has vowels and
diphthongs. The division of syllables within a word is as follows:
a. A single consonant goes with the following vowel, as
pa-no, be-la, a-e-ro.
b. A consonant followed by l or r (which are liquids) goes with
l or r, as in ta-blo, a-kra, a-gra-bla.
c. Otherwise, the syllable division is made before the last
consonant of the group, as sus-pek-ti, sank-ta, deks-tra.
d. Prefixes are separated from the words to which they are
attached, as dis-meti, mal-akra, and compound words are divided
into their component parts, as cxef-urbo, sun-ombelo.
-----------------------------------------------------------------------------------
Posted by Robert E. Nordlander
nord@aol.com, nord2@juno.com
To: alt.usage.english, comp.lang.perl.misc, sci.lang.translation, sci.lang
cc: cc: Kent Jones <102252.3271@compuserve.com>
May 11, 1998
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Mon, 11 May 1998 05:25:09 GMT
From: nord@aol.com
To: Kent Jones <102252.3271@compuserve.com>
Subject: (1) Esperanto: Ivy Kellerman-8
Message-Id: <6j623l$533$1@nnrp1.dejanews.com>
A COMPLETE GRAMMAR OF ESPERANTO
-- THE INTERNATIONAL LANGUAGE --
By Ivy Kellerman
NEW YORK: BOSTON: CHICAGO
D.C. HEATH AND COMPANY
Revision of 1910 Edition [1931]
-------------------------------------------------------------------------------------------
LESSON I
ACCENT
8. Words of more than one syllable are accented upon the
syllable before the last, as TA-blo, a-GRA-bla, sus-PEK-ti
-------------------------------------------------------------------------------------
Posted by Robert E. Nordlander
nord@aol.com, nord2@juno.com
To: alt.usage.english, comp.lang.perl.misc, sci.lang.translation, sci.lang
cc: cc: Kent Jones <102252.3271@compuserve.com>
May 11, 1998
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Mon, 11 May 1998 05:28:11 GMT
From: nord@aol.com
To: Kent Jones <102252.3271@compuserve.com>
Subject: (1) Esperanto: Ivy Kellerman-9
Message-Id: <6j629b$5h6$1@nnrp1.dejanews.com>
A COMPLETE GRAMMAR OF ESPERANTO
-- THE INTERNATIONAL LANGUAGE --
By Ivy Kellerman
NEW YORK: BOSTON: CHICAGO
D.C. HEATH AND COMPANY
Revision of 1910 Edition [1931]
-----------------------------------------------------------------------------
---------------
LESSON I
WORDS FOR PRACTICE
9. (To be pronounced aloud, and correctly accented).
Afero, trairi, najbaro, aero, hodia , pacienco, centono,
cxielo, ecx, samideano, treege, obei, obeu, Euxropo, gvidi,
gxojo, cxiujn, justa, gxuste, jxugxi. auxdo, lingvo, knabo,
larga, kuirejo, cxevalejo, sankteco, scio, nescio, edzo, meze,
duobla, sxipo, sxargxi, posxo, svingi, sklavo, palaj, sxafajxo,
atmosfero, monahxo, geometrio, la di, vasta, eksplodi, sencxesa,
senseneajxo, malluma, arbaranoj, mangxo, fresxa, auxskulti,
dauxri.
---------------------------------------------------------------------------------
Posted by Robert E. Nordlander
nord@aol.com, nord2@juno.com
to: alt.usage.english, comp.lang.perl.misc, sci.lang.translation, sci.lang
cc: Kent Jones <102252.3271@compuserve.com>
May 11, 1998
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 11 May 1998 04:24:21 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: a header for `Mail me copies' or `Do not mail me copies'
Message-Id: <6j5uhl$t8r$1@news.NERO.NET>
In article <19980511.001518.3U3.rnr.w164w_-_@locutus.ofB.ORG>,
Russell Schulz <Russell_Schulz@locutus.ofB.ORG> wrote:
>stanley@skyking.OCE.ORST.EDU (John Stanley) writes:
>
>>> why was this in comp.lang.perl?
>> It wasn't.
>
>I was referring to the perl hierarchy, not the specific obsolete
>comp.lang.perl group.
>
>I'm guessing you knew that,
That comp.lang.perl was an obsolete group? Yes. That YOU knew it was an
obsolete group and were referring to a hierarchy in the context of a
newsgroup name, no, of course I didn't know that. I can never guess what
you really meant to say because you can't seem to come close enough on
the first try.
>if only there was a way to specify you didn't want them... some header...
>
>(not to mention the Posted-And-Mailed: header proposal I grabbed off
>of the internic.net internet-drafts directory recently which makes this
>line of argument even more pointless...)
Oh, you mean proposal that Jamie Zawinski extracted from the more
complete proposal I wrote that dealt with the entire issue of mail-news
integration? But then I assume you know that and are just being dense.
>> Please provide an RFC reference that defines this header for news.
>
>I can't.
Then we won't jump up and down expecting it to have any value.
------------------------------
Date: Mon, 11 May 1998 05:15:58 GMT
From: manish@plexustech.net
Subject: Can i get help PLs?
Message-Id: <6j61ie$4ou$1@nnrp1.dejanews.com>
Hi there!!
i am just a beginner in perl programming...
I was trying this script which will take message and attachments from a user
and will mail to several persons..now rest all is fine but i am not getting
how to attach different MIME types to my mail??
Can i attach files of different types to my mail using Perl Script??
Thanks
Manish
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 11 May 1998 06:48:08 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: CGI file writes?
Message-Id: <6j66v8$nc5$1@comdyn.comdyn.com.au>
In article <894817050.33805@ajatar.dragon.net.au>,
"Noel Sampol" <noels@chilli.net.au> writes:
> If I wrote a CGI script that does a file write to a specified server
> file in my web site, what happens when the CGI script is executed by
> multiple users simultaneously?
That will probably go wrong, unless you take the right precautions.
> Or, do I have to handle this situation myself in the CGI script code?
Yep.
> Do I have to have something like
>
> open(FILE, ">test.dat") || die "Can't open file for write";
> print FILE "item=test1" || die "Can't write to file";
No. You have to implement file locking.
For a good discussion on file locking, see Randal Schwartz's column in
Web techniques, especially the one on file locking:
http://www.stonehenge.com/merlyn/WebTechniques/
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | I took an IQ test and the results were
Commercial Dynamics Pty. Ltd. | negative.
NSW, Australia |
------------------------------
Date: 10 May 1998 22:51:57 -0700
From: kin@c-cube.com
Subject: Cons and MD5 on NT?
Message-Id: <6j63lt$onp@co-op.newsguy.com>
The current issue of TPJ describes this:
Cons: A Software Construction Tool
I'm interested to try this but since my prefered platform is NT and
Cons and MD5 from CPAN do not seem to be "NT-aware" yet.
Has anyone made Cons with MD5 work on NT?
-kin
------------------------------
Date: 10 May 1998 21:37:58 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <m3af8p8lsp.fsf@windlord.Stanford.EDU>
Greg Bacon <gbacon@cs.uah.edu> writes:
> Using an editor that claims to do syntax highlighting is like riding a
> bicycle with training wheels so rickety they're bound to break at any
> moment. Parsing Perl is no small problem, and any editor that claims to
> do more than a half-ass job is lying.
You use your tools, I'll use mine. :) Ilya's cperl-mode does a good
enough job for my coding style, and the syntax highlighting has caught a
lot of bugs for me. So has the indentation.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Mon, 11 May 1998 08:06:18 GMT
From: maurice@hevanet.com
Subject: Re: Email Authentication
Message-Id: <6j6bhp$kl7$1@nnrp1.dejanews.com>
In article <6i69s4$glt$1@nntp3.interaccess.com>,
"Orin Fink" <orin@thirdwaveweb.com> wrote:
> I will be running a Perl script on an IRIX system that would send mail to
> users that have "registered" on a web site. Problem is, I don't want to
> send mail to bunk addresses. Is there a way to "validate" someone's e-mail
> address before sending the message.
See the Email::Valid module at:
http://olympia2.adhost.com/~maurice/
It's basically just a modularization of Tom's ckaddr program. From the
README:
This module determines whether an e-mail address conforms to
the RFC822 specification. Optionally, additional
tests/modifications are performed on the address to
correct common addressing errors, identify invalid addresses
within specific domains, verify that a DNS entry exists for
the domain, and ensure that the address is fully qualified.
Maurice <maurice@hevanet.com>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Mon, 11 May 1998 08:06:18 GMT
From: maurice@hevanet.com
Subject: Re: Email Authentication
Message-Id: <6j6bjl$cq6$1@nnrp2.dejanews.com>
In article <6i69s4$glt$1@nntp3.interaccess.com>,
"Orin Fink" <orin@thirdwaveweb.com> wrote:
> I will be running a Perl script on an IRIX system that would send mail to
> users that have "registered" on a web site. Problem is, I don't want to
> send mail to bunk addresses. Is there a way to "validate" someone's e-mail
> address before sending the message.
See the Email::Valid module at:
http://olympia2.adhost.com/~maurice/
It's basically just a modularization of Tom's ckaddr program. From the
README:
This module determines whether an e-mail address conforms to
the RFC822 specification. Optionally, additional
tests/modifications are performed on the address to
correct common addressing errors, identify invalid addresses
within specific domains, verify that a DNS entry exists for
the domain, and ensure that the address is fully qualified.
Maurice <maurice@hevanet.com>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 11 May 1998 06:35:39 GMT
From: "Andy" <ngai@att.com>
Subject: Help! Perl for Win32 Build 316 socket 'connect' question
Message-Id: <01bd7ca7$02a6a420$b5c02e87@Outpost2.ciin.att.com>
Hi,
I've tried the following piece of code to connect an NT 4.0 client running
Perl for Win32 Build 316 to an NT-based web server and it fails to
establish a connection to the server. I've tried the same code on HP-UX
running Perl 5.003 and it works fine. I've isolated the problem to the
'connect' call and would like to know if anyone had come across a similar
problem with the 'connect' function and have a solution to this problem.
Did I overlook something or failed to install a required module?
Thanks in advance for any help!
#!/usr/local/bin/perl
$them = 'www.webserver.com';
$port = 80;
$AF_INET = 2;
$SOCK_STREAM = 1;
$hostname = 'localhost';
$sockaddr = 'S n a4 x8'; # I've also replaced 'a4' with 'C4' w/o success.
($name, $aliases, $proto) = getprotobyname('tcp');
($name, $aliases, $port) = getservbyname($port, 'tcp') unless $port=~
/^\d+$/;
;
($name, $aliases, $type, $len, $thisaddr) = gethostbyname ($hostname);
($a, $b, $c, $d) = unpack('C4',$thisaddr);
print "Local IP Address: $a.$b.$c.$d\n"; # IP addr for local sys is
correct.
($name, $aliases, $type, $len, $thataddr) = gethostbyname ($them);
($a, $b, $c, $d) = unpack('C4',$thataddr);
print "Remote IP Address: $a.$b.$c.$d\n"; # IP addr to remote is correct.
$this = pack($sockaddr, $AF_INET, 0, $thisaddr);
$that = pack($sockaddr, $AF_INET, $port, $thataddr);
$sockrc = socket(S, $AF_INET, $SOCK_STREAM, $proto); # Return code=
1(successful)
$bindrc = bind(S, $this); # Return code= 1 (successful)
$conrc = connect(S,$that); # Returns fail code (NULL)!
# Web server is up and running, I've checked.
.
.
.
------------------------------
Date: Mon, 11 May 1998 08:38:45 +0200
From: "sg" <info@atig.fr>
Subject: Re: if ($string eg "y") or if ($string == "y")
Message-Id: <6j66ij$otv$1@minus.oleane.net>
>> Does anyone know the difference b/w
>>
>> if ($string eg "y") and if ($string == "y")?
>>
>> It seems to me that the latter does not work for string matching.
>> Even $string is something totally different from "y",
>> the if statement is always true. Any comments?
a) eg is false, use eq
eq is used to compare two strings
b) == is used to compare two variables or expressions,
particurlarly numbers
sg
info@atig.fr
------------------------------
Date: Sun, 10 May 1998 23:38:50 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Local GUI Perl Apps via DHTML
Message-Id: <qcv5j6.dof.ln@localhost>
Mike Coyle (mike@coylesystems.com) wrote:
: While many individuals have cited that Perl's end user GUI is the web
: browser, typically this has involved users interacting with a Perl program
: running on a remote web server.
Most Perl programs are not related to the WWW at all, so using
"typically" with regards to Perl is not accurate.
It would be accurate with regards to CGI programs. But such things
are discussed in a different newsgroup.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 10 May 1998 20:07:17 -0400
From: "craig green" <cagreen@sprint.ca>
Subject: need help capturing error
Message-Id: <894844634.724856@michelob>
Hi, I've just started with Perl and need help...
I need help to capture the error output.
What I am doing is calling a program (say prog1) and giving it a file
(file.ext1). This returns another file (file.ext2), which I give to another
program (prog2). This second program returns a file (file.ext3). But it also
produces a report to the screen ( standard error?). My problem is that I
need to get this report as a string so I can then furthur process it. and I
cannot change prog2 in anyway. If anyone can help me I would be forever
greatful!!! Thanks in advance.
Craig.
------------------------------
Date: 11 May 1998 06:53:28 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: need help capturing error
Message-Id: <6j6798$nc5$2@comdyn.comdyn.com.au>
[Please note that comp.lang.perl is not a functional group anymore. If
your news server still carries it, please inform your news admin to
remove it: Newsgroups adapted]
In article <894844634.724856@michelob>,
"craig green" <cagreen@sprint.ca> writes:
> Hi, I've just started with Perl and need help...
> I need help to capture the error output.
# perldoc perlfaq8
/How can I capture STDERR from an external command?
You don't seem to be too certain that it is stderr you need to
capture. If it is stdout, you can just use backticks.
# perldoc perlop
/`STRING`
Martien
PS. Documentation is your friend. Please learn to use it.
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | The gene pool could use a little
Commercial Dynamics Pty. Ltd. | chlorine.
NSW, Australia |
------------------------------
Date: Mon, 11 May 1998 05:38:01 GMT
From: redmonds@acf2.nyu.edu
Subject: OO question: reference to a method?
Message-Id: <6j62rp$6a6$1@nnrp1.dejanews.com>
If you save a reference to a subroutine like so:
$sub = \&subroutine
Then later these two statements are equivalent, right?
&subroutine( 1,2,3 )
$sub->( 1,2,3 )
But if &subroutine is an object method what is the equivalent of
$self->subroutine( 1,2,3 ). Is there anything besides $sub->( $self,1,2,3 )?
Sean Redmond
redmonds@acf2.nyu.edu
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 11 May 1998 07:00:29 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: OO question: reference to a method?
Message-Id: <894870477.550782@thrush.omix.com>
redmonds@acf2.nyu.edu wrote:
: If you save a reference to a subroutine like so:
: $sub = \&subroutine
: Then later these two statements are equivalent, right?
: &subroutine( 1,2,3 )
: $sub->( 1,2,3 )
: But if &subroutine is an object method what is the equivalent of
: $self->subroutine( 1,2,3 ). Is there anything besides $sub->( $self,1,2,3 )?
Nope, not directly at least. However...you can "fake it" for most uses
like this:
$sub = sub { $obj->method (@_) };
$sub->(1, 2, 3); # Calls $obj->method (1, 2, 3)
Note that $obj can be lexical (my $obj), go out of visible scope, and will
still work fine.
--
-Zenin
zenin@archive.rhps.org
------------------------------
Date: 11 May 1998 09:09:30 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
To: tonyc@clara.net
Subject: Re: Perl output for a gif image
Message-Id: <7xiund9tcl.fsf@beavis.vcpc.univie.ac.at>
Re: Perl output for a gif image, Anthony <tonyc@clara.net>
said:
Anthony> print "Content-Type: image/gif\n\n";
Anthony> print "$output";
Anthony> The output is in the form: <img src = "1.gif">
Anthony> which doesn't work, and I have reformed it to read
Anthony> what form must the output be for an HTML page? -
Your <img> syntax is correct for *HTML* (no alt attribute?).
Your content type is specified as "image/gif".
If you want to output HTML, you'd have to have a content
type of "text/html".
"image/gif" means that what follows is in GIF format,
i.e. it isn't HTML. So "$output" should just be the
contents of the GIF image, not an HTML tag to include a GIF.
If you want to generate text/html instead, remember that a
CGI script is not running as you, nor necessarily with the
current working directory you think it is.
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, AT | http://www.vcpc.univie.ac.at/
"You see? You see? Your stupid minds! Stupid! Stupid!" ~ Eros, Plan9 fOS.
------------------------------
Date: Sun, 10 May 1998 22:14:33 -1000
From: Jason Kronemeyer <kroney@aloha.net>
Subject: running a perl script
Message-Id: <3556B368.8B3DBA82@aloha.net>
Just installed perl for win32. In order to run a script I have to type
"perl script.pl" -- is there a way to run the same script without typing
"perl" and just entering "script.pl" like you would a normal
executable? I know that I can do this on a unix system.
Thanks
------------------------------
Date: Mon, 11 May 1998 07:56:02 GMT
From: steven.chau@ssmb.com
Subject: Scanning Perl scripts for Y2K problems
Message-Id: <6j6auh$k45$1@nnrp1.dejanews.com>
Hi All,
Does anyone know if there is a tool to scan Perl programs for potential year
2000 problems?
Steve
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Mon, 11 May 1998 00:12:10 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Stripping HTML Tags from a file
Message-Id: <ab16j6.lvf.ln@localhost>
Matt McKenzie (jasmatt@es.co.nz) wrote:
: I have a script that uses the Simple.pm module to fetch an HTML file
: from the web and stores it into an @array for processing.
^^^^^^^^^^^^^^
How is it divided up into array elements?
If they are split on lines, then it will be Real Hard to deal with
HTML tags that span more than one line (so the s/// below is meant
to be used on the whole thing in one big string, not on individual
lines).
: I really want to do is strip out the HTML tags.
: <snipped from perlfaq9>------How do I remove HTML from a string?
: #!/usr/bin/perl -p0777
: s/<(?:[^>'"]*|(['"]).*?\1)*>//gs
: -----------------------------------
: I'm not sure how to implement this into my script.
$page = get "http://www.perl.com";
die "could not get page\n" unless defined $page;
$page =~ s/<(?:[^>'"]*|(['"]).*?\1)*>//gs;
@array = split /\n/;
...
Of course a "simple minded" approach such as this would only be used
in Hobbiest applications.
If it is important that it always Work Right, then don't do
it this way...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 11 May 1998 00:31:01 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Stripping HTML Tags from a file
Message-Id: <le26j6.v3g.ln@localhost>
Tad McClellan (tadmc@flash.net) wrote:
: $page =~ s/<(?:[^>'"]*|(['"]).*?\1)*>//gs;
: @array = split /\n/;
Uh, sorry.
make that:
@array = split /\n/, $page; # ;-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 11 May 1998 17:22:34 +1000
From: "Andrew Specht" <andrew@iaccess.com.au>
Subject: substitution of text??
Message-Id: <6j68qa$3sp@sleipnir.iaccess.com.au>
hey,
is there a way in perl to substitute a large number of spaces in a text file
with just one space?
i tried it with sed, but that didn't work.
any ideas?
Thanks :)
Andrew Specht
System Administrator
Internet Access Australia
andrew@iaccess.com.au
------------------------------
Date: Mon, 11 May 1998 02:57:51 -0400
From: kaylward@removethis.eicorp.net (Kevin Aylward)
Subject: Translate UNIX shell script into Perl - $100 for best port
Message-Id: <MPG.fc06b7a4acddf6e989699@news.clark.net>
I am in the process of moving a web site programmed by a contractor from
UNIX to NT. The site has a Press Release page that loads wrapper HTML
code then executes a UNIX shell script:
<!--#exec cmd="cgi-bin/pr.sh"-->
to build HTML code for the page as follows:
<font color=#ff0000 size=2>
<b> <br>
May 5, 1998
<br>
</b>
</font><a href="news.shtml?1998050501.prr">BBB TO ACQUIRE LEADING US
TECHNOLOGY COMPANY<br>
</a>
<font color=#ff0000 size=2>
<b> <br>
May 1, 1998
<br>
</b>
</font><a href="news.shtml?1998050101.prr">BOB REACHES THREE YEAR TARGET
- TWO YEARS EARLY<br>
</a>
Etc...
All the files the /site/news/current/ directory have names like
1998050501.prr. That directory is scanned completely by the shell
script. Each .prr file is converted to a link as shown above. The name
of the file is translated on the third line of each link (i.e., May 5,
1998), and the last two digits of the file name before the .prr extension
indicate the press release number (01 in the example above). If another
press release is made that day it will be named 1998050502.prr and should
come first in a listing of stories. The text in the URL is taken from
the first line of the .prr file.
The site is currently running on Solaris 2.6 and is moving to IIS 4.0 on
NT 4.0. The new site has ActiveState Perl for Win32 installed and all of
our Perl scripts are running fine. We want to translate this UNIX shell
script into standard Perl to complete the move. Since the new site is
hosted at a large corporate site provider we probably can't use modules
that are not in the standard ActiveState Perl for Win32 package. If I
had time I would try to fix this myself, but since I am not very Perl
fluent I am offering $100 to the first (or best) workable replacement
Perl script. Source code for pr.sh is shown below. If you are in any
way offended by this post I sincerely apologize, but I figure that a good
Perl programmer can knock this out in 15 to 30 minutes (or less) and that
offering a decent reward will result in complete solution, which is what
I really need.
------------------------------------------
Kevin Aylward
kaylward@clark.net
Contents of pr.sh:
datestring ()
{
datestryear=`echo $1 | cut -b1-4`
datestrmonth=`echo $1 | cut -b5-6`
datestrday=`echo $1 | cut -b7-8`
case ${datestrmonth:=Bad_Month} in
01) datestr=January;;
02) datestr=February;;
03) datestr=March;;
04) datestr=April;;
05) datestr=May;;
06) datestr=June;;
07) datestr=July;;
08) datestr=August;;
09) datestr=September;;
10) datestr=October;;
11) datestr=November;;
12) datestr=December;;
*) datestr=${datestrmonth};;
esac
case ${datestrday:=Bad_Day} in
0?) datestr="$datestr `echo $datestrday | cut -b2-2`";;
*) datestr="$datestr $datestrday";;
esac
datestr="${datestr}, ${datestryear:=Bad_Year}"
echo $datestr
printf "<br>\n"
}
prtitle ()
{
printf "%s<br>\n" "`head -1 $1`"
}
pritem ()
{
prfile=$1
prname=`basename $1`
if [ $currentdate -ne `echo $prname | cut -b1-8` ]
then
printf "<font color=#ff0000 size=2>\n<b>"
printf " <br>\n"
datestring $prname
printf "</b>\n</font>"
fi
currentdate=`echo $prname | cut -b1-8`
printf "<a href=\"news.shtml?${prname}\">"
prtitle $prfile
printf "</a>\n"
}
prall ()
{
printf "<font face=\"verdana,helvetica,arial\" color=#ff0000>\n"
for f in `ls ${prdir}*.prr | sort -r`
do
printf "\n\n"
pritem $f
done
}
prpage ()
{
prfile=$1
prname=`basename $1`
printf "<font face=\"verdana,helvetica,arial\" color=#990000
size=2>\n<b>\n"
datestring $prname
printf " <br>\n\n<font color=#000099 size=3>"
prtitle $prfile
printf " <br>\n</b>\n</font></font>\n\n"
tail +2 $prfile
}
prdir=/site/news/current/
bindir=/site/cgi-bin/
currentdate=abcdefgh
if [ $QUERY_STRING ]
then prpage ${prdir}$QUERY_STRING
else prall
fi
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 2553
**************************************