[33151] in Perl-Users-Digest
Perl-Users Digest, Issue: 4430 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 13 05:17:20 2015
Date: Wed, 13 May 2015 02:17:07 -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 Wed, 13 May 2015 Volume: 11 Number: 4430
Today's topics:
Re: custom 'multigrep' <fillmore_remove@hotmail.com>
Re: custom 'multigrep' sharma__r@hotmail.com
Re: custom 'multigrep' <rweikusat@mobileactivedefense.com>
Re: custom 'multigrep' <rweikusat@mobileactivedefense.com>
Re: custom 'multigrep' <whynot@pozharski.name>
Re: custom 'multigrep' <rweikusat@mobileactivedefense.com>
Re: Doubt about a sample code in "Hashes" chapter, Perl <gypark@gmail.com>
invoking superclass constructors <rweikusat@mobileactivedefense.com>
Re: mind.pl showing storage and retrieval from memory <uri@stemsystems.com>
Re: mind.pl showing storage and retrieval from memory mentificium@gmail.com
Re: mind.pl showing storage and retrieval from memory <jurgenex@hotmail.com>
Re: mind.pl showing storage and retrieval from memory <jblack@nospam.com>
rename key <gravitalsun@hotmail.foo>
Re: rename key <jurgenex@hotmail.com>
Re: rename key <gravitalsun@hotmail.foo>
Re: rename key <jurgenex@hotmail.com>
text-bumming (was: custom 'multigrep') <rweikusat@mobileactivedefense.com>
Re: wordx....not_wordx...wordy pattern matching. deangwilliam30@gmail.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 11 May 2015 07:48:14 -0400
From: Fillmore <fillmore_remove@hotmail.com>
Subject: Re: custom 'multigrep'
Message-Id: <miq4ts$ard$2@speranza.aioe.org>
Awesome. Thank you, Rainer. I am impressed about the amount of expertise
by the people in this group.
On 05/09/2015 12:08 PM, Rainer Weikusat wrote:
> Fillmore <fillmore_remove@hotmail.com> writes:
>> On 05/03/2015 08:13 PM, Fillmore wrote:
------------------------------
Date: Mon, 11 May 2015 06:55:39 -0700 (PDT)
From: sharma__r@hotmail.com
Subject: Re: custom 'multigrep'
Message-Id: <7ce5fdfd-96e5-40d7-a634-c53a48748ec6@googlegroups.com>
On Saturday, 9 May 2015 21:38:30 UTC+5:30, Rainer Weikusat wrote:
This is a slightly modified scheme whereby due to the "any" function,
further matching on the current line is aborted upon the 1st truth.
Note: The !s on the command line are to be backslashed to skip history
substitution if the shell command line allows it. And, at the same time
the ! would need to be escaped in the push @{... line as well. Basically,
everywhere in the code that is.
perl -Mstrict -Mwarnings -MList::MoreUtils=any -lne '
BEGIN{
my(@args, @want, @dont) = splice @ARGV, 1, $#ARGV;
push @{\(s/^!// ? @dont : @want)}, qr{\Q$_\E} for @args;
sub effective_match {
my($L) = @_ ? @_ : $_;
return if any { $L !~ /$_/ } @want;
return if any { $L =~ /$_/ } @dont;
1;
}
}
print if effective_match();
' input_file key1 !key2 key3 !key4 ... !keyN
------------------------------
Date: Mon, 11 May 2015 15:29:03 +0100
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: custom 'multigrep'
Message-Id: <87mw1b6vdc.fsf@doppelsaurus.mobileactivedefense.com>
sharma__r@hotmail.com writes:
> On Saturday, 9 May 2015 21:38:30 UTC+5:30, Rainer Weikusat wrote:
>
> This is a slightly modified scheme whereby due to the "any" function,
> further matching on the current line is aborted upon the 1st truth.
>
> Note: The !s on the command line are to be backslashed to skip history
> substitution if the shell command line allows it. And, at the same time
> the ! would need to be escaped in the push @{... line as well. Basically,
> everywhere in the code that is.
>
>
> perl -Mstrict -Mwarnings -MList::MoreUtils=any -lne '
>
> BEGIN{
>
> my(@args, @want, @dont) = splice @ARGV, 1, $#ARGV;
>
> push @{\(s/^!// ? @dont : @want)}, qr{\Q$_\E} for @args;
The request specifically called for 'regexes'. That's not possible when
quoting meta-characters.
> sub effective_match {
> my($L) = @_ ? @_ : $_;
> return if any { $L !~ /$_/ } @want;
> return if any { $L =~ /$_/ } @dont;
> 1;
> }
> }
Further, while you may be absolutely hell-bent to promote code written
by Tassilo v Parzeval not matter if this makes any sense or not, just
repeating this endlessly doesn't add anything of value to the
discussion. Lastly, you should consider to stop using -n in order to
avoid another simple loop (and maybe learn something about Perl looping
constructs instead) so that you can get rid of the bziarre BEGIN/ END
workarounds intended to hammer code which doesn't fit into the -n/-p
model into it by brute force.
------------------------------
Date: Mon, 11 May 2015 16:17:05 +0100
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: custom 'multigrep'
Message-Id: <87a8xb6t5a.fsf@doppelsaurus.mobileactivedefense.com>
sharma__r@hotmail.com writes:
> This is a slightly modified scheme whereby due to the "any" function,
> further matching on the current line is aborted upon the 1st truth.
>
> Note: The !s on the command line are to be backslashed to skip history
> substitution if the shell command line allows it. And, at the same time
> the ! would need to be escaped in the push @{... line as well. Basically,
> everywhere in the code that is.
>
Some more things:
>
> perl -Mstrict -Mwarnings -MList::MoreUtils=any -lne '
>
> BEGIN{
>
> my(@args, @want, @dont) = splice @ARGV, 1, $#ARGV;
This deletes all but the first element from @ARGV and assigns the
deleted elements to @args. That's another contortion necessary to work
around -n as that would otherwise interpret the 'pattern' arguments as
names of additional files to process.
> push @{\(s/^!// ? @dont : @want)}, qr{\Q$_\E} for @args;
This modifies the pattern arguments themselves which may not be desired
and which may not be possible (in another context, eg, when they're
subroutine arguments) because they could be constants. Also,
@{\(s/^!// ? @dont : @want)}
is a construct which takes references to the return value of the ?:,
thereby preserving the identity of the array-argument (it would
'flatten' into a list) and this references is then immediately
de-references again so that it can serve as argument to push. The only
point of this is to avoid a second line of code and/ or repeating the
push.
s/^!// ? push(@dont, $_) : push(@want, $_)
or
s/^!// and push(@dont, $_) or push(@want, $_) [*]
would work fine, too. To a degree, this is a question of style, however,
in my opinion, "horizontal extension constructs" shouldn't be used to
string different operations together just for the sake of reducing the
number of lines of the code.
[*] Insofar this is an excercise in genuflecting for the god of text
bumming, a
push(@{$r[s/^!//]}, $_) for @args;
followed by using @{$r[1]} instead of @dont and @{$r[0]} instead of
@want would work nicely, too, and it would reduce the text-to-linenoise
ratio even further, thereby pleasantly heightening the barrier to
understanding.
------------------------------
Date: Mon, 11 May 2015 12:36:55 +0300
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: custom 'multigrep'
Message-Id: <slrnml0u1n.etq.whynot@orphan.zombinet>
with <mil1ut$781$1@speranza.aioe.org> Fillmore wrote:
*SKIP*
> #implement mini-Expr Language to negate key
> if (substr($searchKey, 0, 1) eq "!") {
> #remove initial "!"
> $searchKey =~ s/^!//;
>
> if ($uaString =~ /$searchKey/) {
> return 0;
> }
> } else {
>
> if ($uaString !~ /$searchKey/) {
> return 0;
> }
> }
When in Perl you do it this way:
if( $searchKey =~ s/^!// ) {
$uaString =~ m/$searchKey/ and return 0
} else {
$uaString =~ m/$searchKey/ and return 0
}
However, this might get you behaded:
if( $searchKey =~ s/^!// && $uaString =~ m/$searchKey/ ) {
return 0
}
elsif( $uaString =~ m/$searchKey/ ) {
return 0
}
And in this case your death will be even more violent:
$searchKey =~ s/^!// && $uaString =~ m/$searchKey/ and return 0;
$uaString =~ m/$searchKey/ and return 0;
Fine line, isn't it? And not because it must be m/\Q$searchKey/ all
over.
*CUT*
p.s. And, thanks, now I feel much better. But that's still puzling.
--
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom
------------------------------
Date: Mon, 11 May 2015 19:08:24 +0100
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: custom 'multigrep'
Message-Id: <871tin6l7r.fsf@doppelsaurus.mobileactivedefense.com>
Eric Pozharski <whynot@pozharski.name> writes:
> with <mil1ut$781$1@speranza.aioe.org> Fillmore wrote:
>
> *SKIP*
>
>> #implement mini-Expr Language to negate key
>> if (substr($searchKey, 0, 1) eq "!") {
>> #remove initial "!"
>> $searchKey =~ s/^!//;
>>
>> if ($uaString =~ /$searchKey/) {
>> return 0;
>> }
>> } else {
>>
>> if ($uaString !~ /$searchKey/) {
>> return 0;
>> }
>> }
[...]
> it must be m/\Q$searchKey/ all over.
If it is /\Q$searchKey/ then $searchKey can't be a regex itself, only a
string matching literally. Considering the
,----
| What I need is that each line gets selected iff:
|
| $line =~ /$key1/ && $line =~ /$key2/ && $line =~ /$keyN/
|
| the result would be similar to shell commands
|
| #grep key1 <file> | grep key2| .... | grep keyN
`----
from the original postings, that's not what was intended.
------------------------------
Date: Mon, 11 May 2015 00:39:21 -0700 (PDT)
From: Raymundo <gypark@gmail.com>
Subject: Re: Doubt about a sample code in "Hashes" chapter, Perl Cookbook 2nd
Message-Id: <6f3f6da2-f5ca-4517-acdd-bde1010b0e84@googlegroups.com>
2015=EB=85=84 5=EC=9B=94 5=EC=9D=BC =ED=99=94=EC=9A=94=EC=9D=BC =EC=98=A4=
=ED=9B=84 9=EC=8B=9C 1=EB=B6=84 25=EC=B4=88 UTC+9, G.B. =EB=8B=98=EC=9D=98 =
=EB=A7=90:
> On 04.05.15 19:31, Raymundo wrote:
> > Am I missing or misunderstanding something?
>=20
> For a start, the use of passive voice and active voice
> in view of perhaps the plural of a noun:
> "includes"
> vs. the 3rd person singular of a verb:
> "includes"
> stays ambiguous because the first does not obviously decide
> on a the direction of the relation between keys and values
> in the hash, unlike the second.
>=20
> Somehow Perl writers seem to like ambiguous names.
> Maybe TIMTOWTDI at work, as an excuse.
>=20
> If "includes" is a plural, then to what objects should
> "includes" in
>=20
> if ($includes{$x})
>=20
> call attention? Included files, or files that include?
> Both? Both in some circumstances, but not in others?
> It sure seems possible to extrapolate the intended meaning
> from a study of the program, but then the variable could
> more honestly be named 'L' or similar.
>=20
> I guess you'd have to ask the author.
Thank you, G.B. and George Mpouras.
I agree I'd better ask the author. :-)
------------------------------
Date: Tue, 12 May 2015 21:10:06 +0100
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: invoking superclass constructors
Message-Id: <87a8x9zhep.fsf@doppelsaurus.mobileactivedefense.com>
perldoc perlobj documents the user of SUPER as
As a special case of the above, you may use the "SUPER"
pseudo-class to tell Perl to start looking for the method in the
packages named in the current class's @ISA list.
[...]
It is important to note that "SUPER" refers to the
superclass(es) of the current package and not to the
superclass(es) of the object. Also, the "SUPER" pseudo-class can
only currently be used as a modifier to a method name, but not
in any of the other ways that class names are normally used, eg:
something->SUPER::method(...); # OK
For some years, I've been invoking superclass constructors[*]
like this:
sub new
{
my ($class, $arg) = @_;
my $self;
$self = Super::Class->new('Hmpf', $arg);
return bless($self, $class);
}
The most striking problem with this is that this will only work when the
superclass constructor doesn't call any possibly overloaded methods
after creating the instance (via bless). I didn't really need this so
far until today (because of an class representing a HTTP-request which
invokes an overloaded method add_default_headers where subclasses both
need to add their own default headers and provide 'implied arguments' to
the superclass ctor). At this point, I remembered the
It is important to note that "SUPER" refers to the
superclass(es) of the current package and not to the
superclass(es) of the object.
I've been reading over for years without ever understanding why it was
written: In the context of the given problem, it means that it is
possible to use the class argument passed to the subclass constructor as
invocant for the superclass one as the search for a method will start in
the packages named in @ISA regardless of the actual invocant. Ie, this
sub new
{
return $_[0]->SUPER::new($_[1], RESOURCE);
}
will invoke the superclass constructor with the current class argument
as class argument and the additional argument provided by the subclass
constructor. That will then bless the object into the correct class and
invoke any overloaded methods as it should.
[*] A constructor is supposed to create a fully initialized object
instance, ie it's not just the
sub new
{
return bless({}, $_[0]); # why this again ?!?
}
of a sequence of (Javay) code looking like this:
my $obj = Class->new(); # [**]
$obj->setA('B');
$obj->setB('C');
$obj->setD(45);
$obj->setF(13.5);
That's something which isn't supposed to occur at all as this
'encapsulation' things means 'only the class has knowledge about and
direct access to the object representation' and that's obviously no
longer the case when the representation is 1:1 mirrored by the public
interface.
[**] Boldly avoiding the lip service altogether
my $obj = bless({}, 'Class');
works, too.
------------------------------
Date: Mon, 11 May 2015 19:35:56 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: mind.pl showing storage and retrieval from memory
Message-Id: <87lhgu4rhf.fsf@stemsystems.com>
>>>>> "m" == mentificium <mentificium@gmail.com> writes:
m> use strict; # PERL by Example (2015) p. 77
m> use warnings; # PERL by Example (2015) p. 85
do you need to cite the lousy book where you learned lousy perl from?
these are among the worst and most useless comments i have ever
seen. they rank up with $i++ ; # increment i
m> our $age = 0; # Temporary age for loop-counting and loop-exit.
m> our @aud = " "; # PERL by Example (2015) p. 17: auditory array
that isn't an empty array anymore.
m> our $cns = 32; # size of AI memory for central nervous system.
why our????? my is better here.
m> sub AudInput; # PERL by Example p. 351 Forward declaration
perl doesn't need forward declarations of subs if you call them with
(). this is wasted pixels
m> TabulaRasa: { # PERL by Example (2015), p. 204: Labels
wtf do you need a label? you don't use it anywhere!!
m> my $trc = 0; # $trc variable is "tabula rasa counter".
unneeded.
m> until ($trc == $cns) { # PERL by Example (2015), p. 193: "Loops".
until loops are so wacko. no one uses them.
m> $aud[$trc] = " "; # Fill CNS memory with blank spaces.
gack!!
m> $trc++; # PERL by Example (2015) p. 21: autoincrement $trc.
learn about the x operator. maybe that stupid book mentions it.
m> } # End of loop filling auditory memory with blank engrams.
m> } # End of TabulaRasa "clean slate" sequence.
m> EnBoot: { # http://mind.sourceforge.net/enboot.html
m> $t = 0; # English Bootstrap sequence stretches over mental time "$t".
m> print "English bootstrap is loading into memory... \n";
m> $t = 0; $aud[$t] = "H"; # Indexing of array begins with zero.
m> $t = 1; $aud[$t] = "E"; # Single elements of array use $aud not @aud.
m> $t = 2; $aud[$t] = "L"; # PERL by Example (2015), p. 95: Elements
m> $t = 3; $aud[$t] = "L"; # AudMem() stores new words at higher $t values.
m> $t = 4; $aud[$t] = "O"; # Bootstrap "HELLO" is not permanently here.
m> $t = 5; # A blank gap is necessary between words.
m> $t = 6; # More bootstrap words will be needed.
this is ridiculous. you are coding perl like it is another
language. learn perl to code in perl.
m> while ($t < $cns) { # PERL by Example (2015), p. 190
m> $age = $age + 1; # Increment $age variable with each loop.
crapola!! you use the ++ op earlier
m> print "\nMain loop cycle ", $age, " \n"; # Display loop-count.
m> sensorium(); # PERL by Example p. 350: () empty parameter list
m> think(); # PERL by Example p. 350: () empty parameter list
empty skull list.
m> if ($age eq 999) { die "Perlmind dies when time = $t \n" }; #
m> safety
if you really enabled warnings, that should trigger one.
m> } # End of main loop calling mind.pl Strong AI subroutines
i mind.pl this code very much. ewww
i do code review for candidate screening. i would recommend this code to
my worst enemy. well, i would get you a job in redmond if they lowered
their exam passing grade to 0.
uri
------------------------------
Date: Mon, 11 May 2015 22:49:21 -0700 (PDT)
From: mentificium@gmail.com
Subject: Re: mind.pl showing storage and retrieval from memory
Message-Id: <f7620298-4ff8-4cf8-9642-86e29bae6f41@googlegroups.com>
On Monday, May 11, 2015 at 4:40:33 PM UTC-7, Uri Guttman wrote:
> >>>>> "m" == mentificium <mentificium@gmail.com> writes:
>
> m> use strict; # PERL by Example (2015) p. 77
> m> use warnings; # PERL by Example (2015) p. 85
>
> do you need to cite the lousy book
> where you learned lousy perl from?
http://www.amazon.com/dp/0133760812
"Perl by Example, Fifth Edition" (2015!)
is extremely up-to-date and authoritative.
When the Perl AI code-comments cite page-numbers
in "Perl by Example", Perl newbies have a chance
to learn Perl and AI-in-Perl simultaneously.
> these are among the worst and most useless comments i have ever
> seen. they rank up with $i++ ; # increment i
You may be a Perl expert, but a newbie needs lots of help.
>
> m> our $age = 0; # Temporary age for loop-counting and loop-exit.
> m> our @aud = " "; # PERL by Example (2015) p. 17: auditory array
>
> that isn't an empty array anymore.
>
> m> our $cns = 32; # size of AI memory for central nervous system.
>
> why our????? my is better here.
https://groups.google.com/d/msg/comp.lang.perl.misc/3K9PYNHKIgg/CIZjsbv4gggJ
is where Robbie Hatley on 25 April 2015:
> Package variables (in this case in package main::)
> should be declared with "our":
>
> m> sub AudInput; # PERL by Example p. 351 Forward declaration
>
> perl doesn't need forward declarations of subs if you call them with
> (). this is wasted pixels
Hmm, thanks for that information.
>
> m> TabulaRasa: { # PERL by Example (2015), p. 204: Labels
>
> wtf do you need a label? you don't use it anywhere!!
The label "TabulaRasa" (Latin for "empty slate" memory)
is used merely informatively to indicate what is happening,
and also as a legacy term from previous AI Minds (see below).
>
> m> my $trc = 0; # $trc variable is "tabula rasa counter".
> unneeded.
>
> m> until ($trc == $cns) { # PERL by Example (2015), p. 193: "Loops".
>
> until loops are so wacko. no one uses them.
In the primitive prototype Perl AI, we need to
show some output with the temporary until-loop.
>
> m> $aud[$trc] = " "; # Fill CNS memory with blank spaces.
>
> gack!!
>
> m> $trc++; # PERL by Example (2015) p. 21: autoincrement $trc.
>
> learn about the x operator. maybe that stupid book mentions it.
>
>
> m> } # End of loop filling auditory memory with blank engrams.
> m> } # End of TabulaRasa "clean slate" sequence.
>
> m> EnBoot: { # http://mind.sourceforge.net/enboot.html
> m> $t = 0; # English Bootstrap sequence stretches over mental time "$t".
> m> print "English bootstrap is loading into memory... \n";
> m> $t = 0; $aud[$t] = "H"; # Indexing of array begins with zero.
> m> $t = 1; $aud[$t] = "E"; # Single elements of array use $aud not @aud.
> m> $t = 2; $aud[$t] = "L"; # PERL by Example (2015), p. 95: Elements
> m> $t = 3; $aud[$t] = "L"; # AudMem() stores new words at higher $t values.
> m> $t = 4; $aud[$t] = "O"; # Bootstrap "HELLO" is not permanently here.
> m> $t = 5; # A blank gap is necessary between words.
> m> $t = 6; # More bootstrap words will be needed.
>
> this is ridiculous. you are coding perl like
> it is another language. learn perl to code in perl.
>
Gee, the Forth community said the same thing about my Forth code.
>
> m> while ($t < $cns) { # PERL by Example (2015), p. 190
> m> $age = $age + 1; # Increment $age variable with each loop.
>
> crapola!! you use the ++ op earlier
>
> m> print "\nMain loop cycle ", $age, " \n"; # Display loop-count.
> m> sensorium(); # PERL by Example p. 350: () empty parameter list
> m> think(); # PERL by Example p. 350: () empty parameter list
>
> empty skull list.
>
> m> if ($age eq 999) { die "Perlmind dies when time = $t \n" }; #
> m> safety
>
> if you really enabled warnings, that should trigger one.
>
> m> } # End of main loop calling mind.pl Strong AI subroutines
>
> i mind.pl this code very much. ewww
>
> i do code review for candidate screening. i would recommend this code to
> my worst enemy. well, i would get you a job in redmond if they lowered
> their exam passing grade to 0.
>
> uri
Slowly but surely, the Perl AI code archived at
http://ai.neocities.org/perlmind.txt
is coming along quite well, thank you.
Yesterday with
# $aud[$t] = $pho; #2015may01: Store the input phoneme
$aud[$t] = "$t, $pho, $act, $audpsi"; # 2015may10: store flag-panel
I figured out how to store multiple items
in each row of the @aud memory array.
The Perl AI Mind is a third-generation Mentifex AI.
Therefore I am taking the opportunity to simplify
the free AI source code in Perl by eliminating
clumsy mind-module structures which were previously
serving only the purpose of making it easy to code
the AI. The lean, mean, new AI is emerging in Perl.
For instance, the Forth auditory array had 7 flags:
krt pho act pov beg ctu audpsi
630.
631. {
632. I 0 # 1 0 701
633.
Now in Perl the @aud array may get by with only
three items per line of array storage:
$pho $act $audpsi
where $pho is the phoneme being stored; and
$act is the activation-level on the phoneme; and
$audpsi is the associative tag over to a concept.
http://ai.neocities.org/AiSteps.html is where I
am trying to revive and breath new life into
the "perl-ai" mailing list, long defunct:
> You may discuss Perl and AI combined at
> http://lists.perl.org/list/perl-ai.html
> http://www.nntp.perl.org/group/perl.ai/
> http://www.mail-archive.com/perl-ai@perl.org
When you do your "code review for candidate screening",
please remember to ask candidates how much they know
about Mentifex artificial intelligence.
The Mentifex AI Minds are guaranteed to exhibit
thinking -- or I will express extreme regrets.
Any major corporation with Perl coders on staff,
needs to look into the Mentifex AI Minds free at
http://www.nlg-wiki.org/systems/Mind.Forth in English
http://www.nlg-wiki.org/systems/Wotan in German
http://www.nlg-wiki.org/systems/Mind in English
http://www.nlg-wiki.org/systems/Dushka in Russian
or risk falling behind the sudden Singularity.
Cheers,
ATM/Mentifex
--
http://www.reddit.com/r/perl/comments/35hhue/domm_things_i_learned_at_german_perl_workshop_2015/cr4gtls
------------------------------
Date: Mon, 11 May 2015 23:11:57 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: mind.pl showing storage and retrieval from memory
Message-Id: <lr53la1vg6loadhtu59unrssigrfg7r3tl@4ax.com>
mentificium@gmail.com wrote:
[...]
>> this is ridiculous. you are coding perl like
>> it is another language. learn perl to code in perl.
>>
>Gee, the Forth community said the same thing about my Forth code.
I can't help thinking they were probably right.
>Slowly but surely, the Perl AI code archived at
>is coming along quite well, thank you.
>Yesterday with
>
># $aud[$t] = $pho; #2015may01: Store the input phoneme
> $aud[$t] = "$t, $pho, $act, $audpsi"; # 2015may10: store flag-panel
>
>I figured out how to store multiple items
>in each row of the @aud memory array.
You figured out how to expand 4 variables in a string? And you are
selling this as a break-through? AS A BREAKTHROUGH?
Damn, you are good! You are extremely good. You are at least as good as
that salesman who sold the milking machine to the farmer and accepted
the only cow as down payment.
jue
------------------------------
Date: Tue, 12 May 2015 10:44:40 -0500
From: John Black <jblack@nospam.com>
Subject: Re: mind.pl showing storage and retrieval from memory
Message-Id: <MPG.2fbbdbde38ba8011989827@news.eternal-september.org>
In article <lr53la1vg6loadhtu59unrssigrfg7r3tl@4ax.com>, jurgenex@hotmail.com says...
> Damn, you are good! You are extremely good.
He is still having spectacular success at what he is trying to accomplish. So yes, he is
good...
John Black
------------------------------
Date: Wed, 13 May 2015 01:30:26 +0300
From: George Mpouras <gravitalsun@hotmail.foo>
Subject: rename key
Message-Id: <mituu3$nl3$1@news.grnet.gr>
is there any internal hack to rename a hash key (without ref to it) ?
------------------------------
Date: Tue, 12 May 2015 15:55:24 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: rename key
Message-Id: <1k05la1fels813c7uilsnauthp41vnlbk5@4ax.com>
George Mpouras <gravitalsun@hotmail.foo> wrote:
>is there any internal hack to rename a hash key (without ref to it) ?
$myhash{'newkey'} = $myhash{'oldkey'};
delete $myhash{'oldkey'};
should do the job quite nicely.
jue
------------------------------
Date: Wed, 13 May 2015 02:14:06 +0300
From: George Mpouras <gravitalsun@hotmail.foo>
Subject: Re: rename key
Message-Id: <miu1fv$18n$1@news.grnet.gr>
On 13/5/2015 01:55, jurgenex@hotmail.com wrote:
> George Mpouras <gravitalsun@hotmail.foo> wrote:
>> is there any internal hack to rename a hash key (without ref to it) ?
>
> $myhash{'newkey'} = $myhash{'oldkey'};
> delete $myhash{'oldkey'};
> should do the job quite nicely.
>
> jue
>
yes it will; the drawback is that copy the data and this takes times.
------------------------------
Date: Tue, 12 May 2015 17:09:07 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: rename key
Message-Id: <9e55lahkfcqgobuhuq2i847ii91p8cj516@4ax.com>
George Mpouras <gravitalsun@hotmail.foo> wrote:
>On 13/5/2015 01:55, jurgenex@hotmail.com wrote:
>> George Mpouras <gravitalsun@hotmail.foo> wrote:
>>> is there any internal hack to rename a hash key (without ref to it) ?
>>
>> $myhash{'newkey'} = $myhash{'oldkey'};
>> delete $myhash{'oldkey'};
>> should do the job quite nicely.
>>
>> jue
>>
>
>yes it will; the drawback is that copy the data and this takes times.
If you need to do this so often that performance becomes a factor then
maybe it would be easier to restructure your data and introduce another
layer of indirection.
jue
------------------------------
Date: Mon, 11 May 2015 17:24:26 +0100
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: text-bumming (was: custom 'multigrep')
Message-Id: <87617z6q11.fsf_-_@doppelsaurus.mobileactivedefense.com>
Rainer Weikusat <rweikusat@mobileactivedefense.com> writes:
[...]
> [*] Insofar this is an excercise in genuflecting for the god of text
> bumming,
... at the expense of reducing legibility somewhat, the whole algorithm
can also be expressed
eval{(/^!(.*)/?$l=~/$1/:$l!~/$_/)&&&{&}for@ARGV;print$l}while$l=<STDIN>;
------------------------------
Date: Wed, 13 May 2015 02:03:08 -0700 (PDT)
From: deangwilliam30@gmail.com
Subject: Re: wordx....not_wordx...wordy pattern matching.
Message-Id: <be2d43d0-ec3c-445b-be21-3070b2cfbba2@googlegroups.com>
Wow...I thought I'd just check up on the off-chance that someone had responded and see that several of you have. I can't do anything on this now...but just wanted to thankyou as a courtesy. I'll respond later today when I'm a position to.
Thanks once again.
Dean
------------------------------
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 4430
***************************************