[16496] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3908 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 3 21:10:29 2000

Date: Thu, 3 Aug 2000 18:10:15 -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: <965351415-v9-i3908@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 3 Aug 2000     Volume: 9 Number: 3908

Today's topics:
    Re: Net::IRC - kicking users (Clinton A. Pierce)
    Re: Net::IRC - kicking users <adam@netsetdesign.com>
        re: Net::IRC.... <adam@netsetdesign.com>
    Re: Net::IRC.... <adam@netsetdesign.com>
    Re: newbie:  multiple file input <zentara@gypsyfarm.com>
    Re: newbie:  multiple file input (Marcel Grunauer)
        Q: PerlSE.dll on NT Event Log <poseidon@yifan.net>
    Re: Regexp problem - Stripping HTML <elijah@workspot.net>
        remove entry from file --anyone!! hallian@hotmail.com
    Re: Sendmail and ACTIVEPERL sotoo@my-deja.com
    Re: Sendmail and ACTIVEPERL <wyzelli@yahoo.com>
    Re: splitting on spaces <amonotod@netscape.net>
    Re: splitting on spaces <dilworth@megsinet.net>
    Re: splitting on spaces (NP)
    Re: String to Integer -- but oct/hex not converted! <Juha.Laiho@iki.fi>
    Re: What happened to $fh->input_record_separator ? (Craig Berry)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 03 Aug 2000 23:35:19 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: Net::IRC - kicking users
Message-Id: <Xkni5.57575$fR2.575205@news1.rdc1.mi.home.com>

[Posted and mailed]

In article <d5njoskgj8ho66k06hs8rs2h5rdvgjb4g9@4ax.com>,
	Adam Zihla <adam@netsetdesign.com> writes:
> Hello,
> 
> Currently I'm using the Net::IRC module for a little perl bot that
> I've created for our channel. It's doing its job well and I'm slowly
> adding new features. Recently another op requested I add in a 
> kick user feature, and this has pretty much stumped me. I've read a
> few rfcs and searched around, but I can't come up with anything.
> 
> Does anyone familiar with Net::IRC have any info to offer on this?

*ahem*  Just a word.  I don't mean this to be insulting in any way, but
I'd rather not pretty this up and not have you listen.

Listen carefully:

If you're not smart enough to figure out how to kick a user from a
channel in Net::IRC, you're probably not qualified to write an IRC bot 
that has OP status in a channel.

No, really, I mean it.  I'm sorry to be brutal, but I'm sure I'm 
not alone in these sentiments.

It's far too easy to take advantage of a poorly written bot and take 
over a channel and abuse the participants.  IRC Bots with OP status 
must be written with great care and knowledge in what you're doing.
Some things just require enough basic knowledge to handle before they're
safe: set-UID programs, radioative matter, network daemons with root
privileges, commercial aircraft and authentication schemes.


Just a hint though, it _CAN_ be done.  Use the Source, Luck.  And the 
RFC's.  Working examples of other bots.  Etc.

-- 
    Clinton A. Pierce              Teach Yourself Perl in 24 Hours! 
  clintp@geeksalad.org         for details see http://www.geeksalad.org
"If you rush a Miracle Man, 
	you get rotten Miracles." --Miracle Max, The Princess Bride


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

Date: Fri, 04 Aug 2000 00:00:49 GMT
From: Adam Zihla <adam@netsetdesign.com>
Subject: Re: Net::IRC - kicking users
Message-Id: <ss1kos8q7dhgo9ljf4sjbvg1qeo3ce3ldg@4ax.com>

I appreciate your opinion and honesty, though I may not necessarily
share all of it ;)

I've put in place a user authentication scheme based upon hostmasks
and several tiers of user priveliges, as well the bot runs in a
chrooted low-privelige environment. 

Thanks for the hint about the source, though. I don't see how I could
have missed it the first time around.

On Thu, 03 Aug 2000 23:35:19 GMT, clintp@geeksalad.org (Clinton A.
Pierce) wrote:

>[Posted and mailed]
>
>In article <d5njoskgj8ho66k06hs8rs2h5rdvgjb4g9@4ax.com>,
>	Adam Zihla <adam@netsetdesign.com> writes:
>> Hello,
>> 
>> Currently I'm using the Net::IRC module for a little perl bot that
>> I've created for our channel. It's doing its job well and I'm slowly
>> adding new features. Recently another op requested I add in a 
>> kick user feature, and this has pretty much stumped me. I've read a
>> few rfcs and searched around, but I can't come up with anything.
>> 
>> Does anyone familiar with Net::IRC have any info to offer on this?
>
>*ahem*  Just a word.  I don't mean this to be insulting in any way, but
>I'd rather not pretty this up and not have you listen.
>
>Listen carefully:
>
>If you're not smart enough to figure out how to kick a user from a
>channel in Net::IRC, you're probably not qualified to write an IRC bot 
>that has OP status in a channel.
>
>No, really, I mean it.  I'm sorry to be brutal, but I'm sure I'm 
>not alone in these sentiments.
>
>It's far too easy to take advantage of a poorly written bot and take 
>over a channel and abuse the participants.  IRC Bots with OP status 
>must be written with great care and knowledge in what you're doing.
>Some things just require enough basic knowledge to handle before they're
>safe: set-UID programs, radioative matter, network daemons with root
>privileges, commercial aircraft and authentication schemes.
>
>
>Just a hint though, it _CAN_ be done.  Use the Source, Luck.  And the 
>RFC's.  Working examples of other bots.  Etc.



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

Date: Thu, 03 Aug 2000 23:51:55 GMT
From: Adam Zihla <adam@netsetdesign.com>
Subject: re: Net::IRC....
Message-Id: <231kos4efnim5o2l9t6g04ss5c5m590htu@4ax.com>

I appreciate your opinion and honesty, though I may not necessarily
share all of it ;)

I've put in place a user authentication scheme based upon hostmasks
and several tiers of user priveliges, as well the bot runs in a
chrooted low-privelige environment.

Thanks for the hint, though.






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

Date: Thu, 03 Aug 2000 23:59:17 GMT
From: Adam Zihla <adam@netsetdesign.com>
Subject: Re: Net::IRC....
Message-Id: <6s1kos8un502n0h5ou91sjmu2i404qt8e7@4ax.com>

Gah.. wrong place to reply.

On Thu, 03 Aug 2000 23:51:55 GMT, Adam Zihla <adam@netsetdesign.com>
wrote:

>I appreciate your opinion and honesty, though I may not necessarily
>share all of it ;)
>
>I've put in place a user authentication scheme based upon hostmasks
>and several tiers of user priveliges, as well the bot runs in a
>chrooted low-privelige environment.
>
>Thanks for the hint, though.
>
>
>



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

Date: Thu, 03 Aug 2000 20:25:27 -0400
From: zentara <zentara@gypsyfarm.com>
Subject: Re: newbie:  multiple file input
Message-Id: <4r2kos46knd6l5m9a8mt89ka4n6h8jeg0j@4ax.com>

On Wed, 02 Aug 2000 23:15:59 GMT, marcel@codewerk.com (Marcel
Grunauer) wrote:

>  my $out;
>    for (@ARGV) {
>	    push @$out, [ do { local @ARGV = $_; <> } ];
>    }
>
>    # to visualize the data structure, use:
>    #   use Data::Dumper;
>    #   print Dumper($out);
>
>    # to show the first array, use:
>    #   print @{$out->[0]};
>


Hi thanks, 
I got it to work with your method, very neat.
One question.....

Is the line
print @{$out->[0]};

the only way to get the first array to print all it's lines?
I tried 
print @{[0]}; 

and it printed something like  ARRAY (Oxf345d456) instead
of the lines.  

Is the {$out->[0]} part of the newer object oriented syntax?

Thanks.



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

Date: Fri, 04 Aug 2000 00:32:03 GMT
From: marcel@codewerk.com (Marcel Grunauer)
Subject: Re: newbie:  multiple file input
Message-Id: <slrn8ok41n.e8t.marcel@gandalf.local>

On Thu, 03 Aug 2000 20:25:27 -0400, zentara <zentara@gypsyfarm.com> wrote:

>Is the {$out->[0]} part of the newer object oriented syntax?

Not really. You'll see that sort of thing with object-oriented Perl,
but it's really about references. Read all about it:

perldoc perlreftut
perldoc perlref
perldoc perldsc
perldoc perllol

and later, if you're interesting in OOP, read

perldoc perlboot
perldoc perltoot
perldoc perltootc
perldoc perlobj

-- 
Marcel
sub AUTOLOAD{($_=$AUTOLOAD)=~s;^.*::;;;y;_; ;;print} Just_Another_Perl_Hacker();


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

Date: Thu, 3 Aug 2000 17:37:15 -0700
From: "poseidon" <poseidon@yifan.net>
Subject: Q: PerlSE.dll on NT Event Log
Message-Id: <8md37u$267u$1@nntp1.ba.best.com>

Hi, all

We are using ActivePerl through Microsoft WSH. It works great except for one
thing. Every time they start and quit, they log to NT Event Log and NT Event
Log is filled up very quickly. Are there any way to disable this?

Thank you very much!

poseidon







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

Date: 4 Aug 2000 00:28:48 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: Regexp problem - Stripping HTML
Message-Id: <eli$0008032005@qz.little-neck.ny.us>

In comp.lang.perl.misc, Jeff Yoak <jeff@yoak.com> wrote:
> [posted and emailed]

Me too.

> Eli the Bearded <elijah@workspot.net> wrote:
> >> $x =~ s/<\?php.*?\?>//g;
> > 	<?php echo "PHP tags look like &lt;?php {code} ?>"; ?>
> > into
> > 	"; ?>
> Now it isn't fair to snip out the part of my comment where I said "if you
> are sure that ?> won't appear before the end of the tag..."  :-)

Oops. Sorry.

> > I find non-greedy matches dangerous, and would prefer a five-line RE
> > that avoids them to a one-liner that uses them.
> 
> In this case only?  If generally, why?

I do this for the general case since it is so easy to have an
error that causes a larger match than intended due to other
context in the RE (the above RE does not have that problem
since it is so small).

Consider:

	$_ = '
	<a href="foo"><some weird html></a>
	<a href="foo"><b>FIND THIS</b></a>
	';

	if (m!<a \s+ href="?foo"?\b [^>]*>(.*? FIND \s* THIS .*?)</a>!xis)
	{
	  print "Found (1) $1\n";
	}

	if (m!<a \s+ href="?foo"?\b [^>]*>(
		(?: [^<]+ | <+[^/<] | </[^a] | </a[^>\s] )*
		FIND \s* THIS
		(?: [^<]+ | <+[^/<] | </[^a] | </a[^>\s] )*
		)</a>!xis)
	{
	  print "Found (2) $1\n";
	}

Which produces output:

	Found (1) <some weird html></a>
	<a href="foo"><b>FIND THIS</b>
	Found (2) <b>FIND THIS</b>

Result #2 seems much better to me.

Elijah
------
has used 20+ line REs for HTML modifications


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

Date: Fri, 04 Aug 2000 00:52:44 GMT
From: hallian@hotmail.com
Subject: remove entry from file --anyone!!
Message-Id: <8md44r$nol$1@nnrp1.deja.com>

hi all,

simple question:

I need to replace the user fred from the magic file.
File magic looks like this:

jill:nothappy:9034: gill hill
fred:happy:9012:hill road
nill:pop:983:jd houise

I need to remove fred from the file and move nill up so that it looks
like this:

jill:nothappy:9034: gill hill
nill:pop:983:jd houise

thanks




Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 03 Aug 2000 23:32:11 GMT
From: sotoo@my-deja.com
Subject: Re: Sendmail and ACTIVEPERL
Message-Id: <8mcvdr$kdf$1@nnrp1.deja.com>

In article <0ee5c130.6ea1e19e@usw-ex0104-031.remarq.com>,
  Chino Ficher <chinob103NOchSPAM@hotmail.com.invalid> wrote:
> I am having the same problem but haven;'t even gotten that far.
> There is no perl interpreter installed on our NT server and need
> to get it installed but cannot find out where to get it. Any
> ideas?
>
> -----------------------------------------------------------
>
> Got questions?  Get answers over the phone at Keen.com.
> Up to 100 minutes free!
> http://www.keen.com
>
>
Chino:
Got to www.activestate.com and get a copy of the Activeperl build of
Perl for Windows.  It is a pretty easy install and it works great in NT
Server and Win 2K.
Omar


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 4 Aug 2000 09:36:22 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Sendmail and ACTIVEPERL
Message-Id: <rQni5.14$f_.2580@vic.nntp.telstra.net>

Paris <odesseus@my-deja.com> wrote in message
news:8mcc58$4ss$1@nnrp1.deja.com...
> When running a 'proper' PERL interpreter on a proper OS I can usually
> pipe to the the 'sendmail' program in usr/lib to send mail.
> However there is no such luxury on an NT Server running activeperl..
>
> Does anyone have a clue how you send mail from such a server???
>

Too few people know of the various sendmail ports to Windows.

I prefer the one from www.dynamicstate.com but there are others
(including one from Microsoft).

That helps keep your scripts portable.

Wyzelli




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

Date: Thu, 03 Aug 2000 21:59:53 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: splitting on spaces
Message-Id: <8mcq0l$g82$1@nnrp1.deja.com>

In article <8m9arg$ifa$1@lublin.zrz.tu-berlin.de>,
  anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:
> Bob Dilworth  <bdilworth@mco.edu> wrote in comp.lang.perl.misc:
> >Anno Siegel wrote:
> >> [radical jeopardectomy by amputation of everything else]
> >>
> >> Please post your replies so that they follow, not precede, what you
> >> are replying to.
> >
> >I'm new to this newsgroup and took the plunge and posted two replies
> >yesterday to questions.  Both have been groused about for formatting
> >sins (as above).
<<snip>>
> >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.
>
> Anno

http://www.geocities.com/amonotod/non_jep_reply.html
Authored by Tom Christiansen, I just posted it as HTML.

Later,
amonotod

--
    `\|||/                     amonotod@
      (@@)                     netscape.net
  ooO_(_)_Ooo________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 03 Aug 2000 19:04:23 -0400
From: Dilworth <dilworth@megsinet.net>
Subject: Re: splitting on spaces
Message-Id: <3989FA77.A8A99134@megsinet.net>

Anno Siegel wrote:

<snip>

> >> >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.
> >>
> >
> >No, I haven't been around THIS newsgroup for long.
>
> Over-long lines and stealth Cs's are unpopular everywhere, for reasons
> that don't depend on the purpose of any particular newsgroup.
>
> BTW, your lines are longer than 80 characters again.
>

Yes I know they are.  It's so much fun to get a reaction with such little effort.

<snip>

> > You can't assume that my experience
> >is like yours so please stop doing that.
>
> You and me are walking along a street.
>
> Me:  Hey, watch out.  We got a red traffic light.
> You: Traffic light?
> Me:  You haven't been around for long, have you?
> You: Don't assume your experience is like mine.

Usenet and "the street" are different places.  My wife frequents biology related NGs and
reports that the strict rules so dear to everyone's hearts here don't seem to apply there.  I
showed her this thread and she was quite surprised by the slathering about formatting rules.
I still maintain that not every NG is like clpm.

<snip>

> Careful with those big words, they're tricky to handle. (Obeisance.)

I allow an occasional misspelling.  After all isn't this supposed to be rather informal?

<snip>

> It isn't *the* purpose of clpm to help people with their Perl programs,
> although we do it all the time, a lot of it.  This is a place for people
> with an interest in the Perl language to discuss pertinent issues.  Not
> much of that happens, because a vast majority of original postings are
> questions (often very elementary questions) about how to do this or that
> "in PERL".  The arrogance is really on the side of people who believe
> that a community of Perl experts (some of them world class) are obliged
> to help and hold the hands of everyone who happens to barge in with
> a question.

Ooooh the poor world class experts have to sully themselves with common rabble!  You must be
very proud being their protector.  Perhaps they even grant you an occasional lick of their
boot now and then.  If the stench of the newbie is so overpowering why don't these experts
start their own moderated group where they can preen and display their gaudy plumage to each
other in private?

That said, I officially declare you the winner of this little sub thread of ours.  You can
even have the last word if you'd like.

Bob D.



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

Date: Thu, 03 Aug 2000 23:17:39 GMT
From: nvp@spamnothanks.speakeasy.org (NP)
Subject: Re: splitting on spaces
Message-Id: <n4ni5.429836$MB.6503866@news6.giganews.com>

On Thu, 03 Aug 2000 19:04:23 -0400, Dilworth <dilworth@megsinet.net> wrote:
:
: Usenet and "the street" are different places.  My wife frequents
: biology related NGs and

USENET "rules" apply everywhere, yet some groups are more vocal about
enforcing these rules than others.

: I still maintain that not every NG is like clpm.

I totally agree with you.

: I allow an occasional misspelling.  After all isn't this supposed to
: be rather informal?

But you are correct; spelling/grammar flames are lame.  They never
lead to anything fruitful.  :-)

: boot now and then.  If the stench of the newbie is so overpowering
: why don't these experts start their own moderated group where they can
: preen and display their gaudy plumage to each other in private?

There is also a moderated newsgroup: comp.lang.perl.moderated.

-- 
Nate II


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

Date: 3 Aug 2000 22:13:50 +0300
From: Juha Laiho <Juha.Laiho@iki.fi>
Subject: Re: String to Integer -- but oct/hex not converted!
Message-Id: <8mcg9e$1f8$1@ichaos.ichaos-int>

oderus54@my-deja.com said:
>Is there a function in perl that changes a string to an integer, for
>example.
>
>$blah = "123456";
># Now i want $num = 123456

As has been discussed, '$num=0+$blah;' can be used, but warily. Here's
something I noticed today while just fooling around with the conversion.

~$ perl -e 'print 0+"0755","\n",0+0755,"\n";'
755
493

 .. so the quotes do make a difference. Beware.
-- 
Wolf  a.k.a.  Juha Laiho     Espoo, Finland
(GC 3.0) GIT d- s+: a- C++ UH++++$ UL++++ P+@ L+++ E(-) W+$@ N++ !K w !O
         !M V PS(+) PE Y+ PGP(+) t- 5? !X R tv--- b+ DI? D G e+ h--- r+++ y+
"...cancel my subscription to the resurrection!" (Jim Morrison)


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

Date: Fri, 04 Aug 2000 00:10:03 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: What happened to $fh->input_record_separator ?
Message-Id: <sok2erk0dbm15@corp.supernews.com>

Tom Christiansen (tchrist@perl.com) wrote:
: I don't use that embarrassingly nasty crudware. :-) But if you're
: talking about the manpage, apparently no one bothered to explain
: this.  But trying to figure out anything through that labyrinth of 
: overly obfuscated gratuitously object(GENUFLECT)oriented crud is 
: challenging at best.

He's baaaaaaaaack...and crankier than ever! :)

-- 
   |   Craig Berry - http://www.cinenet.net/users/cberry/home.html
 --*--  "Turning and turning in the widening gyre
   |   The falcon cannot hear the falconer." - Yeats, "The Second Coming"


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

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


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