[12695] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 104 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jul 10 19:07:16 1999

Date: Sat, 10 Jul 1999 16:05:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 10 Jul 1999     Volume: 9 Number: 104

Today's topics:
    Re: Best method to test a string within an array? <sjs@yorku.ca>
    Re: cgi timeout <sjs@yorku.ca>
    Re: cgi.pm question <sjs@yorku.ca>
        dbmopen()  e   dbmclose() <fnemec@sti.com.br>
    Re: dbmopen()  e   dbmclose() <cassell@mail.cor.epa.gov>
    Re: FAQ 5.7: How can I use a filehandle indirectly? (Michael Rubenstein)
    Re: FAQ 5.7: How can I use a filehandle indirectly? <flavell@mail.cern.ch>
    Re: Floating Point Number With Time Function (Jan Dubois)
    Re: Help: creating files through a CGI (Mike Bristow)
    Re: How to dereference an array reference? <anonymous@web.remarq.com>
    Re: How to dereference an array reference? (Abigail)
        Ignoring the first line of a file <bwebb@fred.net>
    Re: Loop - how to <sjs@yorku.ca>
    Re: Need Expert Help! <sjs@yorku.ca>
    Re: Not Learning Perl <jason@killdare.demon.co.uk>
    Re: one-file Perl for Win32 <granadam@mail.datanet.hu>
        OT(ish): What is "Perl golf"?! <pcs26@cam.ac.uk>
    Re: OT(ish): What is "Perl golf"?! <rick.delaney@home.com>
    Re: Random Numbers <doughera@lafayette.edu>
    Re: Random Numbers <cassell@mail.cor.epa.gov>
        Reg. Expression HELP <prasad@panix.com>
    Re: Reg. Expression HELP (Abigail)
        url extraction without HTML::LinkExtor module webmaster@inlandpac.com
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sat, 10 Jul 1999 16:52:46 -0400
From: Steven Smolinski <sjs@yorku.ca>
Subject: Re: Best method to test a string within an array?
Message-Id: <931640099.2015233735@newshub.ccs.yorku.ca>

On Wed, 07 Jul 1999, pedro wrote:
>Wondered if anyone could suggest
>the best method to test whether
>a string is within an array?

I suggest you look into any one of the Perl books; most have fairly extensive
information on pattern matching.

$string =~ /$match/;  # returns true if $match is in $string

The above is horribly simple compared to the power included in Perl's RegEx
engine.

steve



------------------------------

Date: Sat, 10 Jul 1999 17:33:24 -0400
From: Steven Smolinski <sjs@yorku.ca>
Subject: Re: cgi timeout
Message-Id: <931642547.1618237450@newshub.ccs.yorku.ca>

On Thu, 08 Jul 1999, Nicola wrote:
>I'd want to run a perl script that need 30 minutes to execute,
>but this is killed by the cgi-timeout limit of the server.
>Is there a method to avoid the timeout limit?

If you don't need any input back from the script to the browser then don't call
the script as a cgi program, call it from a cgi program with system(), and let
your user go on about his day.

If you need the thing to wait for half an hour and pop up a page, then aside
from reconfiguring your server, I don't have any ideas.

Steve


------------------------------

Date: Sat, 10 Jul 1999 16:56:19 -0400
From: Steven Smolinski <sjs@yorku.ca>
Subject: Re: cgi.pm question
Message-Id: <931640381.7997244@newshub.ccs.yorku.ca>

On Wed, 07 Jul 1999, John Hurley wrote:

>My site is running on a BSD server and every time i try to run a Perl
>program on it with the use CGI line, i get a 500 error.  Can it be
>that the Perl interpreter on the server may be an old version that
>does not contain cgi.pm on it?  I have been trying to get a hold of my
>isp for a while now to find out about this and have not been replied
>to yet.  So I just thought I would ask you Perl pros.

I have found debugging 500 server errors to be a pain because it could be so
many things.

Things to try:
1. Is the script executable on the webserver?
2. execute the perl script on the command line on the web server machine and
see if it spits out the proper html
3. Get _The Official Guide to Programming with CGI_ and _Perl Cookbook_ (the
last has a more extensive list of things to check when you get a 500 sever
error.)


------------------------------

Date: Sat, 10 Jul 1999 17:14:50 -0300
From: "Fernando Nemec" <fnemec@sti.com.br>
Subject: dbmopen()  e   dbmclose()
Message-Id: <7m8asj$mtr$1@news.sti.com.br>

Hello!

I need install any lib to use these functions ?

dbmopen()
dbmclose()

Thanks!

--
Fernando Nemec
fnemec@sti.com.br
São Paulo - BR




------------------------------

Date: Sat, 10 Jul 1999 14:42:58 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: Fernando Nemec <fnemec@sti.com.br>
Subject: Re: dbmopen()  e   dbmclose()
Message-Id: <3787BE62.9531BCFD@mail.cor.epa.gov>

[courtesy cc mailed to poster]

Fernando Nemec wrote:
> 
> Hello!
> 
> I need install any lib to use these functions ?
> 
> dbmopen()
> dbmclose()

No.  These functions are part of the Perl base.  However:
[1] they have been largely superseded by the tie() and untie()
    functions; and
[2] in older Perls, if your system had neither DBM nor ndbm
    installed, you would usually get a fatal error when
    trying dbmopen() .

You might want to type 'perl -v' at a command prompt to see
what version you have.  The current stable release is 5.005_03.

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


------------------------------

Date: Sat, 10 Jul 1999 21:38:20 GMT
From: miker3@ix.netcom.com (Michael Rubenstein)
Subject: Re: FAQ 5.7: How can I use a filehandle indirectly?
Message-Id: <378aba02.79373663@nntp.ix.netcom.com>

On 10 Jul 1999 12:18:41 -0500, abigail@delanet.com (Abigail)
wrote:

>Michael Rubenstein (miker3@ix.netcom.com) wrote on MMCXXXIX September
>MCMXCIII in <URL:news:37886376.57218315@nntp.ix.netcom.com>:
>?? 
>?? Ordinary, conversational, English is, I believe, the appropriate
>?? standard for Usenet discussion.
>
>
>All those damned foreigners should stay away from Usenet.

If you prefer,

	s/English/language/

Of course, except on newsgroups specifically intended for other
languages, English is the norm.  I've seen some people get upset
by those who use other languages, but it  doesn't bother me.
-- 
Michael M Rubenstein


------------------------------

Date: Sat, 10 Jul 1999 23:48:33 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: FAQ 5.7: How can I use a filehandle indirectly?
Message-Id: <Pine.HPP.3.95a.990710234727.6859B-100000@hpplus03.cern.ch>

On 10 Jul 1999, Abigail wrote:

> ?? Ordinary, conversational, English is, I believe, the appropriate
> ?? standard for Usenet discussion.
> 
> All those damned foreigners should stay away from Usenet.

Was that "tot ziens"?  Hope not.

-- 
          The British attitude is essentially that it is better to have 
          100% of nothing than 25% of something. - D.Hansen, uk.railway




------------------------------

Date: Sun, 11 Jul 1999 00:44:33 +0200
From: jan.dubois@ibm.net (Jan Dubois)
Subject: Re: Floating Point Number With Time Function
Message-Id: <3795b6b1.59304054@news3.ibm.net>

"Troy Knight" <troyknight@troyknight.eurobell.co.uk> wrote:

>Activeperl 5.307 does include the docs but not the faq's, not even an option
>to include them on setup. I have now downloaded the newest win32 version
>Activeperl 5.518 which does have the faq's included. :)

I wish people wouldn't mangle the ActiveState build numbers with the Perl
version numbers.  That is just wrong.  There is no exact relation between
those two.  But you can guess a little at the systematic:

build 110 : 11th build of Perl 5.001m from hip/ActiveWare
build 316 : 17th build of Perl 5.003_07 from ActiveState
build 518 : 19th build of Perl 5.005_0x (in this case, _03)

Only builds 5xx are called ActivePerl; earlier ones were called "Perl for
Win32".  This is confusing enough without creating phantom versions like
5.307 which looks like 5.003_07.  Oops, in this case it is even correct. :-)

-Jan


------------------------------

Date: Sat, 10 Jul 1999 21:21:15 GMT
From: mike@fat.dotat.at (Mike Bristow)
Subject: Re: Help: creating files through a CGI
Message-Id: <slrn7ofeaa.n88.mike@lindt.fat.dotat.at>

On Sat, 10 Jul 1999 20:29:48 -0700, Scientia <scientia@XXXtechnologist.com> wrote:
>Abstract: my CGI is supposed to create new files (not existing files)
>but I am not able to make it work!
>
>I mean this: imagine that someone visits my site
>and I want him to write some informations.
>For reasons that I can't explain here, I need that
>the CGI creates a file within my directory where such informations
>must be stored (the name of the files depends on the informations
>themselves).
>Of course, the visitor is not aware that the CGI is creating a file:
>he simply fills some fields in a form.
>
>My Perl program is not able to create such file on my web directory!
>However, I have Win95/DOS and ActivePerl and in this case the file is
>created with no problems.
>For example:
>open (outf,">created.txt");
>print outf "Hello\n";
>This works perfectly in ActivePerl with Win95/DOS.

Are you using -w & use strict?

Are you using CGI::Carp 'fatalsToBrowser'?

Perhaps you should recode that fragment:

my $file = '/full/path/name/created.txt'
open (OUTF, ">$file") || die "Help, I can't create $file: $!";
print OUTF "Hello\n"  || die "Help, I can't print to $file: $!";
close OUTF            || die "Help, I can't close $file: $!;

>But unfortunately I do not know UNIX or LINUX
>and I do not even know what is running on my web server!

print `uname -a`;

>I understand that in UNIX and LINUX a file must be created
>with the command "touch filename", so I tried to do that
>from my Perl program:
>system "touch created.txt";
>but nothing happens;
>I also chmod-ed it:
>system "chmod 777 created.txt"

Of course not; chmod can only CHange MODes of files
that exist.

Oh, and perldoc -f chmod.

>My CGI runs with no errors, 

Is that the CGI runs with no errors, or the CGI runs with
no errors that you notice?  Do you check the return values
of all the syscalls?

>Somewhere I read that I should make the entire directory
>readable/writable, but this is not a good idea.

Well, it should be readable, searchable and writeable
for the user that the CGI runs as (may be your account
on the system, or it may be ``nobody'' or similar.

>So, what can I do?

Buy a book on UNIX and PERL.

Or hire someone else to do the job for you :-)

>Final question: commands like "chmod 777" are the same
>for UNIX and LINUX?!

Yes.

>scientia@technologist.com

Ignored; post in here and read it in here.

-- 
Mike Bristow, Geek-At-Large.                GK/RM0501
one tequila - two tequila - three tequila - FLOOR !!!


------------------------------

Date: Sat, 10 Jul 1999 12:36:22 -0800
From: theoddone33 <anonymous@web.remarq.com>
Subject: Re: How to dereference an array reference?
Message-Id: <931638984.7350@www.remarq.com>

I must ask why these are violations.  Spam proofed email
does not seem like a bad thing to me.  Or were you
referring to the fact that his email address was not easy
to find or un-spam-proof?  As for serving as a help desk,
Usenet is for people of like interests who wish to
converse, but certainly using technical groups to find
answers to questions is another major purpose of Usenet in
general.  If you doubt this, look at comp.os.linux.misc or
another similar newsgroup.  Many of Tom's posts from the
manpages would be useless if Usenet were not for helping
people.  Or once again, have I misuderstood your criticism?
 One more thing, when advising someone to read the faq for
this newsgroup, it would help that person out if you could
provide a web address for someone to reach that faq.  I
don't know the home address of the faq, but there is a copy
at www.faqs.com I believe.

theoddone33
theoddone - AT - quakefiles - DOT - com



**** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ****


------------------------------

Date: 10 Jul 1999 16:09:02 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How to dereference an array reference?
Message-Id: <slrn7ofdim.h7.abigail@alexandra.delanet.com>

theoddone33 (theoddone@quakefiles.com) wrote on MMCXXXIX September
MCMXCIII in <URL:news:931638984.7350@www.remarq.com>:
|| I must ask why these are violations.  Spam proofed email
|| does not seem like a bad thing to me.

It's violating the standards, and putting the burden on people
who might help you. And that just because you give in to spammers
and are to much of a wussie to hit 'd' or install some filtering
software.

||                                        Or were you
|| referring to the fact that his email address was not easy
|| to find or un-spam-proof?  As for serving as a help desk,
|| Usenet is for people of like interests who wish to
|| converse, but certainly using technical groups to find
|| answers to questions is another major purpose of Usenet in
|| general.  If you doubt this, look at comp.os.linux.misc or
|| another similar newsgroup.  Many of Tom's posts from the
|| manpages would be useless if Usenet were not for helping
|| people.  Or once again, have I misuderstood your criticism?

Helping people is something else than being a help desk. People
at help desks get paid for answering the same stupid questions
over and over and over again. People here don't get paid. People
here don't want to answer the same stupid questions over and over
again. That's why there are FAQs and manuals. To prevent people
having to ask the same stupid questions over and over again.

I don't really believe there isn't a FAQ for comp.os.linux.misc
or another similar newsgroup. But even if there isn't, it's
irrelevant. This is comp.lang.perl.misc, not some other group.
This is a group with a FAQ. Like many other groups have.

||  One more thing, when advising someone to read the faq for
|| this newsgroup, it would help that person out if you could
|| provide a web address for someone to reach that faq.  I
|| don't know the home address of the faq, but there is a copy
|| at www.faqs.com I believe.

Pointers to the FAQ are posted here every few days. "I don't know
where the FAQ is" isn't an excuse. "I don't know where the FAQ is"
is just a way of saying "I am a lamer - and I don't even know it".



Abigail
-- 
Spammers, pay attention: theoddone@quakefiles.com


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: Sat, 10 Jul 1999 18:41:44 -0400
From: "Robert E Webb" <bwebb@fred.net>
Subject: Ignoring the first line of a file
Message-Id: <5%Ph3.47$hI2.95095@news.abs.net>

I have a file that has control Ms on the end of each line where the data
starts at line 2. The first line is an unwanted data.

I wrote the following:

#!/usr/bin/perl -i -p

next if $.=1;
tr/\cM//d;


The problem is that the 1st line is still in the file after running the
script. What am I doing wrong??

Also, the last 4 lines in the file are also unwanted data, but the file
itself is variable in length, so I am not sure how to get rid of those
lines.

TIA.

Regards,
Bob/




------------------------------

Date: Sat, 10 Jul 1999 17:37:20 -0400
From: Steven Smolinski <sjs@yorku.ca>
Subject: Re: Loop - how to
Message-Id: <931642904.1490465940@newshub.ccs.yorku.ca>

On Fri, 09 Jul 1999, jingker cheng wrote:
>Hello All :
>
>I want to use PERL writing a loop to retrive my FORM data...
>Following is my question:
>
>From the previous FORM, I got two sets of data,say:
>
>aaa1=5,bbb1=3,ccc1=6,ddd1=0
>aaa2=1,bbb2=1,ccc2=5,ddd2=7
>
>I want to print them in a loop. Can anyone tell me how to retrive ?
>Thanks....

First, how do you get two sets of data from a form?  I thought you just always
get a bunch of name=value pairs.  But anyway....try this:

use CGI qw(:standard);

foreach ( param() ) {
	print "$_=param($_)\n";
}

This should produce:

aaa1=5
bbb1=3
ccc1=6
 ..etc...

>By th way, if I want to INSERT them into an Informix Database ( I can
>use
>DBI,DBD to connect the database engine), the procedure is ......

 ..to crack a manual or pod on database functions.

Steve



------------------------------

Date: Sat, 10 Jul 1999 17:22:45 -0400
From: Steven Smolinski <sjs@yorku.ca>
To: Dafydd Hopkin <dafydd@gointernet.co.uk>
Subject: Re: Need Expert Help!
Message-Id: <931642215.585911895@newshub.ccs.yorku.ca>

On Thu, 08 Jul 1999, Dafydd Hopkin wrote:

>Something like that yes - I want to write a script which will open a
>differing number of files dependent on the number of command line
>arguments, and rather than writing separate code for each of the
>possible files that could be opened. I want to reference each as an
>element of an array, so I can step through the list one by one and do
>similar operations on each of them.

Look into the diamond operator: <>

If in a while loop it will step though the lines of all the files named in
@ARGV, which seems like what you're aiming at.  It returns EOF and exits the
while loop at the end of the last file mentioned in @ARGV.  Try something 
like:

while (<>) {
	...process line...
}

Remember to shift out your command-line options (if any) so that only 
filenames are left in @ARGV before you run it this way.

HTH

Steve
Just Another Perl Newbie

BTW: Apparently if you ask a question here which is answered in one of the 
many good FAQs I am supposed to tell you to RTFM.  So, there you go.



------------------------------

Date: Sat, 10 Jul 1999 16:44:29 +0100
From: Jason <jason@killdare.demon.co.uk>
Subject: Re: Not Learning Perl
Message-Id: <e$hO9DAdp2h3Ewtn@shambolica.freeserve.co.uk>

In article <x7n1x5qff4.fsf@home.sysarch.com>, Uri Guttman
<uri@sysarch.com> writes

[My pathetic effort snipped out]

All I wanted was to be loved, is that so bad?

>this was done much better last year. someone posted a long troll which
>hit every hot button this group has. he wanted instant help and didn't
>want to rtfm etc. it should be reposted every so often. it actually
>suckered some of us into thinking the poster was a real nutcase. anyone
>remember the name (or is the author still here?) of the author so we
>could find it on deja?
>
>uri
>

Here's the original, play it again Spam:

Subject: QUESTIONS (was: Perl Programmer Needed)
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Date: 1998/09/09
Newsgroups: comp.lang.perl.misc
help me out quick buds ...
got some big work for any def perl programmers who
don't mind a rad work setup ... need on call 24/7
earn some money and stock options while workin for the
next microsoft

need you now but you gotta respond now ... this will
go fast ... you gotta be expert html programmer and
know NT web servers like the back of my hand ... and
ready to go

but you gotta prove yourself first (you gotta give a little
to get a little ... yeah ... ya know it!)

all of our perl programs are giving us some major '500'
errors to our clients ... not cool ... (i know, i know
why aren't ya usin ASP? well we'll get there dude, we
just inherited this perl lameness ... maybe you'll help us
out)

so here's your perl test ... get this right, and you might
get a shot at workin here:

first, our CGI scripts runs from the command line but not the
browser (500 Server Error) ... what's gives?

two, how do ya extract URLs?

three, how do ya decode a CGI form?

i took a look 'round the web, to try to get some clues on
all this, but come up short ... and the perl documentation
sucks, so if you think you can nail this, why not let me
know ... it could be your last chance to get in on this

anybody who wants to help me gotta send some email cuz i
don't normally read this group

you help me out ... maybe i'll help you out some time

cool

ptimmins@|NO.SPAM|netserv.unmc.edu

p.s.
Hitlers need not respond
-- 
Jason@shambolica.freeserve.co.uk


------------------------------

Date: Sat, 10 Jul 1999 23:58:03 +0200
From: "dzsi" <granadam@mail.datanet.hu>
Subject: Re: one-file Perl for Win32
Message-Id: <3787c54f.0@ganymede.datanet.hu>

> I have found that the normal Perl distributions for Win32 require certain
> .DLLs in order for the interpreter to work, and thus I have had to put the
> DLLs on the network and add the shared directory into the %PATH% variable.
> This is a problem under Win95 where the DOS prompt (and thus the batch
file)
> has limited space for environment variables.
>
doesn't the exe file look in the current directory for the dll files first?
if so, make a batch
file (perl.bat) that changes the current dir to whereever the interpreter
is, then call it with the
proper parameters.

also, try pif's or shortcuts, there you can also set the working directory
for the executable file.

> So what I want is a PERL.EXE that will run all by itself, with no other
> files required. I assume that the best way to do this is to build it from
> the sources, but I have little experience compiling anything under NT or
95.
> Any advice or help would be appreciated, especially if someone has already
> done what I want to do.
>

there has to be an option for the linker to link code from dll's instead of
references. check on this.

adam.





------------------------------

Date: Sat, 10 Jul 1999 22:34:58 +0100
From: "Paul Scott" <pcs26@cam.ac.uk>
Subject: OT(ish): What is "Perl golf"?!
Message-Id: <931642342.20258.0.nnrp-06.c2ded04b@news.demon.co.uk>

Hi all,
seen refs to perl golf in a few replies and I was just wondering what it is.

Go on, quote me a manpage or FAQ entry :-)

Thanks
PaulS


--
In motorway driving, there are many things which are more dangerous
than speed.

Cocaine, for example.






------------------------------

Date: Sat, 10 Jul 1999 21:56:23 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: OT(ish): What is "Perl golf"?!
Message-Id: <3787C158.7375E91@home.com>

[posted & mailed]

Paul Scott wrote:
> 
> seen refs to perl golf in a few replies and I was just wondering what it is.
> 
> Go on, quote me a manpage or FAQ entry :-)

Okay, from perlfaq2:

    Archives of comp.lang.perl.misc

Not really a question, but still enough information for you to figure it
out.  :-)

-- 
Rick Delaney
rick.delaney@home.com


------------------------------

Date: Sat, 10 Jul 1999 17:08:17 -0400
From: Andy Dougherty <doughera@lafayette.edu>
Subject: Re: Random Numbers
Message-Id: <Pine.GSU.4.05.9907101703590.14195-100000@newton.phys>

On Fri, 9 Jul 1999, David Cassell wrote:

> But on a related topic, why doesn't Perl use a better rand()
> algorithm than the OS provides, given how lousy some of these
> are?

The short answer is that there is no single rand-like function that is
universally "better" for all uses.  Still some rand()s are *really* bad.
In 5.006, Configure will search for and use the first of the set {drand48,
random, rand} that it finds.  This will probably be good enough for most
casual uses.

Folks who are doing serious work involving pseudo-random numbers probably
ought to find a well-tested PRNG suited for their particular purpose and
use it via perl5's extension mechanism.  That's why the extension
mechanism is there, after all.

    Andy Dougherty		doughera@lafayette.edu
    Dept. of Physics
    Lafayette College, Easton PA 18042



------------------------------

Date: Sat, 10 Jul 1999 14:46:10 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Random Numbers
Message-Id: <3787BF22.22E862BA@mail.cor.epa.gov>

Andy Dougherty wrote:
> 
> On Fri, 9 Jul 1999, David Cassell wrote:
> 
> > But on a related topic, why doesn't Perl use a better rand()
> > algorithm than the OS provides, given how lousy some of these
> > are?
> 
> The short answer is that there is no single rand-like function that is
> universally "better" for all uses.  Still some rand()s are *really* bad.

Yes.  I believe I referred to Jon Orwant's article in TPJ on
the subject.

> [snip]
> Folks who are doing serious work involving pseudo-random numbers probably
> ought to find a well-tested PRNG suited for their particular purpose and
> use it via perl5's extension mechanism.  That's why the extension
> mechanism is there, after all.

I just use a little code to implement one of George Marsaglia's
PRNG's, rather than using the extension mechanism.. as I probably
ought to.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


------------------------------

Date: Sat, 10 Jul 1999 21:41:33 GMT
From: "Prasad" <prasad@panix.com>
Subject: Reg. Expression HELP
Message-Id: <h6Ph3.68682$eF3.16906@news.rdc1.nj.home.com>

Hi,

I am looking for an expression which should replace the FONT tags
with PRE tag if that font face has Courier font. It should leave other
FONT tags as it is.
For ex:

<font face="courier" ...>The text here</font>

Should be replaced with:

<pre>The text here</pre>

So far I wrote the following which doesn't work.

$text =~ s/(\<font.*courier.*\>)(.*)(\<\/font\>)/\<pre\> $2 \<\/pre\>/gi;

Could some one help me out. Please cc me at: prasad@panix.com.

Thanks in advance.
- Prasad





------------------------------

Date: 10 Jul 1999 17:20:59 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Reg. Expression HELP
Message-Id: <slrn7ofhpk.h7.abigail@alexandra.delanet.com>

Prasad (prasad@panix.com) wrote on MMCXXXIX September MCMXCIII in
<URL:news:h6Ph3.68682$eF3.16906@news.rdc1.nj.home.com>:
__ 
__ I am looking for an expression which should replace the FONT tags
__ with PRE tag if that font face has Courier font. It should leave other
__ FONT tags as it is.


HTML::Parser


Abigail
-- 
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: Sat, 10 Jul 1999 20:57:45 GMT
From: webmaster@inlandpac.com
Subject: url extraction without HTML::LinkExtor module
Message-Id: <7m8c46$drd$1@nnrp1.deja.com>

I am trying to write a script that will extract all domains (i.e.
ME.COM, PEPSI.COM, etc.) from $results and out put those domains as
$domains.

I don't want to use HTML::LinkExtor and cannot find any documentation
on how to do this.

Thanks,
Chad.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


------------------------------

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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 V9 Issue 104
*************************************


home help back first fref pref prev next nref lref last post