We had another TechSocial Meeting in Vienna - taking place on 1st monday of every month. First Willy showed using Perl for emulating heavy (really tons of) hardware - very impressive. Second talk by domm was an intro to Perl 5.10.
The pub (remember TechScocial) did e.g. provide 'Perlhuhnbrust' on the menue, but we didn't ask if it were of the 5.10 persuasion.
The smart match operator lead to immediate discussion, whether there exists a 'not-smart-operator' or rather a 'smart-not-operator' or their combination:
$foo !~~ /bar/; # not smart aka dumb match
Would this maybe match every chicken
or rather not?
$foo ~!~ /bar/; # smart no match
$foo !~!~ /bar/; # no dumb match
... which immediately lead to a discussion of the orthogonality of the not
operator, which generally was considered as very important. E.g. is this valid syntax, and what does it mean:
not my $var;
Semantically it's a promise not to use this variable in that scope. But perl has a different POV
$ perl -Mstrict -Mwarnings -le'not my $var'
Useless use of not in void context at -e line 1.
OTOH ...
$ perl -Mstrict -Mwarnings -le'print not my $beer'
1
$ perl -Mstrict -Mwarnings -le'print ! my $beer'
1
... there are some 'true' items, which aren't your beer. But ...
$ perl -Mstrict -Mwarnings -le'print $_->ignore for not our @beer'
Can't call method "ignore" without a package or object reference at -e line 1.
... you can't actually ignore all of them.
Slides to my Perl 5.10 intro are available here: http://domm.plix.at/talks/2007_vienna_perl5_10/
I even fixed some typos and added a few more comments from the discussions/questions
Re:My slides
Aristotle on 2007-12-04T14:16:28
To anyone who wants to read the slides: feed the POD source to perldoc and read it on the console. If you try the HTML version, you’ll be clicking “next” every three seconds for some 10 minutes or so.
Shortest JAPH
Aristotle on 2007-12-04T14:20:09
Shouldn’t
perl5_10 -E 'say JAPH'
work? That would be another two characters shorter.Re:Shortest JAPH
domm on 2007-12-04T15:24:52
No:
~$ perl5_10 -E 'say JAPH'
~$
~$ perl5_10 -mO=Deparse -E 'say JAPH'
BEGIN {
$^H{'feature_say'} = q(1);
$^H{'feature_state'} = q(1);
$^H{'feature_switch'} = q(1);
}
say JAPH $_;Re:Shortest JAPH
Aristotle on 2007-12-04T19:51:59
Ah. Stupid magical prototypes…