[16602] in Perl-Users-Digest
Perl-Users Digest, Issue: 4014 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 14 18:15:43 2000
Date: Mon, 14 Aug 2000 15:15:27 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <966291326-v9-i4014@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 14 Aug 2000 Volume: 9 Number: 4014
Today's topics:
Re: regex <aqumsieh@hyperchip.com>
Re: regex <lr@hpl.hp.com>
Re: Slightly off topic vod@writemail.com
Someone help!!! <kjostudio@hotmail.com>
Re: Someone help!!! <care227@attglobal.net>
Re: Someone help!!! <kjostudio@hotmail.com>
Re: Someone help!!! <care227@attglobal.net>
Re: su.c <russ_jones@rac.ray.com>
Re: su.c <occitan@esperanto.org>
Re: Substituting newlines for HTML equivalent <lr@hpl.hp.com>
Re: tag parsing. johnvert@my-deja.com
Re: tag parsing. <godzilla@stomp.stomp.tokyo>
what the heck is C<$_> ?? <nlymbo@mindspring.com>
Re: what the heck is C<$_> ?? <care227@attglobal.net>
Re: what the heck is C<$_> ?? <vmurphy@Cisco.Com>
Re: what the heck is C<$_> ?? <lr@hpl.hp.com>
Re: what the heck is C<$_> ?? <dethtoll@yahoo.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 14 Aug 2000 18:14:07 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: regex
Message-Id: <7a7l9jd828.fsf@merlin.hyperchip.com>
Drew Simonis <care227@attglobal.net> writes:
> jponder9@my-deja.com wrote:
> >
> > Hi all,
> > This is driving me mad!! I am testing for decimal places on a
> > number and when encountering more than 2 i wish to substitute however
> > many there are for just the 2 i.e. trimming them down to 2 decimal
> > places. Trouble is i cant use printf (long story!) with which it would
> > be a doddle.
> > Any ideas gratefully received
> > Jimbo
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
>
> $string = 1234.567;
> $string =~ s/(\d\.\d{2})\d*/$1/ if $string =~ /\d\.\d{3,}/;
The if() condition is not really necessary if you change the '*' to a
'+' in your s///.
--Ala
------------------------------
Date: Mon, 14 Aug 2000 11:47:34 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: regex
Message-Id: <MPG.1401de9fe8326c4698ac74@nntp.hpl.hp.com>
In article <u9aeefdacy.fsf@wcl-l.bham.ac.uk> on 14 Aug 2000 18:24:29
+0100, nobull@mail.com <nobull@mail.com> says...
> jponder9@my-deja.com writes:
>
> > Hi all,
> > This is driving me mad!! I am testing for decimal places on a
> > number and when encountering more than 2 i wish to substitute however
> > many there are for just the 2 i.e. trimming them down to 2 decimal
> > places. Trouble is i cant use printf (long story!) with which it would
> > be a doddle.
>
> s/(\.\d\d)\d+/\1/;
>
> (You did say you wanted to truncate not round).
Change the /\1/ to /$1/ to avoid a warning.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 14 Aug 2000 18:31:43 GMT
From: vod@writemail.com
Subject: Re: Slightly off topic
Message-Id: <8n9dug$apu$1@nnrp1.deja.com>
In article <966194486AIJ.fvw@var.cx>,
fvw+usenet@var.cx wrote:
> <8n6r8a$g6e$1@nnrp1.deja.com> (vod@writemail.com):
> >I wanted to find a web-hosting company that has the
> >Perl module WWW::Search installed on it and allows the
> >hosted sites to use it.
> >Or is there any way using Perl to be able to
> >get results from other search engines like
> >Yahoo or AltaVista etc..
>
> Does it matter? If they don't have it installed, ask them
> to install it and if they won't, install it yourself in your
> homedir. I don't know how big it is, but it can't be so
> big that it'd cost significantly more because of diskspace
> quota...
>
> --
>
> Frank v Waveren
> fvw@var.cx
> ICQ# 10074100
The hosting company says that they wont install that particular module
(www::search) and i had tried installing the module in my homedir
but it doesnt seem to work.
btw is there any other way in Perl to do get other search engine
results.
-Regards-
--V0D--
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 14 Aug 2000 12:56:43 -0700
From: "Kevin Ostrowski" <kjostudio@hotmail.com>
Subject: Someone help!!!
Message-Id: <bfYl5.6$wS3.3058@news.pacbell.net>
I've been trying to find a couple of free/low-cost script that do these
things...
script 1.) A user inputs data (name, email, comments, ect...). The user is
also able to upload an image. This information is then saved via flatfile
(individual html pages will work too) All this info needs to be displayed in
a template (needs not be external HTML I don't mind coding it into the
script, although external would be better) with a table of contents or list
of each users name, that when clicked on shows that user's info. This
doesn't seem like it would be that hard to find, but I've had no luck!!! I
am NOT a perl programmer, so can someone point me in the right direction?
script 2.) This one's a little more advanced, but I need a review script
similar to the one on Amazon.com where people can review and rate products.
If anyone can help me fine either or both of these, you would be saving my
life!!! I've looked everywhere, but can't seem to find them!!
Thanks
Kevin
------------------------------
Date: Mon, 14 Aug 2000 16:02:36 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Someone help!!!
Message-Id: <3998505C.2477152D@attglobal.net>
Kevin Ostrowski wrote:
>
> I've been trying to find a couple of free/low-cost script that do these
> things...
You seem to have wandered into the wrong group...
> script 1.) A user inputs data (name, email, comments, ect...). The user is
> also able to upload an image. This information is then saved via flatfile
> (individual html pages will work too) All this info needs to be displayed in
> a template (needs not be external HTML I don't mind coding it into the
> script, although external would be better) with a table of contents or list
> of each users name, that when clicked on shows that user's info. This
> doesn't seem like it would be that hard to find, but I've had no luck!!! I
> am NOT a perl programmer, so can someone point me in the right direction?
Hire a programmer, don't beg from them.
> script 2.) This one's a little more advanced, but I need a review script
> similar to the one on Amazon.com where people can review and rate products.
>
> If anyone can help me fine either or both of these, you would be saving my
> life!!! I've looked everywhere, but can't seem to find them!!
You are asking us to search the web for you? Or to do free programming?
Or both? Quite rude, don't you say?
------------------------------
Date: Mon, 14 Aug 2000 13:16:31 -0700
From: "Kevin Ostrowski" <kjostudio@hotmail.com>
Subject: Re: Someone help!!!
Message-Id: <NxYl5.9$wS3.5846@news.pacbell.net>
> You seem to have wandered into the wrong group...
How so... this is a perl group isn't it, a misc perl group at that. And my
topic is about perl scripts.
> You are asking us to search the web for you? Or to do free programming?
> Or both? Quite rude, don't you say?
Look, I'm not trying to be RUDE! Since when was asking for help rude anyway?
I am not asking anyone to write me a program, or search the web for me. I
just thought someone might know of scripts that do this.
> Hire a programmer, don't beg from them.
Well if I had the funds to hire a programmer I wouldn't be posting on this
group would I?
Why are you flaming me anyway? This post was not off topic.
Kevin
------------------------------
Date: Mon, 14 Aug 2000 16:23:05 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Someone help!!!
Message-Id: <39985529.EDCE1616@attglobal.net>
Kevin Ostrowski wrote:
>
> > You are asking us to search the web for you? Or to do free programming?
> > Or both? Quite rude, don't you say?
> Look, I'm not trying to be RUDE! Since when was asking for help rude anyway?
> I am not asking anyone to write me a program, or search the web for me. I
> just thought someone might know of scripts that do this.
>
> > Hire a programmer, don't beg from them.
>
> Well if I had the funds to hire a programmer I wouldn't be posting on this
> group would I?
>
> Why are you flaming me anyway? This post was not off topic.
Thy skin is thin. That was hardly a flame. Point is, this is a
group to discuss Perl related topics. Often it is viewed as a
place to get help with problems related to programming in the Perl
language. It has never been a place to get free scripts.
------------------------------
Date: Mon, 14 Aug 2000 13:02:30 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: su.c
Message-Id: <39983436.1EF2FA72@rac.ray.com>
tunin@my-deja.com wrote:
>
> could anybody help me. I am looking for the su.c source code on unix.
>
> do you know where can i get it ?
>
> thankx
>
Try
find / -name su.c -print
Or try asking in a C language group.
--
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747
Quae narravi, nullo modo negabo. - Catullus
------------------------------
Date: Mon, 14 Aug 2000 21:44:07 GMT
From: Daniel Pfeiffer <occitan@esperanto.org>
Subject: Re: su.c
Message-Id: <8n9p76$k9g$1@nnrp1.deja.com>
In article <8n9845$62a$1@nnrp1.deja.com>, tunin@my-deja.com wrote:
> could anybody help me. I am looking for the su.c source code on unix.
> do you know where can i get it ?
Since you're asking in the Perl group, I'll assume that little .c was a
typo. If you've enabled suid scripts all it takes is a script belonging
to root with permissions 1755 and the following content:
#! /usr/local/bin/perl
system @ARGV;
You can be more elaborate if you want an exact su clone.
--
Bring text-docs to life! Erwecke Textdokumente zum Leben!
http://beam.to/iPerl/
Vivigu tekstodokumentojn!
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 14 Aug 2000 11:29:02 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Substituting newlines for HTML equivalent
Message-Id: <MPG.1401da4683643ceb98ac72@nntp.hpl.hp.com>
In article <399ef73e.46509779@news.newsguy.com> on Mon, 14 Aug 2000
13:43:49 GMT, Keith Calvert Ivey <kcivey@cpcug.org> says...
> "Marr, Lincoln [HOOF:4713:EXCH]" <lincolnmarr@europem01.nt.com>
> wrote:
>
> >$field =~ s/\n/<BR>/g
> >
> >But the thing is, I want one newline to be replaced with <BR> but 2
> >consecutive newlines to be replaced with <P>. Is this possible?
>
> Did you try it?
>
> $field =~ s/\n\n/<P>/g;
> $field =~ s/\n/<BR>/g;
Though the specification is inadequate, perhaps three or more newlines
should be replaced by just <P>, not by a sequence of <P><BR> or <P><P>,
etc.
Also, for the sake of a human using a browser to look at the HTML
source, I would leave a newline in place.
So:
$field =~ s/\n\n+/<P>\n/g;
$field =~ s/\n/<BR>\n/g;
One could do that all in one bizarre line:
$field =~ s/\n(\n*)/$1 ? "<P>\n" : "<BR>\n"/eg;
Ugh!
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 14 Aug 2000 18:31:41 GMT
From: johnvert@my-deja.com
Subject: Re: tag parsing.
Message-Id: <8n9dud$apq$1@nnrp1.deja.com>
I thought this post never made it, sorry for the doubles. Thank you for
your unpolite but useful response.
-- john
In article <3998318F.178A9F5@stomp.stomp.tokyo>,
"Godzilla!" <godzilla@stomp.stomp.tokyo> wrote:
> johnvert wrote:
>
> > Philip Garrett wrote:
> > > johnvert wrote:
>
> (snipped)
>
> > > ($data) = join( "", @tlines) =~ /\<T\>(.*)\<\/T\>/;
>
> > > That works for this small example, but if you want to
> > > do a lot of parsing like this, you might want to check
> > > out the perldoc pages for HTML::Parser and HTML::TokeParser.
>
> > I want to use HTML::TokeParser, as it seems a lot more logical than
> > quick-n-dirty regexps. I tried the following:
>
> > $p=HTML::TokeParser->new("file");
> > while($line=$p->get_token("<T>"))
> > {
> > my $text=$p->get_trimmed_text;
> > print "$text\n";
> > }
>
> > Taken from the HTML::TokeParser examples. The problem is, the
stuff
> > between <T> and </T> is a bunch of tags, and I simply want to
retrieve
> > these tags -as is-. Example:
>
> > <T><f>f</f><d c="left"></d></T>
>
> > I want it to return: <f>f</f><d c="left"></d>
>
> > How can I achieve that with HTML::TokeParser? The above does not
work.
>
> Jeeesshh... unimaginative Techno-Geeksters and
> their Cargo Cult modules.
>
> Some bare bones skeleton scripts showing some
> alternative methods, per your stated parameters.
>
> Do not respond with changed parameters and,
>
> "This doesn't work."
>
> Gozilla!
>
> TEST SCRIPTS:
> ______________
>
> #!/usr/local/bin/perl
>
> print "Content-Type: text/plain\n\n";
>
> ## Single Line, Single T-Line Entry Method:
>
> $string = 'Mule Manure<T><f>f</f><d c="left"></d></T> Mule Manure';
>
> $string =~ s!.*<T>(.+)</T>.*!$1!;
>
> print "Single String Method:\n\n $string";
>
> ## Multiple Line, Multiple T-Line Method:
>
> $/ = "";
> open (TEST, "test.txt");
> $string = <TEST>;
> close (TEST);
>
> if (!($string))
> { print "Danger Will Robinson! Danger!"; exit; }
>
> $string =~ s/\n//g;
> $string =~ s!<T>|</T>!¦!g;
>
> @Array = split (/¦/, $string);
>
> print "\n\nMultiple Line Method:\n\n";
>
> foreach $element (@Array)
> {
> if ($element =~/</)
> { print " $element\n"; }
> }
>
> print "\n\n\nAll Done Boss.";
>
> exit;
>
> CONTENTS OF TEST.TXT:
> _____________________
>
> <T><f>f</f><d c="left"> LINE ONE </d></T> Mule Manure
> <T><f>f</f><d c="left"> LINE TWO </d></T>Some Gibberish<T><f>f
> </f><d c="left"> LINE THREE </d></T>
> Techno-Geeksters Have No Imagination<T><f>f</f>
> <d c="left">
> LINE FOUR </d></T>
>
> PRINTED RESULTS:
> ________________
>
> Single String Method:
>
> <f>f</f><d c="left"></d>
>
> Multiple Line Method:
>
> <f>f</f><d c="left"> LINE ONE </d>
> <f>f</f><d c="left"> LINE TWO </d>
> <f>f</f><d c="left"> LINE THREE </d>
> <f>f</f><d c="left"> LINE FOUR </d>
>
> All Done Boss.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 14 Aug 2000 12:57:05 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: tag parsing.
Message-Id: <39984F11.95A39D3@stomp.stomp.tokyo>
johnvert@my-deja.com wrote:
> Thank you for your unpolite but useful response.
You mistake rudeness for a matter-of-fact
attitude on my part. I afforded you help,
for free, and my help is afforded under
rules set by me, being free help which
uses up a portion of my Life's remaining
time. My time is precious. I just gave
some of my Life to you.
You have a well earned reputation for
consistently changing your parameters
with each response provided. This annoys
me. Deal with it.
This is no Beggar's Banquet.
Godzilla!
------------------------------
Date: Mon, 14 Aug 2000 16:28:52 -0400
From: steveFarris <nlymbo@mindspring.com>
Subject: what the heck is C<$_> ??
Message-Id: <39985683.5704D650@mindspring.com>
I see alot of this and others in perl docs but have never seen the
explanation...could someone point me to the proper documentation for
this syntax?? thanks!
--
original guitar music at
http://www.mindspring.com/~nlymbo
------------------------------
Date: Mon, 14 Aug 2000 16:29:59 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: what the heck is C<$_> ??
Message-Id: <399856C7.B11088A3@attglobal.net>
steveFarris wrote:
>
> I see alot of this and others in perl docs but have never seen the
> explanation...could someone point me to the proper documentation for
> this syntax?? thanks!
That is text formatting markup.
------------------------------
Date: 14 Aug 2000 16:40:32 -0400
From: Vinny Murphy <vmurphy@Cisco.Com>
Subject: Re: what the heck is C<$_> ??
Message-Id: <u8ztzh8zj.fsf@Cisco.Com>
>>>>> "sf" == steveFarris <nlymbo@mindspring.com> writes:
sf> I see alot of this and others in perl docs but have never seen
sf> the explanation...could someone point me to the proper
sf> documentation for this syntax?? thanks!
perldoc perlpod will give you the details.
-vjm
------------------------------
Date: Mon, 14 Aug 2000 13:43:00 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: what the heck is C<$_> ??
Message-Id: <MPG.1401f9ab51a9601698ac77@nntp.hpl.hp.com>
In article <39985683.5704D650@mindspring.com> on Mon, 14 Aug 2000
16:28:52 -0400, steveFarris <nlymbo@mindspring.com> says...
> I see alot of this and others in perl docs but have never seen the
> explanation...could someone point me to the proper documentation for
> this syntax?? thanks!
C<code> Render code in a typewriter font, or give some other
indication that this represents program text
perldoc perlpod
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 14 Aug 2000 21:01:23 GMT
From: Sebastian <dethtoll@yahoo.com>
Subject: Re: what the heck is C<$_> ??
Message-Id: <8n9mn0$i5d$1@nnrp1.deja.com>
In article <39985683.5704D650@mindspring.com>,
steveFarris <nlymbo@mindspring.com> wrote:
> I see alot of this and others in perl docs but have never seen the
> explanation...could someone point me to the proper documentation for
> this syntax?? thanks!
Try 'man perlpod' or a complete explanation.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 4014
**************************************