Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

need help with the tr and s///

0 views
Skip to first unread message

jo...@yahoo.com

unread,
Jan 17, 2007, 6:50:14 PM1/17/07
to
Hi,
Does anyone have an easy way to replace the end of one string with
another? I have 2 strings one that ends with some unknown number of 0,
and I need to replace the trailing chars in the other string with that
number of 0s. I figure I could do this with a few loops but there has
to be an easy way to use the s/// and the tr to help me out.
any ideas,
zim

Mark Donovan

unread,
Jan 17, 2007, 9:21:15 PM1/17/07
to

Let me understand... you want the number of trailing zeros to be the same
for both strings. Here are two ways.

Find the trailing zeros on the first string, count them, remove trailing
zeros from the second string, and append new trailing zeros to the second
string.

$s1 =~ m/(0*)\z/;
$len = length $1;
$s2 =~ s/(.*?)0*\z/$1/;
$s2 .= '0' x $len;

Here's the same result with two statements that run about 15 percent faster.

($len = $s1) =~ s/.*?(0*)\z/length $1/e;
$s2 =~ s/(.*?)0*\z/$1 . '0' x $len/e;

--
Mark

Tad McClellan

unread,
Jan 17, 2007, 8:45:06 PM1/17/07
to
jo...@yahoo.com <jo...@yahoo.com> wrote:

> Does anyone have an easy way to replace the end of one string with
> another? I have 2 strings one that ends with some unknown number of 0,
> and I need to replace the trailing chars in the other string with that
> number of 0s.


---------------------------
#!/usr/bin/perl
use warnings;
use strict;

my $one_str = '1230000';
my $other_str = 'Laziness, Impatience and Hubris';

(my $zeros = $one_str) =~ s/.*?(?=0+$)//; # strip all but trailing zeros
substr($other_str, -length $zeros) = $zeros;

print "$other_str\n";

__END__
# a shorter, but much too ugly way:
substr($other_str, -length(($one_str =~ m/(0+)$/)[0]) ) =~ s/./0/g;
---------------------------


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

Purl Gurl

unread,
Jan 17, 2007, 11:43:51 PM1/17/07
to
jo...@yahoo.com wrote:

> Does anyone have an easy way to replace the end of one string with
> another? I have 2 strings one that ends with some unknown number of 0,
> and I need to replace the trailing chars in the other string with that
> number of 0s.

Your article is gibberish.

"I have 2 strings one that ends with some unknown number of 0...."

You have one string which ends with an unknown quantity of zeroes.
Are there zeroes elsewhere in this string or only trailing? Will
data ever have no trailing zeroes? Will data ever be all zeroes?


"...I need to replace the trailing chars in the other string...."

Are readers to guess at what are those trailing characters and
how many trailing characters?


"...replace the trailing chars in the other string... with that number of 0s."

Are you to replace trailing characters of one string with the trailing zeroes
of another string OR replace trailing characters of one string with the actual
"numerical count" of zeroes from another string?

Readers have no choice but to guess what is your task.
Guessing is not a viable programming method.

Best help you will receive is to help yourself write
articles which are clear, concise and cohesive.

Purl Gurl

Michele Dondi

unread,
Jan 18, 2007, 6:19:05 AM1/18/07
to
On Wed, 17 Jan 2007 19:21:15 -0700, Mark Donovan
<nova...@hotmail.com> wrote:

>Find the trailing zeros on the first string, count them, remove trailing
>zeros from the second string, and append new trailing zeros to the second
>string.
>
>$s1 =~ m/(0*)\z/;
>$len = length $1;
>$s2 =~ s/(.*?)0*\z/$1/;
>$s2 .= '0' x $len;

This amounts to getting a string of zeroes, getting its length and
rebuild it based on this length, there's clearly an unnecessary
passage:

my ($pad) = $s1 =~ /(0*)\z/g;
$s2 =~ s/(.*?)0*\z/$1$pad/;


Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,

Michele Dondi

unread,
Jan 18, 2007, 7:57:34 AM1/18/07
to
On Thu, 18 Jan 2007 12:19:05 +0100, Michele Dondi
<bik....@tiscalinet.it> wrote:

>This amounts to getting a string of zeroes, getting its length and
>rebuild it based on this length, there's clearly an unnecessary
>passage:
>
> my ($pad) = $s1 =~ /(0*)\z/g;
> $s2 =~ s/(.*?)0*\z/$1$pad/;

Or even in a single s/// statement (not that I'd recommend it):

$s2 =~ s/(.*?)0*\z/$1 . do{($s1 =~ m|(0*)\z|g)[0]}/e;

Mark Donovan

unread,
Jan 18, 2007, 2:40:27 PM1/18/07
to
You are right, of course, but the four line version was for illustration
purposes. I believe the individual steps make the more compact alternatives
easier to understand.

--
Mark

Michele Dondi

unread,
Jan 18, 2007, 5:13:32 PM1/18/07
to
On Thu, 18 Jan 2007 12:40:27 -0700, Mark Donovan
<nova...@hotmail.com> wrote:

>You are right, of course, but the four line version was for illustration
>purposes. I believe the individual steps make the more compact alternatives
>easier to understand.

I believe individual steps make things easier to understand too, but
*not* steps that arbitrarily do and undo stuff. Taking the length of a
string to build the same string to pad with zeroes, whereas the first
string would do in the first place, simply does not fit there.

>On 1/18/07 04:19, "Michele Dondi" <bik....@tiscalinet.it> wrote:

[snip (to)fu]

*Please* do not top-post!

Mark Donovan

unread,
Jan 18, 2007, 6:36:58 PM1/18/07
to
If the purpose of illustration isn't clear to you, I'm happy to explain.

As a matter of preference and for purposes of illustration, I carefully
chose the steps I used so that the person asking the question could insert
print statements, if needed, so that each step would be clear. The original
question indicated to me that zim is familiar with a C-like programming
language. To me, the extra steps are helpful to someone who may not be
familiar with the substitution features of perl. The extra steps allow
someone to examine the intermediate results. Moreover, my answer included a
method that avoided the extra steps. But for my purpose of illustrating the
method, your assertion is simply wrong.

As to your other remark, I find it irrelevant and refer you and others to
the posting guidelines for this newsgroup. Specifically, the "first
guidelines commandment" which I'll quote for you.

> A note to newsgroup "regulars":
> Do not use these guidelines as a "license to flame" or other
> meanness. It is possible that a poster is unaware of things
> discussed here. Give them the benefit of the doubt, and just
> help them learn how to post, rather than assume that they do
> know and are being the "bad kind" of Lazy.

You may have noticed that when I replied to the original question, I placed
my reply after the material I quoted. I did it for a good reason.

In a general sense, there *is* a good reason for posting replies after
quoted text. It is to help others who may read the message to follow the
revisions or sequence of changes that others have suggested. Beyond that,
however, placing a reply above or below quoted material is a matter of
personal preference. There is no program code that is relevant from your
reply, you simply failed to understand my purpose in showing individual
steps of the method I used.

You should understand that placing the word *please* in front of a sentence
does not make a rude and irrelevant demand into a polite request. You are
not enforcing rules. There's a line from the first "Pirates of the
Caribbean" movie, "the Code is more what you'd call 'guidelines' than actual
rules."

The posting guidelines for this newsgroup are guidelines, not rules. You
will find people, who for their own reasons, may not follow the guidelines
100 percent of the time. It's best to assume there may be a reason and avoid
making irrelevant remarks.

If you prefer more authoritative standards than the posting guidelines, I
refer you to:

"Netiquette Guidelines," http://rfc.net/rfc1855.html

http://en.wikipedia.org/wiki/Etiquette

http://en.wikipedia.org/wiki/Manners

http://www.campaignforcourtesy.org/

--
Regards,
Mark

On 1/18/07 15:13, "Michele Dondi" <bik....@tiscalinet.it> wrote:

> On Thu, 18 Jan 2007 12:40:27 -0700, Mark Donovan
> <nova...@hotmail.com> wrote:
>
> I believe individual steps make things easier to understand too, but
> *not* steps that arbitrarily do and undo stuff. Taking the length of a
> string to build the same string to pad with zeroes, whereas the first
> string would do in the first place, simply does not fit there.
>

> *Please* do not top-post!
>

Tad McClellan

unread,
Jan 18, 2007, 8:17:59 PM1/18/07
to
Mark Donovan <nova...@hotmail.com> wrote:

> If the purpose of illustration isn't clear to you, I'm happy to explain.


What illustration?


> As to your other remark,


What other remark?


> I find it irrelevant and refer you and others to
> the posting guidelines for this newsgroup. Specifically, the "first
> guidelines commandment" which I'll quote for you.
>
>> A note to newsgroup "regulars":
>> Do not use these guidelines as a "license to flame" or other
>> meanness. It is possible that a poster is unaware of things
>> discussed here. Give them the benefit of the doubt, and just
>> help them learn how to post, rather than assume that they do
>> know and are being the "bad kind" of Lazy.


I find your quote irrelevant, as there was no flaming or other meanness.


> You may have noticed that when I replied to the original question, I placed
> my reply after the material I quoted. I did it for a good reason.


And that reason has now stopped applying?

What changed?


> In a general sense, there *is* a good reason for posting replies after
> quoted text.


So why not just do that then?

What's all the hubbub about?


> It is to help others who may read the message to follow the
> revisions or sequence of changes that others have suggested.


Right. Like what illustration and what remark.


> Beyond that,
> however, placing a reply above or below quoted material is a matter of
> personal preference.


I exercise my personal preference by killfiling top-posters.


> There is no program code that is relevant from your
> reply,


But there was other context that _was_ relevant in the previous replies.


> You should understand that placing the word *please* in front of a sentence
> does not make a rude and irrelevant demand into a polite request.


Requesting that you not top post is neither rude nor irrelevant.


> The posting guidelines for this newsgroup are guidelines, not rules.


But there are (often unspoken) consequences should you choose to
not follow them.


> You
> will find people, who for their own reasons, may not follow the guidelines
> 100 percent of the time.


That is their choice.


> It's best to assume there may be a reason and avoid
> making irrelevant remarks.


I find it best to simply auto-ignore whiners.

Michele Dondi

unread,
Jan 19, 2007, 5:08:21 AM1/19/07
to
On Thu, 18 Jan 2007 16:36:58 -0700, Mark Donovan
<nova...@hotmail.com> wrote:

>someone to examine the intermediate results. Moreover, my answer included a
>method that avoided the extra steps. But for my purpose of illustrating the
>method, your assertion is simply wrong.

To quote:

: Here's the same result with two statements that run about 15 percent faster.


:
: ($len = $s1) =~ s/.*?(0*)\z/length $1/e;
: $s2 =~ s/(.*?)0*\z/$1 . '0' x $len/e;

That is, your method that "avoided the extra steps" still *had* the
extra steps of (i) taking a string length and (ii) using it to rebuild
the original string, whereas the latter would do in the first place.
IMNSHO this is neither logical nor convenient. The point I'm trying to
make, but I won't try any harder than this, is that one thing is to
break say a single statement into several ones with assignments to
temporary variables -for illustrative purposes- and a whole another
thing is to arbitrarily insert extra steps that are involutive, i.e.
consist of mappings that yield identity when composed each other.

Basically you're building the $pad string like thus:

$s1 =~ m/(0*)\z/;
my $len = length $1;
my $pad = '0' x $len;

But I see no point in doing so when $pad eq $1 in the first place.

>You should understand that placing the word *please* in front of a sentence
>does not make a rude and irrelevant demand into a polite request. You are

I wrote "*please*" because it really bothers me to see top-posted
stuff, and it tends to make my life harder when replying further
because it increases the probability of requiring me to do editing
acrobatics, and there's a general consensus here that proper quoting
is preferred. Glad to notice you prefer to intentionally bother me,
and others here, for no particular good reason...

Andrew DeFaria

unread,
Jan 19, 2007, 8:51:24 AM1/19/07
to
Michele Dondi wrote:
I wrote "*please*" because it really bothers me to see top-posted stuff, and it tends to make my life harder when replying further because it increases the probability of requiring me to do editing acrobatics, and there's a general consensus here that proper quoting is preferred. Glad to notice you prefer to intentionally bother me, and others here, for no particular good reason...
So, to review - you say "please" but deep down you don't really mean that. You mean "DO IT!".

Bitch!

Plonk
--
Andrew DeFaria
Do unto others, then run like hell.

Mark Donovan

unread,
Jan 19, 2007, 9:21:26 AM1/19/07
to
Dondi,

It's unfortunate that your e-mail address doesn't work.

Delivery to the following recipient failed permanently:

bik....@tiscalinet.it

Technical details of permanent failure:
PERM_FAILURE: SMTP Error (state 9): 552 RCPT TO:<bik....@tiscalinet.it>
Mailbox disk quota exceeded

I take exception to your assertion. You are simply wrong. I, not you, decide
what steps are necessary to illustrate the method I suggest. If you think
you have a better solution, fine, post it. Your only contribution so far is
this obfuscated code which illustrates how badly perl can be abused.

$s2 =~ s/(.*?)0*\z/$1 . do{($s1 =~ m|(0*)\z|g)[0]}/e;

It makes nothing more clear. I don't like it. You said you don't like it.
You may have a solution. I haven't seen it.

You seem to believe I have used some unnecessary perl statements in my
answer. You said so. I agreed and I told you why. The perldocs have lots of
examples of code that is not optimal. Why won't you accept that I might want
to include steps that show something I think is important.

I don't need your instruction on how to answer questions. You have yet to
offer anything constructive or useful information to zim who asked the
original question.

The four statements I posted allow someone to insert print statement that
show the steps I chose to illustrate a method. For some reason, you felt
your method is more clear than mine. Fine! I agreed, my method is not
optimal, I said it. If you have a better method, post it. Instead, you
persist in trying to push your solution on me. But your comments don't
instruct me, I already know my code was not optimal. I explained that and
still you try to tell me how I must answer a question to suit your
preferences.

The reason I posted my reply over your quoted text is that I did not intend
for you to reply. You might have taken the hint. In any case, whether I post
above or below quoted material is not your concern. You certainly saw that
my original post was below the quoted material. So you can assume I
understand when to use that style and you can further assume that when I
don't do it, I have a reason.

Frankly, I don't care if you're annoyed by someone who posts above quoted
material in certain circumstances. It's not your place to correct me. You
entirely miss the point of posting guidelines. The guidelines are not rules
for you to enforce. As I explained, the purpose of posting after quoted
material is to make it easier for others to follow an extended discussion. I
responded and agreed with you that my illustration was not optimal perl
code. I let you know that my intent was to illustrate a method. No follow-up
is required.

You are free to post an your improved solution if you have one. If it works
and it's not obfuscated abuse of perl code, you can be assured I'll let your
solution stand without trying to improve it with irrelevant commentary.

--
Regards,
Mark Donovan

anno...@radom.zrz.tu-berlin.de

unread,
Jan 19, 2007, 10:10:53 AM1/19/07
to
Tad McClellan <ta...@augustmail.com> wrote in comp.lang.perl.misc:

[...]

> my $one_str = '1230000';


>
> (my $zeros = $one_str) =~ s/.*?(?=0+$)//; # strip all but trailing zeros

Why not a simple capture?

my ( $zeros) = $one_str =~ /(0*)$/;

Anno

Michele Dondi

unread,
Jan 19, 2007, 3:33:27 PM1/19/07
to
On Fri, 19 Jan 2007 07:21:26 -0700, Mark Donovan
<nova...@hotmail.com> wrote:

>Dondi,
>
>It's unfortunate that your e-mail address doesn't work.
>
>Delivery to the following recipient failed permanently:
>
> bik....@tiscalinet.it

Well, I strongly prefer to keep the discussion public, but if you
really want to you can write me at

ti tod nfni tod im tod mcl ta razalb

(I hope you will decipher it, it's not that difficult - I won't post
it in any clearer form.)

>I take exception to your assertion. You are simply wrong. I, not you, decide
>what steps are necessary to illustrate the method I suggest. If you think
>you have a better solution, fine, post it. Your only contribution so far is

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


>this obfuscated code which illustrates how badly perl can be abused.
>
> $s2 =~ s/(.*?)0*\z/$1 . do{($s1 =~ m|(0*)\z|g)[0]}/e;

(BTW: I'd rewrite it like thus:

$s2 =~ s/0*\z/($s1 =~ m|(0*)\z|g)[0]/e;

since there's no need and no educational value in capturing in s///.)

Your claim is plainly false: in fact that was sort of a joke (much
less so in its latest incarnation above, which is not obfuscated at
all and concise and clear enough IMO) in answer to a post of mine in
answer to yours, where I wrote

: >$s1 =~ m/(0*)\z/;
: >$len = length $1;
: >$s2 =~ s/(.*?)0*\z/$1/;

(BTW: I'd rewrite it like thus:

$s2 =~ s/0*\z//;

since there's no need and no educational value in capturing in s///.)

: >$s2 .= '0' x $len;


:
: This amounts to getting a string of zeroes, getting its length and
: rebuild it based on this length, there's clearly an unnecessary
: passage:
:
: my ($pad) = $s1 =~ /(0*)\z/g;
: $s2 =~ s/(.*?)0*\z/$1$pad/;

(BTW: I'd rewrite it like thus:

$s2 =~ s/0*\z/$pad/;

since there's no need and no educational value in capturing in s///.)

I WANT TO STRESS THAT IT'S NOT ABOUT THE NUMBER OF STEPS/STATEMENTS:
You can still add a step to "my solution" much in the same vein as you
did, namely

my ($pad) = $s1 =~ /(0*)\z/g;

$s2 =~ s/0*\z//;
$s2 .= $pad;

But there's no point and no *educational* value in taking the length
$len of $pad (although you call it $1) to reconstruct it by means of
'0' x $len. IT'S ALL ABOUT THE LOGIC: KISS!

>It makes nothing more clear. I don't like it. You said you don't like it.
>You may have a solution. I haven't seen it.

That's strange, because you replied to *that* post, not to the one
with the single statement...

>You seem to believe I have used some unnecessary perl statements in my
>answer. You said so. I agreed and I told you why. The perldocs have lots of
>examples of code that is not optimal. Why won't you accept that I might want
>to include steps that show something I think is important.

It seems I have difficulties explaining myself: I wasn't talking about
uunnecessary *statements* but of unnecessary *operations*. Even my one
statement only could be made to use the same logic:

$s2 =~ s/0*\z/'0' x do{$s1 =~ m|(0*)\z|g; length $1}/e;

It's in the *logic* that I see a flaw, not in the number of
statements.

>I don't need your instruction on how to answer questions. You have yet to

Yet I can comment if I see something potentially risky. I'm not
accusing you of anything, I don't think you will spoil our fellow
newbie. I still see a moderate risk of educating him to do A o B where
A o B = Id and one has no advantage in computing A and B where Id
would suffice in the first place.

>offer anything constructive or useful information to zim who asked the
>original question.

my ($pad) = $s1 =~ /(0*)\z/g;
$s2 =~ s/(.*?)0*\z/$1$pad/;

which I would now amend to

my ($pad) = $s1 =~ /(0*)\z/g;

$s2 =~ s/0*\z/$pad/;

or to the the (latest) one statement version, since it's very easy and
immediate now, and not obfuscated in any way.

>The four statements I posted allow someone to insert print statement that
>show the steps I chose to illustrate a method. For some reason, you felt
>your method is more clear than mine. Fine! I agreed, my method is not
>optimal, I said it. If you have a better method, post it. Instead, you

(Sorry to repeat myself, but) already done:

my ($pad) = $s1 =~ /(0*)\z/g;
$s2 =~ s/(.*?)0*\z/$1$pad/;

>persist in trying to push your solution on me. But your comments don't


>instruct me, I already know my code was not optimal. I explained that and
>still you try to tell me how I must answer a question to suit your
>preferences.

But you insist on explaining that your code is not optimal because of
the number of statements, which is not something I'm whining about.
You can add 10 intermediate statements if you feel that is
instructive. It's *not* instructive to do-and-undo. Not a big harm
done in this situation, but it could be made into a bad programming
habit.

>The reason I posted my reply over your quoted text is that I did not intend
>for you to reply. You might have taken the hint. In any case, whether I post

Then please explain why I shouldn't! Or do you hold the Absolute
Truth(TM)?!?

>above or below quoted material is not your concern. You certainly saw that
>my original post was below the quoted material. So you can assume I
>understand when to use that style and you can further assume that when I
>don't do it, I have a reason.

I can assume that indeed. Only I don't see any *good* one. The
comments in Tad McClellan's reply at
<news:slrner0727...@tadmc30.august.net> should help you to see
why I, and others, can't see any... but you're free to ignore our
concerns, of course.

>Frankly, I don't care if you're annoyed by someone who posts above quoted
>material in certain circumstances. It's not your place to correct me. You
>entirely miss the point of posting guidelines. The guidelines are not rules

Did I happen to mention the posting guidelines? Please check, you'll
see I didn't. I was and I am talking out of *common sense* and of
maximizing communication efficiency.

>for you to enforce. As I explained, the purpose of posting after quoted
>material is to make it easier for others to follow an extended discussion. I

Indeed. And I don't see any good reason why you arbitrarily decided
that your comments were not to be to be part of an extended discussion
others may be interested in reading.

>responded and agreed with you that my illustration was not optimal perl
>code. I let you know that my intent was to illustrate a method. No follow-up
>is required.

Still you let me know that in answer to a comment of mine. People
reading your post may want to read both my comment *and* your reply to
it. It's all a matter of courtesy and kindness. You may claim your
right not to be kind at all, of course. It's all up to you...

More importantly -trying to stress the concept once more in the
probably vain hope for you to understand that- you have been agreeing
and discussing on *one aspect* of your code's non-optimality which is
one I was not and I am not concerned with nor bothered by. I was
discussing a wholly different thing, which you still failed to
address, since you insist on talking about breaking the whole stuff in
several statements for the convenience of the OP to print intermediate
values. Which is not something I'm contesting in any way. While I was
and I am contesting the *logic* of doing-and-undoing, or if you
prefer, to perform the functional composition of a retraction with a
section, which amounts to identity - for no particularly good reason.

Mark Donovan

unread,
Jan 19, 2007, 5:37:19 PM1/19/07
to
You have my e-mail address in the clear. Your preference. You choose.

--
Regards,
Mark Donovan

lucca...@hotmail.com

unread,
Jan 19, 2007, 10:28:46 PM1/19/07
to

Michele Dondi wrote:
> On Fri, 19 Jan 2007 07:21:26 -0700, Mark Donovan
> <nova...@hotmail.com> wrote:
>
> >Dondi,
> >
> >It's unfortunate that your e-mail address doesn't work.
> >
> >Delivery to the following recipient failed permanently:
> >
> > bik....@tiscalinet.it
>
> Well, I strongly prefer to keep the discussion public, but if you
> really want to you can write me at
>
> ti tod nfni tod im tod mcl ta razalb
>
> (I hope you will decipher it, it's not that difficult - I won't post
> it in any clearer form.)

I figured it out: bla...@lcm.mi.infn.it

Mark Donovan

unread,
Jan 19, 2007, 10:37:16 PM1/19/07
to

Ah, thanks! I have no interest in crypto games. That's cool.

--
Mark


Sherm Pendley

unread,
Jan 19, 2007, 10:45:58 PM1/19/07
to
lucca...@hotmail.com writes:

> Michele Dondi wrote:
>>
>> Well, I strongly prefer to keep the discussion public, but if you
>> really want to you can write me at
>>
>> ti tod nfni tod im tod mcl ta razalb
>>
>> (I hope you will decipher it, it's not that difficult - I won't post
>> it in any clearer form.)
>

> I figured it out: ***************

Yeah, that was the idea - any human with two working brain cells can easily
figure it out, but it's not sitting there in the clear for spambots to
harvest.

Anyone with an ounce of courtesy would have respected Michele's decision
to keep his address munged against automated spam harvesters. Reposting it
in the clear was the act of a petulant child. Grow up.

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net

lucca...@hotmail.com

unread,
Jan 19, 2007, 11:36:25 PM1/19/07
to

Sherm Pendley wrote:
> lucca...@hotmail.com writes:
>
> > Michele Dondi wrote:
> >>
> >> Well, I strongly prefer to keep the discussion public, but if you
> >> really want to you can write me at
> >>
> >> ti tod nfni tod im tod mcl ta razalb
> >>
> >> (I hope you will decipher it, it's not that difficult - I won't post
> >> it in any clearer form.)
> >
> > I figured it out: bla...@lcm.mi.infn.it

>
> Yeah, that was the idea - any human with two working brain cells can easily
> figure it out, but it's not sitting there in the clear for spambots to
> harvest.
>
> Anyone with an ounce of courtesy would have respected Michele's decision
> to keep his address munged against automated spam harvesters. Reposting it
> in the clear was the act of a petulant child. Grow up.

Anyone with an ounce of courtesy would have used a real email address,
so those of us that want to ask further questions in email could
actually reach her.

> Web Hosting by West Virginians, for West Virginians: http://wv-www.net

West Virginia has computers???

Sherm Pendley

unread,
Jan 20, 2007, 12:12:55 AM1/20/07
to
lucca...@hotmail.com writes:

> Sherm Pendley wrote:
>>
>> Anyone with an ounce of courtesy would have respected Michele's decision
>> to keep his address munged against automated spam harvesters. Reposting it
>> in the clear was the act of a petulant child. Grow up.
>
> Anyone with an ounce of courtesy would have used a real email address,
> so those of us that want to ask further questions in email could
> actually reach her.

Michele is male - or at least I assume so, seeing as how most people who
wear a beard and moustache are of that gender, and "Michele" is an Italian
form of "Michael".

Anyhow, *he* did provide a real email address, in a form that any human with
two working brain cells could use to reach *him*. De-munging it and reposting
it in plain text for the sole benefit of spam-bots was not only unnecessary,
it was petty, spiteful, and childish.

So like I said - grow up.

sherm--

--

Web Hosting by West Virginians, for West Virginians: http://wv-www.net

Dr.Ruud

unread,
Jan 20, 2007, 5:04:12 AM1/20/07
to
lucca...@hotmail.com schreef:
> Michele Dondi:

>> ti tod nfni tod im tod mcl ta razalb
>>
>> (I hope you will decipher it, it's not that difficult - I won't post
>> it in any clearer form.)
>

> I figured it out: blazar(AT)lcm.mi.infn.it

> NNTP-Posting-Host: 202.108.119.227.

Public proxies are almost exclusively used by assholes, so they are easy
to filter.

--
Affijn, Ruud

"Gewoon is een tijger."

Sherm Pendley

unread,
Jan 20, 2007, 5:41:07 AM1/20/07
to
"Dr.Ruud" <rvtol...@isolution.nl> writes:

> lucca...@hotmail.com schreef:


>
>> NNTP-Posting-Host: 202.108.119.227.
>
> Public proxies are almost exclusively used by assholes, so they are easy
> to filter.

Thank you for the tip, I shall update my killfile appropriately. :-)

Michele Dondi

unread,
Jan 20, 2007, 5:56:58 AM1/20/07
to
On 19 Jan 2007 20:36:25 -0800, lucca...@hotmail.com wrote:

>Anyone with an ounce of courtesy would have used a real email address,
>so those of us that want to ask further questions in email could
>actually reach her.

s/her/him/; # please!

Michele Dondi

unread,
Jan 20, 2007, 5:58:29 AM1/20/07
to
On 19 Jan 2007 19:28:46 -0800, lucca...@hotmail.com wrote:

>> (I hope you will decipher it, it's not that difficult - I won't post
>> it in any clearer form.)
>

>I figured it out: xxx...@xxx.xx.xxxx.xx

TY! (I'm being sarcastic, for the record...)

Mark Donovan

unread,
Jan 20, 2007, 6:19:58 AM1/20/07
to
Sherm,

The problem stems from Dondi's attempt to be cute with a "clever"
cryptogram. Dondi offered to continue a discussion with me by e-mail. The
thread has become a person-to-person matter that is no longer relevant to a
perl technical newsgroup. I was told, "I hope you will decipher it, it's not


that difficult - I won't post it in any clearer form."

In point of fact, it was *entirely* unnecessary for Dondi to to risk the
exposure of *his* e-mail address, since my address is posted in the clear.

--
Regards,
Mark

On 1/19/07 22:12, "Sherm Pendley" <spam...@dot-app.org> wrote:

> Michele is male ...

Michele Dondi

unread,
Jan 20, 2007, 7:46:54 AM1/20/07
to
On Sat, 20 Jan 2007 04:19:58 -0700, Mark Donovan
<nova...@hotmail.com> wrote:

>The problem stems from Dondi's attempt to be cute with a "clever"
>cryptogram. Dondi offered to continue a discussion with me by e-mail. The

Really I wrote:

: Well, I strongly prefer to keep the discussion public, but if you

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

: really want to you can write me at

>thread has become a person-to-person matter that is no longer relevant to a
>perl technical newsgroup. I was told, "I hope you will decipher it, it's not
>that difficult - I won't post it in any clearer form."

The fact that the discussion has become a person-to-person one is IMO
a pure circumstance: it is still technical and Perl-related, anyone
may want to jump in and contribute.

lucca...@hotmail.com

unread,
Jan 20, 2007, 9:05:41 AM1/20/07
to
Sherm Pendley wrote:
> lucca...@hotmail.com writes:
> > Anyone with an ounce of courtesy would have used a real email address,
> > so those of us that want to ask further questions in email could
> > actually reach her.
>
> Michele is male - or at least I assume so, seeing as how most people who
> wear a beard and moustache are of that gender, and "Michele" is an Italian
> form of "Michael".

Michele *is* a girl's name, and plenty of Italian women have
mustaches...

> Web Hosting by West Virginians, for West Virginians: http://wv-www.net

West Virginia has a computer???

lucca...@hotmail.com

unread,
Jan 20, 2007, 9:07:17 AM1/20/07
to
Michele Dondi wrote:
> On 19 Jan 2007 20:36:25 -0800, lucca...@hotmail.com wrote:
>
> >Anyone with an ounce of courtesy would have used a real email address,
> >so those of us that want to ask further questions in email could
> >actually reach her.
>
> s/her/him/; # please!

Not until you stop acting like a spoiled little girl.

lucca...@hotmail.com

unread,
Jan 20, 2007, 9:10:17 AM1/20/07
to

Michele Dondi wrote:
> On 19 Jan 2007 19:28:46 -0800, lucca...@hotmail.com wrote:
>
> >> (I hope you will decipher it, it's not that difficult - I won't post
> >> it in any clearer form.)
> >
> >I figured it out: xxx...@xxx.xx.xxxx.xx
>
> TY! (I'm being sarcastic, for the record...)

Hey, va fa Napoli!

Andrew DeFaria

unread,
Jan 20, 2007, 9:28:43 AM1/20/07
to
All this excellent, expert and highly technical Perl expertise flying back and forth is amazing!

OK, children, it's time to stop your childishness.
--
Andrew DeFaria
The trouble with doing something right the first time is that nobody appreciates how difficult it was.

Michele Dondi

unread,
Jan 20, 2007, 9:32:47 AM1/20/07
to
On 20 Jan 2007 06:05:41 -0800, lucca...@hotmail.com wrote:

>> Michele is male - or at least I assume so, seeing as how most people who
>> wear a beard and moustache are of that gender, and "Michele" is an Italian
>> form of "Michael".
>
>Michele *is* a girl's name, and plenty of Italian women have
>mustaches...

In Italy the feminine name is Michela and the masculine one is
Michele. Maybe you're confusing with french Michelle.

Michele Dondi

unread,
Jan 20, 2007, 9:34:08 AM1/20/07
to
On 20 Jan 2007 06:07:17 -0800, lucca...@hotmail.com wrote:

>> >Anyone with an ounce of courtesy would have used a real email address,
>> >so those of us that want to ask further questions in email could
>> >actually reach her.
>>
>> s/her/him/; # please!
>
>Not until you stop acting like a spoiled little girl.

Huh?!? Just because I want to avoid further spam on a particular email
address?

Mumia W. (NOSPAM)

unread,
Jan 20, 2007, 11:29:02 AM1/20/07
to
On 01/20/2007 08:34 AM, Michele Dondi wrote:
> On 20 Jan 2007 06:07:17 -0800, lucca...@hotmail.com wrote:
>
>>>> Anyone with an ounce of courtesy would have used a real email address,
>>>> so those of us that want to ask further questions in email could
>>>> actually reach her.
>>> s/her/him/; # please!
>> Not until you stop acting like a spoiled little girl.
>
> Huh?!? Just because I want to avoid further spam on a particular email
> address?
>
>
> Michele

It's a troll--and probably a morph of Mark Donovan.

Don't waste your time.


--
Windows Vista and your freedom in conflict:
http://techdirt.com/articles/20061019/102225.shtml

lucca...@hotmail.com

unread,
Jan 20, 2007, 2:32:24 PM1/20/07
to

Michele Dondi wrote:
> On 20 Jan 2007 06:05:41 -0800, lucca...@hotmail.com wrote:
>
> >> Michele is male - or at least I assume so, seeing as how most people who
> >> wear a beard and moustache are of that gender, and "Michele" is an Italian
> >> form of "Michael".
> >
> >Michele *is* a girl's name, and plenty of Italian women have
> >mustaches...
>
> In Italy the feminine name is Michela and the masculine one is
> Michele. Maybe you're confusing with french Michelle.

Nope, Michele is a girl's name. Examples include Michele Laurita,
Michele Tafoya, Michele Balan, and many more.

lucca...@hotmail.com

unread,
Jan 20, 2007, 2:39:36 PM1/20/07
to

Michele Dondi wrote:
> On 19 Jan 2007 20:36:25 -0800, lucca...@hotmail.com wrote:
>
> >Anyone with an ounce of courtesy would have used a real email address,
> >so those of us that want to ask further questions in email could
> >actually reach her.
>
> s/her/him/; # please!

Assuming $_ contains "Anyone with an ounce of courtesy would have used


a real email address, so those of us that want to ask further questions

in email could actually reach her.", your substitution will result in:

Anyone with an ounce of courtesy would have used a real email address,

so those of us that want to ask furthim questions in email could
actually reach him.

You should have used s/\bher\b/him/g;

Sherm Pendley

unread,
Jan 20, 2007, 2:50:50 PM1/20/07
to
lucca...@hotmail.com writes:

More examples: Stacy Keach, Carrol O'Connor, Marion Morrison (aka John Wayne),
this group's own Abigail - all men.

Michele is *not* traditionally a "girl's name" in Italy, but even if it were,
there are any number of examples of men who have non-traditional names. The
only thing you're proving here is that you're a petty, childish little troll.

I for one refuse to entertain your ego with any further responses.

*plonk*

sherm--

--

Web Hosting by West Virginians, for West Virginians: http://wv-www.net

lucca...@hotmail.com

unread,
Jan 20, 2007, 2:54:38 PM1/20/07
to
Sherm Pendley wrote:
> lucca...@hotmail.com writes:
>
> > Michele Dondi wrote:
> >> On 20 Jan 2007 06:05:41 -0800, lucca...@hotmail.com wrote:
> >>
> >> >> Michele is male - or at least I assume so, seeing as how most people who
> >> >> wear a beard and moustache are of that gender, and "Michele" is an Italian
> >> >> form of "Michael".
> >> >
> >> >Michele *is* a girl's name, and plenty of Italian women have
> >> >mustaches...
> >>
> >> In Italy the feminine name is Michela and the masculine one is
> >> Michele. Maybe you're confusing with french Michelle.
> >
> > Nope, Michele is a girl's name. Examples include Michele Laurita,
> > Michele Tafoya, Michele Balan, and many more.
>
> More examples: Stacy Keach, Carrol O'Connor, Marion Morrison (aka John Wayne),
> this group's own Abigail - all men.
>
> Michele is *not* traditionally a "girl's name" in Italy

Like you've even been to Italy, hillbilly.

John W. Kennedy

unread,
Jan 20, 2007, 4:52:42 PM1/20/07
to
Sherm Pendley wrote:
> Michele is *not* traditionally a "girl's name" in Italy,

You mean the baritone in "Il Tabarro" is a /woman/? Well, judging from
the action of the opera, she's still pretty butch.

--
John W. Kennedy
"The blind rulers of Logres
Nourished the land on a fallacy of rational virtue."
-- Charles Williams. "Taliessin through Logres: Prelude"

Mark Donovan

unread,
Jan 21, 2007, 9:53:23 AM1/21/07
to
To whom it may concern,

Some people seem to forget the perl motto, "There is more than one way to do
it."

Rather than simply posting a solution and explaining the method as a reply
to zim, who asked the question, Dondi chose to improve my method. I replied
and said Dondi was right. I wonder what part of "you're right" Dondi does
not understand? That's is a rhetorical question; no reply is necessary.

Dondi persists in wasting his time and mine revising a method again and
again. Dondi has never posted a direct reply to zim explaining a method.
That, after all, is the purpose of the thread... to answer zim's question.

I answered zim's question. I offered a method that works; I included an
explanation that is consistent with *my* solution. I assume zim found an
answer and has left; maybe zim will ask a question if more information is
needed.

As to Dondi's optimal improvements, I offer this section of the perl
documentation from perldoc perlstyle.

o Think about reusability. Why waste brainpower on a one-shot when
you might want to do something like it again? Consider
generalizing your code. Consider writing a module or object class.
Consider making your code run cleanly with "use strict" and "use
warnings" (or -w) in effect. Consider giving away your code.
Consider changing your whole world view. Consider... oh, never
mind.

o Be consistent.

o Be nice.

There are no relevant technical issues to this newsgroup that remain to be
discussed. I have offered to discuss anything further by e-mail.
"Consider... oh, never mind. Be consistent. Be nice."

--
Regards,
Mark Donovan


Michele Dondi

unread,
Jan 21, 2007, 12:35:09 PM1/21/07
to
On Sun, 21 Jan 2007 07:53:23 -0700, Mark Donovan
<nova...@hotmail.com> wrote:

>As to Dondi's optimal improvements, I offer this section of the perl
>documentation from perldoc perlstyle.
>
>o Think about reusability. Why waste brainpower on a one-shot when
> you might want to do something like it again? Consider
> generalizing your code. Consider writing a module or object class.
> Consider making your code run cleanly with "use strict" and "use
> warnings" (or -w) in effect. Consider giving away your code.
> Consider changing your whole world view. Consider... oh, never
> mind.

OTOH also consider YAGNI.

>o Be consistent.
>
>o Be nice.

OTOH I didn't feel like stumping on your ego and I'm sorry you took it
like that, your solution IMHO was 95% fine and 5% at risk of spreading
a bad programming habit. I just wanted to correct the latter, for the
benefit of the OP. It was part of the be consistent and be nice thing,
nice to him/her, which is to say he/she who needed help. But then
again sorry to see you took it as a personal attack on you. I wanted
to resist the temptation to answer further, but I did. In any case
this is my last word on the whole question. I tried to stress hard the
difference from my pov between suboptimality and useless redundancy,
but appearently to no avail. So long then...


PS: BTW there's no reason I wouldn't have wanted to be nice to you
too, and FWIW I apologize if gave that impression, but that's not the
case and it was all up to you to feel like I were bashing you or
whatever.

0 new messages