[16475] in Perl-Users-Digest
Perl-Users Digest, Issue: 3887 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 2 14:10:36 2000
Date: Wed, 2 Aug 2000 11:10:23 -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: <965239823-v9-i3887@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 2 Aug 2000 Volume: 9 Number: 3887
Today's topics:
Re: Perl Module in C - Question. <fortinj@attglobal.net>
Re: Perl Module in C - Question. (Greg Bacon)
Re: Perl Module in C - Question. <fortinj@attglobal.net>
PerlScript <jason.horner@corp.rmi.net>
Preserving exit code through END subroutine <fenkNOfeSPAM@agora.rdrop.com.invalid>
Re: Problems with require <bart.lateur@skynet.be>
quick question on regualr expressions <T.Cockle@staffs.ac.uk>
reinterprete a variable in a variable <werbung@htmlfilter.de>
Re: relative to absolute Hyperlink-URL greuer@my-deja.com
Re: Removing newline chars <godzilla@stomp.stomp.tokyo>
Re: Removing newline chars <uri@sysarch.com>
saving form fields - how? <squawkNOsqSPAM@greenparrotdesign.net.invalid>
Script Failure. Need Some Advice Please... (Cyber Thief)
Re: splitting on spaces (Bob Dilworth)
Re: splitting on spaces (Anno Siegel)
Re: splitting on spaces (Marcel Grunauer)
Re: splitting on spaces (Helgi Briem)
stripping - ? html tags <kellym36@drink.bt.co.uk>
Re: Upload File??? nobull@mail.com
Re: Upload File??? <samara_biz@hotmail.com>
Re: Using symbolic references to call methods decided a <aqumsieh@hyperchip.com>
Re: Using symbolic references to call methods decided a (Andrew J. Perrin)
Re: Using symbolic references to call methods decided a nobull@mail.com
Re: Variable Scope in Included Files nobull@mail.com
very cool routine <rbank@csf.edu>
Re: very cool routine (Prasanth A. Kumar)
Re: very cool routine <gellyfish@gellyfish.com>
Re: very cool routine <mjcarman@home.com>
Re: very cool routine <godzilla@stomp.stomp.tokyo>
Re: very cool routine (Brandon Metcalf)
Re: very cool routine <uri@sysarch.com>
Re: Which Win32 Perl? <Timothy.Clemmer@lexis-nexis.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 02 Aug 2000 12:27:44 -0400
From: John Fortin <fortinj@attglobal.net>
Subject: Re: Perl Module in C - Question.
Message-Id: <ecigosskgq4sbu511ovs575f7ao6e87drm@4ax.com>
On Wed, 02 Aug 2000 14:45:35 GMT, gbacon@HiWAAY.net (Greg Bacon)
wrote:
>In article <398806E9.DE89EEB6@attglobal.net>,
> <fortinj@attglobal.net> wrote:
>
>: Greg Bacon wrote:
>:
>: > In article <nneeoschbm15pski7lpdcrpdqlo1dcm4uu@4ax.com>,
>: > John Fortin <fortinj@attglobal.net> wrote:
>: >
>: > : hmmm, Activestate perl for windows doesn't seem to have manpages.
>: >
>: > Look again.
>:
>: OK, I looked again. Still no man pages. Plenty of HTML documentation,
>: but alas, no man pages.
>
>Gee, that's funny. I see plenty:
>
> Directory of E:\Perl\lib\Pod
>
> [.] [..] Functions.pm
> Html.pm perl.pod perl5004delta.pod
> perlapio.pod perlbook.pod perlbot.pod
> perlcall.pod perldata.pod perldebug.pod
> perldelta.pod perldiag.pod perldsc.pod
> perlembed.pod perlfaq.pod perlfaq1.pod
> perlfaq2.pod perlfaq3.pod perlfaq4.pod
> perlfaq5.pod perlfaq6.pod perlfaq7.pod
> perlfaq8.pod perlfaq9.pod perlform.pod
> perlfunc.pod perlguts.pod perlhist.pod
> perlipc.pod perllocale.pod perllol.pod
> perlmod.pod perlmodinstall.pod perlmodlib.pod
> perlobj.pod perlop.pod perlopentut.pod
> perlpod.pod perlport.pod perlre.pod
> perlref.pod perlreftut.pod perlrun.pod
> perlsec.pod perlstyle.pod perlsub.pod
> perlsyn.pod perlthrtut.pod perltie.pod
> perltoc.pod perltoot.pod perltrap.pod
> perlvar.pod perlwin32.pod perlxs.pod
> perlxstut.pod Text.pm Win32.pod
> 60 File(s) 2,170,060 bytes
>
This is POD documentation. You use perldoc to view it. You don't use
man.
In the context of Abigail's initial response, the poster was told to
use 'man manpage' which does not exist on most win32 boxes.
perldoc does exist.
>: No man command either. now that I think of it.
>: :)
>
>You don't need man(1) to have manpages.
>
>: BTW, from my point of view, this conversation is somewhat
>: tongue-in-cheek, as I use both the windows and unix versions of perl,
>: and their respective documentation.
>
>Oh, I see; you're just being a snit. I'm glad we cleared that up.
>
I don't think so. Many posters to this newgroup get roasted for not
being specific or accurate in thier posts or reponses. To me this is
a case in point.
John
------------------------------
Date: Wed, 02 Aug 2000 17:21:21 GMT
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: Perl Module in C - Question.
Message-Id: <sogm4hp0dbm75@corp.supernews.com>
In article <ecigosskgq4sbu511ovs575f7ao6e87drm@4ax.com>,
John Fortin <fortinj@attglobal.net> wrote:
: On Wed, 02 Aug 2000 14:45:35 GMT, gbacon@HiWAAY.net (Greg Bacon)
: wrote:
:
: >Gee, that's funny. I see plenty:
: > [snip]
:
: This is POD documentation. You use perldoc to view it. You don't use
: man.
Nonsense. A manpage is any document that fits the familiar Unix manual
format (i.e., starting with a NAME section, followed by a SYNOPSIS or
DESCRIPTION section, etc.). This is independent of encoding (typically
nroff's man macro package, preformatted plain text, POD, HTML, etc.).
This is independent of viewer. Many people read manpages with GNU
info. Does the resource behind the following URL fail to be a manpage
because it's encoded in HTML or because you view it with a web wowser?
<URL:http://www.openbsd.org/cgi-bin/man.cgi?query=fsck>
FWIW, I use man to view Perl documentation, e.g., man perlfunc.
: In the context of Abigail's initial response, the poster was told to
: use 'man manpage' which does not exist on most win32 boxes.
:
: perldoc does exist.
All irrelevant. If I tell you to more a file, does that mean you
can't use less? The use of man above was as a simple placeholder for
the appropriate documentation viewer. Compare the following statements:
Use the appropriate documentation viewer to read manpage.
Read man manpage.
Greg
--
God created man. Sam Colt made all men equal.
-- Jim Farmer
------------------------------
Date: Wed, 02 Aug 2000 14:04:27 -0400
From: John Fortin <fortinj@attglobal.net>
Subject: Re: Perl Module in C - Question.
Message-Id: <9nngosgjrf1b7fk9jg9hcvuunlf7st7gee@4ax.com>
On Wed, 02 Aug 2000 17:21:21 GMT, gbacon@HiWAAY.net (Greg Bacon)
wrote:
>In article <ecigosskgq4sbu511ovs575f7ao6e87drm@4ax.com>,
> John Fortin <fortinj@attglobal.net> wrote:
>
>: On Wed, 02 Aug 2000 14:45:35 GMT, gbacon@HiWAAY.net (Greg Bacon)
>: wrote:
>:
>: >Gee, that's funny. I see plenty:
>: > [snip]
>:
>: This is POD documentation. You use perldoc to view it. You don't use
>: man.
>
>Nonsense. A manpage is any document that fits the familiar Unix manual
>format (i.e., starting with a NAME section, followed by a SYNOPSIS or
>DESCRIPTION section, etc.). This is independent of encoding (typically
>nroff's man macro package, preformatted plain text, POD, HTML, etc.).
>This is independent of viewer. Many people read manpages with GNU
>info. Does the resource behind the following URL fail to be a manpage
>because it's encoded in HTML or because you view it with a web wowser?
>
> <URL:http://www.openbsd.org/cgi-bin/man.cgi?query=fsck>
>
>FWIW, I use man to view Perl documentation, e.g., man perlfunc.
>
>: In the context of Abigail's initial response, the poster was told to
>: use 'man manpage' which does not exist on most win32 boxes.
>:
>: perldoc does exist.
>
>All irrelevant. If I tell you to more a file, does that mean you
>can't use less? The use of man above was as a simple placeholder for
>the appropriate documentation viewer. Compare the following statements:
except Abigail explicitly mentioned not using a web browser...
>
> Use the appropriate documentation viewer to read manpage.
>
> Read man manpage.
However, you are assuming that a user has the backround to translate
the 2nd to the 1st.
If I did not know what a manpage was ( in its unix context) I may not
make the connection.
Knowing a flavor of unix (IMHO) is not a requirement of perl, and when
unix'isms are used, the translation from unix to " Other OS" may not
happen, and, unfortunately, questions can show up like " How do I
find/read the documentation for my flavor of perl."
Oh well, no sense wasting anymore bandwidth on this topic. I
appreciate you comments. :)
John
------------------------------
Date: Wed, 2 Aug 2000 11:09:23 -0600
From: "Jason Horner" <jason.horner@corp.rmi.net>
Subject: PerlScript
Message-Id: <DpYh5.682$rL3.91317@den-news1.rmi.net>
does anyone know how to instantiate a com object in perlscript(server side)
in vb script
ex:
Set Parent=GetObject("IIS://"& ServerName& "/W3SVC")
how would you do this in PerlScript
also does anyone know of a Perlscript News Group I was unable to find one.
thanks
------------------------------
Date: Wed, 02 Aug 2000 10:08:12 -0700
From: John Fenk <fenkNOfeSPAM@agora.rdrop.com.invalid>
Subject: Preserving exit code through END subroutine
Message-Id: <005d8da8.cea10427@usw-ex0104-025.remarq.com>
The following program:
#!/usr/local/bin/perl
exit 50;
END { system "ls"; }
exits with return code of 0.
perl 5.005_03 on Solaris if it matters.
Is this a bug or a feature? Is there an easy way of preserving
the exit code through the END subroutine? I had expected the
exit code to be 50 unless I had another exit statement in the END
subroutine.
-----------------------------------------------------------
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: Wed, 02 Aug 2000 15:51:42 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Problems with require
Message-Id: <4iggoscf2ktt2nkca6773o3m7i2oj5crud@4ax.com>
Jill Waters wrote:
>I am using both packages and library files.
>In my main program I have:
>
>require "alibrarayfile.pl";
>use APackage;
>
>In APackage.pm I also need to include alibraryfile.pl so have
>require "alibraryfile.pl";
>
>What appears to be happening is that at compile time alibraryfile.pl is
>loaded into the APackage.pm namespace OK. However, at run-time
>alibraryfile.pl is not loaded into the main namespace - because Perl
>thinks it has already been loaded perhaps?
This question came up a little while ago (a month?). Yess, you're
correct, that's the problem.
A "solution": put the code inside the required file in it's own
namespace, and access its subs/variables with fully qualified name. If
you choose it to be in main::, you can use "$::var" and "::sub" as short
fulmly qualified names.
There is no neater solution. That's why modules and "import" were
invented.
--
Bart.
------------------------------
Date: Wed, 02 Aug 2000 18:32:48 +0100
From: Tim Cockle <T.Cockle@staffs.ac.uk>
Subject: quick question on regualr expressions
Message-Id: <39885B40.200DFF26@staffs.ac.uk>
Hi,
I think my tiered eyes are stopping me from seeing this one!
I have extracted some URLs from a HTML file using TokeParse.
I now want to go through the file one line at a time looking for the URL
and so I can mark it.
eg $_ =~ s/'@orginalURL[$i]'/@changeURL[$i]/;
This works for most URLs however any complicated one with ? followed by
data mess the whole thing up!
Basically how do I say look for this string! (that is all characters are
real characters and metacharacters or alike!)
Thanks in advance,
Tim
------------------------------
Date: Wed, 2 Aug 2000 13:37:28 -0400
From: "Martin Tribius" <werbung@htmlfilter.de>
Subject: reinterprete a variable in a variable
Message-Id: <8m9m97$5se5k$1@ID-43618.news.cis.dfn.de>
Hi,
got a problem... Here an easy example for it:
$data2 = 'hello $data1 !!'; #can't change this line into doublequotes
$data1 = 'Martin'; #can't change this line into doublequotes
$data3 = "".$data2; #thats a try (showed in my book) to get the
#variable used in $data2
reinterpreted
print "\n\n Should say 'hello Martin !!' but it says $data2 \n\n";
This gives the output:
Should say 'hello Martin !!' but it says hello $data1 !!
I want to get this variable $data1 interpreted again.
But I don't know how to - and I can't change the first 2 lines into
doublequotes. Or just imagine the variable is not assigned at this moment.
However, this is just a simple example - in real there are no single or
double-quotes... I get the variables $data1 and $data2 from a MYSQL-Database
and they behave like beeing singlequoted (not interpreted)...
So I thought there must be a solution to reinterprete this variable ($data1)
in a variable ($data2) without making changes in the first 2 lines of this
example... Let me know if you need more details - the real problem is
involved into sql-statements and regular expression-stuff - but I think the
problem can be simplified like the example above!
Please help me!!! I and a lot of people I've asked ran out of solutions.
And I really need this for my thesis!
Thanks & Regards,
--
Martin Tribius
------------------------------
Date: Wed, 02 Aug 2000 17:13:06 GMT
From: greuer@my-deja.com
Subject: Re: relative to absolute Hyperlink-URL
Message-Id: <8m9kqr$31r$1@nnrp1.deja.com>
Hallo,
I found a solution by my self.
Thank you for helping.
Andreas
--------------------------------------------------------
use URI;
$doc="<html><head></head><body>
<a href=\"http://www.irgendwo.de/seite.html\">
<a href = \"http://www.irgendwo.de/seite.html\">
<img SRC=\"bild.gif\" alt=\"Gelbe Seiten\" align=\"top\"></a>
<a href=\"bild2.gif\">
<a href=\"bildhref2.gif\">
<img SRC=bild.gif></a>
<a href=Seite.html>Seite</a>
<a href=http://www.irgendwo.de><img SRC =
http://www.irgendwo.de/bild.gif></a>
</body></html>
";
print $doc."\n";
$doc=&setze_absoluten_Pfad("http://www.sonstwo.de",$doc);
print $doc;
sub setze_absoluten_Pfad
{
my $absoluterPfad=shift;
my $HTMLText=shift;
$HTMLText =~ s/<(a|img) (.*?)>/"<".$1."
".&trenne_URL_ab($absoluterPfad,$2).">"/egi;
return $HTMLText;
}
sub trenne_URL_ab
}
sub ersetze
{
my $absoluterPfad=shift;
my $string=shift;
#schneidet Alles hinter einem evtl. vorhandenen Space ab.
my $ende = "";
#($string,$ende)= $string =~ /(.*?)( *?$)/;
my @options= split(/\s|\t/,$string);
$string=shift(@options);
if ($#options>0){$ende=" ".join(" ",@options);}
#entferne Anführungszeichen
$string =~ s/^\"(.*?)\"$/$1/;
#ersetze absoluten durch relativen String
$uri = URI->new($string);
return $uri->abs($absoluterPfad).$ende;
}
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 02 Aug 2000 08:59:19 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Removing newline chars
Message-Id: <39884557.DD779FB9@stomp.stomp.tokyo>
Larry Rosler wrote:
> Godzilla! wrote:
> > Your code, =~ s/[\r\n]+/ /g; would seem best choice
> > on taking care of this carriage return / newline thing.
> > There is no problem with doubling up spaces using your
> > character set as compared to \r|\n type regex. Tested
> > your code, works very well indeed. I couldn't break it.
> > This is a good learning experience. Thank you.
> Excellent. Here's another good learning experience, assuming
> an order-of-magnitude performance improvement matters in the
> particular application:
> tr/\r\n/ /s
Learning experiences are usually good but not always
enjoyable. I will share another learning experience
via an article you will not read. I have cancelled
this article. I tested your code, but neglected to
remember to include the /s switch. Of course, doubled
up spaces appeared. I made an assumption you had
posted untested code again and, in response, chastised
you for your habit of not testing before posting.
Nevertheless, a result of my personal rule of testing
before utterance, after testing your code, with having
forgotten to include the /s switch, my tests confirmed a
mindless mistake, this result caused me to think,
"This is not in keeping with Mr. Rosler's expertise."
With this thought foremost in my mind, I went over all
givens again and again, until I noted my /s mistake but
not until after I had posted my erroneous article.
Lesson here is not really in how easy it is to overlook
a small detail, become blind to it until you force yourself
to see, in my case by reading givens backwards, the real
lesson here is in being objective, fair and ethically
responsible in dealing with a person, even if you hold
an opinion he is braying jackass.
True lesson here is a difference between women and men,
in general. We women have healthy egos allowing us point
out our mistakes, even when we have no need to do so. Most
men are incapable of this notion and defer to braying.
I made a mistake you most likely would have never known
about without my openingly discussing this mistake of mine.
I question if your code is an order of magnitude faster.
Godzilla!
Like a child, I will rock you.
http://la.znet.com/~callgirl3/child.mid
------------------------------
Date: Wed, 02 Aug 2000 17:54:12 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Removing newline chars
Message-Id: <x7vgxj35x7.fsf@home.sysarch.com>
>>>>> "G" == Godzilla! <godzilla@stomp.stomp.tokyo> writes:
G> Larry Rosler wrote:
>> tr/\r\n/ /s
G> Learning experiences are usually good but not always
G> enjoyable. I will share another learning experience
G> via an article you will not read. I have cancelled
G> this article. I tested your code, but neglected to
G> remember to include the /s switch. Of course, doubled
G> up spaces appeared. I made an assumption you had
G> posted untested code again and, in response, chastised
G> you for your habit of not testing before posting.
it didn't get canceled. your typical flame coming from a lack of clue is
on usenet servers worldwide.
G> Nevertheless, a result of my personal rule of testing
G> before utterance, after testing your code, with having
G> forgotten to include the /s switch, my tests confirmed a
G> mindless mistake, this result caused me to think,
oh, i think you have it the other way around. you never seem to test
anything before you speak. and rarely even grasp the problem at hand.
G> With this thought foremost in my mind, I went over all
G> givens again and again, until I noted my /s mistake but
G> not until after I had posted my erroneous article.
cut and paste. oh, you don't believe in that. buty you do it all the
time with your own bad code.
G> Lesson here is not really in how easy it is to overlook
G> a small detail, become blind to it until you force yourself
G> to see, in my case by reading givens backwards, the real
G> lesson here is in being objective, fair and ethically
G> responsible in dealing with a person, even if you hold
G> an opinion he is braying jackass.
heh. you should know from braying jackasses. look in a mirror.
G> I made a mistake you most likely would have never known
G> about without my openingly discussing this mistake of mine.
maybe this will start a trend of your recognizing your mistakes. in a
few decades you might even learn how to program perl.
G> I question if your code is an order of magnitude faster.
benchmark it.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Wed, 02 Aug 2000 08:30:45 -0700
From: greenparrot <squawkNOsqSPAM@greenparrotdesign.net.invalid>
Subject: saving form fields - how?
Message-Id: <05369a00.a6fdc67e@usw-ex0101-007.remarq.com>
HiYa
I have a site that i needs many forms, with common information.
I would like to save the data from the form fields and insert
into the next form,they are in seperate directories. The site is
at
http://www.greenparrotdesign.net/juiceworld/apple/concentrate.htm
The common contact details at the bottom of the form need to be
saved so that when they go through to another fruit product this
common contact details are auto filled. Can i acheive this with
cgi and cookies? Any ideas where i might find a suitable script.
SeeYa
Roy Chappell
Green Parrot Design Ltd
www.greenparrotdesign.net
Web Design, Domain Registration,
Database & E-Commerce Integration
Web Site Promotion
A prayer for the Stressed
Grant me the serenity to accept the things I cannot change,
the courage to change the things I cannot accept
and the wisdom to hide the bodies of those I had to kill today
because they pi#!ed me off.
When all is said and done, more is said than done
-----------------------------------------------------------
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: Wed, 02 Aug 2000 17:55:18 GMT
From: fake@address.com (Cyber Thief)
Subject: Script Failure. Need Some Advice Please...
Message-Id: <agZh5.2097$gW5.93508@bgtnsc04-news.ops.worldnet.att.net>
Hey, sorry to bother you guys, but I need some assistance from the experts.
I've been having problems with people leeching files on my site (copying links
to actual files instead of downloading and uploading them to their own
webspace). I really loathe this practice, and would pretty much go to the ends
of the Earth to put a stop to it. A couple years ago, some guy wrote a script
for me that should accomplish that purpose. Unfortunately, I can't get it
working, and I'm pretty sure the problem relates to the script, more than the
server. Anyway, this is the error message I'm receiving...
"It looks like there was an error: Your script produced this error: (Maybe you
didn't strip carriage returns after a network transfer?)"
I'm going to be honest and say that Perl is greek to me, so if someone here can
explain in plain terms what this means, and how I can rectify the problem, I
would be most appreciative.
As for the script, I was advised that it is generally not a good idea to post
it in a usenet message, so I'm leaving it out. However, if you need to see the
script, just post or drop me a note saying "hey, we need the script", and I'll
gladly put it up.
Thanks for your time,
--
Cyber Thief
http://internettrash.com/users/cyberthief/
http://wwp.mirabilis.com/83606927
cyberthief@deathsdoor.nospam.com (Remove the .nospam to reply)
1-800-226-0007 Box 233 (After Hours)
------------------------------
Date: Wed, 02 Aug 2000 15:22:18 GMT
From: bdilworth@mco.edu (Bob Dilworth)
Subject: Re: splitting on spaces
Message-Id: <39883b30.9949539@news.mco.edu>
On 2 Aug 2000 14:22:40 -0000, anno4000@lublin.zrz.tu-berlin.de (Anno
Siegel) wrote:
[Posted and e-mailed as per the "rules"]
<snip>
>More grousing: Pleas keep your line length below 72 characters or so. And
>don't Cc postings per email without clearly indicating that the same
>message was also posted to the group. Both are rules that apply all
>over Usenet and are by no means specific to this group.
>
Sorry but I've never heard of these "rules" before. Doesn't men they
don't exist just that the other groups must be more forgiving of such
sins.
>>also not familiar with the "jeopardectomy" metaphor and am curious as to what the
>>heck it refers.
>
>Hang around a bit. The term "jeopardy posting" (and implicitly
>"jeopardectomy") are explained about twice or three times a week.
So ... there's not a simple explanation that your yourself could have
provided? Such knowledge must be "earned" as part of some sort of
initiation ritual?
>
>> Based on responses so far, this group seems very elitist and
>>doesn't seem to take well to errors of any sort, formatting or otherwise. The
>>other groups I frequent are far more forgiving of human foibles. I'd appreciate
>>it if someone would explain to me exactly why the culture of this group is so
>>unforgiving.
>
>Usenet groups tend to be as forgiving as they can afford to be. Some
>groups are under more pressure than others.
Where such pressure come from? It takes less time to be mean than it
does to be nice? Jeesh.
How'd I do with this posting? Does it pass the necessary muster?
Bob Dilworth
Toledo, Ohio
bdilworth@mco.edu
>
>Anno
------------------------------
Date: 2 Aug 2000 16:05:21 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: splitting on spaces
Message-Id: <8m9gs1$ikj$1@lublin.zrz.tu-berlin.de>
Bob Dilworth <bdilworth@mco.edu> wrote in comp.lang.perl.misc:
>On 2 Aug 2000 14:22:40 -0000, anno4000@lublin.zrz.tu-berlin.de (Anno
>Siegel) wrote:
>
>[Posted and e-mailed as per the "rules"]
>
><snip>
>
>>More grousing: Pleas keep your line length below 72 characters or so. And
>>don't Cc postings per email without clearly indicating that the same
>>message was also posted to the group. Both are rules that apply all
>>over Usenet and are by no means specific to this group.
>>
>Sorry but I've never heard of these "rules" before. Doesn't men they
>don't exist just that the other groups must be more forgiving of such
>sins.
You haven't been around usenet for long, it appears.
>>>also not familiar with the "jeopardectomy" metaphor and am curious as to what the
>>>heck it refers.
>>
>>Hang around a bit. The term "jeopardy posting" (and implicitly
>>"jeopardectomy") are explained about twice or three times a week.
>
>So ... there's not a simple explanation that your yourself could have
>provided? Such knowledge must be "earned" as part of some sort of
>initiation ritual?
Well, in part, frankly yes. Most newsgroups of some standing develop
an array of in-jokes and what might be called shibboleths, whose use
shows that posters have done their required lurking before posting.
But another reason is that the term comes from a US TV show named
"Jeopardy" which I, living in Germany, have never seen. Apparently
the candidates are given an answer and have to guess the question.
Someone with first hand knowledge of the show might have been better
equipped to answer.
>>
>>> Based on responses so far, this group seems very elitist and
>>>doesn't seem to take well to errors of any sort, formatting or otherwise. The
>>>other groups I frequent are far more forgiving of human foibles. I'd appreciate
>>>it if someone would explain to me exactly why the culture of this group is so
>>>unforgiving.
>>
>>Usenet groups tend to be as forgiving as they can afford to be. Some
>>groups are under more pressure than others.
>
>Where such pressure come from? It takes less time to be mean than it
>does to be nice? Jeesh.
No. It takes care and effort to insert the right amount of mean-ness
in a posting. Often it would be quicker to give a straight reply and
be done with.
In the face of an overwhelming influx of newbies, a newsgroup develops
defense mechanisms to maintain its identity. This is by no means
particular to clpm.
>How'd I do with this posting? Does it pass the necessary muster?
Very well.
Anno
------------------------------
Date: Wed, 02 Aug 2000 16:04:05 GMT
From: marcel@codewerk.com (Marcel Grunauer)
Subject: Re: splitting on spaces
Message-Id: <slrn8oghtb.23c.marcel@gandalf.local>
On Wed, 02 Aug 2000 15:22:18 GMT, Bob Dilworth <bdilworth@mco.edu> wrote:
>On 2 Aug 2000 14:22:40 -0000, anno4000@lublin.zrz.tu-berlin.de (Anno
>Siegel) wrote:
>
>>Hang around a bit. The term "jeopardy posting" (and implicitly
>>"jeopardectomy") are explained about twice or three times a week.
>
>So ... there's not a simple explanation that your yourself could have
>provided? Such knowledge must be "earned" as part of some sort of
>initiation ritual?
In a way. It makes sense to hang around for a while to get the idea how
this group works.
>>Usenet groups tend to be as forgiving as they can afford to be. Some
>>groups are under more pressure than others.
>
>Where such pressure come from? It takes less time to be mean than it
>does to be nice? Jeesh.
From people asking the same kind of questions and making the same kind
of mistakes all over without bothering to read documentation, check with
deja etc.
This group is a busy place. You know, as they say, if you can't stand
the heat...
--
Marcel
sub AUTOLOAD{($_=$AUTOLOAD)=~s;^.*::;;;y;_; ;;print} Just_Another_Perl_Hacker();
------------------------------
Date: Wed, 02 Aug 2000 15:54:22 GMT
From: helgi@NOSPAMdecode.is (Helgi Briem)
Subject: Re: splitting on spaces
Message-Id: <398843d4.495204977@news.itn.is>
On Mon, 31 Jul 2000 18:40:18 GMT, emavres@my-deja.com wrote:
>Can anyone show me how to split a line that is seperated by spaces but
>not by the same amount of spaces?
>
>Example:
>
>"Hello how can I help you"
>
>I would like to get each word.
>
@string = split(/\s+/,$string);
------------------------------
Date: Wed, 02 Aug 2000 17:07:27 +0100
From: john kelly <kellym36@drink.bt.co.uk>
Subject: stripping - ? html tags
Message-Id: <3988473F.F4E153ED@drink.bt.co.uk>
evenin all,
im pretty new to perl and ive got to write this script that pulls text
out of an HTML page.
all the information is in a table - arranged like this....
'<tr><td>some stuff to extract</td><td>some more</td><td>and
more</td></tr>'
it needs to come out looking like this...
some stuff to extract
some more
and more
currently i read the HTML into a long, single line string and ive been
splitting it up
at the <td> tags, this is fine but i cant come up with an efficient way
of
removing all the other tags ie<html></html>etc...
- something like -
$string =~ s/<( / or nothing)(not <td>)(anythingelse)>//g;
would do the job but im a bit slow so i can't figure out how to do it.
-
cheers :)
j
------------------------------
Date: 02 Aug 2000 17:38:03 +0100
From: nobull@mail.com
Subject: Re: Upload File???
Message-Id: <u9lmyf8vpw.fsf@wcl-l.bham.ac.uk>
Abel Almazan <abel@inlander.es> writes:
> I need to upload a file and i have a perl that do that, but...
>
> i need to retrieve more information from the form (like description,
> etc..) and i don't know how to get this info.
I assume you mean this information is entered in other fields in the
same form as contains the file upload field?
> normallly i use CGI.pm and param('<name of the field>'), but i don't
> hope this work this time.
Why not?
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Wed, 02 Aug 2000 13:48:35 -0400
From: "Alex T." <samara_biz@hotmail.com>
Subject: Re: Upload File???
Message-Id: <39885EF3.1630A1B1@hotmail.com>
Have you got anything similar to work? If you tried you would see what the
problem is.
Alex
nobull@mail.com wrote:
> Abel Almazan <abel@inlander.es> writes:
>
> > I need to upload a file and i have a perl that do that, but...
> >
> > i need to retrieve more information from the form (like description,
> > etc..) and i don't know how to get this info.
>
> I assume you mean this information is entered in other fields in the
> same form as contains the file upload field?
>
> > normallly i use CGI.pm and param('<name of the field>'), but i don't
> > hope this work this time.
>
> Why not?
>
> --
> \\ ( )
> . _\\__[oo
> .__/ \\ /\@
> . l___\\
> # ll l\\
> ###LL LL\\
------------------------------
Date: Wed, 02 Aug 2000 15:06:12 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: Using symbolic references to call methods decided at run-time.
Message-Id: <7aittjg0t6.fsf@merlin.hyperchip.com>
aperrin@demog.berkeley.edu (Andrew J. Perrin) writes:
> "David T. Liu" <david.t.liu@intel.com> writes:
>
> > package main;
> > main();
> >
> > sub main(){
> > $guy = new Class;
> >
> > my $string = "f2";
> >
> > &{$guy->{$string}};
> > }
>
> Do you call any other methods this way? This looks for an anonymous
> code reference stored in the anonymous hash pointed to by $guy, with
> the key of $string, and attempts to execute it.
>
> >
> > How would I decide on which method of guy to call depending on the value of
> > $string) ?
>
> A method call can be a string:
>
> $guy->$string;
>
> should do it.
No. This cofuses Perl. You need parentheses:
$guy->$string();
--Ala
------------------------------
Date: 02 Aug 2000 11:46:13 -0500
From: aperrin@demog.berkeley.edu (Andrew J. Perrin)
Subject: Re: Using symbolic references to call methods decided at run-time.
Message-Id: <873dknboh6.fsf@achebe.perrins>
Ala Qumsieh <aqumsieh@hyperchip.com> writes:
> >
> > A method call can be a string:
> >
> > $guy->$string;
> >
> > should do it.
>
> No. This cofuses Perl. You need parentheses:
>
> $guy->$string();
>
> --Ala
Learn something new every day - thanks.
ap
------------------------------
Date: 02 Aug 2000 17:38:25 +0100
From: nobull@mail.com
Subject: Re: Using symbolic references to call methods decided at run-time.
Message-Id: <u9k8dz8vpa.fsf@wcl-l.bham.ac.uk>
"David T. Liu" <david.t.liu@intel.com> writes:
> How would I decide on which method of guy to call depending on the value of
> $string) ?
$guy->$string();
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 02 Aug 2000 17:43:09 +0100
From: nobull@mail.com
Subject: Re: Variable Scope in Included Files
Message-Id: <u9g0on8vhe.fsf@wcl-l.bham.ac.uk>
bluearchtop@my-deja.com writes:
> Subject: Variable Scope in Included Files
Your question has nothing to do with scope. It has to do with
execution order. You are trying to read a value out of a variable
before you put it in there.
> How would I make that work?
You need "temporaly global variables" :-)
> I have to put the require statement in the begining of the file,
> there is no way I can get around that.
So you are saying you have to put the statements in a particular
lexical order but you want then executed in a different order. The
fact that one of the satements is a require is a red herring.
One way to do this is to use an INIT or BEGIN block.
print $foo;
INIT { $foo="Hello "; }
print "there!\n";
This prints: Hello there!
Actually I don't think this is what you meant to ask.
What is it you really want to do?
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Wed, 2 Aug 2000 09:09:28 -0600
From: "Robin Bank" <rbank@csf.edu>
Subject: very cool routine
Message-Id: <8m9dh5$ekj$1@reader.nmix.net>
Simple and yet very very useful...
sub del_element
{
my ($element, @array) = @_;
my ($len, $count);
$len = @array;
$len = $len - 1;
$count = $element;
while ($count <= $len)
{
$array[$count] = $array[$count + 1];
$count++;
}
return (@array);
}
Enjoy.
--
< Robin Bank >
{ Web Design / Programming }
[ Internet @ Cybermesa ] [ www.cybermesa.com ] [ 505 - 988 - 9200 ]
------------------------------
Date: Wed, 02 Aug 2000 15:25:53 GMT
From: kumar1@home.com (Prasanth A. Kumar)
Subject: Re: very cool routine
Message-Id: <m37l9zit1a.fsf@C654771-a.frmt1.sfba.home.com>
"Robin Bank" <rbank@csf.edu> writes:
> Simple and yet very very useful...
>
> sub del_element
> {
> my ($element, @array) = @_;
> my ($len, $count);
> $len = @array;
> $len = $len - 1;
> $count = $element;
> while ($count <= $len)
> {
> $array[$count] = $array[$count + 1];
> $count++;
> }
> return (@array);
> }
>
> Enjoy.
<snip>
There is a built-in function 'splice' which does the same thing.
--
Prasanth Kumar
kumar1@home.com
------------------------------
Date: Wed, 02 Aug 2000 15:36:29 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: very cool routine
Message-Id: <1eXh5.892$82.48213@news.dircon.co.uk>
On Wed, 2 Aug 2000 09:09:28 -0600, Robin Bank Wrote:
> Simple and yet very very useful...
>
> sub del_element
>
Er splice() ....
/J\
------------------------------
Date: Wed, 02 Aug 2000 10:28:27 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: very cool routine
Message-Id: <39883E1B.632EC8DF@home.com>
Robin Bank wrote:
>
> Simple and yet very very useful...
>
> sub del_element
> {
> my ($element, @array) = @_;
> my ($len, $count);
> $len = @array;
> $len = $len - 1;
> $count = $element;
> while ($count <= $len)
> {
> $array[$count] = $array[$count + 1];
> $count++;
> }
> return (@array);
> }
>
> Enjoy.
perldoc -f splice
-mjc
------------------------------
Date: Wed, 02 Aug 2000 09:09:04 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: very cool routine
Message-Id: <398847A0.CB256331@stomp.stomp.tokyo>
Robin Bank wrote:
> Simple and yet very very useful...
> sub del_element
> {
> my ($element, @array) = @_;
> my ($len, $count);
> $len = @array;
> $len = $len - 1;
> $count = $element;
> while ($count <= $len)
> {
> $array[$count] = $array[$count + 1];
> $count++;
> }
> return (@array);
> }
Very nice! I haven't tested your code yet but have no
reason to doubt it works well. This one I have saved
to my scrapebook. Actually, this resolves a perplexing
problem I have been working on lately regarding Natural
Language Emulation, a problem I have not been able to
resolve using traditional methods to do this. After
analysis of your code, I have found if I modify your
code very slightly, I can apply your code to my needs!
Well.. in theory on my part! Nonetheless, I will have
fun adapting your code to rather peculiar circumstances.
Thank you! Your posting of alternative coding to traditional,
is of great benefit not only to me, but to all.
Godzilla!
--
print "http://mailto:%63%61ll%67i%72l@3483852801/%7e%63%61ll%67i%72l";
------------------------------
Date: 2 Aug 2000 15:50:12 GMT
From: bmetcalf@nortelnetworks.com (Brandon Metcalf)
Subject: Re: very cool routine
Message-Id: <8m9fvk$arc$1@bcrkh13.ca.nortel.com>
rbank@csf.edu writes:
> Simple and yet very very useful...
>
> sub del_element
> {
> my ($element, @array) = @_;
> my ($len, $count);
> $len = @array;
> $len = $len - 1;
> $count = $element;
> while ($count <= $len)
> {
> $array[$count] = $array[$count + 1];
> $count++;
> }
> return (@array);
> }
Wouldn't it be a lot easier to use splice?
Brandon
------------------------------
Date: Wed, 02 Aug 2000 17:49:20 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: very cool routine
Message-Id: <x7ya2f365c.fsf@home.sysarch.com>
>>>>> "G" == Godzilla! <godzilla@stomp.stomp.tokyo> writes:
G> Very nice! I haven't tested your code yet but have no
G> reason to doubt it works well. This one I have saved
G> to my scrapebook. Actually, this resolves a perplexing
G> problem I have been working on lately regarding Natural
G> Language Emulation, a problem I have not been able to
G> resolve using traditional methods to do this. After
G> analysis of your code, I have found if I modify your
G> code very slightly, I can apply your code to my needs!
funny how everyone else said this was just a rewrite of perl's built in
splice. and you think it is cool. well the other day you actually
claimed you learned something. maybe you should do it again. why write
something in slow bulky perl code when a single fast well known and
documented operator does it for you?
G> Well.. in theory on my part! Nonetheless, I will have
G> fun adapting your code to rather peculiar circumstances.
that is one reason why your code is disdained here. you have no
grasp of perl's functions and operators. and until you rtfm and
COMPREHEND you never will.
G> Thank you! Your posting of alternative coding to traditional,
G> is of great benefit not only to me, but to all.
only to you. no one else is stupid enough to reinvent the wheel.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Wed, 2 Aug 2000 13:49:13 -0400
From: "Timothy Clemmer" <Timothy.Clemmer@lexis-nexis.com>
Subject: Re: Which Win32 Perl?
Message-Id: <8m9n0i$33t$1@mailgate2.lexis-nexis.com>
Iain,
I just downloaded an activestate distribution of perl (I don't recall what
version) at home for use on my Windows 98 PC. It went very smoothly. After
reading lots of documentation on the activestate web site, I came to the
conclusion that I'd needed a make facility in order to enable the perl
package manager, ppm. I followed the directions and installed it, not
really knowing if it was required or not. Then, I used ppm and installed Tk
from the default repository, which I believe is activestate's own. Much to
my surprise, it worked great... A turnkey installation. I was very
impressed.
-tim
Iain Georgeson <iain@kremlinux.demon.co.uk> wrote in message
news:ZYidRCArC0h5EwXw@kremlinux.demon.co.uk...
> [X-posted because I'm after the input of the Tk folks. FU set to .misc]
>
> I'm currently trying out a selection of Perl ports to Win32. I'm after
> a port that allows me to use Tk and also build the SNMP module
> ("build" is an important word there - I'd like to be able to fiddle
> with the C source). I'm also considering hacking together the bastard
> progeny of the BSD in.tftpd and xsub, so IWBNI that built with
> whatever compiler I end up with.
>
> So far, I've played with cygwin 1.1 (which can't build Tk),
> mingw32/egcs 2.91.66 (doesn't appear to be able to build SNMP) and
> ActiveState (requires me to buy MS Visual C++ and has an obnoxious
> redistribution clause).
>
> ,--{ActiveState Community License}
> | 2. [...] You may not distribute copies of this Package, or copies
> | of packages derived from this Package, to others outside your
> | organization without specific prior written permission from
> | ActiveState (although you are encouraged to direct them to sources
> | from which they may obtain it for themselves).
> `--
>
> (How does that fit with perl's GPL nature?)
>
> Much as it irks me, it looks like I'll have to use ActiveState Perl and
> Microsoft Visual C++, unless you can advise me of another combination
> that will do what I need.
>
> Most over-used phrase of the week is
>
> "This would just plain work on Unix".
>
> Iain.
>
> --
> So I think trying to direct Linux is like herding cats. Cats are not
> motivated by anything resembling what motivates you, but if you get
> enough cats, some portion of them will go the right direction just by
> chance. -- Dave Taylor, responsible for Doom on Linux
------------------------------
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 3887
**************************************