Question for the regulars

T

Tad McClellan

regarding -> "Purl Gurl"

"You have only factually demonstrated over the years that you know
very little about Perl,"
snip!

You might not like her, but the assertion you make here makes you look
like a monkey.


Are you saying that it _does_ know a good bit about Perl?

That is an indefensible position.

(it doesn't know much about programming in general, let alone Perl.)

You need to lay down your gun, boy.


Lay yours down first.
 
A

A. Sinan Unur

Fred said:
(snipped)

I am absolutely infamous. You are not.
I am saying that the person that wrote this:
@Array = ("Purl", "Girl Rocks", "And gurl Rolls!");
$" = "¦";
print "First Array Element Containing Gurl Is: ",
(substr ("@Array", 0, index ("@Array", "Gurl"))) =~ tr/¦//;
print "\n\n";
print $Array[(substr ("@Array", 0, index
("@Array","Gurl")))=~tr/¦//];

That's interesting thought provoking code. I played with it a little
to test it out and heck, nothing wrong with it.

Hmmmm ...

First, what if none of the array elements contains the word 'Gurl'? What
does the code above print when

@Array = ("Purl", "Girl Rocks", "And girl Rolls!");

Second, what if ¦ appears in one of the array elements? What then?
That ingenious code is uniquely mine, and you know this.

No doubt!

Sinan
 
J

John Bokma

Purl Gurl said:
This method can be used to address an element with $Array[n] syntax as
shown in my final print. This aids in programming to manipulate a
specific element when its precise array location is unknown."

I have given all my scorpions a number, that makes it easier to manipulate
one, when I have no clue where it is located.
 
A

A. Sinan Unur

A. Sinan Unur writes a what if troll:

So, who's on third?

What if, what if, what if, how very lame.

No, not realizing when a particular piece of code might fail is lame.
Since there was no such caution in the code you posted, I was pointing
out the pitfalls for other impressionable readers out there.

....
"Perl currently has no function to return an index number for a
specific array element nor substring of a specific array element. This
snippet exemplifies a quick and easy method to determine an element
index number. Caution should be exercised to not use a record
separator delimiter which is found within one or more array entries.
Use of a broken pipe symbol is usually safe. Do not ignore this
cautionary note.

So, the code you posted might return wrong results, but there is no way
for a user of that code to check the validity of the result ... Hmmm.
This method can be used to address an element with $Array[n] syntax as
shown in my final print. This aids in programming to manipulate a
specific element when its precise array location is unknown."

No, it doesn't, because you cannot be certain that the index found by
the code you posted actually refers to an element of the array
containing the substring you are looking for.

And, since you like benchmarks:

#!/usr/bin/perl

use strict;
use warnings;

use Benchmark 'cmpthese';

my @arr = ("Purl", "Girl Rocks", "And Gurl Rolls!");

sub my_index_of_element {
my $i = 0;
while (-1 == index $arr[$i], 'Gurl') {
$i += 1;
return -1 if $i == @arr;
}
return $i;
}

sub pg_index_of_element {
local $" = "¦";
(substr ("@arr", 0, index ("@arr", "Gurl"))) =~ tr/¦//;
}

cmpthese -1, {
my_index_of_element => \&my_index_of_element,
pg_index_of_element => \&pg_index_of_element,
};

D:\Home\asu1\UseNet\clpmisc> ai
Rate pg_index_of_element my_index_of_element
pg_index_of_element 142315/s -- -28%
my_index_of_element 196887/s 38% --

Sinan
 
R

robic0

Your reference to me as "the bitch" grants me an unlimited license
to reference you as I wish. I am confused. My reference to you as
a "sexist arsehole" should not cause you concern. This you expected.

Your use of "bulldog" as a euphemism would be more accurate if you
used "stubborn mule" in place.

The "boys" here, yes, I know "how they are" after dealing with them
for years. Quite the unimaginative ignorant lot, they are. No surprises
there. Boys here are no different than boys in any other newsgroup.
Mentally challenged they are, a trait which manifests as living life
in a newsgroup, quite literally; Perl Perl Land Syndrome.

Just a bunch of control freaks wasting away life's precious time
pursuing irrelevant authority over a textual fantasy world.

Entertaining lot of game boys they are, yes.

Purl Gurl
Indeed!
 
M

Matt Garrish

Purl Gurl said:
Your reference to me as "the bitch" grants me an unlimited license
to reference you as I wish. I am confused. My reference to you as
a "sexist arsehole" should not cause you concern. This you expected.

Your use of "bulldog" as a euphemism would be more accurate if you
used "stubborn mule" in place.

The "boys" here, yes, I know "how they are" after dealing with them
for years. Quite the unimaginative ignorant lot, they are. No surprises
there. Boys here are no different than boys in any other newsgroup.
Mentally challenged they are, a trait which manifests as living life
in a newsgroup, quite literally; Perl Perl Land Syndrome.

Speak like yoda, you may, but intelligent you aren't.

Matt
 
J

John W. Kennedy

Alan said:
That depends on whether you're forced to take a business decision
to care about a browser-like object which disqualifies itself as
a WWW-compatible browser by violating some mandatory requirements
of the interworking protocols.

As long as I have a website catering to Joe Sixpack, I have no choice.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top