[26465] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 8633 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Nov 5 06:05:15 2005

Date: Sat, 5 Nov 2005 03: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, 5 Nov 2005     Volume: 10 Number: 8633

Today's topics:
    Re: FAQ 3.24 Can I write useful Perl programs on the co Ben Wa
    Re: FAQ 3.24 Can I write useful Perl programs on the co Ben Wa
    Re: FAQ 3.24 Can I write useful Perl programs on the co Ben Wa
    Re: The Purpose of the Precious Swich in PPM3 (Newbie) <sisyphus1@nomail.afraid.org>
    Re: The Purpose of the Precious Swich in PPM3 (Newbie) <vtatila@mail.student.oulu.fi>
    Re: Why my code doesn't look Perl-ish? <tassilo.von.parseval@rwth-aachen.de>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 05 Nov 2005 00:34:22 -0800
From: Ben Wa
Subject: Re: FAQ 3.24 Can I write useful Perl programs on the command line?
Message-Id: <eooom159shmq9fif66v9oo9h69qs8tivcd@4ax.com>

On 4 Nov 2005 02:35:16 GMT, John Bokma <john@castleamber.com> wrote:

>Abigail <abigail@abigail.nl> wrote:
>
>> John Bokma (john@castleamber.com) wrote on MMMMCDXLVIII September
>> MCMXCIII in <URL:news:Xns9703C27C61B91castleamber@130.133.1.4>:
>> ()  "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote:
>> ()  
>> () > John Bokma <john@castleamber.com> wrote in 
>> () > news:Xns9703AB74F4C91castleamber@130.133.1.4:
>> () > 
>> () >> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote:
>> () >> 
>> () >>> D:\> perl -e "print qq{my var$_;\n} for (1 .. 1_000_000)" >
>> payme.pl () >> 
>> () >> Now why did you do that... :-( (j/k, I blame Ben Wa, and will
>> tell so () >> to his provider in a not nice way)
>> () > 
>> () > I had plonked him right after seeing his reply to the Emacs
>> modules () > message so I did not realize what he had done after that.
>> I noticed it () > when I checked the group later on my office machine.
>> () > 
>> () > I beg forgiveness,
>> ()  
>> ()  LOL
>> ()  
>> () > and I'll get in touch with Adelphia as well.
>> ()  
>> ()  Let's hope he loses his account. A joke is ok, but 24 x 40.000
>> lines is ()  uhm, well...
>> 
>> 
>> Uhm, about 2 seconds of traffic of a random abpe group? Less traffic
>> than the front page of many websites? It's about 14 Mb.
>
>Pfft, can't think of a webpage that offers me 14 megabyte on the front 
>page.
>
>> Not nice,
>> and a lot of traffic back in 1985.
>
>I think it still is a lot of traffic for this group.
>
>> But it's now 2005. Where people 
>> swap entire movies.
>
>And still many can't because swapping an entire movie takes weeks. That 
>a relatively small number of people are able so doesn't mean everybody 
>has a huge pipe entering their homes. It's just very recent I have 512 
>kbps. Where I live (Mexico) most people can't pay for that speed. 64 and 

Mexico is where most of the phishers originate. Pictures, links, form,
fonts. Copied straight from the major US banks. 
Site is hooked from a misnamed link. Insert name/password/credit card
number/expiration date. Click "go" then form submitted to server, in
Mexico, phisher capital of the North American continent. Notable as
the largest source of spam in such continent.
I'm suprised of your knowledge of usnet, where ISP's offer free
a 5 gig download per month and where a 30 second porno loop is up
to 20 megs at good quality mpeg 2, posted on hundreds of groups.
You should get your "head" out of Perl and get a little worldly.
Usenet isn't a "www" forum. There are people who actually pay alot of
money for it. Usenet is a big "spam" buisness, big for the ISP's.
Repeated huge, huge file size porno postings, identical and cycled,
just to bust the per month max download per month. There is no 
doubt that this is contractual. By who? Whoever will benifit
monitarily. So your rather small textual group is floating in 
usenet sea made up of quad-terabytes of porno uploaded and 
downloaded with pipes so thick (mainly from 3 sources) you can't
even imagine. Your 2400 baud Ventel modem can't keep up.
I would suggest you get on a "www" forum where everybodys
bitch an moan results in administrator ban. 

The next jerk that writes a Perl 1-liner, and specifically 
tells me to excecute it from my command line. I may do it.
And I assume that jerk wants to see the output and I will
post it back to them straight away! Cause I'm no expert in
Perl like all you "regulars" are. I have no idea if your 
trying to "teach" or just "fuck my harddrive up"!!!!!!!!
Thats right, if your trying to "fuck" me up, I'll come back
with output of "YOUR" 1-liner, that "YOU" told me to run
and post it straight away to your usenet group.

I hope I'm clear with all you "experts" there. I'm not 
and you are. If you tell me to execute a Perl program 
on this group, and you are a "PRO", do expect to have 
the "output" of your program to be "uploaded" for questions!!!!!

>128 is common for those who can afford it (15 minutes to download the 
>aforementioned webpage if I didn't make a mistake).
>
>> In 2005, misuse of 14Mb isn't worth bothering
>> people at an ISP for.
>
>To me it is. Today it's 14Mb, tomorrow it's 1.4GB.



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

Date: Sat, 05 Nov 2005 00:56:15 -0800
From: Ben Wa
Subject: Re: FAQ 3.24 Can I write useful Perl programs on the command line?
Message-Id: <7ssom1d7g15vo5i7q9j9btmppkej41gjos@4ax.com>

On Thu, 03 Nov 2005 22:59:53 GMT, "A. Sinan Unur"
<1usa@llenroc.ude.invalid> wrote:

>John Bokma <john@castleamber.com> wrote in 
>news:Xns9703AB74F4C91castleamber@130.133.1.4:
>
>> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote:
>> 
>>> D:\> perl -e "print qq{my var$_;\n} for (1 .. 1_000_000)" > payme.pl
>> 
>> Now why did you do that... :-( (j/k, I blame Ben Wa, and will tell so to 
>> his provider in a not nice way)
>
>I had plonked him right after seeing his reply to the Emacs modules 
>message so I did not realize what he had done after that. I noticed it 
>when I checked the group later on my office machine.
>
>I beg forgiveness, and I'll get in touch with Adelphia as well.
>
>Sinan
What about my forgiveness asshole?


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

Date: Sat, 05 Nov 2005 01:04:46 -0800
From: Ben Wa
Subject: Re: FAQ 3.24 Can I write useful Perl programs on the command line?
Message-Id: <gvsom1586fs6tugpalmo7bs8bou8hcrfah@4ax.com>

On Thu, 03 Nov 2005 22:59:53 GMT, "A. Sinan Unur"
<1usa@llenroc.ude.invalid> wrote:

>John Bokma <john@castleamber.com> wrote in 
>news:Xns9703AB74F4C91castleamber@130.133.1.4:
>
>> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote:
>> 
>>> D:\> perl -e "print qq{my var$_;\n} for (1 .. 1_000_000)" > payme.pl
>> 
>> Now why did you do that... :-( (j/k, I blame Ben Wa, and will tell so to 
>> his provider in a not nice way)
>
>I had plonked him right after seeing his reply to the Emacs modules 
>message so I did not realize what he had done after that. I noticed it 
>when I checked the group later on my office machine.
>
>I beg forgiveness, and I'll get in touch with Adelphia as well.
>
>Sinan
I didn't hear from adelphia, but I've filed a complaint
against you with the feds for trying to damage my computer
and have me run a malicious classified piece of software.
Intendedd to damage my computer and sensitive files.
This is a state and federal issue.


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

Date: Sat, 5 Nov 2005 19:31:13 +1100
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: The Purpose of the Precious Swich in PPM3 (Newbie)
Message-Id: <436c6e12$0$27743$afc38c87@news.optusnet.com.au>


"Veli-Pekka Tätilä" <vtatila@mail.student.oulu.fi> wrote in message
 .
 .
>     -precious
>         Allows upgrading of "precious" packages

This was bound to happen when they let Joseph Heller start writing the docs
:-)

I couldn't find any sane documentation of "-precious" anywhere, but since
it's a switch for handling precious packages, then I would  think that you
could not get into trouble by invoking it. Surely the worst thing that will
happen is that you'll get a message saying something like "Hey, dummy -
there's nothing precious about *this* package!!!".

Cheers,
Rob




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

Date: Sat, 5 Nov 2005 12:28:06 +0200
From: "Veli-Pekka Tätilä" <vtatila@mail.student.oulu.fi>
Subject: Re: The Purpose of the Precious Swich in PPM3 (Newbie)
Message-Id: <dki1g5$hmg$1@news.oulu.fi>

Sisyphus wrote:
> "Veli-Pekka Tätilä" <vtatila@mail.student.oulu.fi> wrote in message
>>     -precious
>>         Allows upgrading of "precious" packages
>
> This was bound to happen when they let Joseph Heller start writing the
> docs :-)
Hehe, well that can happen, occasionnally. Writing good docs is actually 
pretty difficult. It's gone the other way round for me, people thought I was 
too verbose and elaborate. Though not in Perl, I've also seen funny SDK docs 
saying something like "I cannot test this right now as I'm not running a 
Mac".

> the worst thing that will happen is that you'll get a message saying
> something like "Hey, dummy - there's nothing precious about *this*
> package!!!".
Haha, you might be right. Well I guess the only way to find out is trying 
it, which I'll do right now:
I've made a copy of my Perl directory and typed in PPM3:
ppm> upgrade -install -precious
Acme-Brainfuck 1.1.1: up to date.
Acme-Pythonic 0.45: up to date.
Acme-Rant 0.1: up to date.
Acme-Turing 0.01: up to date.
Archive-Zip 1.16: up to date.
Class-Accessor 0.22: up to date.
Class-Accessor-Chained 0.01: up to date.
Class-Data-Inheritable 0.04: up to date.
Class-Trigger 0.08: new version 0.10 available in ActiveState Package 
Repository

Class-Trigger 0.08: new version 0.09 available in ActiveState PPM2 
Repository

   Note: Class-Trigger version 0.08 is available from more than one place.
   Which repository would you like to upgrade from?

1. ActiveState Package Repository
2. ActiveState PPM2 Repository

Repository? [ActiveState PPM2 Repository] u1

At this point the process seemed to lock up. I waited about a minute and 
gave up. I'm on VDSL here so speed should not be an issue. Maybe that rep 
didn't have the package at all.

Then I tried again and selected the second rep on the list. It started 
downloading stuff almost instantly. Regarding the output listing I've 
snipped the beginning which is the same and leaved in even the packages that 
are up-to-date, as ppm may check some more exotic packages.

Repository? [ActiveState PPM2 Repository] 2
====================
Upgrade 'Class-Trigger' version 0.09 in ActivePerl 5.8.6.811.
====================
Downloaded 4134 bytes.
Extracting 5/5: blib/arch/auto/Class/Trigger/.exists
Installing C:\Perl\html\site\lib\Class\Trigger.html
Installing C:\Perl\site\lib\Class\Trigger.pm
Successfully upgraded Class-Trigger version 0.09 in ActivePerl 5.8.6.811.
Data-Dump 1.06: up to date.
Data-Lazy 0.5: up to date.
Data-Page 2.00: up to date.
File-Slurp 9999.09: up to date.
IO-Socket-SSL 0.94: up to date.
IO-String 1.06: new version 1.07 available in ActiveState Package Repository
====================
Upgrade 'IO-String' version 1.06 in ActivePerl 5.8.6.811.
====================
Downloaded 5272 bytes.
Extracting 5/5: blib/arch/auto/IO/String/.exists
Installing C:\Perl\html\site\lib\IO\String.html
Installing C:\Perl\site\lib\IO\String.pm
Successfully upgraded IO-String version 1.06 in ActivePerl 5.8.6.811.
IO-Zlib 1.04: up to date.
IO-stringy 2.110: up to date.
Math-BooleanEval 1.00: up to date.
Module-ScanDeps 0.51: up to date.
Net-SSH 0.08: up to date.
PAR-Dist 0.07: up to date.
Parse-Binary 0.09: up to date.
Regexp-Common 2.120: up to date.
Regexp-English 0.21: up to date.
Tcl 0.88: up to date.
Test-Exception 0.21: up to date.
Test-Manifest 1.14: up to date.
Test-Simple 0.62: up to date.
Text-CSV-Simple 1.00: up to date.
Text-CSV_XS 0.23: up to date.
Tkx 1.02: up to date.
WWW-OpenSearch 0.02: new version 0.03 available in ActiveState Package 
Repositor
y
====================
Upgrade 'WWW-OpenSearch' version 0.02 in ActivePerl 5.8.6.811.
====================
Downloaded 2409 bytes.
Extracting 5/5: blib/arch/auto/WWW/OpenSearch/.exists
Successfully upgraded WWW-OpenSearch version 0.02 in ActivePerl 5.8.6.811.
Win32-API 0.41: up to date.
Win32-AbsPath 1.0: up to date.
Win32-ActAcc 1.0: up to date.
Win32-Autoglob 1.01: up to date.
Win32-Console-ANSI 0.07: up to date.
Win32-EventLog-Carp 1.21: up to date.
Win32-Exe 0.08: up to date.
Win32-FileOp 0.14.1: up to date.
Win32-GUI 1.02: up to date.
Win32-GUI-XMLBuilder 0.34: up to date.
Win32-GuiTest 1.3: up to date.
Win32-Hardlink 0.02: up to date.
Win32-Locale 0.04: up to date.
Win32-MCI-Basic 0.01: up to date.
Win32-MIDI-0 2.0: up to date.
Win32-MSAgent 0.04: up to date.
Win32-MachineInfo 0.05: up to date.
Win32-OLE 0.1403: up to date.
Win32-SAPI4 0.08: up to date.
Win32-SoundRec 0.02: up to date.
Win32-Symlink 0.04: up to date.
Win32-SystemInfo 0.08: up to date.
Win32-TieRegistry 0.24: up to date.
Win32-Wallpaper 0.03: up to date.
XML-RSS 1.05: up to date.
XML-Twig 3.22: up to date.
libwin32 0.24: up to date.

I think the big question is, does this list include packages that won't 
normally get updated?

By the way, I ran the upgrade command without the precious switch yesterday, 
so that's why something like Win32::OLE is not updated at this time.

-- 
With kind regards Veli-Pekka Tätilä (vtatila@mail.student.oulu.fi)
Accessibility, game music, synthesizers and programming:
http://www.student.oulu.fi/~vtatila/ 




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

Date: Sat, 5 Nov 2005 09:34:40 +0100
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: Why my code doesn't look Perl-ish?
Message-Id: <3t3952Fqfmj9U1@news.dfncis.de>

Also sprach robic0@yahoo.com:

> On Fri, 04 Nov 2005 23:09:06 -0800, robic0@yahoo.com wrote:

>>In my opinion, Perl is NOT good for stream parsing of
>>strings because the only powerful tool in Perl for that
>>is Regular Expressions (filters/pattern matching). 
>>Though with RE's you do have mechanism's of
>>of capturing the non-matching in-stream characters,
>>but it usually is, if you have multiple paterns,
>>very slow and itterative as opposed to a very robust
>>C++ class like CString. You however, are doing 
>>stream parsing and not pattern matching. And,
>>given you are keying on a single escape character
>>(although it could be others combined, as well)
>>I believe your method is "better" than the regex
>>suggested by others. The reason being that your 
>>methid is infinetly expandable which would leave
>>regex methods far behind when it comes to stream
>>parsing.
>>
>>Well done!
> Just want to add that sometimes in Perl it would
> be nice to be able to index and adress, ie:
> change and modify a single character in a string,
> known only by its position in the array of 
> characters. Or embed a string in a string, or
> delete the same. To "index" a character in 
> would be heaven. Maybe this can be done without
> having to turn a string into an array of characters
> then back into a string. I haven't seen it.
> It would be nice to have the power to index a
> string even if Perl doesen't know pointers.
> Makes you wonder if "substr" is an intrinsic.

substr() is exactly the tool for that. And it's often overlooked that
substr returns a lvalue:

    my $str = "abc";
    my $c = \substr $str, 1, 1;
    $$c = uc($$c);
    print $str;
    __END__
    aBc

That translates quite easily into C:

    #include <ctype.h>
    #include <stdio.h>

    ...
    
    char str[] = "abc";
    char *c = str + 1;
    *c = toupper(*c);
    printf("%s", str);
    
That's not quite as convenient as doing

    str[1] = toupper(str[1]);

but behold this:

    substr($str, 1, 1) =~ tr/a-z/A-Z/;
    
The string may even grow when using substr():

    my $str = "abc";
    substr($str, 1, 1, "bbb");
    print $str;
    __END__
    abbbc

Or even:

    my $str = "abc";
    substr($str, 1, 1) .= "bb";
    print $str;
    __END__
    abbbc

Try that in C. ;-)

Perl could even be made to look more like C with a little overload trickery:

    package StrArray;

    use overload '""' => sub { return join '', @{+shift} };

    sub import {
	shift;
	overload::constant q => sub { 
	    return "\n" if $_[0] eq '\n';
	    return bless [ split //, shift ] => __PACKAGE__;
	};
    }
    1;
    __END__

And now:

    use StrArray;
    my $str = "abc";
    
    for my $i (0 .. length($str) - 1) {
	print $str->[$i], "\n";
    }

    splice @$str, 1, 0, qw/d e f/;
    print $str, "\n";
    __END__
    a
    b
    c
    adefbc

I'd never recommend using that in production code but it's a nice
showcase for some of Perl's abilities.

Tassilo
-- 
use bigint;
$n=71423350343770280161397026330337371139054411854220053437565440;
$m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($m+=8)<=200);


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

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


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