[27224] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9018 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 4 14:05:46 2006

Date: Sat, 4 Mar 2006 11:05:04 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 4 Mar 2006     Volume: 10 Number: 9018

Today's topics:
    Re: A Problem With GD <rr@rrrrrme.org>
    Re: Emulating Generators: Iterators for Lists (Newbie) <shirsch@adelphia.net>
    Re: Emulating Generators: Iterators for Lists (Newbie) <vt@vtttt.org>
    Re: making your OS collapse by using Perl (Randal L. Schwartz)
    Re: making your OS collapse by using Perl <jurgenex@hotmail.com>
    Re: making your OS collapse by using Perl <rvtol+news@isolution.nl>
    Re: making your OS collapse by using Perl <puonegf+hfrarg@tznvy.pbz>
    Re: making your OS collapse by using Perl xhoster@gmail.com
        Question about sub calling other sub <news@chaos-net.de>
    Re: Question about sub calling other sub <thepoet_nospam@arcor.de>
    Re: Question about sub calling other sub (Randal L. Schwartz)
    Re: Question about sub calling other sub <rvtol+news@isolution.nl>
    Re: Smart::Comments  overwritting? <kirby@lkjh.wanadoo.co.uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 04 Mar 2006 15:58:15 GMT
From: Mark Manning <rr@rrrrrme.org>
Subject: Re: A Problem With GD
Message-Id: <rOiOf.7667$RM2.798269@news20.bellglobal.com>

Mark Manning <markem@airmail.net> trolled:
> Uri Guttman wrote:
> > finally we can invoke godwin's law and end this stupid thread.
> > we all agree manning is an arrogant ass who will never get clpm
> > or the larger perl community (especially cpan) nor will he ever
> > understand api design. so stop responding to him as godwin's law
> > implies. he seems to come back every couple of days and blather
> > so give it a rest and maybe he will quietly slink away.
> > 
> > amazing how that law works and how this jerk was totally
> > anticipated by it.

Godwin's "law" is not a real law, you dumb fuck.  Only a complete
moron who can't think for himself would recognize Godwin's "law" as
anything more than a not-so-funny joke.

cordially, as always,

rm


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

Date: Sat, 04 Mar 2006 09:31:59 -0500
From: "Steven N. Hirsch" <shirsch@adelphia.net>
Subject: Re: Emulating Generators: Iterators for Lists (Newbie)
Message-Id: <ip6dndVTkYRCOZTZnZ2dnUVZ_sKdnZ2d@adelphia.com>

Veli-Pekka Tätilä wrote:

> What would be a good way to do an iterator for a sequence of values to be 
> returned, also called a generator, in Perl?

You will probably find Mark-Jason Dominus' book "Higher Order Perl" of 
interest.


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

Date: Sat, 04 Mar 2006 15:59:55 GMT
From: Veli-Pekka T?til? <vt@vtttt.org>
Subject: Re: Emulating Generators: Iterators for Lists (Newbie)
Message-Id: <%PiOf.7669$RM2.798309@news20.bellglobal.com>

"Veli-Pekka T?til?" <vtatila@mail.student.oulu.fi> trolled:
> Hi,
> I've been asking a number of pretty generic but newbie questions
> on achieving various things in Perl. Here's yet another one. I
> checked the faq in perldoc but haven't Googled the archives yet:

There is no reason to do either before asking a question.  And even
if you did both, there is no reason to tell anyone that you have
done either.



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

Date: 04 Mar 2006 07:27:08 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: making your OS collapse by using Perl
Message-Id: <86wtfa9qnn.fsf@blue.stonehenge.com>

>>>>> "Lars" == Lars  <for_usenet_use@arcor.de> writes:

Lars> Did you ever notice that simply typing "perl -e 'fork while 1'" makes
Lars> your operating system irresponsive, so a reset is required? This is
Lars> especially fatal for a web server that runs a CGI script containing
Lars> contains (by chance) the line 'fork while 1'.

Lars> This seems to at least hold for the Linux OS.

Have you ever noticed that when you poke yourself in the eye with a sharp
stick, it hurts really bad, and you could have permanent damage?

What exactly is your point?  "Don't do that"?

Or are you just trying to make sure as many of your scriptkiddy friends know
about a simple boring DoS attack on a box for which they have execution
rights?

{sigh}

print "Just another Perl hacker,"; # the original

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
*** Free account sponsored by SecureIX.com ***
*** Encrypt your Internet usage with a free VPN account from http://www.SecureIX.com ***


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

Date: Sat, 04 Mar 2006 15:42:09 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: making your OS collapse by using Perl
Message-Id: <lziOf.275$sp4.21@trnddc01>

Lars wrote:
> Did you ever notice that simply typing "perl -e 'fork while 1'" makes
> your operating system irresponsive, so a reset is required? [...]

Of course this can be done with pretty much any programming language.
You must be petty new to computing if you are surprised that a deliberate 
DOS attack can bring an OS to its knees.

jue 




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

Date: Sat, 4 Mar 2006 17:06:59 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: making your OS collapse by using Perl
Message-Id: <duchgb.1hs.1@news.isolution.nl>

Lars schreef:
> Did you ever notice that simply typing "perl -e 'fork while 1'" makes
> your operating system irresponsive, so a reset is required? This is
> especially fatal for a web server that runs a CGI script containing
> contains (by chance) the line 'fork while 1'.
> 
> This seems to at least hold for the Linux OS.

  while ($alive) {
    $object->next->mount;
    jump;
  }

-- 
Affijn, Ruud

"Gewoon is een tijger."


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

Date: Sat, 04 Mar 2006 09:35:24 -0700
From: Chris Barts <puonegf+hfrarg@tznvy.pbz>
Subject: Re: making your OS collapse by using Perl
Message-Id: <1141490021_415@corp.com>

Lars <for_usenet_use@arcor.de> wrote on Friday 03 March 2006 14:18 in
comp.lang.perl.misc <4408b2c2$1@news.arcor-ip.de>:

> Did you ever notice that simply typing "perl -e 'fork while 1'" makes
> your operating system irresponsive, so a reset is required?

Why don't you patch perl so it can detect and abort such infinite loops?
Keep in mind that an infinite loop can be very large, and not look infinite
the first few times it runs through.

-- 
My address happens to be com (dot) gmail (at) usenet (plus) chbarts,
wardsback and translated.
It's in my header if you need a spoiler.


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----


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

Date: 04 Mar 2006 18:35:34 GMT
From: xhoster@gmail.com
Subject: Re: making your OS collapse by using Perl
Message-Id: <20060304133957.759$t6@newsreader.com>

Lars <for_usenet_use@arcor.de> wrote:
> Did you ever notice that simply typing "perl -e 'fork while 1'" makes
> your operating system irresponsive, so a reset is required?

Yeah.

> This is
> especially fatal for a web server that runs a CGI script containing
> contains (by chance) the line 'fork while 1'.

What do you mean by chance?  Do you have an infinite number of monkeys
writing your CGI code for you?

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

Date: Sat, 4 Mar 2006 16:30:08 +0100
From: Martin Kissner <news@chaos-net.de>
Subject: Question about sub calling other sub
Message-Id: <slrne0jck0.4eu.news@maki.homeunix.net>

hello together,

I have a sub, which can be called by different other subs.
There are some slight differences depending from which sub it is called.
Is it possible to find out, which other sub called the actual sub?

I have writen the following script for demonstration:
Would it be possible to find out which sub called "who_called_me"
without passing the strings to it?

Best regards
Martin 

-----
#!/usr/bin/perl

use warnings;
use strict;

one();

sub who_called_me {
    my $who = shift;
    print "$who called me\n";
}
sub one {
    who_called_me("one");
}
sub two {
    who_called_me("two");
}
-----

-- 
perl -e '$S=[[73,116,114,115,31,96],[108,109,114,102,99,112],
[29,77,98,111,105,29],[100,93,95,103,97,110]];
for(0..3){for$s(0..5){print(chr($S->[$_]->[$s]+$_+1))}}'


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

Date: Sat, 04 Mar 2006 16:43:47 +0100
From: Christian Winter <thepoet_nospam@arcor.de>
Subject: Re: Question about sub calling other sub
Message-Id: <4409b5b2$0$22079$9b4e6d93@newsread2.arcor-online.net>

Martin Kissner schrieb:
> hello together,
> 
> I have a sub, which can be called by different other subs.
> There are some slight differences depending from which sub it is called.
> Is it possible to find out, which other sub called the actual sub?
> 
[...]
> -----
> #!/usr/bin/perl
> 
> use warnings;
> use strict;
> 
> one();
> 
> sub who_called_me {

     my $who = (caller(1))[3];
>     print "$who called me\n";
> }
> sub one {
>     who_called_me();
> }
> sub two {
>     who_called_me();
> }

See "perldoc -f caller".
The fourth element in the list returned by caller(EXPR) is
the complete name of the invoking sub, including the package
name, so in this case you will get back main::one and
main::two.

HTH
-Chris


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

Date: 04 Mar 2006 07:55:21 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
To: Martin Kissner <news@chaos-net.de>
Subject: Re: Question about sub calling other sub
Message-Id: <86psl29pcm.fsf@blue.stonehenge.com>

>>>>> "Martin" == Martin Kissner <news@chaos-net.de> writes:

Martin> I have a sub, which can be called by different other subs.
Martin> There are some slight differences depending from which sub it is called.
Martin> Is it possible to find out, which other sub called the actual sub?

Please, please don't do this. You are introducing fragility and instability in
your code by thinking this way.

If you want a subroutine to have different behaviors, pass it a flag argument
of some kind.  But why not just create two different subroutines to call, so
the "flag" is effectively part of the subroutine name.  Then factor out the
parts in common of those two subroutines to a new subroutine or two.  Then you
have more reusable components, and a much better and clearer design.

print "Just another Perl hacker,"; # the original

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
*** Free account sponsored by SecureIX.com ***
*** Encrypt your Internet usage with a free VPN account from http://www.SecureIX.com ***


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

Date: Sat, 4 Mar 2006 16:55:11 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Question about sub calling other sub
Message-Id: <ducgsd.1d4.1@news.isolution.nl>

Martin Kissner schreef:

> I have a sub, which can be called by different other subs.
> There are some slight differences depending from which sub it is
> called. Is it possible to find out, which other sub called the actual
> sub? 


A quick search on CPAN returned:
  Sub::Caller 
  Devel::CallTrace 

See also
  http://gisle.aas.no/perl/illguts/



But why not change your code?

-- 
Affijn, Ruud

"Gewoon is een tijger."


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

Date: Sat, 04 Mar 2006 15:08:23 +0000
From: Kirby James <kirby@lkjh.wanadoo.co.uk>
Subject: Re: Smart::Comments  overwritting?
Message-Id: <ducah2$sms$1@newsg3.svr.pol.co.uk>

Karlheinz - you are right.

Following your suggestion I've saved the source of simple.pl in 'UNIX' 
format (using MultiEdit) and it works as advertised.

I'm not sure whether many Windows editors have this functionality - so 
it is likely to trip up others.

Thanks again

Kirby

> 
> Seems to me that Smart::Comments does not handle MS line ending
> correctly, as it's obviously keeping the CR as part of the string it
> processes.
> 
> Karlheinz


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V10 Issue 9018
***************************************


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