[19444] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1639 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 28 14:05:31 2001

Date: Tue, 28 Aug 2001 11:05:11 -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: <999021910-v10-i1639@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 28 Aug 2001     Volume: 10 Number: 1639

Today's topics:
    Re:  FAQ asking (was Re: CODE reference to member funct 194.203.212.8 [demerphq@hotmail.com]
    Re:  Re: CODE reference to member function of package C 194.203.212.8 [demerphq@hotmail.com]
    Re: $1 as subroutine parameter - problems ctcgag@hotmail.com
    Re: $1 as subroutine parameter - problems <bart.lateur@skynet.be>
    Re: Avoiding symbolic references. (Trewth Seeker)
        Calling a Java Class from within PERL (Team ALN)
    Re: CODE reference to member function of package Confus (Anno Siegel)
    Re: delete duplicate records (Anno Siegel)
    Re: Evaluation order of object methods <djberge@v55host56.interprise.com>
    Re: Evaluation order of object methods (Anno Siegel)
        FAQ asking (was Re: CODE reference to member function o (Tad McClellan)
    Re: Help!  Trying to configure SendMail.pm is driving m <dmartin119@home.com>
    Re: how to do 'c' - 'a' = 2 in perl? <kristian.fischer@koehlershohn.de>
    Re: how to do 'c' - 'a' = 2 in perl? <tinamue@zedat.fu-berlin.de>
    Re: how to do 'c' - 'a' = 2 in perl? (Tad McClellan)
    Re: how to do 'c' - 'a' = 2 in perl? <bart.lateur@skynet.be>
    Re: how to do 'c' - 'a' = 2 in perl? <cheng@cs.wustl.edu>
    Re: how to get character from string one by one? <cberry@cinenet.net>
    Re: how to get character from string one by one? (John J. Trammell)
    Re: It's to AM for me to think <iltzu@sci.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 28 Aug 2001 16:54:45 GMT
From: 194.203.212.8 [demerphq@hotmail.com]
Subject: Re:  FAQ asking (was Re: CODE reference to member function of package Confusing..)
Message-Id: <p1Qi7.1391$3x.5015@news.bc.tac.net>

> tadmc wrote...
> Yves Orton <demerphq@hotmail.com> wrote:
> >nobull@mail.com wrote in message news:<u9snemzxuk.fsf@wcl-l.bham.ac.uk>...
> >> Komtanoo  Pinpimai <romerun@greezi.com> writes a question from the FAQ's..
> Just curious Yves, but do you think that after _your_ comment CLPM
> will become "better" in some way? 
> 
> If yes, then how is silently allowing FAQs better?
> 
> If not, then what is the purpose of your followup?

Nice point.  After the various comments I have recieved, (most of which were more thoughtful than my own) I realize I shouldnt have said anything for the very same reason that I was saying he shouldnt say anything.

> >(Oh wait, the concept of not speaking English comes hard as hard to
> >Brits as to Septic Tanks doesnt it....)
> 
> Ethnic slurs are not very helpful in supporting your position.

I believe people are allowed to slur their own ethnicity (I am both more or less hmm in more ways than one actually).  And since when is rhyming slang a slur? 

> 
> (particularly since it was obviously NOT a language problem,
>  so you seem to be "reaching" for things to support your
>  position.
> )

No. Thats how I read it the first time. See my reply to anno mail as well.

> Or are you trying to make some other point altogether?
> 
> I really do not understand the point of your followup at all. Please
> try explaining what you mean again.

There a way to tell people without packing attitude.  Sarcasm can hurt at times I think.  But nevertheless I shouldnt have written my post at all.

SNIP

>    If you dont like the fact that someone is being asked to not re-ask 
>    already answered questions, then dont bitch and dont comment.

Yes. I will follow this advice. Its fair and correct.

> A well socialized response to being told that "the line forms to the 
> rear" is something along the lines of: "Oh. Sorry." followed by taking
> the proper place in line.
> 
> A response of saying "Standing in line is a stupid rule" is 
> not one of those kind of responses.

Actually I prefer the 'Thats ok im a VIP' when i can get away with it.  Amazing what a nice laminated card can do for you at various events... :-)

Sorry I annoyed you tad. Sorry I annoyed anyone, especially nobull.

In the future when the urge to write a mail like that comes on I will write it to myself first.

Yves



==================================
Poster's IP address: 194.203.212.8
Posted via http://nodevice.com
Linux Programmer's Site


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

Date: 28 Aug 2001 16:36:32 GMT
From: 194.203.212.8 [demerphq@hotmail.com]
Subject: Re:  Re: CODE reference to member function of package Confusing..
Message-Id: <9mghag6178u@enews1.newsguy.com>

> According to  <194.203.212.8 [demerphq@hotmail.com]>:
> > > According to Yves Orton <demerphq@hotmail.com>:
> > > > nobull@mail.com wrote in message news:<u9snemzxuk.fsf@wcl-l.bham.ac.uk>...
> > > > 
> > > > > Komtanoo  Pinpimai <romerun@greezi.com> writes a question from the FAQ's..
> > > > > So your question is "How can I pass a method?".
> > > > 
> > > > > This is a FAQ: "How can I pass/return a {Function, FileHandle, Array,
> > > > > Hash, Method, Regex}?"
> > > > 
> > > > > > what should I do?
> > > > > > suggestion please...
> > > > 
> > > > > I suggest that what you should do is check the FAQ before posting to
> > > > > Usenet.
> > > > 
> > > > Just curious nobull, but do you think that after this comment CLPM
> > > > will magically become free of newbies asking questions from the FAQ?
> > >  
> > > Why do you assume he expects that?  You probably never sweep your
> > > floor because that doesn't magically make it dust-free forever.
> > 
> > I would buy this if the OP had posted a bunch of FAQ questions.  But
> > just one?  And no I never sweep.  Hoovers are much easier. :-)
>  
> You are side-stepping the issue.  You made the implicit assumption
> that calling newbies on asking FAQs made only sense if it "magically"
> made the problem go away.  My point is that, like sweeping the floor,
> it makes sense to let it be known that these questions are unwanted.
> It doesn't matter if an individual poster has asked many of them.
> In fact, few do, and that's a good thing.

Which is where my point lies.. Saying, 
'You really should read the faq, cause if you did you see the answer to your problem under the title X' Helpful but at the same time educational.  But as you say perhaps I was being a little oversensitive.  

SNIP

> I think the language issue is a red herring.  

Well im not so sure.  A lot of FAQ's that get posted seem to be written in bad english.  Now this doesn't mean anything really but....

>I can't say that I have particularly watched out
> for it, but I don't see a correlation between fluency in English and
> FAQ asking.  Native speakers ask their share of FAQs without the
> handicap.

I dont think I would try defending them either.

> > OTOH I wouldnt have said anything if the reply had been very simply 
> > 
> > perldoc -q Method
> 
> It said that.  In fact, it quoted the full title of the FAQ.

??? Where ???  He quoted the title yes.
 
SNIP

> Well, what is considered human etiquette varies.  What one considers
> un-called-for rudeness is another's healthy expression of exasperation.

True.
 
> > something like 'do unto others as you would have them do to you'.  I
> 
> Oh dear.  The rabbi said it a bit differently:  Don't do unto others
> what you would find hateful if it were done to you.  This is from memory,
> but the point is the negative formulation, which has quite different
> consequences.  This leads into ethics and is severely off topic.
> Suffice it to say that I wouldn't want to live in a world where people
> are encouraged to force do to me what they decide they like.

Put like that I can see your point.  :-)  

> > believe most people dislike uncalled for snarky answers so why give em?
>  
> Yes, they do.  So feelings get hurt.  Other feelings get hurt from
> seeing too many questions whose answers can easily be looked up.

Ok Ok. PWT.

> 
> [snip]
> 
> > > The quality of a news group depends on the vigilance of its regulars.
> > 
> > Agreed.  And a bunch of regulars replied, *without* abusing the OP.  
> > Dont you think that generally it is nicer to start off nice?
> 
> Ah, come on.  Now we're talking abuse?  Nobull's post was absolutely
> neutral but for the last sentence, which was sarcastic but by no means
> abusive.  I think you're playing over-sensitive to make a point.

True.  That day I had gotten a hard time cause of my poor German, perhaps I transferred my feeling regarding that to nobulls mail.

Nobull: my apologies for reacting in the way that I did to your mail.
It was a bit OTT. Sorry.

Yves



==================================
Poster's IP address: 194.203.212.8
Posted via http://nodevice.com
Linux Programmer's Site


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

Date: 28 Aug 2001 16:09:58 GMT
From: ctcgag@hotmail.com
Subject: Re: $1 as subroutine parameter - problems
Message-Id: <20010828120958.006$f0@newsreader.com>

abigail@foad.org (Abigail) wrote:
> ctcgag@hotmail.com (ctcgag@hotmail.com) wrote on MMCMXVII September
> ^^
> ^^ But, if you print $1 again after the subroutine, it will have the same
> ^^ value it did before the subroutine.  So $_[0] wasn't really acting as
> ^^ an alias for the passed $1.
>
> Oh, sure it does. Except that for each block, there's an implied local()
> for $1 and friends. Hence the "restoration".

Hmmm.  This is still somewhat confusing.  It looks like special variables
are localized by saving the value someplace else, using the original
address, then restoring the value upon leaving the block.  Whereas ordinary
values are localized be creating a new address, changing the symbol table
to point to that address, then changing the symbol table back upon exiting
the block.

Xho


#!/usr/bin/perl -w
"abcdefgh" =~ /(d.+f)/ or die;
$y=$1;
&x($y);
print "outer   end: $y\n";

sub x {
  print "inner start: $y, $_[0] \n";
  local $y=$y;
  $y = "deadbeef" ;
  print "inner   end: $y, $_[0] \n";
} ;

__END__
inner start: def, def
inner   end: deadbeef, def
outer   end: def

#!/usr/bin/perl -w

"abcdefgh" =~ /(d.+f)/ or die;

&x($1);

print "outer   end: $1\n";

sub x {
  print "inner start: $1, $_[0] \n";
  local $1;
  "deadbeef" =~ /(d.+f)/ or die;
  print "inner   end: $1, $_[0] \n";
} ;
__END__
inner start: def, def
inner   end: deadbeef, deadbeef
outer   end: def

-- 
-------------------- http://NewsReader.Com/ --------------------
                    Usenet Newsgroup Service


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

Date: Tue, 28 Aug 2001 16:37:41 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: $1 as subroutine parameter - problems
Message-Id: <lthnotggjiio51spcfbp21n2gmmfugb677@4ax.com>

ctcgag@hotmail.com wrote:

>Hmmm.  This is still somewhat confusing.  It looks like special variables
>are localized by saving the value someplace else, using the original
>address, then restoring the value upon leaving the block.

Nonono. It happens to all global variables, if you use local() yourself
on them. The only thing special about $1 and friends is that this
localisation happens automatically when you enter a new block that
happens to contain a regex. Something like that, anyway.

	$x = 'outer';
	test();
	{
	    local $x = 'inner';
	    test();
	}
	test();

	sub test {
	      print "The value of global \$x is now '$x'\n";
	}
-->
	The value of global $x is now 'outer'
	The value of global $x is now 'inner'
	The value of global $x is now 'outer'

You're right in that local() does indeed save the old value "somewhere",
and restores it afterwards. That's how it works.

-- 
	Bart.


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

Date: 28 Aug 2001 09:35:26 -0700
From: trewth_seeker@yahoo.com (Trewth Seeker)
Subject: Re: Avoiding symbolic references.
Message-Id: <d690a633.0108280835.4ebf2065@posting.google.com>

Benjamin Goldberg <goldbb2@earthlink.net> wrote in message news:<3B8B4E08.B7F8BA86@earthlink.net>...
> Anno Siegel wrote:
> > 
> > According to Benjamin Goldberg  <goldbb2@earthlink.net>:
> > 
> > [calculating Euler's number]
> > 
> > > I suppose it doesn't matter much, anyway.  Having seen the amount of
> > > time it takes to calculate successive significant bits of euler's
> > > number, I've given up on calculating it to the log2(256!)
> > > significant bits I need to do what I want.
> > 
> > It can't be that bad.  Using e = 1 + 1/1! + ... + 1/n!, the error is
> > less than twice the first neglected term, so we want n = 256.  My
> > measly Pentium 90 does that in about 15 seconds.
> > 
> > > It's far easier and faster to download it off of a website.
> > 
> > That may still be true, if you count writing the program.
> 
> Umm, this is a different Euler's constant I'm calculating.  It's for
> implementing something on John Savard's crypo pages.... Here's a quote:
> 
> "The constant I am using is Euler's constant, sometimes called the
> Euler-Mascheroni constant, also known as gamma. Its value is
> .57721 56649 01532 86060 65120 90082..."
> 
> I'm not sure why he picked this particular number, given how hard it is
> to calculate.

Perhaps he took into account the fact that there's no need to re-calculate it.

> I would have picked a number which is known to be
> transcendental and which is easy to calculate.
> 
> I suppose I should have mentioned I was looking for gamma, not e.
> 
> Anyway, the value is calculated as:
> 
> gamma = sum( i=1..inf, i*sum( j=2**i..2**(i+1)-1, (-1)**j / j ) );
> 
> which takes an ungodly long time to get even a few significant digits.

I guess that's why

http://www.cecm.sfu.ca/projects/ISC/dataB/isc/C/gamma.txt

only lists the first 1000000 digits.


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

Date: 28 Aug 2001 10:39:25 -0700
From: rxsid@aol.com (Team ALN)
Subject: Calling a Java Class from within PERL
Message-Id: <982f6619.0108280939.a4fe731@posting.google.com>

Hello all,

Does anyone know how to call a Java Class from within PERL?  I have
tried using the system function to no avail.  I would prefer not to
use the exec() if at all possible.  Any ideas?

Thanks in advance...

Gary

gary.theisen@eds.com


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

Date: 28 Aug 2001 15:35:27 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: CODE reference to member function of package Confusing..
Message-Id: <9mgdnv$8pm$1@mamenchi.zrz.TU-Berlin.DE>

According to  <194.203.212.8 [demerphq@hotmail.com]>:
> > According to Yves Orton <demerphq@hotmail.com>:
> > > nobull@mail.com wrote in message news:<u9snemzxuk.fsf@wcl-l.bham.ac.uk>...
> > > 
> > > > Komtanoo  Pinpimai <romerun@greezi.com> writes a question from the FAQ's..
> > > > So your question is "How can I pass a method?".
> > > 
> > > > This is a FAQ: "How can I pass/return a {Function, FileHandle, Array,
> > > > Hash, Method, Regex}?"
> > > 
> > > > > what should I do?
> > > > > suggestion please...
> > > 
> > > > I suggest that what you should do is check the FAQ before posting to
> > > > Usenet.
> > > 
> > > Just curious nobull, but do you think that after this comment CLPM
> > > will magically become free of newbies asking questions from the FAQ?
> >  
> > Why do you assume he expects that?  You probably never sweep your
> > floor because that doesn't magically make it dust-free forever.
> 
> I would buy this if the OP had posted a bunch of FAQ questions.  But
> just one?  And no I never sweep.  Hoovers are much easier. :-)
 
You are side-stepping the issue.  You made the implicit assumption
that calling newbies on asking FAQs made only sense if it "magically"
made the problem go away.  My point is that, like sweeping the floor,
it makes sense to let it be known that these questions are unwanted.
It doesn't matter if an individual poster has asked many of them.
In fact, few do, and that's a good thing.

> > > Also did it occur to you that perhaps his English is maybe not native?
> > > And that therefore reading/searching the faqs might not be so easy? 
> > > (Oh wait, the concept of not speaking English comes hard as hard to
> > > Brits as to Septic Tanks doesnt it....)
> > 
> > So fuckin what?  Are you saying clpm is easier to read than the Perl FAQ?
> 
> Yes. Its easier to write a pointed question and then read the replies.
> The perl FAQs are organised in such a way that it is not entirely
> obvious where to look for a given question unless you had read through a
> big chunk of them at least once before.  I mean does objectively is
> 'Perl Language Issues' a title that strongly suggests that it is the doc
> to read in this case?  Maybe im think (probably actually) but it didnt
> to me. (I looked elsewhere first.)

All this goes for native speakers as well.  I think the language issue
is a red herring.  I can't say that I have particularly watched out
for it, but I don't see a correlation between fluency in English and
FAQ asking.  Native speakers ask their share of FAQs without the
handicap.

It's Usenet.  People of all cultural, societal and personal backgrounds
who would hardly meet in real life engage in a dialog.  More than that,
they establish their own mini-societies with all sorts of rules and
manners.  That doesn't happen by itself, and it doesn't happen without
the occasional (or even permanent) unpleasantness.  That's how it
works, and it's amazing that it works at all.

> OTOH I wouldnt have said anything if the reply had been very simply 
> 
> perldoc -q Method

It said that.  In fact, it quoted the full title of the FAQ.

[more language snipped]

> >It applies to clpm as well as the FAQ and
> > a lot of documentation.  I you want to program, you need access to the
> > resources, no matter what.  Better get used to it.
> 
> I am used to it.  I do tend to look things up.  I dont tend to post many
> questions, in fact I try to contributemore answers (or at least my best
> attempt) than questions. (As you know)  The point is that while the
> nettetiquette is 'RTFM first!' there is also normal human etiquette,

Well, what is considered human etiquette varies.  What one considers
un-called-for rudeness is another's healthy expression of exasperation.

> something like 'do unto others as you would have them do to you'.  I

Oh dear.  The rabbi said it a bit differently:  Don't do unto others
what you would find hateful if it were done to you.  This is from memory,
but the point is the negative formulation, which has quite different
consequences.  This leads into ethics and is severely off topic.
Suffice it to say that I wouldn't want to live in a world where people
are encouraged to force do to me what they decide they like.

> believe most people dislike uncalled for snarky answers so why give em?
 
Yes, they do.  So feelings get hurt.  Other feelings get hurt from
seeing too many questions whose answers can easily be looked up.

[snip]

> > The quality of a news group depends on the vigilance of its regulars.
> 
> Agreed.  And a bunch of regulars replied, *without* abusing the OP.  
> Dont you think that generally it is nicer to start off nice?

Ah, come on.  Now we're talking abuse?  Nobull's post was absolutely
neutral but for the last sentence, which was sarcastic but by no means
abusive.  I think you're playing over-sensitive to make a point.

Anno
-- 
use overload '${}' => sub { \ 'Just '}, '@{}' => sub { [ 'another ']},
'%{}' => sub { { a => 'Perl '}}, '&{}' => sub { sub { print @_, 'hacker'}};
$plop = bless [];
$plop->( $$plop, $plop->[ 0], $plop->{ a});


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

Date: 28 Aug 2001 16:21:10 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: delete duplicate records
Message-Id: <9mggdm$aic$2@mamenchi.zrz.TU-Berlin.DE>

According to Benjamin Goldberg  <goldbb2@earthlink.net>:

[...]
 
> Also, where your code has:
> 	@temphash{@data}=1;
> You should keep in mind what happens when assignment between lists of
> unequal length -- and a hash slice is a list.  This code is effectively
> the same as
> 	@temphash{@data} = ( 1, (undef) x $#data );
> It would be faster to either do:
> 	@temphash{@data} = ();
> or, better yet:
> 	undef @temphash{@data};

In what respect is it better?  It may (or may not) be  a bit faster, but
the intention of the statement is creation of the keys.  "undef" is so
much in contradiction with that, I'd definitely try to avoid it.

Anno


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

Date: Tue, 28 Aug 2001 11:37:21 -0500
From: Mr. Sunblade <djberge@v55host56.interprise.com>
Subject: Re: Evaluation order of object methods
Message-Id: <pIPi7.12$9n5.9542@news.uswest.net>

<snip,snip>

> That's why there's that fun wantarray() function.  Return $self or the
> new object if wantarray is false, otherwise return an array.

Doesn't work.  If you chain a method, then 'defined wantarray' will 
return true for the immediately preceding method.

-- a very basic array package ---
package Set::Array;
use strict;
 
sub new{
   my($class, @list) = @_;
   return bless \@list, ref($class) || $class;
}
 
sub length{
   my $self = shift;
   return scalar(@$self);
}
 
sub unique{
   my $self = shift;
   my %seen;
 
   if(wantarray){
      return grep !$seen{$_}++, @$self;
   }
   elsif(defined wantarray){
      return [grep !$seen{$_}++, @$self];
   }
   else { # void context
      @$self = grep !$seen{$_}++, @$self;
   }
}
1;

-- using our package --
my $array = My::Array->new(1,2,3,1,2);
my @unique = $array->unique(); # 'wantarray' true, returns list
my $uniqref = $array->unique(); # 'defined wantarray' true, returns ref

# Now, I'll chain method calls without an lvalue...
$array->unique()->length(); # 'defined wantarray' true, CRASH!

Problem is, because of the call to 'length', the 'defined wantarray' 
will evaluate to 'true' within 'unique'.  Consequently, the 'unique' 
method will try to return an unblessed value to the 'length' method and 
that will cause it to crash.

But if I return $self if 'defined wantarray' evaluates to true, then I 
get an object when all I wanted was the length.  It's a catch 22.  This 
makes using "defined wantarray" a *bad idea* if you want to support 
method chaining for any class.

This is crux of the problem.  Is there a way to tell Perl, "hey, if 
'defined wantarray' evaluates to true and I'm being passed to an object 
method, return $self (or at least a blessed array reference that 
presumably is a copy of $self).  Otherwise, just return a normal 
value." ?

I'm just accepting reality at this point and returning blessed array 
references in most cases (or $self) for methods where I want a little 
flexibility.

Regards,

Mr. Sunblade

-- 
"Evil will always triumph because Good is *dumb*."
- Dark Helmet, "Spaceballs: The Movie"


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

Date: 28 Aug 2001 17:05:48 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Evaluation order of object methods
Message-Id: <9mgj1c$aic$3@mamenchi.zrz.TU-Berlin.DE>

According to Mr. Sunblade  <djberge@v55host56.interprise.com>:

Please provide an attribution. This is in reply to Benjamin Goldberg.

[snippage]

> -- using our package --
> my $array = My::Array->new(1,2,3,1,2);
> my @unique = $array->unique(); # 'wantarray' true, returns list
> my $uniqref = $array->unique(); # 'defined wantarray' true, returns ref
> 
> # Now, I'll chain method calls without an lvalue...
> $array->unique()->length(); # 'defined wantarray' true, CRASH!

[more snippage]
 
> I'm just accepting reality at this point and returning blessed array 
> references in most cases (or $self) for methods where I want a little 
> flexibility.

If you want an intuitive interface to the array aspect of your
objects, consider overloading @{}.  I think Abigail suggested this
in this thread before, but it got lost in a maze of confusion.

You can then, besides ordinary method application, treat an object
as an arrayref and say "@unique = @{ $array->unique()}", where the
unique() method can return its object, no matter what.  It doesn't
have quite the automation you were aiming at, but it's a compromise.

Anno


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

Date: Tue, 28 Aug 2001 08:17:07 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: FAQ asking (was Re: CODE reference to member function of package Confusing..)
Message-Id: <slrn9on2u3.s19.tadmc@tadmc26.august.net>

Yves Orton <demerphq@hotmail.com> wrote:
>nobull@mail.com wrote in message news:<u9snemzxuk.fsf@wcl-l.bham.ac.uk>...
>> Komtanoo  Pinpimai <romerun@greezi.com> writes a question from the FAQ's..
>> So your question is "How can I pass a method?".
>
>> This is a FAQ: "How can I pass/return a {Function, FileHandle, Array,
>> Hash, Method, Regex}?"
>
>> > what should I do?
>> > suggestion please...
>
>> I suggest that what you should do is check the FAQ before posting to
>> Usenet.


Seems to me to be a nice enough pointer to the FAQs.

The equivalent of saying "the line forms to the rear" when 
someone takes cuts in front of you.


>Just curious nobull, but do you think that after this comment CLPM
>will magically become free of newbies asking questions from the FAQ?


Just curious Yves, but do you think that after _your_ comment CLPM
will become "better" in some way? 

If yes, then how is silently allowing FAQs better?

If not, then what is the purpose of your followup?


>Also did it occur to you that perhaps his English is maybe not native?
>And that therefore reading/searching the faqs might not be so easy? 


The OP used the word "method", so he _did_ know the right search term:

   perldoc -q method

finds the aforementioned FAQ. Clearly couldn't have been a language
issue there so I don't see why you are going on about it.


>(Oh wait, the concept of not speaking English comes hard as hard to
>Brits as to Septic Tanks doesnt it....)


Ethnic slurs are not very helpful in supporting your position.

(particularly since it was obviously NOT a language problem,
 so you seem to be "reaching" for things to support your
 position.
)

Please offer instead a reason or two that supports your point.

I'm unclear on what, exactly, your point _is_. Maybe it is one of these:

   FAQ asking is OK

   FAQ asking is not OK, but telling someone that is not OK is not OK.

Or are you trying to make some other point altogether?

I really do not understand the point of your followup at all. Please
try explaining what you mean again.


>Ive seen the tagline that is attributed to you, the one about this
>being a discussion forum and answering questions is purely incidental.
> Good comment.  But heres one for you:
>
>If you dont like the fact that someone is asking questions that you'd
>rather not answer, THEN DONT! Dont bitch, and don't answer.


In the spirit of giving that you have inspired, I will contribute
one for you too. Seems only fair.

   If you dont like the fact that someone is being asked to not re-ask 
   already answered questions, then dont bitch and dont comment.


>PS I bet there is not a soul on CLPM that has not at one time or
>another asked a question from the FAQ.  Including you.


A well socialized response to being told that "the line forms to the 
rear" is something along the lines of: "Oh. Sorry." followed by taking
the proper place in line.

A response of saying "Standing in line is a stupid rule" is 
not one of those kind of responses.


-------------------------------------------------
In article <1995Nov9.193745.13694@netlabs.com>, lwall@netlabs.com (Larry
Wall) wrote: ...

<Larry>  [snip]  I view a programming language as a place to be
<Larry>  explored, like Disneyland. You don't need to have a lot of preparation
<Larry>  to explore a theme park.  You do have to go along with the crowd
<Larry>  control measures, though.  In a sense, each ride has its own
<Larry>  prerequisites--if you cut in line, you risk getting tossed out of the
<Larry>  park.
<Larry> 
<Larry>  What we have here in this newsgroup is a failure in crowd control.
<Larry>  Reading the FAQ is like staying in line--it's something you should
<Larry>  learn in kindergarten.  Usenet needs a better kindergarten.
-------------------------------------------------


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


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

Date: Tue, 28 Aug 2001 17:20:41 GMT
From: "JerryGarciuh" <dmartin119@home.com>
Subject: Re: Help!  Trying to configure SendMail.pm is driving me crazy!!
Message-Id: <JpQi7.136667$oh1.53525036@news2.rdc2.tx.home.com>



http://www.tneoh.zoneit.com/perl/SendMail/
It's the autor's site.  What do you think about getting the module to accept
the SMTP server adress?
jg


> Where did you get this module from?  I can only see Mail::Sendmail on
>CPAN  and it has a different interface to what you describe.


"Tintin" <somewhere@in.paradise.net> wrote in message
news:Yozi7.3$rD6.153699@news.interact.net.au...
>
> "JerryGarciuh" <dmartin119@home.com> wrote in message
> news:_lvi7.134432$oh1.52034544@news2.rdc2.tx.home.com...
> > My tests got error :
> >
> > no host: , please specify SMTP server with "$obj = new
> > SendMail('your.smtp.server');"
> >
> > So in SendMail.pm I edited
> >
> > $smtpserver   = "mail.server.com";
> >
> > to
> >
> > $smtpserver   = "mail.mysite.com";
> >
> > and got same error.  Since error said to edit
> >
> > "$obj = new SendMail('your.smtp.server');"
> >
> > I went down to
> >
> > $obj = new SendMail();
> >   $obj = new SendMail($smtpserver);
> >   $obj = new SendMail($smtpserver, $smtpport);
> >
> > and changed first line to
> >
> > $obj = new SendMail(mail.mysite.com);
> >
> > got same error
> >
> > so I changed it back and tried replacing variable  $smtpserver with my
> info
> > which off course rendered script inoperable.
> >
> > I REALLY don't get why setting $smtpserver   = "mail.mysite.com"; gave
> error
> > no host  when   $obj = new SendMail($smtpserver);
> > should have had the info it needed from var.
>
>
>
>




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

Date: Tue, 28 Aug 2001 17:34:05 +0200
From: Kristian Fischer <kristian.fischer@koehlershohn.de>
Subject: Re: how to do 'c' - 'a' = 2 in perl?
Message-Id: <3B8BB9ED.89717F12@koehlershohn.de>

Hallo

cheng huang wrote:
> 
> Say I have a $letter variable and want to know what it is exactly, can sb.
> get some advice? Thanks.

perl -e 'print (ord(c) - ord(a))'
 
Regards
 Kristian


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

Date: 28 Aug 2001 15:34:42 GMT
From: Tina Mueller <tinamue@zedat.fu-berlin.de>
Subject: Re: how to do 'c' - 'a' = 2 in perl?
Message-Id: <9mgdmi$23d6c$1@fu-berlin.de>

cheng huang <cheng@cs.wustl.edu> wrote:
> Say I have a $letter variable and want to know what it is exactly, can sb. 
> get some advice? Thanks.

i'm not sure if i understand what you want, so
perldoc -f ord
*might* help you. otherwise please say more clearly what
you want to achieve.

hth, tina
-- 
http://www.tinita.de \  enter__| |__the___ _ _ ___
tina's moviedatabase  \     / _` / _ \/ _ \ '_(_-< of
search & add comments  \    \ _,_\ __/\ __/_| /__/ perception
---   Warning: content of homepage hopelessly out-dated   ---


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

Date: Tue, 28 Aug 2001 11:02:31 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: how to do 'c' - 'a' = 2 in perl?
Message-Id: <slrn9onck7.sc0.tadmc@tadmc26.august.net>

cheng huang <cheng@cs.wustl.edu> wrote:

>Say I have a $letter variable and want to know what it is exactly, can sb. 


What is "sb"?


>get some advice? Thanks.


   perldoc -f ord


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


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

Date: Tue, 28 Aug 2001 16:40:43 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: how to do 'c' - 'a' = 2 in perl?
Message-Id: <m9inotgt7ce8o4697rub3o2ej2f0kquqtb@4ax.com>

cheng huang wrote:

>Say I have a $letter variable and want to know what it is exactly, can sb. 
>get some advice? Thanks.

I think your problem is that you consider charatsers as numbers. They
are not. They are strings. If you want the numerical value of the byte
that makes up the first character, use the function ord(). That's what
it's for. Its inverse is chr(), BTW.

-- 
	Bart.


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

Date: Tue, 28 Aug 2001 11:57:18 -0500
From: cheng huang <cheng@cs.wustl.edu>
Subject: Re: how to do 'c' - 'a' = 2 in perl?
Message-Id: <9mgiep$mme$1@newsreader.wustl.edu>

Thanks to all. Ord is what I want.

Btw, sb. is for "somebody", forgive me for my lazy. :-)

-- Cheng

cheng huang wrote:

> Say I have a $letter variable and want to know what it is exactly, can sb.
> get some advice? Thanks.
> 
> -- Cheng
> 



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

Date: Tue, 28 Aug 2001 17:00:42 -0000
From: Craig Berry <cberry@cinenet.net>
Subject: Re: how to get character from string one by one?
Message-Id: <Xns910B65D8AFCC1cberrycinenetnet1@207.126.101.92>

demerphq@hotmail.com (Yves Orton) wrote in
news:74f348f7.0108280139.332a852a@posting.google.com: 
> I will be posting an overview of a bunch of benchmarks that I have
> done in this area to the thread 'one character at a time'.  There are
> a variety of methods (5 basic ideas) to achieve it ranging from fast
> to slow.  Split doesnt perform that well actually.

Let's see...substr, split, unpack, m/(.)/sg, and...what?

-- 
Craig Berry <http://www.cinenet.net/~cberry/>
"That which is now known, was once only imagined." - William Blake



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

Date: 28 Aug 2001 17:36:47 GMT
From: trammell@haqq.hypersloth.invalid (John J. Trammell)
Subject: Re: how to get character from string one by one?
Message-Id: <slrn9oo4r3.pj8.trammell@haqq.hypersloth.net>

On Tue, 28 Aug 2001 17:00:42 -0000, Craig Berry <cberry@cinenet.net> wrote:
> demerphq@hotmail.com (Yves Orton) wrote in
> news:74f348f7.0108280139.332a852a@posting.google.com: 
> > I will be posting an overview of a bunch of benchmarks that I have
> > done in this area to the thread 'one character at a time'.  There are
> > a variety of methods (5 basic ideas) to achieve it ranging from fast
> > to slow.  Split doesnt perform that well actually.
> 
> Let's see...substr, split, unpack, m/(.)/sg, and...what?

chop?  :-)

-- 
Just Another Perl Hacker.


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

Date: 28 Aug 2001 17:16:40 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: It's to AM for me to think
Message-Id: <999018371.28999@itz.pp.sci.fi>

In article <slrn9ome4q.r1r.abigail@alexandra.xs4all.nl>, Abigail wrote:
>Ilmari Karonen (iltzu@sci.invalid) wrote on MMCMXIX September MCMXCIII in
><URL:news:998962555.11327@itz.pp.sci.fi>:
>-- In article <9me1e0$c5n$1@mamenchi.zrz.TU-Berlin.DE>, Anno Siegel wrote:
>-- >
>-- >That could only happen if the overhead of "shift @array" vs. "$array[ 0]"
>-- >is greater than one round through the loop.  I was betting that it isn't
>-- >(and still do), but you're right to point it out.
>--
>-- Besides, it could well be that shift() is actually faster than fetching
>-- an array element by index.  No, I'm not going to benchmark it right now.
>
>It could. The point is that we don't know, so the claim that the
>optimization "comes for free" is unfounded.

Well, I we do know that shift() and array indexing are both O(1), since
that much is documented.  This is achieved by implementing Perl arrays
as contiguous chunks of memory, with an adjustable beginning pointer.

If we assume, given the above, a halfway sane implementation of both
operarations, that implies they take approximately the same time, since
the fundamental actions they must perform are nearly identical.  That
makes any optimization enabled by switching between them "free" for all
but the most unreasonably pedantic definitions.

If the array was tied or magical, of course, all bets would be off.

-- 
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real!  This is a discussion group, not a helpdesk.  You post something,
we discuss its implications.  If the discussion happens to answer a question
you've asked, that's incidental."           -- nobull in comp.lang.perl.misc



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

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.  

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


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