[25503] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7747 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 7 00:05:32 2005

Date: Sun, 6 Feb 2005 21:05:09 -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           Sun, 6 Feb 2005     Volume: 10 Number: 7747

Today's topics:
    Re: Custom sort empties instead of sorting <1usa@llenroc.ude.invalid>
    Re: Custom sort empties instead of sorting <abigail@abigail.nl>
    Re: Custom sort empties instead of sorting (Anno Siegel)
    Re: Custom sort empties instead of sorting <groleau+news@freeshell.org>
    Re: Exception handling in class: question <mjl69mjl69@myaccmyacc.net>
    Re: explain "Larry expects that he'll be certified..." ioneabu@yahoo.com
    Re: Extracting .jpg from mbox file with MIME::Base64 <SallyShears@gmail.com>
    Re: Foreign characters in filenames, revisited <joe@inwap.com>
        New Module: Apache process/host manager <invinity@nvinity.net>
    Re: New Module: Apache process/host manager <invinity@nvinity.net>
    Re: Newbie asking, interesting question (Anno Siegel)
    Re: Perl - permute? <1usa@llenroc.ude.invalid>
    Re: Perl - permute? <abigail@abigail.nl>
    Re: Perl - permute? <postmaster@castleamber.com>
    Re: Perl - permute? <1usa@llenroc.ude.invalid>
    Re: Perl - permute? <postmaster@castleamber.com>
    Re: Perl Regex to search for ed2k links <noreply@gunnar.cc>
    Re: Perl Regex to search for ed2k links <cmw@tulpje.co.uk>
    Re: Perl Regex to search for ed2k links <postmaster@castleamber.com>
    Re: Perl Regex to search for ed2k links <noreply@gunnar.cc>
    Re: Perl Regex to search for ed2k links <dha@panix.com>
    Re: Perl Versus Python (Anno Siegel)
    Re: Perl Versus Python <spamtrap@dot-app.org>
    Re: Why aren't 'warnings' on by default? (Anno Siegel)
    Re: Why aren't 'warnings' on by default? <abigail@abigail.nl>
    Re: Why aren't 'warnings' on by default? <hendrik_maryns@despammed.com>
        Win32::ODBC Find Primary Key Column winhtut.oo@gmail.com
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 06 Feb 2005 23:30:32 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Custom sort empties instead of sorting
Message-Id: <Xns95F5BC53F43DAasu1cornelledu@127.0.0.1>

Wes Groleau <groleau+news@freeshell.org> wrote in news:36nlf9F53h7poU1
@individual.net:

> What am I missing?
> 
> RTFM references OK,
> as long as they're not 'perlfunc' or "Perl Cookbook"  :-)

No, the posting guidelines would be more appropriate in this case.

Please post the shortest possible script, along with data, that still 
exhibits the problem so we can replicate and analyze the issue. In other 
words, help others help you.

Oh, and do read the posting guidelines.

Sinan.


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

Date: 06 Feb 2005 23:35:25 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Custom sort empties instead of sorting
Message-Id: <slrnd0dadt.g2.abigail@alexandra.abigail.nl>

A. Sinan Unur (1usa@llenroc.ude.invalid) wrote on MMMMCLXXVII September
MCMXCIII in <URL:news:Xns95F5BC53F43DAasu1cornelledu@127.0.0.1>:
<>  
<>  Please post the shortest possible script, along with data, that still 
<>  exhibits the problem so we can replicate and analyze the issue. In other 
<>  words, help others help you.


Yeah, we won't help you, unless you're a golfer!  ;-)



Abigail
-- 
perl -le 's[$,][join$,,(split$,,($!=85))[(q[0006143730380126152532042307].
          q[41342211132019313505])=~m[..]g]]e and y[yIbp][HJkP] and print'


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

Date: 6 Feb 2005 23:45:33 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Custom sort empties instead of sorting
Message-Id: <cu6a6t$6pg$4@mamenchi.zrz.TU-Berlin.DE>

Wes Groleau  <groleau+news@freeshell.org> wrote in comp.lang.perl.misc:
> I put a bunch of records in a hash.  I need to output a subset
> of the records, so I make a list of the keys needed.  Output order
> is not important EXCEPT that a certain key must always be first,
> and a certain key last.
> 
> # here $Keys[0], $Keys[1], $Keys[5] all contain text
> 
> @Keys = sort
> {
>    if ($a eq "HEAD") {return -1};
>    if ($b eq "HEAD") {return  1};
>    if ($a eq "TRLR") {return  1};
>    if ($b eq "TRLR") {return -1};
>    return 0;
> } @Keys;
> 
> # here $Keys[0], $Keys[1], $Keys[5] are all undefined
> 
> Several variations on the style of the comparison black
> all gave the same result.  Assigning the sort to a different
> array left the result array empty also.

Gee, you're sorting an array, so the elements get shuffled about,
including undef's.  The result is consistent with the data you're
giving, as far as I can see.

> What am I missing?

I don't know, your code works as expected for me, but it's inefficient.
I suppose, "HEAD" and "TRLR" each appear only once.  Then (untested)

    @Keys = ( 'HEAD', grep( $_ ne 'HEAD', grep $_ ne 'TRLR', @Keys), 'TRLR');

does what you want more directly, and in linear time.

Anno


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

Date: Sun, 06 Feb 2005 23:46:42 -0500
From: Wes Groleau <groleau+news@freeshell.org>
Subject: Re: Custom sort empties instead of sorting
Message-Id: <36oa56F53qrnlU1@individual.net>

Anno Siegel wrote:
> Gee, you're sorting an array, so the elements get shuffled about,
> including undef's.  The result is consistent with the data you're
> giving, as far as I can see.

No,

1. I said the array after sorting is EMPTY.
    Before sorting it had text in at least elements
    [0], [1], and [5]  Since it did have one HEAD,
    I expected that to sort to [0]

2. Since the array is the keys of a hash, there
    can be at most _one_ undef, not three.

>>What am I missing?
> 
> I don't know, your code works as expected for me, but it's inefficient.

Hmm.  Maybe a bug in my installation.

> I suppose, "HEAD" and "TRLR" each appear only once.  Then (untested)
> 
>     @Keys = ( 'HEAD', grep( $_ ne 'HEAD', grep $_ ne 'TRLR', @Keys), 'TRLR');
> 
> does what you want more directly, and in linear time.

Thanks.  That looks like it's worth a try.  This is actually
better, because if the user forgets to put in the HEAD and TRLR,
they still get a valid output.

-- 
Wes Groleau

    I've noticed lately that the paranoid fear of computers becoming
    intelligent and taking over the world has almost entirely disappeared
    from the common culture.  Near as I can tell, this coincides with
    the release of MS-DOS.
                                  -- Larry DeLuca


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

Date: 7 Feb 2005 02:56:24 GMT
From: mjl69 <mjl69mjl69@myaccmyacc.net>
Subject: Re: Exception handling in class: question
Message-Id: <36o3moF4up5p0U1@individual.net>


> > > 
> > > Should all methods be wrapped in a single eval block as standard
> > practice for exception handling or should they be sprinkled through code
> > where needed?  I was just stating my question in Perl :-)
> 
> No, you were hiding your question in Perl verbiage.  Three or five lines
> of uncommented code may be okay, near a hundred isn't.  I didn't even see
> you used "eval" in the code, not to mention the different ways you use it
> in different parts.
> 
> As for your question, it is unclear why you use "eval" at all. It is not
> the standard error handling mechanism in Perl.  If you must use it, make
> its scope as small as possible, that is, treat every case individually.
> Only use it if the exception can't be otherwise anticipated.  Don't catch
> division by zero that way, for instance.  Standard error handling is
> through the standard module Carp.

"The eval keyword serves two distinct but related purposes in Perl. 
These purposes are represented by two forms of syntax, evalBLOCK and evalEXPR. 
The first form traps run-time exceptions (errors) that would otherwise prove fatal, 
similar to the "try block" construct in C++ or Java. 
The second form compiles and executes little bits of code on the fly at run time, 
and also (conveniently) traps any exceptions just like the first form. 
But the second form runs much slower than the first form, since it must parse the string every time. 
On the other hand, it is also more general. Whichever form you use, 
eval is the preferred way to do all exception handling in Perl."

-Programming Perl, 3rd ed. (2000)

Note, that I was talking about exception handling and not error handling.  I may be wrong, but I had
the idea that my objects should not crash because of a fatal error, but continue and save the error
description to a string, array, or file and possibly take additional action based on the exception.
I realize that the above statement from "Programming Perl" might be considered outdated, 
especially since the Exception class by Pete Jordan is dated 2004 and allows for greater control, 
more similar to Java exception handling.  The topic is more an issue of program structure rather than
language syntax so it may not be completely appropriate here.

mjl

> 
> OTOH, if you deliberately want to use "eval" for exception handling,
> take a look at some of the "Exception" modules on CPAN, or write your
> own.  Don't use "eval" directly for that.
> 
> Anno


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

Date: 6 Feb 2005 16:56:23 -0800
From: ioneabu@yahoo.com
Subject: Re: explain "Larry expects that he'll be certified..."
Message-Id: <1107737783.217542.258630@c13g2000cwb.googlegroups.com>


Sherm Pendley wrote:
> Brandon Walsh wrote:
>
> > Can someone please explain this quote from perlfaq2: "Larry expects
> > that he'll be certified before Perl is."
> >
> > What does the word "certified" means here?
>
> Courtesy of <http://www.dictionary.com>:
>
>     v. cer=B7ti=B7fied, cer=B7ti=B7fy=B7ing, cer=B7ti=B7fies
>         1. To confirm formally as true, accurate, or genuine.
>         2. To guarantee as meeting a standard: butter that was
certified
>            Grade A. See Synonyms at approve.
>         3. To acknowledge in writing on the face of (a check) that
the
>            signature of the maker is genuine and that there are
sufficient
>            funds on deposit for its payment.
>         4. To issue a license or certificate to.
>         5. To declare to be in need of psychiatric treatment or
confinement.

I was flipping through my "Diagnostic and Statistical Manual of Mental
Disorders DSM-IV-TR (Text Revision)" for an appropriate diagnosis so we
can get him certified and leave open the possibility of working on #2.
I think many great geniuses have the following:

Diagnostic Criteria For 299.80 Asperger's Disorder
A=2E Qualitative impairment in social interaction, as manifested by at
least two of the following:
marked impairments in the use of multiple nonverbal behaviors such as
eye-to-eye gaze, facial expression, body postures, and gestures to
regulate social interaction
failure to develop peer relationships appropriate to developmental
level
a lack of spontaneous seeking to share enjoyment, interests, or
achievements with other people (e.g. by a lack of showing, bringing, or
pointing out objects of interest to other people)
lack of social or emotional reciprocity
B=2E Restricted repetitive and stereotyped patterns of behavior,
interests, and activities, as manifested by at least one of the
following:
encompassing preoccupation with one or more stereotyped and restricted
patterns of interest that is abnormal either in intensity or focus
apparently inflexible adherence to specific, nonfunctional routines or
rituals
stereotyped and repetitive motor mannerisms (e.g., hand or finger
flapping or twisting, or complex whole-body movements)
persistent preoccupation with parts of objects
C=2E The disturbance causes clinically significant impairment in social,
occupational, or other important areas of functioning
D=2E There is no clinically significant general delay in language (e.g.,
single words used by age 2 years, communicative phrases used by age 3
years)

E=2E There is no clinically significant delay in cognitive development or
in the development of age-appropriate self-help skills, adaptive
behavior (other than social interaction), and curiosity about the
environment in childhood

F=2E Criteria are not met for another specific Pervasive Developmental
Disorder or Schizophrenia

Then again, from reading his web site, I doubt that Larry Wall has
Asperger's Syndrome.  There was another syndrome typical of great
geniuses that I read about but forgot.  I have amnesia and insomnia.

w



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

Date: Sun, 06 Feb 2005 23:42:36 -0500
From: Sally Shears <SallyShears@gmail.com>
Subject: Re: Extracting .jpg from mbox file with MIME::Base64
Message-Id: <060220052342366218%SallyShears@gmail.com>

In article <k07c01tq9vt2lpop0i8v2bp5dnomn9gdf3@4ax.com>, zentara
<zentara@highstream.net> wrote:

> On Fri, 04 Feb 2005 23:43:14 -0500, Sally Shears <sshears@theWorld.com>
> wrote:
> 
> >Can anyone help me with this... How to extract a .jpg file from an
> >attachment in a message in an mbox file?
> >
> >I'm trying with MIME::Base64 but I'll take any suggestions. Thanks.
> >
> >   -- Sally
> #!/usr/bin/perl
> use strict;
> use IO::File;
> use Mail::Message::Attachment::Stripper;
> 
> #by Roger of Perlmonks 
 ...snip...

Zentara (and Roger of Perlmonks)... Thanks.  I'll work with that.

  -- Sally

-- 
Sally Shears (a.k.a. "Molly")
SallyShears@gmail.com -or- Sally@Shears.org
http://theWorld.com/~sshears


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

Date: Sun, 06 Feb 2005 20:59:54 -0800
From: Joe Smith <joe@inwap.com>
Subject: Re: Foreign characters in filenames, revisited
Message-Id: <7PSdnQSCz-BUaJvfRVn-vA@comcast.com>

P wrote:

>   open ( IN, $_ ) or die $!;

Does it make any difference when using the three-argument open()?

    open (IN, '<', $_) or die "Cannot open '$_' for input: $!\n";

	-Joe


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

Date: 6 Feb 2005 18:52:59 -0800
From: "invinity" <invinity@nvinity.net>
Subject: New Module: Apache process/host manager
Message-Id: <1107744779.024581.16110@l41g2000cwc.googlegroups.com>

I am writing a Perl module that launches and manages Apache processes
based on stored parameters. I'm currently working with the namespace
"Server::ApacheIVHost" where ApacheIVHost is an abbreviation for
"Apache Independent Virtual Hosts". I'm hoping to get lost of input on
the potential usefulness of this project and my current namespace.

Overview:
As the name implies this package is designed to create a
virtual-host-type setup using seperate Apache processes. This is
accomplished by creating an Apache process for every virtual host
address, each listening on a different port, and using  'master' Apache
processes on ports 80 (really any port you want) and 443 to proxy
connections to the appropriate server. The package contains modules to
store host information in an SQL database, but the software is written
with a clearly defined API to easily allow for the addition of other
storage interfaces.

Motiviation:
Server::ApacheIVHost provides three main things:
1. The ability to run host processes under a specific Unix user/group
and all the advantages that this implies. For example, I run and host
under my Subversion repository user/group for mod_dav_svn.

2. Per-host configuration files. This has alot of advantages, one being
the ability to let users alter a host's configuration files, and if
they mess up and their server doesn't start, oh well. They've shut down
their own server and noone elses.

3. Host creation is completely automated. For example, when storing
host information in a MySQL database one needs only to add a new host
entry and Server::ApacheIVHost automatically creates directories for
the host, creates log files, starts its daemon and updates its DNS
record.

Problems:
My biggest concern is the resource requirements of running an Apache
process for every single hostname. I'm worried that this per-host
process scheme will be too impractical in mass virtualhost systems. To
help reduce the resource requirement the StartServers, MinSpareServers
and MaxSpareServers directives can/will be reduced for the single host
processes. In addition, Server::ApacheIVHost is being written to allow
for a custom list of DSOs per host process, so as to reduce the
process's memory footprint. On my personal server (500MHz P3/1GB RAM),
I have about twenty hosts running through Server::ApacheIVHost and I
don't see any resource problems, however my web traffic is lite.

Please provide me ANY feedback you feel is relevant. I'm really looking
for thoughts on my module namespace and a discussion of how useful you
feel this module might be.

Thank you!
Matthew Pitts
invinity <at> nvinity.net



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

Date: 6 Feb 2005 20:37:32 -0800
From: "invinity" <invinity@nvinity.net>
Subject: Re: New Module: Apache process/host manager
Message-Id: <1107751052.411298.73720@c13g2000cwb.googlegroups.com>

I forgot to mention that the code for Server::ApacheIVHost can be
browsed via mod_dav_svn at http://aivh.nvinity.net/repos/trunk.

Thanks again for any input you guys have.
Matthew Pitts
invinity <at> nvinity.net



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

Date: 6 Feb 2005 23:18:24 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Newbie asking, interesting question
Message-Id: <cu68k0$6pg$2@mamenchi.zrz.TU-Berlin.DE>

Tad McClellan  <tadmc@augustmail.com> wrote in comp.lang.perl.misc:
> Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
> 
> >     tr/0..9//cd;
> > 
> > That will delete everything except digits.
> 
> 
> Make that
> 
>        tr/0-9//cd;
> 
> please.

Yes.  Oh boy.  Looks like I violated the copy/paste rule.

Anno


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

Date: Sun, 06 Feb 2005 23:24:39 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Perl - permute?
Message-Id: <Xns95F5BB551991Aasu1cornelledu@127.0.0.1>

John Bokma <postmaster@castleamber.com> wrote in
news:Xns95F5A45FED6BFcastleamber@130.133.1.4: 

> A. Sinan Unur wrote:

 ...

>> For the following, I just used the first module CPAN gave me when I 
>> searched for the word 'permute'.
> 
> So you select CPAN modules based on "I feel lucky?"
> 
>> I have no idea if it is the best, for 
>> that you will have to do some work yourself.
> 
> So you pick the first module and ...
> 
>> You will note that Algorithm::Permute won't do all 3-letter
>> permutations out of 5 letters.
> 
> Aargh!

Dear John :)

I think you have misunderstood the intention of my post.

Sinan.


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

Date: 06 Feb 2005 23:25:24 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Perl - permute?
Message-Id: <slrnd0d9r4.g2.abigail@alexandra.abigail.nl>

David Trudgett (dtrudgett@holdthespam_yahoo.com) wrote on MMMMCLXXVII
September MCMXCIII in <URL:news:z_wNd.7139$i6.66402@nasal.pacific.net.au>:
**  Bill Smith wrote:
** > 
** > The required function should not
** > be called 'permute'.  A quick
**  
**  Goodness me! Doesn't anyone know a combination when they see one? This 
**  is high school maths. How about the Math:Combinatorics module?
**  
**  
**  my @n = qw(a b c);
**  my @c = combine(2,@n);
**  print join "\n", map { join " ", @$_ } @c;
**  # prints:
**  # b c
**  # a c
**  # a b


Well, that's NOT what the OP wants. So, perhaps you know a combination
when you see one - this wasn't a combination that was asked for.

For a three element array, and a 2 element answer, the OP wants:

    a a
    a b
    a c
    b a
    b b
    b c
    c a
    c b
    c c


Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: 7 Feb 2005 00:01:30 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Perl - permute?
Message-Id: <Xns95F5B75BF8DA1castleamber@130.133.1.4>

A. Sinan Unur wrote:

> I think you have misunderstood the intention of my post.

If I want to teach someone how to cook I don't give him/her a hammer and a 
piece of wood and then say: now find out how to make chicken soup.

-- 
John                   Small Perl scripts: http://johnbokma.com/perl/
               Perl programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html
                        


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

Date: Mon, 07 Feb 2005 00:52:03 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Perl - permute?
Message-Id: <Xns95F5CA26AA4C0asu1cornelledu@127.0.0.1>

John Bokma <postmaster@castleamber.com> wrote in
news:Xns95F5B75BF8DA1castleamber@130.133.1.4: 

> A. Sinan Unur wrote:
> 
>> I think you have misunderstood the intention of my post.
> 
> If I want to teach someone how to cook I don't give him/her a hammer
> and a piece of wood and then say: now find out how to make chicken
> soup. 

You are still misunderstanding the purpose of my reply. I do not want to 
teach him anything. Here is the original post:

>>> Subject: Perl - permute?
>>> From: Ej <justsurge@mailcan.com>
>>> Newsgroups: comp.lang.perl.misc
>>> Hi,
>>> 
>>> How can I take an array (a,b,c,d,e) and list ALL possible 
>>> [3 LETTER] combo s of these letters, I want the output to look 
>>> like
>>> 
>>>
>>> 
>>> abc
>>> acb
>>> aab
>>> aaa
>>> how can I Using perl
>>> Thanks Ej

1. The subject says 'permute' the body says combination

2. The message itself is barely coherent

3. There isn't the slightest hint that the OP made an effort to solve 
the problem on his own

Basically, this is a "write my code for me" post.

In this case Abigail was very nice and showed the obvious. I must have 
been feeling a little sadistic and sent the OP down the wrong path. OK, 
I am evil, but for the sake of everything that is holy in the land of 
Crom, how much effort does it take to write three nested for loops? 
After all, that's how we figured it out in 6th grade to get those 
combinations.

So, for the record, I had no intention of helping the OP. The only thing 
I wanted to teach was the principle of GIGO. If one posts garbage, one 
will get garbage in return.

Sinan


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

Date: 7 Feb 2005 04:56:43 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Perl - permute?
Message-Id: <Xns95F5E96902CCBcastleamber@130.133.1.4>

A. Sinan Unur wrote:

> John Bokma <postmaster@castleamber.com> wrote in
> news:Xns95F5B75BF8DA1castleamber@130.133.1.4: 
> 
>> A. Sinan Unur wrote:
>> 
>>> I think you have misunderstood the intention of my post.
>> 
>> If I want to teach someone how to cook I don't give him/her a hammer
>> and a piece of wood and then say: now find out how to make chicken
>> soup. 
> 
> You are still misunderstanding the purpose of my reply.

Probably you are misunderstanding mine.

> I do not want to 
> teach him anything.

Yeah, I could guess that.

[ snip ]

> 1. The subject says 'permute' the body says combination

So the OP got those two mixed up.

> 2. The message itself is barely coherent

It's clear to me.

> 3. There isn't the slightest hint that the OP made an effort to solve 
> the problem on his own

Yup.

> Basically, this is a "write my code for me" post.

Agreed.

> In this case Abigail was very nice and showed the obvious. I must have
> been feeling a little sadistic and sent the OP down the wrong path.

Yeah, you told him to get a hamer to make chicken soup, and ended that
it was not a good idea. 

> Crom, how much effort does it take to write three nested for loops? 
> After all, that's how we figured it out in 6th grade to get those 
> combinations.

Yup, in the 6th grade I understood things quite a lot of people don't
understand at my current age. Now what? Should I talk to them like they
are stupid? Or just look at them as being able to do things I can't do
and show some respect. 

> So, for the record, I had no intention of helping the OP. The only
> thing I wanted to teach was the principle of GIGO. If one posts
> garbage, one will get garbage in return.

Wonderful. Maybe someone will do the same joke with you one day, and
hopefully you will learn something out of it. 

-- 
John                   Small Perl scripts: http://johnbokma.com/perl/
               Perl programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html
                        


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

Date: Mon, 07 Feb 2005 00:25:39 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Perl Regex to search for ed2k links
Message-Id: <36nnsbF536fbfU1@individual.net>

cmw@tulpje.co.uk wrote:
> Can anybody help me? I need a regex that extracts the ed2k:// links
> from the below text. I am new to regex so i don't really know what i am
> doing. Can anybody help.

Yes, you. You can help yourself:

     perldoc perlrequick
     perldoc perlretut
     perldoc perlre

If you encounter problems after having given it a serious try, please 
feel welcome to ask for help here.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: 6 Feb 2005 15:43:14 -0800
From: "Chris" <cmw@tulpje.co.uk>
Subject: Re: Perl Regex to search for ed2k links
Message-Id: <1107733394.307343.200150@g14g2000cwa.googlegroups.com>

I meant no offence. I just find regex tricky and whated to make sure i
got it right.

sorry.



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

Date: 7 Feb 2005 00:03:02 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Perl Regex to search for ed2k links
Message-Id: <Xns95F5B79E87295castleamber@130.133.1.4>

Chris wrote:

> I meant no offence. I just find regex tricky and whated to make sure i
> got it right.

What have you tried so far?

Also, if you want to print just lines containing a fixed string at a given 
position you don't need regexp. See perldoc -f index.

-- 
John                   Small Perl scripts: http://johnbokma.com/perl/
               Perl programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html
                        


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

Date: Mon, 07 Feb 2005 00:58:53 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Perl Regex to search for ed2k links
Message-Id: <36npreF52npj7U1@individual.net>

[ Please provide context when you reply to another message. ]

Chris wrote:
> Gunnar Hjalmarsson wrote:
>> cmw@tulpje.co.uk wrote:
>>> Can anybody help me? I need a regex that extracts the ed2k:// links
>>> from the below text. I am new to regex so i don't really know what i am
>>> doing. Can anybody help.
>> 
>> 
>> Yes, you. You can help yourself:
>> 
>>     perldoc perlrequick
>>     perldoc perlretut
>>     perldoc perlre
>> 
>> If you encounter problems after having given it a serious try, please 
>> feel welcome to ask for help here.
> 
> I meant no offence.

I was not offended.

> I just find regex tricky and whated to make sure i got it right.

Then it would be a good idea to show us what you have tried so far, 
don't you think?

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Mon, 7 Feb 2005 00:22:53 +0000 (UTC)
From: "David H. Adler" <dha@panix.com>
Subject: Re: Perl Regex to search for ed2k links
Message-Id: <slrnd0dd6t.k4p.dha@panix2.panix.com>

On 2005-02-06, Chris <cmw@tulpje.co.uk> wrote:
> I meant no offence. I just find regex tricky and whated to make sure i
> got it right.

Well, if that's what you want, you should show us what you've tried. :-)

(also, some context in your posts would be nice. Take a look at the
posting guidelines for this group which are posted here periodically if
you haven't already.)

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"A Marine that says 'gee whiz'?  What's he gonna do, storm the
Cunningham house?" - mst3k


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

Date: 6 Feb 2005 23:12:52 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Perl Versus Python
Message-Id: <cu689k$6pg$1@mamenchi.zrz.TU-Berlin.DE>

Sherm Pendley  <spamtrap@dot-app.org> wrote in comp.lang.perl.misc:
> Anno Siegel wrote:
> 
> > They don't, that's the problem.  In particular, some authors of classes
> > published on CPAN don't.  Perl lets you drag stuff in and out of an object
> > willy-nilly, so that's what people do, making clean inheritance harder
> > than it has to be.  I for one would be glad about a way to enforce the
> > definition of accessors and their use throughout the rest of a class.
> 
> I prefer the approach taken by Cocoa/Objective-C. Objective-C does offer
> both "private" and "protected" modifiers, but they're trivially simple to
> bypass with a type cast.

Okay...

> Few people actually do so, because there are a number of tangible benefits
> to be gained by writing and using accessors that follow a simple design
> pattern. The pattern is pervasive through all of Cocoa, and using it in
> your own code makes a number of things Just Work - key-value coding
> observing, serialization, Cocoa bindings, etc.

Now, these benefits seem to be merits of Cocoa, not of Objective-C per
se.  A good Perl class hierarchy written for some purpose could do that
for its clients too.

> In short, if Perl's approach has a weakness, I don't think it's the lack of
> a stick, but rather the lack of a tasty carrot.

To stick (hehe) with the image, the carrot is there, if predictable behavior
of derived classes is tasty.  But it's way out of sight.

You don't see the immediately gain in painfully going through accessors
when (for instance) a hash slice is more natural (and more perlish).
If you don't know the rules of the OO game, you're bound to say: It's my
class (right), it's my code (also right), it's my method (wrong!).  It's
also a method of any class that inherits from yours, and you must
*consider* that, it makes a difference in non-obvious ways.  It seems
to me that Perl OO requires more of that kind of consideration than
other OO languages.

Sure, the freedom we gain in Perl is lovely.  The way Exporter.pm uses
inheritance to its advantage without being otherwise OO at all is a
nice example.

Sorry for explaining in so much detail what must mostly be clear to you.

Anno


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

Date: Sun, 06 Feb 2005 19:45:40 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Perl Versus Python
Message-Id: <xridnV9x88CrJ5vfRVn-qw@adelphia.com>

Anno Siegel wrote:

> also a method of any class that inherits from yours, and you must
> *consider* that, it makes a difference in non-obvious ways.  It seems
> to me that Perl OO requires more of that kind of consideration than
> other OO languages.

I agree. I certainly wouldn't suggest Perl as a language for teaching OO
concepts. In fact I don't think I'd suggest Perl as any sort of teaching
language at all - it's far too forgiving to be useful for that.

I simply meant to counter the claim made by many Python advocates, that it's
utterly impossible to write good OO code in Perl, because it lacks access
modifiers. That's a straw-man argument with no basis in logic. Not only is
it possible write good OO code without them, it's also possible to declare
everything as "public" and write sloppy OO in languages that do have them.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: 6 Feb 2005 23:21:15 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Why aren't 'warnings' on by default?
Message-Id: <cu68pb$6pg$3@mamenchi.zrz.TU-Berlin.DE>

Hendrik Maryns  <hendrik_maryns@despammed.com> wrote in comp.lang.perl.misc:
> Abigail schreef:
> <something very important>
> 
> <-- >
> A perl rose:  perl -e '@}>-`-,-`-%-'
> 
> This doesn't do anything for me?

It doesn't, what should it do?  It's a syntactically perfect (perlfect?)
rose.

Anno


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

Date: 06 Feb 2005 23:22:13 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Why aren't 'warnings' on by default?
Message-Id: <slrnd0d9l5.g2.abigail@alexandra.abigail.nl>

Hendrik Maryns (hendrik_maryns@despammed.com) wrote on MMMMCLXXVII
September MCMXCIII in <URL:news:xaydnaJhoYE2PZvfRVnyhg@scarlet.biz>:
}}  Abigail schreef:
}} <something very important>
}}  
}} <-- >
}}  A perl rose:  perl -e '@}>-`-,-`-%-'
}}  
}}  This doesn't do anything for me?


Do roses ever do something for you? ;-)



Abigail
-- 
perl -swleprint -- -_=Just\ another\ Perl\ Hacker


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

Date: Mon, 07 Feb 2005 00:32:20 +0100
From: Hendrik Maryns <hendrik_maryns@despammed.com>
Subject: Re: Why aren't 'warnings' on by default?
Message-Id: <PaKdnVophPCeNJvfRVnytQ@scarlet.biz>

Abigail schreef:
> Hendrik Maryns (hendrik_maryns@despammed.com) wrote on MMMMCLXXVII
> September MCMXCIII in <URL:news:xaydnaJhoYE2PZvfRVnyhg@scarlet.biz>:
> }}  Abigail schreef:
> }} <something very important>
> }}  
> }} <-- >
> }}  A perl rose:  perl -e '@}>-`-,-`-%-'
> }}  
> }}  This doesn't do anything for me?
> 
> 
> Do roses ever do something for you? ;-)

I get it, d'oh!

H.


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

Date: 6 Feb 2005 19:14:45 -0800
From: winhtut.oo@gmail.com
Subject: Win32::ODBC Find Primary Key Column
Message-Id: <1107746084.990737.83190@z14g2000cwz.googlegroups.com>

Hi

Is there any way I can get primary key column using Win32::ODBC in DB
independant way??

thanks



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

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


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