[17761] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5181 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 22 14:05:31 2000

Date: Fri, 22 Dec 2000 11:05:11 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <977511911-v9-i5181@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 22 Dec 2000     Volume: 9 Number: 5181

Today's topics:
    Re: automatic FAQ answerer idea eggrock@my-deja.com
    Re: automatic FAQ answerer idea (Rafael Garcia-Suarez)
    Re: automatic FAQ answerer idea eggrock@my-deja.com
    Re: automatic FAQ answerer idea (Tad McClellan)
    Re: automatic FAQ answerer idea <mischief@velma.motion.net>
    Re: automatic FAQ answerer idea <mischief@velma.motion.net>
    Re: automatic FAQ answerer idea <mischief@velma.motion.net>
    Re: bug in open() (Ilya Zakharevich)
        changing file permission davidchew@my-deja.com
    Re: changing file permission <josef.moellers@fujitsu-siemens.com>
    Re: changing file permission (Rafael Garcia-Suarez)
    Re: CLPM and novices <dsimonis@fiderus.com>
    Re: heredoc within heredoc <bart.lateur@skynet.be>
        how to install a module (a newby on modules) <karol@imm.org.pl>
    Re: how to install a module (a newby on modules) (EED)
    Re: how to install a module (a newby on modules) <karol@imm.org.pl>
    Re: how to install a module (a newby on modules) (Tad McClellan)
    Re: How to write a packet sniffer for win32 (TCP Packet (EED)
    Re: HTML parse nodo70@my-deja.com
    Re: Is there a standard, current Perl for Win32 (withou <nagle@animats.com>
    Re: Is there a standard, current Perl for Win32 (withou (Tad McClellan)
    Re: Language evolution C->Perl->C++->Java->Python (Is P <jason@harlequin.com>
    Re: Newbie but serious - Problems reading file from mul <dsimonis@fiderus.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 22 Dec 2000 15:59:45 GMT
From: eggrock@my-deja.com
Subject: Re: automatic FAQ answerer idea
Message-Id: <91vtpd$cqu$1@nnrp1.deja.com>

 ..snippage..

> The problem is that people will just post here, they *will not*
> first find out _how_ to post here. If they did, we wouldn't
> be having the problems that we are having at all.
>
> The proposal is a technical (potential) solution to a social problem.
> There is an impedance mismatch there. A social solution would
> have a much better chance. Making an uncomfortable scene about
> FAQ asking instead of answering the FAQ for them, for example.
> But for that to be effective society-wide it would have to be
> nearly universally applied, and it isn't.
>
> Folks that try to be nice by reanswering a FAQ instead of
> merely pointing to the FAQ are trying to help, but end up
> hurting. They reinforce that you don't _really_ need to
> check the FAQ before posting, because "some poor schmuck
> whose time is less valuable than mine will read it to me".

There should be a standard to this as well though. I just saw a 'I could
answer this but if you're too stupid to find it in the FAQ...' response
from someone I consider knowledgeable. Not as helpful as 'Check the FAQ
at www.' or 'take a look perldoc perlre' (assuming a Unix type
environment with the latter.)

It's kind of a catch-22. If the only questions on this newsgroup were
things that weren't covered in the FAQs, perldocs, books, etc. it
wouldn't be much help to a beginner. Allowing posts about anything
creates too much traffic and discourages the more experienced. Hmm. I'd
much rather have the experienced people on the newsgroups though, so I
can't really disagree with you.

I feel that if I can answer some of the more basic questions it will
take the load off people who can better answer the advanced topics, and
in part repay the help I've received from this newsgroup. It's up to me
to do the research to give the proper answer, or at least point out the
relevant FAQ, perldoc, etc. If that's a bad thing I'll stop.


Sent via Deja.com
http://www.deja.com/


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

Date: Fri, 22 Dec 2000 16:19:09 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: automatic FAQ answerer idea
Message-Id: <slrn946vnu.2ts.rgarciasuarez@rafael.kazibao.net>

Logan Shaw wrote in comp.lang.perl.misc:
> 
> So, what I propose is the construction of a system that would run
> every new article posted to comp.lang.perl.misc through a text
> categorization engine and look at the result.

This is not the first time I read about this idea.
Cf <http://www.deja.com/[ST_rn=ps]/getdoc.xp?AN=496426283&fmt=text>
for a little bit of fun.

-- 
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


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

Date: Fri, 22 Dec 2000 16:25:36 GMT
From: eggrock@my-deja.com
Subject: Re: automatic FAQ answerer idea
Message-Id: <91vv9p$e2d$1@nnrp1.deja.com>

oh sh....


I just read something about soft and hard 'plonks', forget I said
anything? Pleeease? ;)

Plonks, I like it.


Sent via Deja.com
http://www.deja.com/


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

Date: Fri, 22 Dec 2000 11:22:38 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: automatic FAQ answerer idea
Message-Id: <slrn946vue.7ta.tadmc@magna.metronet.com>

eggrock@my-deja.com <eggrock@my-deja.com> wrote:
>oh sh....
>
>I just read something about soft and hard 'plonks', forget I said
>anything? Pleeease? ;)


I didn't see you say anything plonkable...

You, in particular, do not have an entry there, but the domain
that you are posting from does...


-- 
    Tad McClellan                          SGML consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Fri, 22 Dec 2000 17:37:27 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: automatic FAQ answerer idea
Message-Id: <t474anbq71r662@corp.supernews.com>

Logan Shaw <logan@cs.utexas.edu> wrote:
> In article <t4532nfeg8o1c4@corp.supernews.com>,
> Chris Stith  <mischief@velma.motion.net> wrote:
>>I propose the group alt.lang.perl.askthebot be created by
>>someone interested in the idea. Humans interested in the
>>idea could post there, as well as anyone who thinks that
>>their question may not be ready for posting to the
>>comp.lang.perl.* hierarchy. 

> I think this is an interesting idea, but I am sort of
> philosophically opposed to the idea of creating a group that might
> not be used.  It just makes more work for Usenet news admins, and
> they are the type of person who is already overworked.

Personally, as a server admin, I'd be more willing to do
the little bit of work required to approve one more group
to be carried on my servers (this is actually moot right now,
as my current company outsources to SuperNews) than to set up
and maintain a website all on my own network and servers. This
just moves the work from a distributed effort to a centralized
one and requires the bot strip text from HTML before dealing
with the text, when our concern did lie with the text.

> Therefore, I would prefer to not create such a group until there
> is at least some sort of prototype of the software ready to go.

Being an alt group, as I suggested, could limit it easily to
those servers whose admins chose to carry it, since alt is
basically unofficial anyway. OR you could create an IRC channel
of your own for it, or have a private (non-distributed) newsgroup
on one server that people could test with.

> Actually, I had envisioned training/testing it in a different
> way -- I'd create a web page where interested people could go
> review articles that the bot picked up on along with which FAQ
> question it categorized it as.  The page would have a form
> that would allow people to tell the bot, "yes, that was
> right", or "no, that was wrong; the correct answer is _____".

This isn't the same as a news group. This leads people into
a false sense of security. The bot, if it is to later be corrected
by newsgroup participants, must be ready to parse the responses
of those humans, who may not be as predictable as a web form.

> Of course, that sort of thing is not mutually exclusive
> with a testbed newsgroup, but I'd prefer to do the web
> thing to train the bot before starting up a newsgroup.

I think the web site is a good idea. I just don't think it's
the same thing. It probably is a better idea than a bot loose
on any newsgroup, even one created for the bot. It just doesn't
solve as interesting a set of issues with AI as far as I can
see. Pro, con. Pro, con. Moderation is the nature of things.

I'd like to see either of these ideas implemented, and would
be willing to pitch in what little free time I have available
to help. I do think, though, that the web bot and the newsgroup
bot are two different ideas which would present different
issues and solve different problems.

By creating a group in which the bot could answer but human
readers also could, you solve those problems that might look
like FAQs at first by wording but turn out to be more complex.

By making sure the humans know the group was created to corrall
the bot, you don't have people leaving human-only groups because
a bot was added, as Abigail and I believe Tad suggested. I know
I would probably leave this group if it became home to a responding
bot, even though I'm for the idea of a bot in a specific group.
There's just no place for a bot here. In its own place, though,
it could be at least interesting if not actually useful.

> And either way, for the next week or so, I'm going to be
> celebrating Christmas, etc. rather than writing code.  :-)

Same here. Merry Christmas.

Chris
--
Christopher E. Stith
Motion Internet
mischief@motion.net



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

Date: Fri, 22 Dec 2000 18:08:47 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: automatic FAQ answerer idea
Message-Id: <t4765fqgs29f30@corp.supernews.com>

Tad McClellan <tadmc@metronet.com> wrote:
> Logan Shaw <logan@cs.utexas.edu> wrote:

>>I had envisioned training/testing it in a different
>>way -- I'd create a web page


> If this idea stops with an "ask the Perl Jeeves" kind of web site,
> then it might be a Pretty Good Idea.

What problems would that solve, though? It may answer a few more
FAQs than 'perldoc -q' does. This would be a good thing. Is it
enough to create a huge project? If it analyzed things well enough
to not just search for key words, could accurately categorize what
was a FAQ without giving a FAQ answer to a non-FAQ, then that could
be a big improvment on 'perldoc -q'.

> Of course then all we'll have is "did you know that www.pjeeves.com
> could have answered that question?" instead of "did you know that
> the Perl FAQ could have answered that question?".

> Not much of an improvement.

That depends. See above. If a person can actually type in a
question and get a good answer instead of guessing keywords
through trial and error, it could save a lot of time. Anything
that saves a potential poster time before posting could result
in fewer FAQ posts to the newsgroup.

> The biggest gain would be to not have the question posted in
> the first place (because they would have found the answer already). 
> An AI 'bot won't help us with that.

That depends upon where the bot resides and how helpful it is.
I definitely wouldn't want such a bot responding to posts here.
In its own group or on a webpage could be a different story.
As I mentioned elsewhere in the thread, I think the web bot and
the newsgroup bot ideas require different middle layers and not
just different front-ends. They also serve different purposes.
Both are good ideas on the surface, but they must be isolated
from groups such as this that are meant solely for human
interaction.

> It's the damn ISPs (and "web-to-news gateways") turning folks 
> loose on Usenet without indicating that it is a foreign society 
> whose rules should probably be looked into before you start posting.
> (along with the user's impatience and unwillingness to lurk first)

This is the same reason why many people around the world have
negative views of Americans, since we tend to travel with too
little regard for the locales we visit. It is a social problem.
Can we blame the travel agents? Should we blame the tourists
instead of the travel agents?

I work for an ISP, and if someone asks what newsgroups are,
we tell them they really don't want to use them unless they
know what they are and how to use them. Is this enough, or should
we be individually screening the users to see if they are ready to
use a service they are already paying to have available? Who
is going to pay for the extra payroll used up in such a screening?
The ISP field is highly competitive and access has reached the
commodity level. We can't afford to hold a user's hand. We have
enough time spent teaching new users how to use email.

Whose responsibility is it that Usenet is now available through the
Internet instead of UUCP and that the Internet is now a household
word?

I think these are problems much deeper than the idea of whether or
not a bot should be allowed its own group. It is definitely deeper
than whether or not a web page could be helpful. This problem
not only seems enough beyond the scope of this thread to have
its own thread, but beyond the scope of its own thread. There
should be a mailing list or group or web page for arguments
around the point that the Internet has degraded in usefulness as
it has grown ever more popular.

> If this proceeds to a machine posting replies here, then I'll
> probably take off along with Abigail.

Count me in. My original suggestion revolved around marking a
group off specifically for the bot and those who didn't mind
using a group with a bot present. I'm all for disclosure of this
sort of thing, and I think it would be unfair to launch a bot
into the chaos of this group. Instead of forcing humans into
a group that says '.nobots' somewhere in the name, I think
the '.bots-allowed' or similar nomenclature should be considered.

This has really gone beyond an answer to the OP's question.
I think the consensus is that a bot HERE would be BAD, no matter
whatever alternatives have been mentioned. The discussion of
alternatives really is secondary to that point. 

Chris
--
Christopher E. Stith - mischief@motion.net



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

Date: Fri, 22 Dec 2000 18:18:28 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: automatic FAQ answerer idea
Message-Id: <t476nkah2q2a34@corp.supernews.com>

Abigail <abigail@foad.org> wrote:
> Chris Stith (mischief@velma.motion.net) wrote on MMDCLXIX September
> MCMXCIII in <URL:news:t4532nfeg8o1c4@corp.supernews.com>:
> __ Logan Shaw <logan@cs.utexas.edu> wrote:
> __ > In article <x766kedznc.fsf@home.sysarch.com>,
> __ > Uri Guttman  <uri@sysarch.com> wrote:
> __ >>it has been shot down for a variety of reasons.
> __ 
> __ I think it would be nice to have a test group for it,
> __ so interested parties could see how it works and get in
> __ on the development. It's obviously not a good idea to
> __ test something in production on this scale anyway.
> __ 
> __ I propose the group alt.lang.perl.askthebot be created by
> __ someone interested in the idea. Humans interested in the
> __ idea could post there, as well as anyone who thinks that
> __ their question may not be ready for posting to the
> __ comp.lang.perl.* hierarchy. 


> I've said it in previous rounds of this discussion before. The day 
> bots replying to posting appear in this group is the day I unsubscribe.

Agreed. That's why I mentioned an alternative that keeps bots
away from this group. It still allows someone to field the bot
in another group, which leaves this one untouched.

> This is a forum for humans. 

Agreed. A group for both humans and bots should be kept separate
and clearly marked. I don't necessarily believe they shouldn't
exist. Even if newsreading bots shouldn't exist, they will at
some point. Someone will do it. I'd rather see bots partitioned
off into particular areas proactively than see Usenet thrown
into chaos after people write a bunch of bots and other people
retaliate by creating new groups.

We already have Newgrabber and such things. We also have the FAQbot
as it exists now, randomly spewing FAQ entries at a controlled rate.
When bots start doing follow-ups, they should be in groups marked for
that. They should also have names identifying them as bots, and
probably a signature/footer noting that they are bots instead of
people. They should not be used in any group that is not marked
as specifically allowing bots.

Chris
--
Christopher E. Stith
"It is dark. You are likely to be eaten by a grue."




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

Date: 22 Dec 2000 18:50:29 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: bug in open()
Message-Id: <9207pl$i8a$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was NOT sent to Joe Schaefer 
<joe+usenet@sunstarsys.com>],
who wrote in article <m3n1dpghzg.fsf@mumonkan.sunstarsys.com>:
> 5.6 FAILS on linux-

Here "FAILS" means "SUCCEEDS in detecting a failure"?

>     (e.g. Can't exec "lls": No such file or directory at ...)
> 
>         open (DD, "lls|") || die "bad something: $!";
>         open (DD, "lls 2>&1 |") || die "bad something: $!";

> 5.6 SUCCEEDS on linux-
>     (e.g. sh: lls: command not found)
> 
>         open (DD, "lls 2>&- |") || die "bad something: $!";
>         open (DD, "lls 2>/dev/null |") || die "bad something: $!";
>         open (DD, "ps lls|") || die "bad something: $!";

Here SUCCEEDS means "start a program via shell, so FAILS to detect
that the shell could not start the program".  [Starting via shell is
the only case when the failure cannot be detected in 5.6...]

The shell is avoided only if Perl can parse the command line itself.
Currently the only "shell special chars" which are recognized by Perl
are "2>&1" at the end of the command line.

Ilya


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

Date: Fri, 22 Dec 2000 16:05:39 GMT
From: davidchew@my-deja.com
Subject: changing file permission
Message-Id: <91vu4e$d1v$1@nnrp1.deja.com>

Using cgi script , how do I change a file permission.
I have been using the perl function
chmod 0777,$filename. But it doesnt seem
work.

I change the owner of cgi script to match the
owner of the filename, But still it doesnt seem to work.

What have I missed ?


Sent via Deja.com
http://www.deja.com/


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

Date: Fri, 22 Dec 2000 17:39:38 +0100
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: changing file permission
Message-Id: <3A4383CA.B1A72C30@fujitsu-siemens.com>

davidchew@my-deja.com wrote:
> =

> Using cgi script , how do I change a file permission.
> I have been using the perl function
> chmod 0777,$filename. But it doesnt seem
> work.
> =

> I change the owner of cgi script to match the
> owner of the filename, But still it doesnt seem to work.
> =

> What have I missed ?

You have missed to explain where you want to change the permissions: on
the server side or on the client side. You can't change file permissions
on the client side using a cgi script.

Also, you can print out why it doesn't work by writing
if (!chmod(0777, $filename)) {
    print "$!\n";
}

-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize (T.  Pratchett)


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

Date: Fri, 22 Dec 2000 16:42:14 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: changing file permission
Message-Id: <slrn947137.336.rgarciasuarez@rafael.kazibao.net>

davidchew@my-deja.com wrote in comp.lang.perl.misc:
> Using cgi script , how do I change a file permission.
> I have been using the perl function
> chmod 0777,$filename. But it doesnt seem
> work.

chmod has a return value, described in the perlfunc manpage: it returns
the number of files successfully changed. Always test if chmod has
succeeded with something like
  chmod 0777,$filename or die "Can't chmod $filename: $!\n";
This will give you an error message on STDERR if chmod fails, and will
explain why.

-- 
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


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

Date: Fri, 22 Dec 2000 12:59:37 -0500
From: Drew Simonis <dsimonis@fiderus.com>
Subject: Re: CLPM and novices
Message-Id: <3A439689.66ADA065@fiderus.com>

Jeff Boes writes :
> 
> I've seen novice posts here that go unanswered, some
> that get five snippy remarks to the tune of 'RTFM, dammit', 

And later writes:

> Better you should struggle with the perldoc pages until you get familiar
> with them, 

This seems to be contradictory.  As has been covered thousands
of times, a reference to a perldoc (RTFM) is often the _best_ 
answer, as you seem to later advise as well.


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

Date: Fri, 22 Dec 2000 18:43:21 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: heredoc within heredoc
Message-Id: <n1874t8bum7kjuuj2pj1h1c11bk8j99ah6@4ax.com>

John Lin wrote:

>Could you help me find out what's wrong with my code here?
>
>print <<OUTSIDE;
>This heredoc within heredoc @{[<<INSIDE;]} needs
>OUTSIDE
>some correction to make it work.
>INSIDE
>
>__END__
>Can't find string terminator "
>INSIDE" anywhere before EOF at line 1.

Well, THIS works:

print <<OUTSIDE;
This heredoc within heredoc @{[ <<INSIDE
some correction to make it work.
INSIDE
]} needs
OUTSIDE

So, it's likely a matter of properly nesting your here-docs.

-- 
	Bart.


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

Date: Fri, 22 Dec 2000 17:41:24 +0100
From: "Karol Nowakowski" <karol@imm.org.pl>
Subject: how to install a module (a newby on modules)
Message-Id: <3a43843e$1@news.home.net.pl>

I'am not a root-user.
Ty OS is afaik Unix.
the module I want to install is:
Image::Size
http://search.cpan.org/doc/RJRAY/Image-Size-2.91/Size.pm

I don't even know where to start. I've read lot's of messages on newsgroups,
some tutorials and faqs but I still don't know what to do.
I'm almost 98% sure that I am allowed to install any modules I want on my
virtual server.

btw - what is the difference beetween module and library?

Best Regards,
Karol Nowakowski





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

Date: Fri, 22 Dec 2000 17:59:26 +0100
From: "Alexander Farber (EED)" <eedalf@eed.ericsson.se>
Subject: Re: how to install a module (a newby on modules)
Message-Id: <3A43886E.3862CB26@eed.ericsson.se>

Karol Nowakowski wrote:
> I'am not a root-user.

root is not necessary

> Ty OS is afaik Unix.
> the module I want to install is:
> Image::Size
> http://search.cpan.org/doc/RJRAY/Image-Size-2.91/Size.pm

gunzip -c ImageSize.xxx.tar.gz | tar xvf -
cd ImageSize.xxx
perl Makefile.PL PREFIX=/home/karol
make
make test
make install

and then set PERL5LIB or "use lib"

> I'm almost 98% sure that I am allowed to install any modules I want on my
> virtual server.
> 
> btw - what is the difference beetween module and library?
> 
> Best Regards,
> Karol Nowakowski


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

Date: Fri, 22 Dec 2000 18:30:18 +0100
From: "Karol Nowakowski" <karol@imm.org.pl>
Subject: Re: how to install a module (a newby on modules)
Message-Id: <3a438fb3$1@news.home.net.pl>

Uzytkownik "Alexander Farber (EED)" <eedalf@eed.ericsson.se> napisal w
wiadomosci news:3A43886E.3862CB26@eed.ericsson.se...
> Karol Nowakowski wrote:
> > I'am not a root-user.
> root is not necessary
ok

> > Ty OS is afaik Unix.
> > the module I want to install is:
> > Image::Size
> > http://search.cpan.org/doc/RJRAY/Image-Size-2.91/Size.pm
> gunzip -c ImageSize.xxx.tar.gz | tar xvf -
> cd ImageSize.xxx
> perl Makefile.PL PREFIX=/home/karol
> make
> make test
> make install
Thank You for answer, but the problem is, where do I write this?
sorry for so newby question, but...
Do I have to connect through telnet


> and then set PERL5LIB or "use lib"
You mean in the script?


Thank You for answer,
Best Regards,
Karol Nowakowski




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

Date: Fri, 22 Dec 2000 11:27:51 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: how to install a module (a newby on modules)
Message-Id: <slrn947087.7ta.tadmc@magna.metronet.com>

Karol Nowakowski <karol@imm.org.pl> wrote:

>I don't even know where to start. 


   perldoc perlmodinstall


>I've read lot's of messages on newsgroups,
>some tutorials and faqs but I still don't know what to do.


Have you seen this Perl FAQ:

   "How do I keep my own module/library directory?"


It tells you how to install modules without being root.


-- 
    Tad McClellan                          SGML consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Fri, 22 Dec 2000 17:20:29 +0100
From: "Alexander Farber (EED)" <eedalf@eed.ericsson.se>
To: Patrick Steiner <patrick.steiner@alcatel.ch>
Subject: Re: How to write a packet sniffer for win32 (TCP Packets)
Message-Id: <3A437F4D.9F428C2C@eed.ericsson.se>

Patrick Steiner wrote:
> I need a packet sniffer for Windows NT, written in perl. It must be
> analyse TCP Packets.
> Which Modul can i use?
> Have anyone a example Script?


http://stein.cshl.org/~lstein/talks/WWW6/sniffer/


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

Date: Fri, 22 Dec 2000 18:26:30 GMT
From: nodo70@my-deja.com
Subject: Re: HTML parse
Message-Id: <9206cd$k8c$1@nnrp1.deja.com>

In article <3A42BCF7.F2ABCEE2@wsb.com>,
  Jeff Helman <jhelman@wsb.com> wrote:
> nodo70@my-deja.com wrote:
>
> > > while ($Body =~ m!<A[^>]+HREF=(['"])([^\1]+?)\1[^>]*>(.+?)</A>!
sig) {
> > >       my ($link, $text) = ($2, $3);
> > >       my $linkText = sprintf ("%-60s %-s\n",$link,$text);
> > >       print $linkText;
> > > }
> > >
> > But if $Body = "<a href="http://www.yourname.com"><font size=3>Your
> > Name</font></a> then it would print
> > http://www.yourname.com      <font size=3>Your Name</font>
>
> Sorry, but I thought that's what you wanted (since you could have all
> sorts of stuff between the <A HREF>...</A> sequence, like image tags,
> etc.).  If you want to lose any HTML tags inside the $text scalar,
just:
>
> $text =~ s/<[^>]+>//g;
>
> > I just add:
> > $text =~ s/\<.+\>(.+)\<\/.+\>/$1/gsi if ($text =~ m/\>/);
> > text =~ s/<\/.+\>//g;
>
> First, you don't need to escape < or > inside a regex, since they
aren't
> special characters (unlike the other "bracket" type tags -- ( ) { } [
> ]).  Escaping them (i.e. \< and \>) doesn't hurt anything, but it just
> adds useless noise to the expression and makes it harder to read.  But
> don't feel bad, I did the exact same thing when I was learning Perl.
>
> Second, the problem with your code is it's really greedy.  For
example,
> if you assigned:
>
> $text = "<B>This is <I>italic</I> text.</B>";
>
> and then ran it through the first of your regular expressions, it
would
> return " text." since your expression would match as follows:
>
>  "<B>This is <I>italic</I> text.</B>"
> s/<           .+         >( .+ )<.+>/$1/gsi;
>
> Your second expression would be even worse, as it would grab
everything
> and return an empty string.  Remember that the expression .+ is
greedy,
> that is, it tries to match as much as possible.  Even if you make it a
> match as little as possible (.+?), you would run into the problem in
my
> above example  of having the <I> and </I> tags remain.
>
> In short, the only (easy) way to get rid of HTML tags in your return
> value is to use the expression I gave you above.  (There are many much
> more difficult ways, such as recursively removing matching tag pairs,
> etc., but those get complex in a hurry and are superfluous for your
> needs as expressed here.)
>
> Hope this helps,
> JH
>

Thanks alot Jeff. I'm really appreciate.

Thanks,
NoDo


Sent via Deja.com
http://www.deja.com/


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

Date: Fri, 22 Dec 2000 08:36:30 -0800
From: John Nagle <nagle@animats.com>
Subject: Re: Is there a standard, current Perl for Win32 (without ActivePerl?)
Message-Id: <3A43830E.1116EAD0@animats.com>

"Philip 'Yes, that's my address' Newton" wrote:
> On Thu, 21 Dec 2000 12:26:02 -0800, John Nagle <nagle@animats.com> wrote:
> >   Is there a current, standard (binary) version of Perl for Win32?
> Seriously, though -- what's wrong with compiling your own?

    I could, but then I'd have a nonstandard binary.  
Also, I use MSVC++ 5.x, and Perl is usually built with 
gcc or Borland compilers.  I hate to download and install
another development environment just to build Perl.

    I'm amazed that someone hasn't built a stock Perl for
Win32 and put it up somewhere, such as SourceForge.  Why
is that?  Is Microsoft pressuring people to avoid distributing
pure Perl binaries?  Or is it that the source distro won't
actually build on Win32 any more without the "active" stuff?
What I'm hearing is that it's possible to do this, but nobody
seems to have done so.

					John Nagle
					Animats


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

Date: Fri, 22 Dec 2000 11:32:57 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Is there a standard, current Perl for Win32 (without ActivePerl?)
Message-Id: <slrn9470hp.7ta.tadmc@magna.metronet.com>

John Nagle <nagle@animats.com> wrote:
>"Philip 'Yes, that's my address' Newton" wrote:
>> On Thu, 21 Dec 2000 12:26:02 -0800, John Nagle <nagle@animats.com> wrote:
>> >   Is there a current, standard (binary) version of Perl for Win32?
>> Seriously, though -- what's wrong with compiling your own?
>
>    I could, but then I'd have a nonstandard binary.  


As nearly all Unix systems build perl from source, they too
have nonstandard binaries. I haven't heard of many problems
related to that though.


>    I'm amazed that someone hasn't built a stock Perl for
>Win32 and put it up somewhere,


That _used to be_ the role filled by ActiveState.

Just as Netscape used to be "cool" and is now just another
"big company", so it is with AS/AP. (I'm generalizing here,
not being entirely accurate)


>What I'm hearing is that it's possible to do this, but nobody
>seems to have done so.


It would be nice if someone did what you suggest.


-- 
    Tad McClellan                          SGML consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Fri, 22 Dec 2000 16:28:10 +0000
From: Jason Trenouth <jason@harlequin.com>
Subject: Re: Language evolution C->Perl->C++->Java->Python (Is Python the ULTIMATE oflanguages??)
Message-Id: <mjt64t00qdj6o2l1qmh0hnks152v19cvcj@4ax.com>

On Fri, 22 Dec 2000 14:49:39 GMT, Daniel Berger <djberg96@my-deja.com> wrote:

> In article <3A3BE3B7.D9866593@nowhere.com>,
>   Just Me <just_me@nowhere.com> wrote:
> > The answer to your question is NO.
> >
> > We will go back to basics and end up in Smalltalk which is the
> ultimate OO
> > language where everything is an object and no types exist.
> >
> >

Smalltalk is not the only language where everything is an object, and is
definitely not the ultimate OO language since it limits itself to
message-passing, single-inheritance, etc... Furthermore OO isn't about "no
types".

> I haven't heard much discussion of Ruby in this thread.  I figured
> SmallTalk programmers might like it.  I just read the Thomas & Hunt
> book - pretty good.
> 
> Like some others in this thread, I was immediately discouraged by
> Python when I realized I had to "line up" code blocks.  Blech - reminds
> me of COBOL.
> 
> As a Perl programmer, I wanted something that was comparable to Perl
> and had good OO (and a GUI builder).  Ruby seems to be it.  Perl +
> Smalltalk = Ruby.

If you like Ruby but want a more industrial strength language without the usual
excuses about multiple inheritance etc then take a look at Dylan (
http://www.gwydiondylan.org/ or http://www.fun-o.com/ ).

For example here is some code that sums all the elements of a list ( we don't
know the representation, ie whether it is represented by an array or some
linked data structure or whatever ):

// Java (new class since we can't add to the existing class)
class Lists
{
  int sum ( List list )
  {
    int result = 0;
    Iterator it = list.iterator();
    while ( it.hasNext() )
      result += ( ( Integer )it.next() ).intValue();
    return result;
  }
}

// Dylan
define method sum ( list )
  let result = 0;
  for ( element in list )
    result := result + element;
  end;
  result;
end;

// or with more type info and fuss (more compile-time checking
// and optimization)
define constant <integer-collection> = limited( <collection>, of: <integer> );

define method sum ( list :: <integer-collection> ) => ( result :: <integer> )
  let result :: <integer> = 0;
  for ( element :: <integer> in list )
    result := result + element;
  end for;
  result;
end method sum;  

// or more briefly
define method sum ( list )
  reduce1( \+, list );
end;

So you don't have to choose between (JIT) compiled static application languages
(eg Java, C++), and interpreted dynamic scripting ones (eg Python, Ruby, Perl).
Languages like Dylan are compiled dynamic and full-spectrum. Moreover they have
a more general definition of OO that allows for things like multiple-argument
dispatch:

// eg multiply( "2", 2 ) => "22"
define method multiply ( x :: <string>, y :: <integer> )
  reduce1( concatenate, make( <vector>, size: y, fill: x ) );
end method;

// eg multiply( 2, "2" ) => 4
define method multiply ( x :: <integer>, y :: <string> )
  x * parse-integer( y );
end method;

__Jason


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

Date: Fri, 22 Dec 2000 13:23:39 -0500
From: Drew Simonis <dsimonis@fiderus.com>
Subject: Re: Newbie but serious - Problems reading file from multipart forms (no  binmode!)
Message-Id: <3A439C2B.A5ECA758@fiderus.com>

Patrick Holthuizen wrote:
> 

# # # # # # # #
# Untested!!! #
# # # # # # # #

# be sure to include this in your script
use CGI::Carp qw(fatalsToBrowser);

# Upload files

for my $onnum (1..10)
{
my $file = $req->param("FILE$onnum");

    if ($file) 
    {
    	my $fileName = $file;
  	$fileName =~ s!^.*(\\|\/)!!;
        
        open OUTFILE, ">F:/www/mysite/$user/$fileName" 
        	or die "ERROR: $!\n";
        binmode ($file);
        binmode (OUTFILE);
    
        while (<$file>)
        {
            $length += length($_);
            print OUTFILE $_;
        }
        close OUTFILE;

print "File no. $onnum ($fileName) has been transfered. ($length
bytes)<p>\n";
    }
}



I didn't test this, but it should work...  No need to use read(),
it over complicates things.


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

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 5181
**************************************


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