[33144] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4423 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 29 00:09:20 2015

Date: Tue, 28 Apr 2015 21:09:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 28 Apr 2015     Volume: 11 Number: 4423

Today's topics:
    Re: -d test recognizes Windows 8.1 SYMLINKD as being di <gamo@telecable.es>
        Attn: Perl Newbies! Learn AI and Perl simultaneously mentificium@gmail.com
    Re: Attn: Perl Newbies! Learn AI and Perl simultaneousl <jurgenex@hotmail.com>
    Re: Attn: Perl Newbies! Learn AI and Perl simultaneousl mentificium@gmail.com
    Re: How do I use "when" to check for "one of two option <gamo@telecable.es>
    Re: How do I use "when" to check for "one of two option <jurgenex@hotmail.com>
    Re: How do I use "when" to check for "one of two option <gamo@telecable.es>
    Re: How do I use "when" to check for "one of two option <rweikusat@mobileactivedefense.com>
    Re: How do I use "when" to check for "one of two option <rweikusat@mobileactivedefense.com>
    Re: How do I use "when" to check for "one of two option <jurgenex@hotmail.com>
    Re: How do I use "when" to check for "one of two option <gamo@telecable.es>
    Re: How do I use "when" to check for "one of two option <gamo@telecable.es>
    Re: How do I use "when" to check for "one of two option <rweikusat@mobileactivedefense.com>
    Re: How do I use "when" to check for "one of two option <m@rtij.nl.invlalid>
    Re: How do I use "when" to check for "one of two option <bauhaus@futureapps.invalid>
    Re: How do I use "when" to check for "one of two option <m@rtij.nl.invlalid>
    Re: How do I use "when" to check for "one of two option <rweikusat@mobileactivedefense.com>
    Re: How do I use "when" to check for "one of two option <news@todbe.com>
    Re: How do I use "when" to check for "one of two option <jblack@nospam.com>
    Re: Mentifex Strong AI Perlmind Programming Journal: 20 mentificium@gmail.com
    Re: Mentifex Strong AI Perlmind Programming Journal: 20 <kaz@kylheku.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 27 Apr 2015 13:44:04 +0200
From: gamo <gamo@telecable.es>
Subject: Re: -d test recognizes Windows 8.1 SYMLINKD as being directory???
Message-Id: <mhl7e7$pv9$1@speranza.aioe.org>

El 14/04/15 a las 15:08, Robbie Hatley escribió:
> The item mentioned, "gargoyle", isn't really a directory at all,
> but a Windows "SYMLINKD" object. But Perl's -d test recognizes
> it as being a "directory" anyway. That's problematic, because
> THIS:
>
>     /rhe/test-zone/tarsier/gargoyle
>
> is just a SYMLINKD leading back to THIS:
>
>     /rhe/test-zone
>
> Which would have caused infinite recursion in RecurseDirs.
> Good thing I thought to include a check for inode reusage:

Try to play with 'if (not -l $entry){ }' because -l is tailored
to tell you if it's a simlink, at least in linux.

-- 
http://www.telecable.es/personales/gamo/
The generation of random numbers is too important to be left to chance


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

Date: Tue, 28 Apr 2015 18:16:04 -0700 (PDT)
From: mentificium@gmail.com
Subject: Attn: Perl Newbies! Learn AI and Perl simultaneously
Message-Id: <16c6480f-51a8-45f8-a17d-9590bef1a38a@googlegroups.com>

Having been a Perl programmer for lo! these 16 days, 
I'm beginning to see how I would teach Perl to an 
absolute beginner like I once was. 

http://ai.neocities.org/AiSteps.html 
is where I have begun to incorporate 
lessons in Perl into my AI lessons. 

Today I updated the "AI Steps" page with 
the simplest possible program that I could 
devise in Perl to illustrate a "while" loop:

#!/usr/bin/perl
$IQ = 0;           # PERL by Example (2015), p.  17
while ($IQ < 8) {  # PERL by Example (2015), p. 190 
  print "IQ = $IQ Enter new IQ: "; 
$IQ = <STDIN>;     # PERL by Example (2015), p.  50
}  # End of mind.pl program for coding AI in Perl

Since I myself bought the brand-new book 
"PERL by Example", Fifth Edition, January 2015, 
I inserted page numbers as comments into the code 
and I put a link to the book on Amazon. 

We need to raise up a generation of Perl AI 
programmers who will save the world, save Perl -- 
well, you get my drift. By the way, the expert 
Perl programmer Drifty used to threaten me with 
dire consequences if I ever referred to him as 
"Drifty" on the Internet. Well, I'm not afraid 
any more, so I am outing "Drifty" as Drifty. 

Meanwhile in my own Perl AI work I have discovered 
on page 460 of the "PERL Black Book" by Holzner 
that I can have my Perlmind.pl users press 
Control-C to exit from the Perl AI Mind program. 
Now I don't need to worry about the EScape-key 
any more, if the users can press Control-C. 
"PERL by Example" page 669 has similar info. 

Another report from the Perl AI trenches by 

Very truly yours,

ATM/Mentifex
-- 
http://ai.neocities.org/perlmind.txt 



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

Date: Tue, 28 Apr 2015 18:28:32 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Attn: Perl Newbies! Learn AI and Perl simultaneously
Message-Id: <tsc0kalng7s7gggr5eu7jonbdjmjobvf15@4ax.com>

mentificium@gmail.com wrote:
>#!/usr/bin/perl

Is there a specific reason why you are not using 
	use strict;
	use warnings;

jue


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

Date: Tue, 28 Apr 2015 18:50:10 -0700 (PDT)
From: mentificium@gmail.com
Subject: Re: Attn: Perl Newbies! Learn AI and Perl simultaneously
Message-Id: <33eb171f-c6c7-4957-a546-a4807f0b7343@googlegroups.com>

On Tuesday, April 28, 2015 at 6:28:46 PM UTC-7, Juergen Exner wrote:
> mentificium@gmail.com wrote:
> >#!/usr/bin/perl
> 
> Is there a specific reason why you are not using 
> 	use strict;
> 	use warnings;
> 
> jue

Yes, there is. While I was writing the program, 
I had those two items _in_ the program. But 
then I removed those two lines from the mind.pl 
program so that it would be as simple as possible 
and still work. 

Btw (by the way) I am especially proud of using
$IQ as a variable for "intelligence quotient." 
Clever Perl coders may be able to include code 
that calculates the IQ of an AI Perlmind and 
reports the waxing or waning IQ over time. 

If anyone knows why I should not use Ctrl+C 
for escaping from the Main AI program loop, 
please let me know. I am glad not only that 
Perl uses "die" to halt a program, but also 
I like reading in my Perl books that the 
default top-level package in a Perl program 
is "main::" even if it has no actual name. 

Thanx,

Arthur 


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

Date: Sun, 26 Apr 2015 12:23:58 +0200
From: gamo <gamo@telecable.es>
Subject: Re: How do I use "when" to check for "one of two options"?
Message-Id: <mhiec0$mij$1@speranza.aioe.org>

El 26/04/15 a las 12:08, jurgenex@hotmail.com escribió:
> gamo <gamo@telecable.es> wrote:
>> BTW, if you do
>>
>> 	my $c = lc (Record_key());
>> 	given ($c) {
>> 	}
>>
>> you limit your alphabet from 52 to 26 possibilities.
>
> Did you by chance notice that this is _EXACTLY_ what the OP wanted?
>

No, I don't know. What I know is that dangerous options could be
restricted to the uppercase form. And I think is a good idea, in
general.

>> Do you comprehend that? Or you fail in the obvious again and again?
>
> Apparently you didn't ....
>
> jue
>


-- 
http://www.telecable.es/personales/gamo/
The generation of random numbers is too important to be left to chance


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

Date: Sun, 26 Apr 2015 03:44:58 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: How do I use "when" to check for "one of two options"?
Message-Id: <b5gpja5rpe90da8uoqbebnfqe509budgr4@4ax.com>

gamo <gamo@telecable.es> wrote:
>What I know is that dangerous options could be
>restricted to the uppercase form. And I think is a good idea, in
>general.

And I guess that's why you designed
<quote>
		when (/D/) { call_delete(); }
		when (/d/) { call_ls(); }
</quote>

In other words: if by chance caps-lock is on or I do hold down the shift
key, then the file will be deleted instead of listed.
Really great design, so totally save and totally not dangerous, and a
very good idea.

jue


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

Date: Sun, 26 Apr 2015 13:55:17 +0200
From: gamo <gamo@telecable.es>
Subject: Re: How do I use "when" to check for "one of two options"?
Message-Id: <mhijn7$3ob$1@speranza.aioe.org>

El 26/04/15 a las 12:44, jurgenex@hotmail.com escribió:
> gamo <gamo@telecable.es> wrote:
>> What I know is that dangerous options could be
>> restricted to the uppercase form. And I think is a good idea, in
>> general.
>
> And I guess that's why you designed
> <quote>
> 		when (/D/) { call_delete(); }
> 		when (/d/) { call_ls(); }
> </quote>
>
> In other words: if by chance caps-lock is on or I do hold down the shift
> key, then the file will be deleted instead of listed.
> Really great design, so totally save and totally not dangerous, and a
> very good idea.
>
> jue
>

Well, it's a simple one that could serve to prevent some accidents.
That's why caps-lock usually has a light in the keyboard. If not,
you have to press two keys. Funny enough, if you are going to damage
yourself, you will find the way.

-- 
http://www.telecable.es/personales/gamo/
The generation of random numbers is too important to be left to chance


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

Date: Sun, 26 Apr 2015 16:38:38 +0100
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: How do I use "when" to check for "one of two options"?
Message-Id: <874mo2j3wh.fsf@doppelsaurus.mobileactivedefense.com>

Jürgen Exner <jurgenex@hotmail.com> writes:
> gamo <gamo@telecable.es> wrote:
>>What I know is that dangerous options could be
>>restricted to the uppercase form. And I think is a good idea, in
>>general.
>
> And I guess that's why you designed
> <quote>
> 		when (/D/) { call_delete(); }
> 		when (/d/) { call_ls(); }
> </quote>
>
> In other words: if by chance caps-lock is on or I do hold down the shift
> key, then the file will be deleted instead of listed.

I'd like to add some emphasis to this: When I wrote about the 'regex
which might or might not have a certain flag', it occurred to me that
someone could consider this a feature and design the interface such that
- sometimes - upper- and lowercase variants of the same letter would
cause the same operation to be performed and sometimes, they wouldn't. I
chose to disregard this possibility as an obviously totally stupid idea
because of the high potential for user confusion.



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

Date: Sun, 26 Apr 2015 18:06:50 +0100
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: How do I use "when" to check for "one of two options"?
Message-Id: <87egn64y50.fsf@doppelsaurus.mobileactivedefense.com>

gamo <gamo@telecable.es> writes:
> El 25/04/15 a las 15:56, Rainer Weikusat escribió:
>> If you wrote some code which calculates factorials "50 times faster"
>> than possible using the Math::Bigint implementation and algorithm,
>> fine. Get yourself a T-shirt which says so and send a copy to the
>> ::Bigint maintainer, maybe, he'll see the error of his ways. Or
>> whatnot.
>>
>> But unless you don't post this code, I surely don't care about it AND
>> this is not at all related to observation about 'function call overhead'
>> vs 'multiplaction' I (again) posted above.
>
> What I see is that people, and you now, thinks the subject or what
> the OP wants change as they thinks or the responses are generated.
> Speed was in the topic for a particular case, a module was not.
> BTW Math::BigInt accepts three types of library last time I read
> about: 'Calc' is the name of the default. The others, GMP and PARI,
> are accessible directly or indirectly. I opted to use them directly,

I already conjectured that, rather than doing something especially
clever, you were likely just using some code performing the calculation
with compiled C code instead of Perl, I just tried to avoid being so
impolite to suggest this. The same phenomenon re 'recursion vs
multiplication' can be observed when using Math::GMP to provide faster
versions of the primitive, arithmetic operations, albeit larger
factorials have to be used to obtain stable results (eg, 99999). I'm
also fairly convinced that it will still be observable when doing away
with Perl altogether and implementing all of the calculating and
'control-flowing' code in C.


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

Date: Sun, 26 Apr 2015 10:28:44 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: How do I use "when" to check for "one of two options"?
Message-Id: <ag7qja1j958ktml1db8jqp8up09h9cltgt@4ax.com>

gamo <gamo@telecable.es> wrote:
>What I see is that people, and you now, thinks the subject or what
>the OP wants change as they thinks or the responses are generated.

How very true.

>Speed was in the topic for a particular case, [...].

No it wasn't. Considering that he is evaluating human input it would be
utterly ridiculous trying to squeeze out the last microsecond in an
action that is performed exactly once after the input.

>BTW Math::BigInt accepts three types of library last time I read

The OPs question had nothing to do with Math:BigInt. 

>about: 'Calc' is the name of the default. The others, GMP and PARI,
>are accessible directly or indirectly. I opted to use them directly,
>and the best was GMP::Mpz, and second Math::PARI, far better than 'Calc' 
>in speed because the language used.

And it had nothing to do with numbers whatsoever, either.
In fact there wasn't a single number or numerical operator in all of his
article.

>It could be argued there are not particular use of that case, but
>I can't know at certain fields. I.e.
>http://en.wikipedia.org/wiki/Poisson_distribution#Occurrence

If you are making a case for not to use similar user actions to perform
contrary actions, then I am all with you. Otherwise it is beyond me what
poison distribution could possibly have to do with creating a switch
table for user actions.

jue


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

Date: Sun, 26 Apr 2015 20:03:25 +0200
From: gamo <gamo@telecable.es>
Subject: Re: How do I use "when" to check for "one of two options"?
Message-Id: <mhj99e$tih$1@speranza.aioe.org>

El 26/04/15 a las 19:28, jurgenex@hotmail.com escribió:
> gamo <gamo@telecable.es> wrote:

>> It could be argued there are not particular use of that case, but
>> I can't know at certain fields. I.e.
>> http://en.wikipedia.org/wiki/Poisson_distribution#Occurrence
>
> If you are making a case for not to use similar user actions to perform
> contrary actions, then I am all with you. Otherwise it is beyond me what
> poison distribution could possibly have to do with creating a switch
> table for user actions.
>
> jue
>

It is not related with the current subject, and with the old factorials 
problem. I'm sorry if messed up the things.

-- 
http://www.telecable.es/personales/gamo/
The generation of random numbers is too important to be left to chance


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

Date: Mon, 27 Apr 2015 21:25:25 +0200
From: gamo <gamo@telecable.es>
Subject: Re: How do I use "when" to check for "one of two options"?
Message-Id: <mhm2f8$8rk$1@speranza.aioe.org>

El 26/04/15 a las 19:06, Rainer Weikusat escribió:
> gamo <gamo@telecable.es> writes:
>> El 25/04/15 a las 15:56, Rainer Weikusat escribió:
>>> If you wrote some code which calculates factorials "50 times faster"
>>> than possible using the Math::Bigint implementation and algorithm,
>>> fine. Get yourself a T-shirt which says so and send a copy to the
>>> ::Bigint maintainer, maybe, he'll see the error of his ways. Or
>>> whatnot.
>>>
>>> But unless you don't post this code, I surely don't care about it AND
>>> this is not at all related to observation about 'function call overhead'
>>> vs 'multiplaction' I (again) posted above.
>>
>> What I see is that people, and you now, thinks the subject or what
>> the OP wants change as they thinks or the responses are generated.
>> Speed was in the topic for a particular case, a module was not.
>> BTW Math::BigInt accepts three types of library last time I read
>> about: 'Calc' is the name of the default. The others, GMP and PARI,
>> are accessible directly or indirectly. I opted to use them directly,
>
> I already conjectured that, rather than doing something especially
> clever, you were likely just using some code performing the calculation
> with compiled C code instead of Perl, I just tried to avoid being so
> impolite to suggest this. The same phenomenon re 'recursion vs
> multiplication' can be observed when using Math::GMP to provide faster
> versions of the primitive, arithmetic operations, albeit larger
> factorials have to be used to obtain stable results (eg, 99999). I'm
> also fairly convinced that it will still be observable when doing away
> with Perl altogether and implementing all of the calculating and
> 'control-flowing' code in C.
>

No, I don't made use of Math::GMP, I used a module of the various
included in /demos of the GNU GMP distribution. Mpz to be precise.
There are other interesting uses of GMP in floats and rationales.
Factorial of 100_000 takes me around 1.7 secs. The result is not
astronomical, is out of the number of particles of the universe.

-- 
http://www.telecable.es/personales/gamo/
The generation of random numbers is too important to be left to chance


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

Date: Mon, 27 Apr 2015 21:07:46 +0100
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: How do I use "when" to check for "one of two options"?
Message-Id: <87k2wxuygd.fsf@doppelsaurus.mobileactivedefense.com>

gamo <gamo@telecable.es> writes:
> El 26/04/15 a las 19:06, Rainer Weikusat escribió:
>> gamo <gamo@telecable.es> writes:
>>> El 25/04/15 a las 15:56, Rainer Weikusat escribió:
>>>> If you wrote some code which calculates factorials "50 times faster"
>>>> than possible using the Math::Bigint implementation and algorithm,
>>>> fine. Get yourself a T-shirt which says so and send a copy to the
>>>> ::Bigint maintainer, maybe, he'll see the error of his ways. Or
>>>> whatnot.
>>>>
>>>> But unless you don't post this code, I surely don't care about it AND
>>>> this is not at all related to observation about 'function call overhead'
>>>> vs 'multiplaction' I (again) posted above.
>>>
>>> What I see is that people, and you now, thinks the subject or what
>>> the OP wants change as they thinks or the responses are generated.
>>> Speed was in the topic for a particular case, a module was not.
>>> BTW Math::BigInt accepts three types of library last time I read
>>> about: 'Calc' is the name of the default. The others, GMP and PARI,
>>> are accessible directly or indirectly. I opted to use them directly,
>>
>> I already conjectured that, rather than doing something especially
>> clever, you were likely just using some code performing the calculation
>> with compiled C code instead of Perl, I just tried to avoid being so
>> impolite to suggest this. The same phenomenon re 'recursion vs
>> multiplication' can be observed when using Math::GMP to provide faster
>> versions of the primitive, arithmetic operations, albeit larger
>> factorials have to be used to obtain stable results (eg, 99999). I'm
>> also fairly convinced that it will still be observable when doing away
>> with Perl altogether and implementing all of the calculating and
>> 'control-flowing' code in C.
>>
>
> No, I don't made use of Math::GMP, I used a module of the various
> included in /demos of the GNU GMP distribution. Mpz to be precise.

I never claimed you were using Math::GMP but I (that's a pronoun
referring to me and not to you) made a statement about Math::GMP,
namely, that

"the same phenomenon re 'recursion vs multiplication' can be observed
when using Math::GMP"

This - coincidentally - being indentical to the other statement made by
me you originally complained about (or rather "attacked me for").



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

Date: Tue, 28 Apr 2015 10:54:58 +0200
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: How do I use "when" to check for "one of two options"?
Message-Id: <2gu31c-8tq.ln1@news.rtij.nl>

On Thu, 23 Apr 2015 06:58:29 +0200, gamo wrote:

>>     when (['a','A']) {action1;}

> when (/a/i) {   }

Those are not the same. You would need /^a$/i for that.

M4


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

Date: Tue, 28 Apr 2015 11:54:12 +0200
From: "G.B." <bauhaus@futureapps.invalid>
Subject: Re: How do I use "when" to check for "one of two options"?
Message-Id: <mhnla7$lul$1@dont-email.me>

On 28.04.15 10:54, Martijn Lievaart wrote:
> On Thu, 23 Apr 2015 06:58:29 +0200, gamo wrote:
>
>>>      when (['a','A']) {action1;}
>
>> when (/a/i) {   }
>
> Those are not the same. You would need /^a$/i for that.

Will they differ, too, when some locale is in effect?

So that some branch will effectively match 'a', 'å', 'Ä', etc?





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

Date: Tue, 28 Apr 2015 13:14:52 +0200
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: How do I use "when" to check for "one of two options"?
Message-Id: <cm641c-8tq.ln1@news.rtij.nl>

On Tue, 28 Apr 2015 11:54:12 +0200, G.B. wrote:

> On 28.04.15 10:54, Martijn Lievaart wrote:
>> On Thu, 23 Apr 2015 06:58:29 +0200, gamo wrote:
>>
>>>>      when (['a','A']) {action1;}
>>
>>> when (/a/i) {   }
>>
>> Those are not the same. You would need /^a$/i for that.
> 
> Will they differ, too, when some locale is in effect?
> 
> So that some branch will effectively match 'a', 'å', 'Ä', etc?

I'm not a unicode expert, but that would greatly surprise me if it where 
so.

But besides that, the original question used ASCII letters only, so we 
probably should take that as context. Otherwise we open up a whole new 
can of worms as some languages have strange (to us) ideas about case.

M4


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

Date: Tue, 28 Apr 2015 16:35:03 +0100
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: How do I use "when" to check for "one of two options"?
Message-Id: <87sibkuuzc.fsf@doppelsaurus.mobileactivedefense.com>

Martijn Lievaart <m@rtij.nl.invlalid> writes:
> On Thu, 23 Apr 2015 06:58:29 +0200, gamo wrote:
>
>>>     when (['a','A']) {action1;}
>
>> when (/a/i) {   }
>
> Those are not the same. You would need /^a$/i for that.

Even this isn't strictly true as $ either matches the end of the string
or a \n which is its last character, cf

perl -e 'print "a\n" =~ /^a$/'

/^a\z/i

would need to be used to match only a or A.


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

Date: Tue, 28 Apr 2015 11:40:13 -0700
From: "$Bill" <news@todbe.com>
Subject: Re: How do I use "when" to check for "one of two options"?
Message-Id: <mhok4i$eq6$1@dont-email.me>

On 4/28/2015 08:35, Rainer Weikusat wrote:
> Martijn Lievaart <m@rtij.nl.invlalid> writes:
>> On Thu, 23 Apr 2015 06:58:29 +0200, gamo wrote:
>>
>>>>      when (['a','A']) {action1;}
>>
>>> when (/a/i) {   }
>>
>> Those are not the same. You would need /^a$/i for that.
>
> Even this isn't strictly true as $ either matches the end of the string
> or a \n which is its last character, cf
>
> perl -e 'print "a\n" =~ /^a$/'
>
> /^a\z/i
>
> would need to be used to match only a or A.

Maybe capital Z instead ??

/^a\Z/i



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

Date: Tue, 28 Apr 2015 13:56:22 -0500
From: John Black <jblack@nospam.com>
Subject: Re: How do I use "when" to check for "one of two options"?
Message-Id: <MPG.2fa993ce37bd5955989825@news.eternal-september.org>

In article <mhok4i$eq6$1@dont-email.me>, news@todbe.com says...
> 
> On 4/28/2015 08:35, Rainer Weikusat wrote:
> > Martijn Lievaart <m@rtij.nl.invlalid> writes:
> >> On Thu, 23 Apr 2015 06:58:29 +0200, gamo wrote:
> >>
> >>>>      when (['a','A']) {action1;}
> >>
> >>> when (/a/i) {   }
> >>
> >> Those are not the same. You would need /^a$/i for that.
> >
> > Even this isn't strictly true as $ either matches the end of the string
> > or a \n which is its last character, cf
> >
> > perl -e 'print "a\n" =~ /^a$/'
> >
> > /^a\z/i
> >
> > would need to be used to match only a or A.
> 
> Maybe capital Z instead ??
> 
> /^a\Z/i

Z does the same thing as $ as far as I know.  Matches the end of a string or just before a 
newline.

$string = "The cat and the dog\n";

/dog$/ matches
/dog\Z/ matches
/dog\z/ does not match

John Black


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

Date: Sun, 26 Apr 2015 23:16:05 -0700 (PDT)
From: mentificium@gmail.com
Subject: Re: Mentifex Strong AI Perlmind Programming Journal: 2015 April 12
Message-Id: <b8b77861-e5bf-4b66-a861-357db1194dcf@googlegroups.com>

From the parallel universe of comp.lang.javascript: 

https://groups.google.com/d/msg/comp.lang.javascript/lDg0hQUAL88/4XcBrdCRhpoJ 

On Sunday, April 26, 2015 at 3:31:53 AM UTC-7, Erwin Moller wrote:
> On 4/25/2015 8:17 AM, mentificium@gmail.com wrote:
> > On Wednesday, April 22, 2015 at 8:50:08 AM UTC-7, Erwin Moller wrote:
> >> [...] It feels strangly comfortable you are still alive and kicking [...]
> >
> > http://ai.neocities.org/perlmind.txt is the growing Perl AI program.
> >
> 
> [PERL warning, this isn't ECMA, isn't on-topic, and only for amusement.]

As the great Mohandas Karamchand Gandhi said, 
"First they ignore you, then they laugh at you, 
then they fight you, then you win."

> 
> If that is all you produced in all thoose years......
> Really, after taking out the comments, little is left, except 
> good-sounding subroutines, 

http://www.cpan.org/authors/id/M/ME/MENTIFEX/mind.txt 
is the first proposal of the subroutines twelve years ago, 
which are now being ported from Javascript and Forth into 
http://ai.neocities.org/perlmind.txt -- Strong AI source code. 

> like sub sensorium(), which actually consist of:
> 
> sub sensorium() {
>    print "Enter input, then press RETURN: ";
>    AudInput();
>    print " \n";
>    @en = " ";
>    @psi = " ";
> }
> 
> Oh, maybe AudInput() does something useful?
> 
> sub AudInput() {
>    our $pho = " ";
>      for (our $i=0; $i<6; $i++) {
>        $pho=getc(STDIN);
>        chomp($pho);
>        if ($pho gt "") { $t = $t + 1 }
>    }
>    AudMem();
> }

In the JavaScript artificial intelligence (English or Russian), 
the auditory input is event-driven by human keystrokes. 
The Perlmind AI code necessitates a non-JavaScript work-around.
> 
> Hmm, again no go.
> Maybe audMem does something useful then?
> 
> sub AudMem() {
>    print "AudMem: Storing ", $pho, " at time = ", "$t\n";
>    $aud[$t] = $pho;
> }
> 
> etc.etc.etc.
> 
> For the interested reader: we have seen half the code of the AI now.
> 
Oh, no. The Perlmind code is currently less than five percent of the 

http://ai.neocities.org/AiMind.html JavaScript code or the 

http://www.nlg-wiki.org/systems/Mind.Forth code as described in 

http://dl.acm.org/citation.cfm?doid=307824.307853 

by the ACM (Association for Computing Machinery).
> 
> Best of luck with your growing AI, Mentifex.
> 
> Erwin Moller

Well thank you, Erwin Moller -- a known trafficker in ideas. 

Please be advised that the World Wide Web runs mainly on 
Apache web-servers glued together with Perl and JavaScript. 

Since Perl can work with Unicode for all human languages, 
Web-resident AI Perlminds will one day be able to think not 
in just one natural language at a time -- like JavaScript -- 
but in multiple human languages under one consciousness. See 

http://aihub.net/artificial-intelligence-lab-projects 

And Denis McMahon posted:
> So all this AI does is store string data. 

The JavaScript English AI and the JavaScript Russian AI 
store characters of keyboard input in memory as if they 
were phonemes of human speech. The growing Perl Strong AI 
must imitate the JavaScript AI Minds in engram-storage. 

When these AI Perlminds gain a footprint on millions of 
Apache web-servers, then, "Watch out, world!" Imagine 
superintelligent Perl-brains flitting about the Web, 
soaking up all previous human knowledge and adding more. 

Messrs Moller and McMahon have made their immortal 
contribution to the AI Singularity by opining above. 
We thank you; History thanks you. 

Mentifex 
-- 
http://www.amazon.com/dp/B007ZI66FS 
http://www.amazon.com/dp/B00GX2B8F0 
http://www.amazon.com/dp/B00FKJY1WY 
http://www.amazon.com/dp/B00F8F1FG0 


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

Date: Mon, 27 Apr 2015 15:31:42 +0000 (UTC)
From: Kaz Kylheku <kaz@kylheku.com>
Subject: Re: Mentifex Strong AI Perlmind Programming Journal: 2015 April 12
Message-Id: <20150427082558.343@kylheku.com>

On 2015-04-27, mentificium@gmail.com <mentificium@gmail.com> wrote:
> As the great Mohandas Karamchand Gandhi said, 
> "First they ignore you, then they laugh at you, 
> then they fight you, then you win."

The applicability of Gandhi's quote here is quite clear.

For instance, to the "fight you" metaphor, we can assign the concrete
instantiation: "ask you to stop posting off-topic self-promoting material to
Usenet newsgroups". And "win", of course, means "continue to do as you please".


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

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:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#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 V11 Issue 4423
***************************************


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