Re: Perl, the new generation
On Fri 11 May 2001 16:31, Michael G Schwern [EMAIL PROTECTED] wrote: On Fri, May 11, 2001 at 01:55:42AM +0100, Graham Barr wrote: On Thu, May 10, 2001 at 07:40:04PM -0500, Jarkko Hietaniemi wrote: By far most of my use of typeglobs is making aliases, and then mostly for code: *color = \colour; I would say that probably the most common use now for typeglobs is from the IO:: modules. Which are created with gensym so they are anonymous. Personally, I use typeglobs mostly to autogenerate repetitive methods without an autoloader: *method = $closure; but this should definately have a direct analogy in Perl 6 so I'm not worried. I use it to check if formats exist, since there is no other way to do so (except maybe an eval that dies :(): if (defined *{$::{$fmt}}{FORMAT}) { local $~ = $fmt; write; } but for perl6 it doesn't matter, cause formats will die anyway (even without an eval :) -- H.Merijn BrandAmsterdam Perl Mongers (http://www.amsterdam.pm.org/) using perl-5.6.1, 5.7.1 629 on HP-UX 10.20 11.00, AIX 4.2, AIX 4.3, WinNT 4, Win2K pro WinCE 2.11. Smoking perl CORE: [EMAIL PROTECTED] http:[EMAIL PROTECTED]/ [EMAIL PROTECTED] send smoke reports to: [EMAIL PROTECTED], QA: http://qa.perl.org
Re: Please make last work in grep
On Wed, 2 May 2001 08:05:29 -0700 (PDT), Larry Wall [EMAIL PROTECTED] wrote: Michael G Schwern writes: : (grep {...} @stuff)[0] will work, but its inelegant. It's inelegant only because the slice doesn't know how to tell the iterator it only needs one value. If it did know, you'd call it elegant. :-) IIRC, that optimization is not even considered for reasons of many people wanting the side effects of grep/map finishing over all elements (which could of course be from a tied array or database connection) -- H.Merijn BrandAmsterdam Perl Mongers (http://www.amsterdam.pm.org/) using perl-5.6.1, 5.7.1 623 on HP-UX 10.20 11.00, AIX 4.2, AIX 4.3, WinNT 4, Win2K pro WinCE 2.11 often with Tk800.022 /| DBD-Unify ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Re: Tying Overloading
On Mon, 23 Apr 2001 13:19:24 +0100, Graham Barr [EMAIL PROTECTED] wrote: $a = $b ~ $c; # Mmm! I like that last one a lot, because it doesn't disturb anything. You'd have to alter ~'s precedence so that binary ~ is higher than named unary operators. (It's print($a~$b), not print $a (~b).) I am not sure I do like the use of ~ here. It does not screan concatenate to me (but then again neither did . when I started perl) I am thinking that maybe it should be a 2 character operator with at least one of then being + as + is common in many other languages for doing concatenation. like ++ ? we have ** already for exponents -- H.Merijn BrandAmsterdam Perl Mongers (http://www.amsterdam.pm.org/) using perl-5.6.1, 5.7.1 623 on HP-UX 10.20 11.00, AIX 4.2, AIX 4.3, WinNT 4, Win2K pro WinCE 2.11 often with Tk800.022 /| DBD-Unify ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Re: Postfix !
On Mon, 23 Apr 2001 13:22:54 +0100, Simon Cozens [EMAIL PROTECTED] wrote: If postfix ! was up for grabs - which it probably isn't - what would you do with it? One interesting suggestion was to have it as a shorthand for assertion: sub foo { (@_ 0)!; ... } (Or even have ! be a valid statement terminator, so (@_0)! would work.) Or you could have it doing something to variables: $a = $b! + $c; (But what?) Fun, eh? DWIM would be faculty -- H.Merijn BrandAmsterdam Perl Mongers (http://www.amsterdam.pm.org/) using perl-5.6.1, 5.7.1 623 on HP-UX 10.20 11.00, AIX 4.2, AIX 4.3, WinNT 4, Win2K pro WinCE 2.11 often with Tk800.022 /| DBD-Unify ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Re: Tying Overloading
On Mon, 23 Apr 2001 13:02:50 +0100, Simon Cozens [EMAIL PROTECTED] wrote: On Mon, Apr 23, 2001 at 01:49:36PM +0200, Dav?? Helgason wrote: This wouldn't mean that anyone is thinking of getting us object dot-syntax, now would it? whistle After giving it a thought, it seems that it can _mostly_ be disambiguated from the concatenation operator. Whatever mostly means. Or we change the concatenation operator. $a = $b $c; # Do people really use Perl for bit fiddling? ABSOLUTELY! Ever done vec? It's even well documented what stringwise should do. (Though I have to admit it's not DWIM) $a = $b # $c; /* Urgh */ $a = $b ~ $c; # Mmm! I like that last one a lot, because it doesn't disturb anything. You'd have to alter ~'s precedence so that binary ~ is higher than named unary operators. (It's print($a~$b), not print $a (~b).) -- H.Merijn BrandAmsterdam Perl Mongers (http://www.amsterdam.pm.org/) using perl-5.6.1, 5.7.1 623 on HP-UX 10.20 11.00, AIX 4.2, AIX 4.3, WinNT 4, Win2K pro WinCE 2.11 often with Tk800.022 /| DBD-Unify ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Re: Postfix !
On Mon, 23 Apr 2001 14:57:50 +0200, Davíð Helgason [EMAIL PROTECTED] wrote: H.Merijn Brand wrote: On Mon, 23 Apr 2001 13:22:54 +0100, Simon Cozens [EMAIL PROTECTED] wrote: If postfix ! was up for grabs - which it probably isn't - what would you do with it? One interesting suggestion was to have it as a shorthand for assertion: sub foo { (@_ 0)!; ... } (Or even have ! be a valid statement terminator, so (@_0)! would work.) Or you could have it doing something to variables: $a = $b! + $c; (But what?) Fun, eh? DWIM would be faculty yeah, but kinda useless unless when teaching (with) perl. What about assert (and having just written that, I notice that is exactly what Cozens suggested So it must be a good idea)? I like it. When do we get to use unicode operators? (inverse question and exclamation marks!!!) joking I'd personally like to see the plusminus, both as operator and as leading parameter mark ;-P if ($a ± $b) { ±c = 1; } meaning if $a is near to $b (almost the same being defined by $±) /joking -- H.Merijn BrandAmsterdam Perl Mongers (http://www.amsterdam.pm.org/) using perl-5.6.1, 5.7.1 623 on HP-UX 10.20 11.00, AIX 4.2, AIX 4.3, WinNT 4, Win2K pro WinCE 2.11 often with Tk800.022 /| DBD-Unify ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Re: Larry's Apocalypse 1
On Mon, 16 Apr 2001 10:29:41 PDT, Jeff Okamoto [EMAIL PROTECTED] wrote: The timescales of corporations like Sun are not the same as those commonly encountered in the open software arena. Ditto for HP. Which is more extreme (HP9000/L1000, HP-UX 11.00 + March 2001 patches): % /usr/contrib/bin/perl -v This is perl, version 4.0 $RCSfile: perl.c,v $$Revision: 4.0.1.8 $$Date: 1993/02/05 19:39:30 $ Patch level: 36 Copyright (c) 1989, 1990, 1991, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 4.0 source kit. % Jeff -- H.Merijn BrandAmsterdam Perl Mongers (http://www.amsterdam.pm.org/) using perl-5.6.1, 5.7.1 623 on HP-UX 10.20 11.00, AIX 4.2, AIX 4.3, WinNT 4, Win2K pro WinCE 2.11 often with Tk800.022 /| DBD-Unify ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Re: Perl culture, perl readabillity
On Thu, 29 Mar 2001 06:53:49 +0200, Otto Wyss [EMAIL PROTECTED] wrote: - Make readability your main objective. Readability is possibly the weakest part of Perl. - Keep your eyes on modularity. Modularity is by far the best concept where complexity could be hidden. - Don't forget usability. This is after all the point why people use Perl in the first place. It seems you are not interested in critics, so lets end this thread. Au contraire. The Perl community is *very* much interested in critiques. Seen the amount of response to you starting mail, this is overwhelming. One thing you probably `missed' in this discussion, is the way /you/ look at the language. Writing to the perl community, you're writing to people that got used to the syntax and now see the logic and usability of the 'line noise' you call unreadable. Every language has got it's pros and cons. Perl's first usage for most of us is probably it's glue function and versability. When you program/script in perl for a few weeks/month/years, you'll get used to it, and you're going to like it and probably even appreciate it. I started using perl in my company after reading an article in Unix-Info (a dutch magazine) that stated that perl would do well as an awk, grep and sed replacement, and that rose my curiosity. All those utils on unix have their own syntax, and you don't tell me that sed, awk and grep based scripts are readable/maintainable, esp. if there's a lot of programmers involved in setting up the lot. Perl being a fine replacement for it, has now 'conquered' this company. We almost never ever use shell scripts anymore, and there's not many left that know how to write awk and sed scripts. One syntax will do. In the beginning we wrote Perl scripts that called external SQL scripts, which now are converted to DBI/DBD. Perl's glue function saves time. A reason to postpone using DBD was that our database was not (yet) implemented by someone, so I had to write it myself. Now the world has access to yet another Database interface for perl through CPAN, yat another *BIG* advantage of the perl community: they /share/ the knowledge. If you want code that is readable by *all* your (even unexperienced) programmers and want to keep it maintainable, feel free to use python, but if you want to grow the program into more flexible use, extend it later to use yet another database, interface or character encoding, I think you should hop over the initial line noise and just *USE* perl. If you do, I'd like to hear your experience half a year from now. Have the appropriate amount of fun (in whatever language)! -- H.Merijn Brand Amsterdam Perl Mongers (http://www.amsterdam.pm.org/) using perl-5.005.03, 5.6.0, 5.6.1, 5.7.1 623 on HP-UX 10.20 11.00, AIX 4.2 AIX 4.3, WinNT 4, Win2K pro WinCE 2.11 often with Tk800.022 /| DBD-Unify ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Re: Perl culture, perl readabillity
On Fri, 23 Mar 2001 23:34:41 +0100, Otto Wyss [EMAIL PROTECTED] wrote: A study in Science (291 P.2165) found out that english speaking children has twice as much reading problems as italian speaking children of the same age. And about similar difference towards german and french. This could come from the fact that english has for 40 phonetics over 1100 kinds of writing while italian has for 25 phonetics only 33 kinds of writing (sorry I hope I've translated it into correct terms). Also 9 years old english children produce more reading error than 7 years old austrian children. It's also more *fun* to express your thoughts/feelings in English or Perl than in speech impediments like french, italian or python I *do* like things like my $sth = $dbh-prepare ("insert into $table values (@{[('?')x@f]})"; ;-) BTW. I realy like Schwietserdeutch, also more fun than German. -- H.Merijn Brand Amsterdam Perl Mongers (http://www.amsterdam.pm.org/) using perl-5.005.03, 5.6.0, 5.6.1, 5.7.1 623 on HP-UX 10.20 11.00, AIX 4.2 AIX 4.3, WinNT 4, Win2K pro WinCE 2.11 often with Tk800.022 /| DBD-Unify ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Re: RFC 288 (v2) First-Class CGI Support
On 27 Sep 2000 07:36:42 -, Perl6 RFC Librarian [EMAIL PROTECTED] wrote: This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE First-Class CGI Support Freezing within two days doesn't leave much space for comments and or objections does it? I'm not against making things easier in general, but I don't want perl to be Just Another Web Service. I've started an RFC on that when perl6 just started, but I saw discussions take a good direction, so I didn't post it. I think this one belongs in perl6-stdlib, certainly not in the perl6-core! I've lost my RFC draft, but it's title was: No JAWS -- H.Merijn Brand Amsterdam Perl Mongers (http://www.amsterdam.pm.org/) using perl-5.005.03, 5.6.0, 5.7.1 516 on HP-UX 10.20 11.00, AIX 4.2 4.3, DEC OSF/1 4.0 and WinNT 4.0 SP-6a, often with Tk800.022 and/or DBD-Unify ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Re: RFC 263 (v1) Add null() keyword and fundamental data type
On 20 Sep 2000 04:12:09 -, Perl6 RFC Librarian [EMAIL PROTECTED] wrote: =head1 TITLE Add null() keyword and fundamental data type =head1 MIGRATION None. New functionality. Not true. Apart from the discussion if undef is the same as null, in which I take no stance, Migration *is* an issue, cause if the null state is available, DBI/DBD users *will* expect that NULL values from the database are yielded as null values in perl and not as undef, the way it is implemented now. Same when inserting data. -- H.Merijn Brand Amsterdam Perl Mongers (http://www.amsterdam.pm.org/) using perl-5.005.03, 5.6.0, 5.7.1 516 on HP-UX 10.20 11.00, AIX 4.2 4.3, DEC OSF/1 4.0 and WinNT 4.0 SP-6a, often with Tk800.022 and/or DBD-Unify ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
FYI: Ruby 1.6.0 - An object-oriented language for quick and easy programming
I don't like OOP, you folks obviously do. Maybe docs/specs/... are interesting for you ... Have fun. From: [EMAIL PROTECTED] Newsgroups: fm.announce Subject: Ruby 1.6.0 - An object-oriented language for quick and easy programming Date: 19 Sep 2000 09:58:15 GMT application: Ruby 1.6.0 author: Yukihiro Matsumoto [EMAIL PROTECTED] license: GPL category: Development/Languages urgency: medium homepage: http://freshmeat.net/redir/homepage/915828413/ download: http://freshmeat.net/redir/download/915828413/ description: Ruby is a language for quick and easy programming. Similar in scope to Perl and Python, it has high-level data types, automatic memory management, dynamic typing, a module system, exceptions, and a rich standard library. What sets Ruby apart is a clean and consistent language design where everything is an object. Other distinguishing features are CLU-style iterators for loop abstraction, singleton classes/methods and lexical closures. Changes: A major release. Numerous bugfixes have been added. | http://freshmeat.net/news/2000/09/19/969357725.html -- H.Merijn Brand Amsterdam Perl Mongers (http://www.amsterdam.pm.org/) using perl-5.005.03, 5.6.0, 5.7.1 516 on HP-UX 10.20 11.00, AIX 4.2 4.3, DEC OSF/1 4.0 and WinNT 4.0 SP-6a, often with Tk800.022 and/or DBD-Unify ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Re: Pre-withdrawal notice for RFC184
On 19 Sep 2000 09:23:00 +0300, Ariel Scolnicov [EMAIL PROTECTED] wrote: I'm planning to withdraw RFC184 ("Perl should support an interactive mode"), due to lack of interest. There was little discussion of it, and the consensus seemed to be that Cperl -de0 is "good enough" for most purposes, and Cpsh for all others. While I do not agree, it does mean there is no call for this RFC. Unless I hear otherwise from people interested in the RFC, I shall be withdrawing it Friday. Though I realy like the idea, and probably would use it if it were available, my need for it was not compelling enough to participate in the discussion. -- H.Merijn Brand Amsterdam Perl Mongers (http://www.amsterdam.pm.org/) using perl-5.005.03, 5.6.0, 5.7.1 516 on HP-UX 10.20 11.00, AIX 4.2 4.3, DEC OSF/1 4.0 and WinNT 4.0 SP-6a, often with Tk800.022 and/or DBD-Unify ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Re: RFC 181 (v1) Formats out of core / New format syntax
On Thu, 14 Sep 2000 12:41:04 -0700, Glenn Linderman [EMAIL PROTECTED] wrote: 1) do perl6 formats need to have exactly the same scoping rules as perl5 formats in this regard? perl5 formats do NOT support lexicals, so this is not a very interesting question. (Re-)implementation of formats in perl6 should only consider perl5 syntax in perl526 as conversion issues. 2) is it a problem in practice? None of the format code I've written would work differently do to such a semantic change in the time of compilation, but I'm just one novice. I tend to think that code that uses formats is really pretty simple code... Bad thinking ;-) As an example, I've converted a 4GL/RPT script of over 1500 lines to a format using perl script of less than 150 lines being able of lots and lots more. OK, it has since than grown to about 400 lines being able of using headers, margings, footers and dynamic (nested) formats, but even than is wasn't the most simplistic code. if it were more complex, it would probably use sprintf rather than format... as simple code, it tends not to have many scopes and reused variable names. Using sprintf I could have reached the same results, but it would have been a lot harder to document and maintain. If it is, p52p6 could handle this situation by renaming the inner scope's $foo to avoid the conflict. Just look at Damian's proposal. Even the most heavily format using perl5 programmers (like me) will switch sooner or later. I'm looking at the consequences of changing *ALL* my format scripts to using the format part of Text::Autoformat right now. -- H.Merijn Brand Amsterdam Perl Mongers (http://www.amsterdam.pm.org/) using perl-5.005.03, 5.6.0, 5.7.1 516 on HP-UX 10.20 11.00, AIX 4.2 4.3, DEC OSF/1 4.0 and WinNT 4.0 SP-6a, often with Tk800.022 and/or DBD-Unify ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Re: RFC 181 (v1) Formats out of core / New format syntax
On Mon, 18 Sep 2000 08:43:05 -0600, Tom Christiansen [EMAIL PROTECTED] wrote: I do not think you two are arguing about the same thing. Certainly as Bart has shown, formats *can* see lexicals. Your illustration does not disprove that. It simply shows that lexical scoping is static scoping, not dynamic scoping, and that the binding of the variable to the format occurs as the format is declared, not when a write executed. This is exactly the same thing as occurs with closures in terms of declaration/creation versus their execution. All that matters is what's in scope when the format or closure template is brought into existence. It doesn't matter what happens later, which would be dynamic scoping, not static scoping. And this is surely not considered "not supporting lexicals". Badly chosen words/phrasing. My fault, core dumped. -- H.Merijn Brand Amsterdam Perl Mongers (http://www.amsterdam.pm.org/) using perl-5.005.03, 5.6.0, 5.7.1 516 on HP-UX 10.20 11.00, AIX 4.2 4.3, DEC OSF/1 4.0 and WinNT 4.0 SP-6a, often with Tk800.022 and/or DBD-Unify ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Re: RFC 216 (v1) POD should tolerate white space.
On 13 Sep 2000 07:18:15 -, Perl6 RFC Librarian [EMAIL PROTECTED] wrote: This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE POD should tolerate white space. I don't want any newlines needed at all, though I think I stand somewhat alone here. I don't like the emty space on my screen when I have to do things like (cut from see RFC 130): | |=head1 CHANGES | |=over 4 | |=item * | |Detailed implementation description | |=item * | |Add a new pragma 'varlock' for controlling the concurrency control. | |=back 4 | |=head1 DESCRIPTION | Where's the info? There's to much empty lines in there! One has to search for the info. It better be written as (be able to): |=head1 CHANGES | |=over 4 |=item * |Detailed implementation description | |=item * |Add a new pragma 'varlock' for controlling the concurrency control. | |=back 4 | |=head1 DESCRIPTION Or for the real compression freaks, no empty lines at all. -- H.Merijn Brand Amsterdam Perl Mongers (http://www.amsterdam.pm.org/) using perl5.005.03, 5.6.0 516 on HP-UX 10.20, HP-UX 11.00, AIX 4.2, AIX 4.3, DEC OSF/1 4.0 and WinNT 4.0 SP-6a, often with Tk800.022 and/or DBD-Unify ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Re: RFC 216 (v1) POD should tolerate white space.
On Wed, 13 Sep 2000 10:19:38 -0400, John Porter [EMAIL PROTECTED] wrote: H.Merijn Brand wrote: On 13 Sep 2000 07:18:15 -, Perl6 RFC Librarian [EMAIL PROTECTED] wrote: This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE POD should tolerate white space. I don't want any newlines needed at all, though I think I stand somewhat alone here. No newlines at all? That means you could write =head1 CHANGES =over 4 =item * Detailed implementation description =item * Add a new pragma 'varlock' for controlling the concurrency control. =back 4 =head1 DESCRIPTION for you example. Are we being clever again? Rephrase: "No empty lines". I know you understood, but ... (no, I won't say it) -- H.Merijn Brand Amsterdam Perl Mongers (http://www.amsterdam.pm.org/) using perl5.005.03, 5.6.0 516 on HP-UX 10.20, HP-UX 11.00, AIX 4.2, AIX 4.3, DEC OSF/1 4.0 and WinNT 4.0 SP-6a, often with Tk800.022 and/or DBD-Unify ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Re: RFC 216 (v1) POD should tolerate white space.
On Wed, 13 Sep 2000 10:58:51 -0400, John Porter [EMAIL PROTECTED] wrote: H.Merijn Brand wrote: Are we being clever again? Rephrase: "No empty lines". I know you understood, but ... (no, I won't say it) Frankly, I thought it was absurd when I first wrote it... but then I looked at again, and now I'm not so sure I dislike it! =head1 CHANGES =over 4 =item * Detailed implementation description =item * Add a new pragma 'varlock' for controlling the concurrency control. =back 4 =head1 DESCRIPTION Looks transparent to me! Cool. Now someone has to write podlators that do not depend on $/ = ""; But it looks nice for a short piece of proza, but will it still be workable when: =head1 CHANGES =over 4 =item * Detailed ... This is some text describing this point into such detail that it extends more than one line. this text would be dealt with as pre-formatted in older podlators. What would it be now? =item * Next piece of info etc. You get the drift. -- H.Merijn Brand Amsterdam Perl Mongers (http://www.amsterdam.pm.org/) using perl5.005.03, 5.6.0 516 on HP-UX 10.20, HP-UX 11.00, AIX 4.2, AIX 4.3, DEC OSF/1 4.0 and WinNT 4.0 SP-6a, often with Tk800.022 and/or DBD-Unify ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Re: sort syntax
On Thu, 07 Sep 2000 13:44:10 +0200, "H.Merijn Brand" [EMAIL PROTECTED] wrote: Having no time to write and/or maintain RFC's, I'll toss this up in the air and see what happens. [ snip ] my $Ycmp = sub { $a cmp $b }; @a = sort $Ycmp @x; but this is an unsupported syntax for sort. No it is :-) (I was lost in focus after fork, D'uh) Is it feasable/useful to extend sort's syntax in supporting sub ref's? Consider previous mail never sent -- H.Merijn Brand Amsterdam Perl Mongers (http://www.amsterdam.pm.org/) using perl5.005.03, 5.6.0 516 on HP-UX 10.20, HP-UX 11.00, AIX 4.2, AIX 4.3, DEC OSF/1 4.0 and WinNT 4.0 SP-6a, often with Tk800.022 and/or DBD-Unify ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Re: switch s/statement/operator/
On Tue, 29 Aug 2000 16:41:41 -0600, Tom Christiansen [EMAIL PROTECTED] wrote: I've actually even used this at run-time, such as: $value = { azure = 0xF0, chartreuse = 0x7FFF00, lavender= 0xE6E6FA, magenta = 0xFF00FF, turquoise = 0x40E0D0, }-{ lc $user_color_preference } || 0x00; I've once reported a similar code snippet to be wrongly parsed if the first key was numerical. This was fixed by Larry, but broke something in map {}. It was something like: sub err_str ($) # give explanation of error code { return { 1 = "Error 1", 2 = "Eroor in error", : 9 = "Possible error", }-{$_[0]} || "unknown error $_[0]"; } # err_str Here you do not much care about efficiency, an error is not soething you wanna have a lot. -- H.Merijn Brand Amsterdam Perl Mongers (http://www.amsterdam.pm.org/) using perl5.005.03, 5.6.0 516 on HP-UX 10.20, HP-UX 11.00, AIX 4.2, AIX 4.3, DEC OSF/1 4.0 and WinNT 4.0 SP-6a, often with Tk800.022 and/or DBD-Unify ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
sort syntax
Having no time to write and/or maintain RFC's, I'll toss this up in the air and see what happens. Abigail has posted sorting benchmarks for 5.6.0 to 5.7.0 on clp.misc, and I've extended that being curious to performance loss for anonymous blocks and named subroutines sub Xcmp { $a cmp $b } @a = sort @x; # Internal sorting @a = sort { $a cmp $b } @x; # sorting through block @a = sort Xcmp @x; # Sorting with named sub I've posted the results (stunning) to p5p and the Amsterdam.pm mailing lists for perl5.005.03, perl5.6.0 and perl5.7.0. Just out of curiopusity someone on amsterdam.pm asked: Which shows a *HUGE* difference between 5.005.03 and 5.6.0 for the diff between named subs (in 5.6.0 almost as fast as internal, sometimes even faster) and anonymous blocks (in 5.005.03 almost as slow as named subs). Whoosh, has 5.6.0 been some improvement in optimizing anonymous blocks! See, this is exactly the kind of thing I'm better off not knowing. Do you think I'll be able to stop myself from using anonymous blocks given how much faster they are? Nee, naturlijk. However I would argue that anonymous blocks are often a bad thing for code maintenance. I don't have Algorithm::Numerical::Shuffle handy - do you think I could convince you to run this benchmark again using subroutine references? That is: my $Ycmp = { $a cmp $b }; I'm just curious. She meant of course: my $Ycmp = sub { $a cmp $b }; @a = sort $Ycmp @x; but this is an unsupported syntax for sort. Is it feasable/useful to extend sort's syntax in supporting sub ref's? -- H.Merijn Brand Amsterdam Perl Mongers (http://www.amsterdam.pm.org/) using perl5.005.03, 5.6.0 516 on HP-UX 10.20, HP-UX 11.00, AIX 4.2, AIX 4.3, DEC OSF/1 4.0 and WinNT 4.0 SP-6a, often with Tk800.022 and/or DBD-Unify ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Re: RFC 111 (v3) Here Docs Terminators (Was Whitespace and Here Docs)
On 4 Sep 2000 21:32:00 -, Perl6 RFC Librarian [EMAIL PROTECTED] wrote: This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1TITLE Here Docs Terminators (Was Whitespace and Here Docs) [...] =head1 IMPLENTATION Intentional? It's either 'IMPLANTATION', which is something that has to be done with Damian's brain into the perl6-core, so every operator is DWIM, or 'IMPLEMENTATION', something you seem to be describing here. Just nitpicking. -- H.Merijn Brand Amsterdam Perl Mongers (http://www.amsterdam.pm.org/) using perl5.005.03, 5.6.0 516 on HP-UX 10.20, HP-UX 11.00, AIX 4.2, AIX 4.3, DEC OSF/1 4.0 and WinNT 4.0 SP-6a, often with Tk800.022 and/or DBD-Unify ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Re: RFC: Highlander Variables
On Wed, 2 Aug 2000 12:29:41 -0400, John Porter [EMAIL PROTECTED] wrote: H.Merijn Brand wrote: If I could, I would VETO! If I could, I would mandate this change. This is definitely in my Top 10 List of Perl 5 Suckinesses. So here we differ. That's what discussions are for. This would break about 90% of my scripts. Some large percentage of your scripts is going to break anyway. Hope not. I have grown a habit of pretty clean programming, using -w and use strict all the way. I use the same name for different type of variables to group them: Imho, this is A Bad Practice. Making it impossible would therefore be Good, existing-script-breakage not withstanding. I think you cannot say "A bad practice". It's a way of thinking. I'm glad Tom's with me on this, except that he refers to global variables that might be deemed anyway. We're not thinking like in C where every variable `should' be prefixed with it's type, like p_var for a pointer to a variable or t_var for defining the type for var. In perl I just LOVE the way $, @, % and unambiguously defines the type of the var. I just miss a prefix for formats (which will be dropped anyway) and IO. I'd hate to see my code being converted to (as suggested): $foo__array = qw(monday tuesday wednesday thursday friday saturday sunday); $foo = 4; print $foo__array[$foo], "\n"; YUK! -- H.Merijn Brand Amsterdam Perl Mongers (http://www.amsterdam.pm.org/) using perl5.005.03, 5.6.0 516 on HP-UX 10.20, HP-UX 11.00, AIX 4.2, AIX 4.3, DEC OSF/1 4.0 and WinNT 4.0 SP-6a, often with Tk800.022 and/or DBD-Unify ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/