From MichaelRWolf at att.net Tue Aug 1 23:51:43 2006 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Tue, 1 Aug 2006 23:51:43 -0700 Subject: SPUG: shebang line on Suse (oxymoronically) requires an option Message-ID: Recently, I tried moving the -w from the shebang line to a 'use warnings' statement, and found that something in the Suse shebang processing won't allow me to have a processor without a flag. What gives? Anyone else seen this? I get a message from the shell indicating an illegal processor, but it doesn't mention /usr/bin/perl in the error message. It doesn't matter what the option is, but I must have an option. My first guess was that if the shebang line contained qq{#!/usr/bin/perl\r} (having come from a DOS-ish system (my XP laptop) that the processing might be confused. I ran the script through dos2unix to make sure that it had qq{#!/usr/bin/perl\n}, but that didn't make a difference. Other ideas? -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From cmeyer at helvella.org Wed Aug 2 08:32:54 2006 From: cmeyer at helvella.org (Colin Meyer) Date: Wed, 2 Aug 2006 08:32:54 -0700 Subject: SPUG: shebang line on Suse (oxymoronically) requires an option In-Reply-To: <20060802065208.D98271783A@x6.develooper.com> References: <20060802065208.D98271783A@x6.develooper.com> Message-ID: <20060802153254.GC11833@funpox.helvella.org> On Tue, Aug 01, 2006 at 11:51:43PM -0700, Michael R. Wolf wrote: [...] > > It doesn't matter what the option is, but I must have an option. My first > guess was that if the shebang line contained qq{#!/usr/bin/perl\r} (having > come from a DOS-ish system (my XP laptop) that the processing might be > confused. I ran the script through dos2unix to make sure that it had > qq{#!/usr/bin/perl\n}, but that didn't make a difference. So, what is the symptom when you don't have an option on the #! line? I just tried a tiny test: #!/usr/bin/perl print "OK\n"; on suse 9.2 and 10.1. It executed as expected. I think that there is nothing special about suse linux's /usr/bin/perl. -Colin. From andrew at sweger.net Wed Aug 2 08:45:36 2006 From: andrew at sweger.net (Andrew Sweger) Date: Wed, 2 Aug 2006 08:45:36 -0700 (PDT) Subject: SPUG: shebang line on Suse (oxymoronically) requires an option In-Reply-To: <20060802065206.116501787A@x6.develooper.com> Message-ID: On Tue, 1 Aug 2006, Michael R. Wolf wrote: > Recently, I tried moving the -w from the shebang line to a 'use warnings' > statement, and found that something in the Suse shebang processing won't > allow me to have a processor without a flag. What gives? Anyone else seen > this? I get a message from the shell indicating an illegal processor, but > it doesn't mention /usr/bin/perl in the error message. > > It doesn't matter what the option is, but I must have an option. My first > guess was that if the shebang line contained qq{#!/usr/bin/perl\r} (having > come from a DOS-ish system (my XP laptop) that the processing might be > confused. I ran the script through dos2unix to make sure that it had > qq{#!/usr/bin/perl\n}, but that didn't make a difference. > > Other ideas? Check for /perl\s+$/. That might be choking it. -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. From cmeyer at helvella.org Wed Aug 2 09:09:16 2006 From: cmeyer at helvella.org (Colin Meyer) Date: Wed, 2 Aug 2006 09:09:16 -0700 Subject: SPUG: shebang line on Suse (oxymoronically) requires an option In-Reply-To: References: <20060802065206.116501787A@x6.develooper.com> Message-ID: <20060802160916.GA23946@funpox.helvella.org> On Wed, Aug 02, 2006 at 08:45:36AM -0700, Andrew Sweger wrote: [...] > Check for /perl\s+$/. That might be choking it. Adding whitespace to the end of the #! line in my little test had no effect (tested on suse and centos). -Colin. From jobs-noreply at seattleperl.org Wed Aug 2 14:40:59 2006 From: jobs-noreply at seattleperl.org (SPUG Jobs) Date: Wed, 2 Aug 2006 14:40:59 -0700 (PDT) Subject: SPUG: JOB: Systems Tech - API - Issaquah Message-ID: Company: Applied Precision Industry: Semiconductor / Life Sciences Location: Issaquah Type: Permanent Contact: Dakotta at api.com Corporate site: www.api.com Job Title: Computer Information Systems Tech - Life Sciences Group Department: Life Sciences Engineering Reports To: Sr. Manager, Life Sciences Product Engineering Position Summary Performs development, testing and maintenance of operating systems and the hardware they run on for Life Science products. Determines hardware and software requirements as well as supports the installation and maintenance of those systems. Works with product engineers and vendors to provide best solutions for requirements, including evaluation, duplication, and end-of-life scheduling. Documents and trains resulting solutions. Responsibilities * Work with CIS group and vendors to specify computer systems for products. * Set up, configure, and test computer systems. * Document installation and customization procedures as well as train and support system integration personnel. * Unix and Windows script programming with BASH, PERL, WSH or similar languages. * Linux and Windows installation and duplication. * Resourceful and timely investigation of hardware/software problem reports. Minimum Qualifications * 2 year degree in Information Technology or Computer Science plus 2+ years of computer information systems experience, or equivalent. * A minimum 2 years computer related experience in a hardware/software environment, preferably in an instrumentation systems environment. * Understanding of Red Hat Enterprise Linux Installation customization, development and duplication. * Understanding of Microsoft Windows Installation customization, development and duplication. * In-depth knowledge of hardware and software interaction. Dakotta Alex | Corporate Recruiter | Applied Precision Voice 425.657.1568 | Fax 425.657.1489 | web: www.appliedprecision.com Applied Precision LLC We're Hiring! Check out our current openings: http://www.api.com/careers/jobs.html From benb at speakeasy.net Wed Aug 2 09:42:57 2006 From: benb at speakeasy.net (BenRifkah Bergsten-Buret) Date: Wed, 02 Aug 2006 09:42:57 -0700 Subject: SPUG: shebang line on Suse (oxymoronically) requires an option In-Reply-To: <20060802065215.EBCD91786F@x6.develooper.com> References: <20060802065215.EBCD91786F@x6.develooper.com> Message-ID: <44D0D611.3020701@speakeasy.net> Michael R. Wolf wrote: > I get a message from the shell indicating an illegal processor, but > it doesn't mention /usr/bin/perl in the error message. > What shell is giving you the problem? Can you provide the exact text of the error message? Is it possible that your shebang line was changed to "#!/usr/bin/per1" (note the numeral one at the end of the line). When I tried this under bash on Debian I got the message "-bash: ./shebang.pl: /usr/bin/per1: bad interpreter: No such file or directory". -- Ben From joshua.mcadams at gmail.com Thu Aug 3 10:49:52 2006 From: joshua.mcadams at gmail.com (Joshua McAdams) Date: Thu, 3 Aug 2006 13:49:52 -0400 Subject: SPUG: shebang line on Suse (oxymoronically) requires an option In-Reply-To: <44D0D611.3020701@speakeasy.net> References: <20060802065215.EBCD91786F@x6.develooper.com> <44D0D611.3020701@speakeasy.net> Message-ID: <49d805d70608031049r54a5c53el76bde9a4722f9877@mail.gmail.com> > > I get a message from the shell indicating an illegal processor, but > > it doesn't mention /usr/bin/perl in the error message. > > > What shell is giving you the problem? Can you provide the exact text of > the error message? Is it possible that your shebang line was changed to > "#!/usr/bin/per1" (note the numeral one at the end of the line). When I > tried this under bash on Debian I got the message "-bash: ./shebang.pl: > /usr/bin/per1: bad interpreter: No such file or directory". I haven't been following this thread too closely, so I very well may be repeating something that has already been said, but I occasionally had issues with the type of newline character(s) being used in the file having a negative effect on the shebang line. Possibly try running dos2unix on the file to ensure that you have the correct line terminators. From thanew at gmail.com Thu Aug 10 10:46:27 2006 From: thanew at gmail.com (Thane Williams) Date: Thu, 10 Aug 2006 10:46:27 -0700 Subject: SPUG: Perl stdin backspace In-Reply-To: References: Message-ID: Hi there. Whenever I write a perl script in the Linux environment, if the user tries to backspace while entering standard input, it seems like none of the backspace keys work. Delete, backspace, and ctrl-H all fail. I've tried googling for a solution to this, but I'm at a loss. Can anyone tell me how to arrange things so that users can backspace while Perl's taking standard input? Thank you,Thane -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20060810/0f68af64/attachment.html From benb at speakeasy.net Thu Aug 10 12:50:06 2006 From: benb at speakeasy.net (BenRifkah Bergsten-Buret) Date: Thu, 10 Aug 2006 12:50:06 -0700 Subject: SPUG: Perl stdin backspace In-Reply-To: References: Message-ID: <44DB8DEE.2040909@speakeasy.net> Thane Williams wrote: > Hi there. Whenever I write a perl script in the Linux environment, if > the user tries to backspace while entering standard input, it seems > like none of the backspace keys work. Delete, backspace, and ctrl-H > all fail. I've tried googling for a solution to this, but I'm at a > loss. Can anyone tell me how to arrange things so that users can > backspace while Perl's taking standard input? Take a look at the Term CPAN modules: Term::ReadLine, Term::ReadKey. Terminal key mapping can be a hassle. Make sure that the keys you want to use when perl is accepting input are working in other applications. -- Ben From MichaelRWolf at att.net Thu Aug 10 21:42:18 2006 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Thu, 10 Aug 2006 21:42:18 -0700 Subject: SPUG: Perl stdin backspace In-Reply-To: Message-ID: You state that ?none of the backspace keys work? For what definition of ?work?? Unix/Linux intercepts some keys for its own purposes. Check your ?stty ?a? output to see if that?s the case. Ctl-C, Ctl-D, Ctl-Z are often caught at this level, and therefore will not be passed as characters. Therefore, you will not find them as characters in your STDIN handle. If your key is generating a destructive backspace, and thereby preventing the previous character from being available on STDIN, it?s working as expected. If this is the case, you?ll need to realign your description ? the backspace key does, in fact, work (for this definition of ?work?). If you don?t like this definition of ?work?, perhaps you could redefine the erase key via ?stty erase undef?. I?m not sure how to do that from within Perl, but if you try it from the command line and it works (for your definition of work), you could investigate how to accomplish it from the inside. -- Michael R. Wolf ??? All mammals learn by playing! ??????? MichaelRWolf at att.net ________________________________________ From: spug-list-bounces+michaelrwolf=att.net at pm.org [mailto:spug-list-bounces+michaelrwolf=att.net at pm.org] On Behalf Of Thane Williams Sent: Thursday, August 10, 2006 10:46 AM To: spug-list at pm.org Subject: Re: SPUG: Perl stdin backspace Hi there. Whenever I write a perl script in the Linux environment, if the user tries to backspace while entering standard input, it seems like none of the backspace keys work. Delete, backspace, and ctrl-H all fail. I've tried googling for a solution to this, but I'm at a loss. Can anyone tell me how to arrange things so that users can backspace while Perl's taking standard input? Thank you, Thane From thanew at gmail.com Thu Aug 10 21:50:44 2006 From: thanew at gmail.com (Thane Williams) Date: Thu, 10 Aug 2006 21:50:44 -0700 Subject: SPUG: Perl stdin backspace In-Reply-To: References: Message-ID: Thanks for the replies, everyone. JD suggested a simple solution that seems to work very well. See below. On 8/10/06, JD Brennan wrote: > > Try > > system("stty erase ^H"); > > Not sure if that'll work. You may need to run the stty > command before running your Perl script. xterm > defaults to sending ^H for the Backspace key, but > the Linux terminal driver defaults to wanting ^? (Delete) > for the erase character. Do "stty -all" and see what > the erase character is set to. > > JD > > On 8/10/06, Thane Williams wrote: > > Hi there. Whenever I write a perl script in the Linux environment, if > the > > user tries to backspace while entering standard input, it seems like > none of > > the backspace keys work. Delete, backspace, and ctrl-H all fail. I've > tried > > googling for a solution to this, but I'm at a loss. Can anyone tell me > how > > to arrange things so that users can backspace while Perl's taking > standard > > input? > > > > > > Thank you, > > Thane > > > > > > _____________________________________________________________ > > Seattle Perl Users Group Mailing List > > POST TO: spug-list at pm.org > > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > > MEETINGS: 3rd Tuesdays > > WEB PAGE: http://seattleperl.org/ > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20060810/321680f2/attachment.html From MichaelRWolf at att.net Thu Aug 10 22:13:38 2006 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Thu, 10 Aug 2006 22:13:38 -0700 Subject: SPUG: sorting hierarchical section numbers Message-ID: <20060811051327.DB78CBC48@gandalf.addnorya.net> I want to sort strings that represent outline numbers. 1 1.1 1.2 1.3 1.3.1 1.3.2 1.3.2.1 1.2 I can't find a module. Could you point me in the correct direction so that I can read the fine manual? I can't seem to find the right search term; these are too general 'hierarchy', 'outline', 'number', 'sort'. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From john.spug at subaykan.com Thu Aug 10 23:16:49 2006 From: john.spug at subaykan.com (John Subaykan) Date: Fri, 11 Aug 2006 01:16:49 -0500 Subject: SPUG: sorting hierarchical section numbers Message-ID: Can't you just do something like this? my @array2 = sort { outlinish() } @array1; sub outlinish { my @one = split /\./, $a; my @two = split /\./, $b; my $max = @one > @two ? @one : @two; for my $i (0 .. $max-1) { if (my $res = ($one[$i] || 0) <=> ($two[$i] || 0)) { return $res; } } } # and maybe add some schmantzy memoization technique for efficiency - John (waiting for Yitzchak or Colin to tell my why this is bad!) Michael R. Wolf wrote: > I want to sort strings that represent outline numbers. > > 1 > 1.1 > 1.2 > 1.3 > 1.3.1 > 1.3.2 > 1.3.2.1 > 1.2 From krahnj at telus.net Thu Aug 10 23:59:07 2006 From: krahnj at telus.net (John W. Krahn) Date: Thu, 10 Aug 2006 23:59:07 -0700 Subject: SPUG: sorting hierarchical section numbers In-Reply-To: <20060811051327.DB78CBC48@gandalf.addnorya.net> References: <20060811051327.DB78CBC48@gandalf.addnorya.net> Message-ID: <44DC2ABB.7020405@telus.net> Michael R. Wolf wrote: > I want to sort strings that represent outline numbers. > > 1 > 1.1 > 1.2 > 1.3 > 1.3.1 > 1.3.2 > 1.3.2.1 > 1.2 > > I can't find a module. Could you point me in the correct direction so that > I can read the fine manual? I can't seem to find the right search term; > these are too general 'hierarchy', 'outline', 'number', 'sort'. $ perl -le' my @numbers = qw( 1 1.1 1.2 1.3 1.3.1 1.3.2 1.3.2.1 1.2 ); print for map $_->[ 0 ], sort { $a->[ 1 ] cmp $b->[ 1 ] } map [ $_, pack q[C*], split /\./ ], @numbers; ' 1 1.1 1.2 1.2 1.3 1.3.1 1.3.2 1.3.2.1 This should work as long as each individual number does not exceed 255, for larger numbers use 'n*' and for really large numbers use 'N*' for the pack format. John -- use Perl; program fulfillment From charles.e.derykus at boeing.com Fri Aug 11 11:52:21 2006 From: charles.e.derykus at boeing.com (DeRykus, Charles E) Date: Fri, 11 Aug 2006 11:52:21 -0700 Subject: SPUG: sorting hierarchical section numbers In-Reply-To: <44DC2ABB.7020405@telus.net> Message-ID: > Michael R. Wolf wrote: > I want to sort strings that represent outline numbers. > > 1 > 1.1 > 1.2 > 1.3 > 1.3.1 > 1.3.2 > 1.3.2.1 > 1.2 > > I can't find a module. Could you point me in the correct direction so > that I can read the fine manual? I can't seem to find the right > search term; these are too general 'hierarchy', 'outline', 'number', 'sort'. JWK>> $ perl -le' JWK>> my @numbers = qw( JWK>> 1 JWK>> 1.1 JWK>> 1.2 JWK>> 1.3 JWK>> 1.3.1 JWK>> 1.3.2 JWK>> 1.3.2.1 JWK>> 1.2 JWK>> ); JWK>>print for JWK>> map $_->[ 0 ], JWK>> sort { $a->[ 1 ] cmp $b->[ 1 ] } JWK>> map [ $_, pack q[C*], split /\./ ], JWK>> @numbers; JWK>> ... JWK>>This should work as long as each individual number does not exceed 255, for JWK>>larger numbers use 'n*' and for really large numbers use 'N*' for the pack format. CPAN's Sort::Fields is another possibility although probably not as efficient: use Sort::Fields; my @sorted = fieldsort '\.', [1..99], @numbers; -- Charles DeRykus From tallpeak at hotmail.com Fri Aug 11 12:53:25 2006 From: tallpeak at hotmail.com (Aaron West) Date: Fri, 11 Aug 2006 12:53:25 -0700 Subject: SPUG: sorting hierarchical section numbers In-Reply-To: <44DC2ABB.7020405@telus.net> Message-ID: Cute. But I don't think characters are a good way to pack the outline numbers (though I suppose an outline number of 256 would be rare). Try N* instead of C*. (network-byte-order ints) Characters: $ perl -le' my @numbers = qw( 255.1 256.1 ); print for map $_->[ 0 ], sort { $a->[ 1 ] cmp $b->[ 1 ] } map [ $_, pack q[C*], split /\./ ], @numbers; ' 256.1 255.1 Network byte order ints: $ perl -le' my @numbers = qw( 255.1 256.1 ); print for map $_->[ 0 ], sort { $a->[ 1 ] cmp $b->[ 1 ] } map [ $_, pack q[N*], split /\./ ], @numbers; ' 255.1 256.1 -----Original Message----- From: spug-list-bounces+tallpeak=hotmail.com at pm.org [mailto:spug-list-bounces+tallpeak=hotmail.com at pm.org] On Behalf Of John W. Krahn Sent: Thursday, August 10, 2006 11:59 PM To: SPUG Subject: Re: SPUG: sorting hierarchical section numbers Michael R. Wolf wrote: > I want to sort strings that represent outline numbers. > > 1 > 1.1 > 1.2 > 1.3 > 1.3.1 > 1.3.2 > 1.3.2.1 > 1.2 > > I can't find a module. Could you point me in the correct direction so that > I can read the fine manual? I can't seem to find the right search term; > these are too general 'hierarchy', 'outline', 'number', 'sort'. $ perl -le' my @numbers = qw( 1 1.1 1.2 1.3 1.3.1 1.3.2 1.3.2.1 1.2 ); print for map $_->[ 0 ], sort { $a->[ 1 ] cmp $b->[ 1 ] } map [ $_, pack q[C*], split /\./ ], @numbers; ' 1 1.1 1.2 1.2 1.3 1.3.1 1.3.2 1.3.2.1 This should work as long as each individual number does not exceed 255, for larger numbers use 'n*' and for really large numbers use 'N*' for the pack format. John -- use Perl; program fulfillment _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: spug-list at pm.org SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list MEETINGS: 3rd Tuesdays WEB PAGE: http://seattleperl.org/ -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.10.9/417 - Release Date: 8/11/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.10.9/417 - Release Date: 8/11/2006 From tallpeak at hotmail.com Fri Aug 11 12:58:54 2006 From: tallpeak at hotmail.com (Aaron West) Date: Fri, 11 Aug 2006 12:58:54 -0700 Subject: SPUG: sorting hierarchical section numbers In-Reply-To: <44DC2ABB.7020405@telus.net> Message-ID: Sorry, apparently I didn't read your last line. Another way, but I think yours is better (since there might possibly be some non-outline-number strings in the input array and this would destroy them). $ perl -le' my @numbers = qw( 255.1 256.1 ); print for map { join ".", (unpack q[N*], $_) } sort map { pack q[N*], split /\./ } @numbers; ' 255.1 256.1 -----Original Message----- From: spug-list-bounces+tallpeak=hotmail.com at pm.org [mailto:spug-list-bounces+tallpeak=hotmail.com at pm.org] On Behalf Of John W. Krahn Sent: Thursday, August 10, 2006 11:59 PM To: SPUG Subject: Re: SPUG: sorting hierarchical section numbers Michael R. Wolf wrote: > I want to sort strings that represent outline numbers. > > 1 > 1.1 > 1.2 > 1.3 > 1.3.1 > 1.3.2 > 1.3.2.1 > 1.2 > > I can't find a module. Could you point me in the correct direction so that > I can read the fine manual? I can't seem to find the right search term; > these are too general 'hierarchy', 'outline', 'number', 'sort'. $ perl -le' my @numbers = qw( 1 1.1 1.2 1.3 1.3.1 1.3.2 1.3.2.1 1.2 ); print for map $_->[ 0 ], sort { $a->[ 1 ] cmp $b->[ 1 ] } map [ $_, pack q[C*], split /\./ ], @numbers; ' 1 1.1 1.2 1.2 1.3 1.3.1 1.3.2 1.3.2.1 This should work as long as each individual number does not exceed 255, for larger numbers use 'n*' and for really large numbers use 'N*' for the pack format. John -- use Perl; program fulfillment _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: spug-list at pm.org SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list MEETINGS: 3rd Tuesdays WEB PAGE: http://seattleperl.org/ -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.10.9/417 - Release Date: 8/11/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.10.9/417 - Release Date: 8/11/2006 From tallpeak at hotmail.com Fri Aug 11 14:03:12 2006 From: tallpeak at hotmail.com (Aaron West) Date: Fri, 11 Aug 2006 14:03:12 -0700 Subject: SPUG: sorting hierarchical section numbers In-Reply-To: Message-ID: If they can include letters, perhaps sprintf is better (won't work with Roman numerals, though..) $ perl -le 'my @numbers = qw( 1.c 1.a 12.g 12.a 3.z 3.1 3.b ); print for map $_->[0], sort { $a->[1] cmp $b->[1] } map [ $_ , join "", map { sprintf"%6s", $_ } split /\./ ], @numbers; ' 1.a 1.c 3.1 3.b 3.z 12.a 12.g -----Original Message----- From: spug-list-bounces+tallpeak=hotmail.com at pm.org [mailto:spug-list-bounces+tallpeak=hotmail.com at pm.org] On Behalf Of Aaron West Sent: Friday, August 11, 2006 12:59 PM To: 'John W. Krahn'; 'SPUG' Subject: Re: SPUG: sorting hierarchical section numbers Sorry, apparently I didn't read your last line. Another way, but I think yours is better (since there might possibly be some non-outline-number strings in the input array and this would destroy them). $ perl -le' my @numbers = qw( 255.1 256.1 ); print for map { join ".", (unpack q[N*], $_) } sort map { pack q[N*], split /\./ } @numbers; ' 255.1 256.1 -----Original Message----- From: spug-list-bounces+tallpeak=hotmail.com at pm.org [mailto:spug-list-bounces+tallpeak=hotmail.com at pm.org] On Behalf Of John W. Krahn Sent: Thursday, August 10, 2006 11:59 PM To: SPUG Subject: Re: SPUG: sorting hierarchical section numbers Michael R. Wolf wrote: > I want to sort strings that represent outline numbers. > > 1 > 1.1 > 1.2 > 1.3 > 1.3.1 > 1.3.2 > 1.3.2.1 > 1.2 > > I can't find a module. Could you point me in the correct direction so that > I can read the fine manual? I can't seem to find the right search term; > these are too general 'hierarchy', 'outline', 'number', 'sort'. $ perl -le' my @numbers = qw( 1 1.1 1.2 1.3 1.3.1 1.3.2 1.3.2.1 1.2 ); print for map $_->[ 0 ], sort { $a->[ 1 ] cmp $b->[ 1 ] } map [ $_, pack q[C*], split /\./ ], @numbers; ' 1 1.1 1.2 1.2 1.3 1.3.1 1.3.2 1.3.2.1 This should work as long as each individual number does not exceed 255, for larger numbers use 'n*' and for really large numbers use 'N*' for the pack format. John -- use Perl; program fulfillment _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: spug-list at pm.org SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list MEETINGS: 3rd Tuesdays WEB PAGE: http://seattleperl.org/ -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.10.9/417 - Release Date: 8/11/2006 From iheffner at gmail.com Fri Aug 11 16:09:14 2006 From: iheffner at gmail.com (Ivan Heffner) Date: Fri, 11 Aug 2006 16:09:14 -0700 Subject: SPUG: sorting hierarchical section numbers In-Reply-To: References: Message-ID: You could gain some efficiency by splitting before you pass you elements of @array1 into your sort function (Hooray, Schwatzian Transforms!). $ benchmark -d index_sort.pm -------------------------------------------------- outlinish_transform -------------------------------------------------- 1 1.1 1.2 1.2.1 1.2.2.1 1.3 1.3.1 1.3.2 1.3.2.1 1.4 -------------------------------------------------- straight_outlinish -------------------------------------------------- 1 1.1 1.2 1.2.1 1.2.2.1 1.3 1.3.1 1.3.2 1.3.2.1 1.4 $ benchmark index_sort.pm 50000 Benchmark: timing 50000 iterations of outlinish_transform, straight_outlinish... outlinish_transform: 6 wallclock secs ( 5.95 usr + 0.00 sys = 5.95 CPU) @ 8403.36/s (n=50000) straight_outlinish: 11 wallclock secs (10.17 usr + 0.00 sys = 10.17 CPU) @ 4916.42/s (n=50000) ( get the benchmark code here: http://www.whitepages.com/perl ) I hope the list keeps my attached .pm file. If not, I'll post it separately. -- Ivan Heffner Sr. Software Engineer DAS Lead WhitePages.com -------------- next part -------------- A non-text attachment was scrubbed... Name: index_sort.pm Type: application/octet-stream Size: 842 bytes Desc: not available Url : http://mail.pm.org/pipermail/spug-list/attachments/20060811/577438f3/attachment.obj From tallpeak at hotmail.com Fri Aug 11 16:09:53 2006 From: tallpeak at hotmail.com (Aaron West) Date: Fri, 11 Aug 2006 16:09:53 -0700 Subject: SPUG: sorting hierarchical section numbers In-Reply-To: Message-ID: Not quite; the sort is not numeric, and not right-justified, and the field-offset array-ref must be 0-based. $ perl -le 'use Sort::Fields; my @numbers = qw(3 5 12 1 13.1 12.2 1.3 1.2 1.4 1.1a 1.1 1.1z 1.1y) ; my @sorted = fieldsort "\.", [0..99], @numbers; print for @sorted; ' 1 1.1 1.1a 1.1y 1.1z 1.2 1.3 1.4 12 12.2 13.1 3 5 -----Original Message----- From: spug-list-bounces+tallpeak=hotmail.com at pm.org [mailto:spug-list-bounces+tallpeak=hotmail.com at pm.org] On Behalf Of DeRykus, Charles E Sent: Friday, August 11, 2006 11:52 AM To: SPUG Subject: Re: SPUG: sorting hierarchical section numbers > Michael R. Wolf wrote: > I want to sort strings that represent outline numbers. > > 1 > 1.1 > 1.2 > 1.3 > 1.3.1 > 1.3.2 > 1.3.2.1 > 1.2 > > I can't find a module. Could you point me in the correct direction so > that I can read the fine manual? I can't seem to find the right > search term; these are too general 'hierarchy', 'outline', 'number', 'sort'. JWK>> $ perl -le' JWK>> my @numbers = qw( JWK>> 1 JWK>> 1.1 JWK>> 1.2 JWK>> 1.3 JWK>> 1.3.1 JWK>> 1.3.2 JWK>> 1.3.2.1 JWK>> 1.2 JWK>> ); JWK>>print for JWK>> map $_->[ 0 ], JWK>> sort { $a->[ 1 ] cmp $b->[ 1 ] } JWK>> map [ $_, pack q[C*], split /\./ ], JWK>> @numbers; JWK>> ... JWK>>This should work as long as each individual number does not exceed 255, for JWK>>larger numbers use 'n*' and for really large numbers use 'N*' for the pack format. CPAN's Sort::Fields is another possibility although probably not as efficient: use Sort::Fields; my @sorted = fieldsort '\.', [1..99], @numbers; -- Charles DeRykus _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: spug-list at pm.org SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list MEETINGS: 3rd Tuesdays WEB PAGE: http://seattleperl.org/ -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.10.9/417 - Release Date: 8/11/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.10.9/417 - Release Date: 8/11/2006 From tallpeak at hotmail.com Fri Aug 11 16:32:31 2006 From: tallpeak at hotmail.com (Aaron West) Date: Fri, 11 Aug 2006 16:32:31 -0700 Subject: SPUG: sorting hierarchical section numbers Message-ID: Sorry, I'm wrong; the sort-field numbers are 1-based, and numeric sort is supported with n at the end of each column-number. It seems I needed double-backslash when the script is entered from the shell as a string like this. $ perl -le 'use Sort::Fields; my @numbers = qw(3 5 12 1 13.1 12.2 1.3 1.1 1.5 1.9 1.12 1.22 1.4) ; my @sorted = fieldsort "\\.", [qw(1n 2n 3n 4n 5n 6n 7n 8n 9n)], @numbers; print for @sorted; ' 1 1.1 1.3 1.4 1.5 1.9 1.12 1.22 3 5 12 12.2 13.1 -----Original Message----- From: Aaron West [mailto:tallpeak at hotmail.com] Sent: Friday, August 11, 2006 4:10 PM To: 'DeRykus, Charles E'; 'SPUG' Subject: RE: SPUG: sorting hierarchical section numbers Not quite; the sort is not numeric, and not right-justified, and the field-offset array-ref must be 0-based. $ perl -le 'use Sort::Fields; my @numbers = qw(3 5 12 1 13.1 12.2 1.3 1.2 1.4 1.1a 1.1 1.1z 1.1y) ; my @sorted = fieldsort "\.", [0..99], @numbers; print for @sorted; ' 1 1.1 1.1a 1.1y 1.1z 1.2 1.3 1.4 12 12.2 13.1 3 5 -----Original Message----- From: spug-list-bounces+tallpeak=hotmail.com at pm.org [mailto:spug-list-bounces+tallpeak=hotmail.com at pm.org] On Behalf Of DeRykus, Charles E Sent: Friday, August 11, 2006 11:52 AM To: SPUG Subject: Re: SPUG: sorting hierarchical section numbers > Michael R. Wolf wrote: > I want to sort strings that represent outline numbers. > > 1 > 1.1 > 1.2 > 1.3 > 1.3.1 > 1.3.2 > 1.3.2.1 > 1.2 > > I can't find a module. Could you point me in the correct direction so > that I can read the fine manual? I can't seem to find the right > search term; these are too general 'hierarchy', 'outline', 'number', 'sort'. JWK>> $ perl -le' JWK>> my @numbers = qw( JWK>> 1 JWK>> 1.1 JWK>> 1.2 JWK>> 1.3 JWK>> 1.3.1 JWK>> 1.3.2 JWK>> 1.3.2.1 JWK>> 1.2 JWK>> ); JWK>>print for JWK>> map $_->[ 0 ], JWK>> sort { $a->[ 1 ] cmp $b->[ 1 ] } JWK>> map [ $_, pack q[C*], split /\./ ], JWK>> @numbers; JWK>> ... JWK>>This should work as long as each individual number does not exceed 255, for JWK>>larger numbers use 'n*' and for really large numbers use 'N*' for the pack format. CPAN's Sort::Fields is another possibility although probably not as efficient: use Sort::Fields; my @sorted = fieldsort '\.', [1..99], @numbers; -- Charles DeRykus _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: spug-list at pm.org SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list MEETINGS: 3rd Tuesdays WEB PAGE: http://seattleperl.org/ -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.10.9/417 - Release Date: 8/11/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.10.9/417 - Release Date: 8/11/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.10.9/417 - Release Date: 8/11/2006 From jerry.gay at gmail.com Sat Aug 12 10:52:03 2006 From: jerry.gay at gmail.com (jerry gay) Date: Sat, 12 Aug 2006 10:52:03 -0700 Subject: SPUG: Meeting Announcement -- Patrick Michaud & Miles Crawford -- 15 August 2006 Message-ID: <1d9a3f400608121052k147f4829o1e1a59403fc1de98@mail.gmail.com> August 2006 Seattle Perl Users Group (SPUG) Meeting =================================================== Title: Introducing the Solstice Framework Speaker: Patrick Michaud and Miles Crawford Meeting Date: Tuesday, 15 August 2006 Meeting Time: 6:30 - 8:30 p.m. Location: Whitepages.com offices, downtown Seattle Cost: Admission is free and open to the public Info: http://seattleperl.org/ =================================================== Please join us Tuesday evening on 15 August 2006 at the (otherwise) regular monthly meeting of the Seattle Perl Users Group. Due to last minute scheduling conflicts, Mark Jason Dominus is unable to join us this month. Instead, we are very happy to have Miles Crawford and Patrick Michaud as our guests to talk about their web framework, Solstice. Thank you to our hosts at Whitepages.com for giving us a great place to hold our meetings and presentations, to the SPUG-Workers list for making speaker arrangements, to all the SPUG members that show up at meetings or participate on the list to make the group worthwhile in the first place, and all the JAPHs out there for just being. See below for more information on... - Speaker Background - Presentation Description - Meeting Location Speaker Background ================== Miles Crawford & Patrick Michaud -------------------------------- Software Developers for Catalyst Research and Development, Office of Learning Technologies at the University of Washington, Miles and Patrick developed a web framework named after everyone's favorite coffee shop on the Ave. They gave a version of this presentation at YAPC::NA this year in Chicago, and thought it was worth all the travel hassles it took to get them there. Presentation Description ======================== Introducing the Solstice Framework ---------------------------------- The Solstice framework is a new MVC-oriented web development framework for mod_perl. Stressing scalability, embedability of application components, and a state-machine driven navigation model, Solstice provides some new approaches to creating Perl web applications. Developed by a group at the University of Washington, this system has allowed our four developers to create and maintain 8 campus-wide applications in two years. We intend to introduce the strengths and features of Solstice as well as do a quick demo of the development process. Meeting Location ================ Whitepages.com is located on the 16th floor of the Rainier Square Tower (1301 5th Avenue, Seattle) which is across from the 5th Avenue Theater. See the directions[1] for a quick primer on how to reach us from variouslocations across Puget Sound. There are plenty of locations to park in the area, including on the street. If you're looking for off-street parking, you can park in the Rainier Square garage which has an entrance on Union St. After 6PM, the building management restricts access to most floors. Our host is trying to take care of this, but if unsuccessful, they will station someone on the 1st floor near the elevator bank and 5th Avenue entrance to let people in. Worst case scenario, give our host a call on his cell phone[2] and he'll run down to let you in. Our hosts are providing a generous assortment of free sodas, fruit drinks, teas, and coffee, and also have some snacks. You definitely won't dehydrate here. We look forward to seeing you! [1] - http://www.whitepagesinc.com/locations/ [2] - (206) 354-7789 _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: spug-list at pm.org SUBSCRIPTION: http://mail.pm.org/mailman/lis tinfo/spug-list MEETINGS: 3rd Tuesdays WEB PAGE: http://seattleperl.org/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20060812/d942ca60/attachment-0001.html From tim at consultix-inc.com Sun Aug 13 19:04:38 2006 From: tim at consultix-inc.com (Tim Maher) Date: Sun, 13 Aug 2006 19:04:38 -0700 Subject: SPUG: Any FrameMaker experts out there? Message-ID: <20060814020438.GA20774@jumpy.consultix-inc.com> Sorry for an off-topic post, but my typesetter is experiencing a last- minute problem with my nearly published book, and I'd like to ask a question of somebody who's familiar with 'editing Index Tags in Frame" (or FrameMaker, whatever they're calling it these days). Anybody with that know-how, please contact me! *-------------------------------------------------------------------* | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim at ( Consultix-Inc, TeachMePerl, or TeachMeUnix ) dot Com | *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-* | UPCOMING CLASSES; 9/18: UNIX/Linux Fundamentals 10/9: Basic Perl | | Watch for my Sept. '06 book: "Minimal Perl for UNIX/Linux People" | | See MinimalPerl.com for details, ordering, and email-list signup | *-------------------------------------------------------------------* From jay at scherrer.com Mon Aug 14 19:38:56 2006 From: jay at scherrer.com (Jay Scherrer) Date: Mon, 14 Aug 2006 19:38:56 -0700 Subject: SPUG: [SLL] Need FrameMaker expert's help In-Reply-To: <20060814021029.GA21332@jumpy.consultix-inc.com> References: <20060814021029.GA21332@jumpy.consultix-inc.com> Message-ID: <44E133C0.6030006@scherrer.com> Tim Maher wrote: > Sorry for an off-topic post, but my typesetter is experiencing a last- > minute problem with my nearly published book, and I'd like to ask a > question of somebody who's familiar with 'editing Index Tags in Frame" > (or FrameMaker, whatever they're calling it these days). > > Anybody with that know-how, please contact me! > > *-------------------------------------------------------------------* > | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | > | tim at ( Consultix-Inc, TeachMePerl, or TeachMeUnix ) dot Com | > *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-* > | UPCOMING CLASSES; 9/18: UNIX/Linux Fundamentals 10/9: Basic Perl | > | Watch for my Sept. '06 book: "Minimal Perl for UNIX/Linux People" | > | See MinimalPerl.com for details, ordering, and email-list signup | > *-------------------------------------------------------------------* > > > Tim, Just what kind of tagging do you need? My Tax package would use tags inside of any text imput section, use perl to find the " (***)". If your FrameMaker is still based on PostScript, this will work. If this is a possible I send you my routine, for your perfection. :-) Jay Scherrer From jay at scherrer.com Mon Aug 14 19:53:52 2006 From: jay at scherrer.com (Jay Scherrer) Date: Mon, 14 Aug 2006 19:53:52 -0700 Subject: SPUG: [SLL] Need FrameMaker expert's help In-Reply-To: <44E133C0.6030006@scherrer.com> References: <20060814021029.GA21332@jumpy.consultix-inc.com> <44E133C0.6030006@scherrer.com> Message-ID: <44E13740.8080406@scherrer.com> Jay Scherrer wrote: > Tim Maher wrote: >> Sorry for an off-topic post, but my typesetter is experiencing a last- >> minute problem with my nearly published book, and I'd like to ask a >> question of somebody who's familiar with 'editing Index Tags in Frame" >> (or FrameMaker, whatever they're calling it these days). >> >> Anybody with that know-how, please contact me! >> >> *-------------------------------------------------------------------* >> | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | >> | tim at ( Consultix-Inc, TeachMePerl, or TeachMeUnix ) dot Com | >> *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-* >> | UPCOMING CLASSES; 9/18: UNIX/Linux Fundamentals 10/9: Basic Perl | >> | Watch for my Sept. '06 book: "Minimal Perl for UNIX/Linux People" | >> | See MinimalPerl.com for details, ordering, and email-list signup | >> *-------------------------------------------------------------------* >> >> >> > Tim, > Just what kind of tagging do you need? My Tax package would use tags > inside of any text imput section, use perl to find the " (***)". If > your FrameMaker is still based on PostScript, this will work. If this > is a possible I send you my routine, for your perfection. :-) > Jay Scherrer > > Also: here is a link for a PDF fo Perl and FrameMaker and SGML. http://www.groupwellesley.com/talks/FrameUsers99/sgml_perl.pdf. Jay Scherrer From tim at consultix-inc.com Tue Aug 15 10:37:59 2006 From: tim at consultix-inc.com (Tim Maher) Date: Tue, 15 Aug 2006 10:37:59 -0700 Subject: SPUG: [SLL] Need FrameMaker expert's help In-Reply-To: <44E133C0.6030006@scherrer.com> References: <20060814021029.GA21332@jumpy.consultix-inc.com> <44E133C0.6030006@scherrer.com> Message-ID: <20060815173759.GA21673@jumpy.consultix-inc.com> On Mon, Aug 14, 2006 at 07:38:56PM -0700, Jay Scherrer wrote: Thanks Jay, but the problem's been handled by now. -Tim > Tim Maher wrote: > > Sorry for an off-topic post, but my typesetter is experiencing a last- > > minute problem with my nearly published book, and I'd like to ask a > > question of somebody who's familiar with 'editing Index Tags in Frame" > > (or FrameMaker, whatever they're calling it these days). > > > > Anybody with that know-how, please contact me! > > > > *-------------------------------------------------------------------* > > | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | > > | tim at ( Consultix-Inc, TeachMePerl, or TeachMeUnix ) dot Com | > > *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-* > > | UPCOMING CLASSES; 9/18: UNIX/Linux Fundamentals 10/9: Basic Perl | > > | Watch for my Sept. '06 book: "Minimal Perl for UNIX/Linux People" | > > | See MinimalPerl.com for details, ordering, and email-list signup | > > *-------------------------------------------------------------------* > > > > > > > Tim, > Just what kind of tagging do you need? My Tax package would use tags > inside of any text imput section, use perl to find the " (***)". If your > FrameMaker is still based on PostScript, this will work. If this is a > possible I send you my routine, for your perfection. :-) > Jay Scherrer > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays > WEB PAGE: http://seattleperl.org/ From MichaelRWolf at att.net Tue Aug 15 17:00:06 2006 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Tue, 15 Aug 2006 17:00:06 -0700 Subject: SPUG: Meeting announcement -- it starts in 1.5 hours. Message-ID: See you there... -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From kmeyer at blarg.net Wed Aug 16 10:04:36 2006 From: kmeyer at blarg.net (Ken Meyer) Date: Wed, 16 Aug 2006 10:04:36 -0700 Subject: SPUG: Invitation to Greater Seattle Geek Cookout -- Sat Aug 19th Message-ID: Friends -- The following invitation was sent to Jim Affeld's Snort User Group. Ken Fury has encouraged me to forward it to other user groups in the area. Seems that the event will be heavy with security folks, so you might learn something as well as meet some new people and even promo your own groups. If you are interested in attending, please RSVP to Ken Fury at: kenfury at gmail.com My understanding is that he will respond with an "e-vite" giving you further details. Ken Meyer > > > --- KenFury wrote: > > > > > > Subject: [Seattlesug] Re: Greater Seattle cookout Sat Aug 19th. > > > > > > James, If you could spam your list for me that would > > > be great. It has Already gone out to a bunch of people in the > > > infosec/hacker community. > > > > > > I talked to some people about the possibility of a party/cookout for > > > all of the Seattle groups; DC206, 2600, Seattle Wireless, GSLUG, etc.. So if > > > you are interested in coming up to Renton, WA next Saturday (the 19th) > > > from 5pm to 2am, or for a meet and greet, let me know and I'll put your > > > email on the e-vite. I have plenty of crash space for those that need it. > > > > > > address is 18525 102nd SE, Renton, WA, right off Rt. 167 > > > > > > Thanks, > > > > > > KF > > > > > > _______________________________________________ > > > > > > SeattleSUG mailing list > > > SeattleSUG at lists.snort.org > > > https://lists.snort.org/mailman/listinfo/seattlesug From mcrawfor at u.washington.edu Wed Aug 16 10:41:26 2006 From: mcrawfor at u.washington.edu (Miles Crawford) Date: Wed, 16 Aug 2006 10:41:26 -0700 (PDT) Subject: SPUG: Solstice Contact and Download Info Message-ID: Hey SPUG-ers, at your request, here's an email with the Solstice Framework info: http://solstice.eplt.washington.edu We're in #solstice on irc.freenode.net for some nice IRC chatting. Also, we use solstice-discussion at googlegroups.com for our mailing list. It's very low traffic right now. Thanks again for having us last night, hope to see you all again, -miles From MichaelRWolf at att.net Thu Aug 17 06:57:04 2006 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Thu, 17 Aug 2006 06:57:04 -0700 Subject: SPUG: Do you dream in Perl? (dualvar and contextual return) Message-ID: It's a little past 6 a.m. on the first day of our vacation. I should be asleep!!! That's one of the things vacations are good for, except my asthma woke me up. In that semi-lucid transition between sleep and consciousness, I realized that I was dreaming in Perl. Not just random ideas, I was thinking through a problem. It had something to do with the dual-slot magic of $!, and wondering if it's magic gets replicated, specifically by the 'x' operator in a list context, and therefore available for sprintf. I guess the test code I had almost written was this. open my $goofy, '<', q{!@#$$%!$!%#@} or warn sprintf "\$! -> numy '%d', stringy '%s'\n", ($!) x 2; BTW, the answer is: "Yes, the magic is replicated". My thoughts on that 'magic' had morphed into a question of contextual return, and eventually to the realization that the basic DBI::fetchrow_*() commands could all be incorporated into one DBI::fetchrow() through the use of contextual return, ala @fields = $sth->fetchrow_array(); $field_aref = $sth->fetchrow_arrayref(); $field_href = $sth->fetchrow_hashref(); @fields = $sth->fetchrow(); $field_aref = $sth->fetchrow(); $field_href = $sth->fetchrow(); Hey, pretty cool!!! I don't always dream in Perl. Yesterday's asthma-induced dream remembrance involved snuggling with my honey while flying naked, realizing we were at our destination, then freefalling into a river, trying to swim ashore, only to be overtaken by the current and ending up befriending some hostile natives who told us a shortcut back to where we needed to be and teaching us how to disable some fierce alligators with dental floss and pot lids. I think that my memory the dreams is enhanced by my asthma, which by it's very nature is slowly dragging me from unconscious breathing and memory into conscious breathing and memory. I'll leave the interpretation of the sex/flying/freefall/swimming/monster dream to other experts, but apropos of this list, I'm psyched to know some things about the two-slot magic of $OS_ERROR (aka $!) and its propagation that I didn't know when I went to sleep. And the possible rewrite of fetchrow_*() family into a single fetchrow() function is a cool possibility, too. I wouldn't recommend asthma as a Perl learning tool, but I still have the question: Do you dream in Perl? Dream on, Michael P.S. For further reading, I reread Scalar::Util::dualvar and Contextual::Return. P.P.S. I really am on vacation now. The computer's going down (and shipped for repairs) while we take a low-tech trip to the Canadian Rockies. I'll check replies on our return. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From MichaelRWolf at att.net Thu Aug 17 10:58:17 2006 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Thu, 17 Aug 2006 10:58:17 -0700 Subject: SPUG: SUMMARY: sorting hierarchical section numbers In-Reply-To: <20060811051327.DB78CBC48@gandalf.addnorya.net> Message-ID: <20060817175811.AA794BC4A@gandalf.addnorya.net> I've appended a test file incorporating some of the suggestions I got. Thanks to all responders. See results embedded in code above the __DATA__ tag. As a test of the test, I tried passing the code in as a code reference and as a string because PBP mentioned it was better as a string. That was contrary to my previous practice, so I thought I'd try it. Summary: 1. For a short, already ordered list, pack and split were equal. I haven't gotten to test this on long lists, reversed lists, and shuffled lists. 2. The subroutine call overhead is substantial for this code/data combination, creating a 20% rate decrease. (See previous disclaimer on reversed, shuffled, and large lists.) CODE STARTS HERE:... #! /usr/bin/perl use warnings; use strict; # use Smart::Comments; use Benchmark qw(:all); my @sections = ; chomp @sections; foreach (@sections) { s/\s//g; } # ================ # Sort a "section number" string (i.e. dot-separated list of numbers). sub by_section_number_splitting { # Turn the section string into a list of numbers... my @a = split /[.]/, $a; my @b = split /[.]/, $b; # While there's still something in both lists... while (@a && @b) { # Grab the first thing in each list... my ($lhs, $rhs) = (shift @a, shift @b); # and compare them numerically. my $rc = $lhs <=> $rhs; # If the pair is unequal, we have our result... return $rc if $rc; } # If a list (or both) became empty, the shortest one compares smallest... return @a <=> @b; } sub by_section_number_packing { # Create a string, packing each number into an unsigned character... my $lhs = pack 'C*', split /[.]/, $a; my $rhs = pack 'C*', split /[.]/, $b; ### lhs: $a, $lhs, length($lhs) ### rhs: $b, $rhs, length($rhs) # then compare them as strings... return $lhs cmp $rhs; } my @sorted_by_splitting = sort by_section_number_splitting @sections; my @sorted_by_packing = sort by_section_number_packing @sections; ### original : @sections ### split sort : @sorted_by_splitting ### pack sort : @sorted_by_packing my $results = timethese(0, { # The two sort algorithms as anonymous sub references... 'split' => sub { sort by_section_number_splitting @sections }, 'pack' => sub { sort by_section_number_packing @sections }, # The two sort algorithms as strings to be eval'd... 'split_str' => q{ sort by_section_number_splitting @sections }, 'pack_str' => q{ sort by_section_number_packing @sections }, } ); cmpthese($results); exit; # ================================================================ =begin comment Benchmark: running pack, pack_str, split, split_str for at least 3 CPU seconds... pack: 4 wallclock secs ( 3.51 usr + 0.00 sys = 3.51 CPU) @ 3889417.00/s (n=13636296) pack_str: 4 wallclock secs ( 3.16 usr + 0.00 sys = 3.16 CPU) @ 4982422.25/s (n=15764384) split: 2 wallclock secs ( 3.28 usr + -0.02 sys = 3.26 CPU) @ 3942718.67/s (n=12837492) split_str: 3 wallclock secs ( 3.17 usr + 0.00 sys = 3.17 CPU) @ 4966724.95/s (n=15764385) Rate pack split split_str pack_str pack 3889417/s -- -1% -22% -22% split 3942719/s 1% -- -21% -21% split_str 4966725/s 28% 26% -- -0% pack_str 4982422/s 28% 26% 0% -- =end comment =cut __DATA__ 1.1 1.11 1.2 1.21 1.3 1.3.1 1.3.1.1 1.3.1.2 1.3.1.3 1.3.1.20 1.3.11.2 1.3.2 1.30.1.2 2 2.1 3. 3.1 11 11.1 11.2 11.3 11.3.1 11.3.1.1 11.3.1.2 11.3.2 -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net > -----Original Message----- > From: spug-list-bounces+michaelrwolf=att.net at pm.org [mailto:spug-list- > bounces+michaelrwolf=att.net at pm.org] On Behalf Of Michael R. Wolf > Sent: Thursday, August 10, 2006 10:14 PM > To: 'SPUG Members' > Subject: SPUG: sorting hierarchical section numbers > > I want to sort strings that represent outline numbers. > > 1 > 1.1 > 1.2 > 1.3 > 1.3.1 > 1.3.2 > 1.3.2.1 > 1.2 > > I can't find a module. Could you point me in the correct direction so > that > I can read the fine manual? I can't seem to find the right search term; > these are too general 'hierarchy', 'outline', 'number', 'sort'. > > -- > Michael R. Wolf > All mammals learn by playing! > MichaelRWolf at att.net > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays > WEB PAGE: http://seattleperl.org/ From krahnj at telus.net Thu Aug 17 12:31:26 2006 From: krahnj at telus.net (John W. Krahn) Date: Thu, 17 Aug 2006 12:31:26 -0700 Subject: SPUG: Do you dream in Perl? (dualvar and contextual return) In-Reply-To: <20060817135711.C4BB01791C@x6.develooper.com> References: <20060817135711.C4BB01791C@x6.develooper.com> Message-ID: <44E4C40E.4040608@telus.net> Michael R. Wolf wrote: > It's a little past 6 a.m. on the first day of our vacation. I should > be asleep!!! That's one of the things vacations are good for, except > my asthma woke me up. > > In that semi-lucid transition between sleep and consciousness, I > realized that I was dreaming in Perl. Not just random ideas, I was > thinking through a problem. It had something to do with the dual-slot > magic of $!, and wondering if it's magic gets replicated, specifically > by the 'x' operator in a list context, and therefore available for > sprintf. I guess the test code I had almost written was this. > > open my $goofy, '<', q{!@#$$%!$!%#@} > or warn sprintf "\$! -> numy '%d', stringy '%s'\n", ($!) x 2; Or you could do: or warn sprintf "\$! -> numy '%d', stringy '%1\$s'\n", $!; And use the same variable for both fields. > BTW, the answer is: "Yes, the magic is replicated". > > My thoughts on that 'magic' had morphed into a question of contextual > return, and eventually to the realization that the basic > DBI::fetchrow_*() commands could all be incorporated into one > DBI::fetchrow() through the use of contextual return, ala > > @fields = $sth->fetchrow_array(); > $field_aref = $sth->fetchrow_arrayref(); > $field_href = $sth->fetchrow_hashref(); > > @fields = $sth->fetchrow(); > $field_aref = $sth->fetchrow(); > $field_href = $sth->fetchrow(); There is no contextual difference between '$field_aref =' and '$field_href ='. They are both in scalar context. John -- use Perl; program fulfillment From jobs-noreply at seattleperl.org Fri Aug 18 22:28:11 2006 From: jobs-noreply at seattleperl.org (SPUG Jobs) Date: Fri, 18 Aug 2006 22:28:11 -0700 (PDT) Subject: SPUG: JOB: Web Developer - Grist - Seattle Message-ID: Company: Grist Magazine, Inc. Industry: Online Media / Environment / Nonprofit Location: Downtown Seattle Type: Permanent Contact: jobs at grist.org Corporate site: http://www.grist.org Job Title: Web Developer Department: Web Production Reports To: Web Production Manager Grist is seeking an experienced web developer to help implement our ambitious expansion plans. In the coming months, Grist will begin to redesign its website and start introducing exciting new features and enhanced functionality, and needs a talented web programmer to make it happen. This is a full-time position (to be filled immediately) located in our downtown Seattle office. The web developer will report to Grist's web production manager. Responsibilities will include: * Integration between Grist's Perl-based content management systems (Bricolage and Scoop), as well as with ASPs and third-party websites * CGI scripting * Template authoring for Grist's website, blog, HTML emails, and RSS feeds * Development of new website features and functionality * Database development * Ensuring cross-browser compatibility and standards compliance * Keeping Grist informed about best practices and latest developments Candidates should have two to four years of experience with: * Perl and CGI scripting * XHTML/HTML and CSS * JavaScript * PHP * MySQL and PostgreSQL * XML And it sure would be nice if you also had experience with: * Bricolage * Scoop * Flash * Ajax * Mason * Web 2.0 concepts * API, LDAP and/or other type of system integration The successful candidate will be proactive in learning new skills and possess superior organizational and time-management skills; excellent verbal and written communication skills; an ability to multitask and thrive under deadlines; and an affinity for open source software. To apply, please send your resume and a thoughtful, personalized cover letter in the body of an email that addresses the following: Why do you want to work for Grist and why you're the person for the job? Links to projects and websites are recommended. Send materials to jobs at grist.org; please put "web developer" in the subject line. No phone calls, please. Grist is an equal-opportunity employer and does not discriminate based on anything except how dang good you are at your work. People of color and individuals from other underrepresented groups are strongly encouraged to apply. Background on Grist: With a fresh spin on environmental news and views, Grist informs, inspires, and links America's next generation of green activists. Since Grist incorporated as a free-standing nonprofit in 2003, our audience has soared to more than 600,000 a month. Our efforts have garnered the 2005 and 2006 People's Voice "Webbys" for Best Magazine, the Utne 2003 and 2005 Independent Press Awards for Online Political Coverage, and citation in major media including the New York Times, Vanity Fair, the San Francisco Chronicle, the Boston Globe, the Weekly Standard, National Journal, National Public Radio, the Japan Times, Fast Company, and the London Independent. Grist's motto: Gloom and doom with a sense of humor. From david.s.patterson at usa.net Tue Aug 22 11:26:35 2006 From: david.s.patterson at usa.net (David S. Patterson) Date: Tue, 22 Aug 2006 11:26:35 -0700 Subject: SPUG: Is Perl for .NET on anyone's radar? Message-ID: <745kHVsZj9120S07.1156271195@cmsweb07.cms.usa.net> An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20060822/7615eb87/attachment.html From dblanchard at gmail.com Tue Aug 22 11:51:49 2006 From: dblanchard at gmail.com (Duane Blanchard) Date: Tue, 22 Aug 2006 11:51:49 -0700 Subject: SPUG: Is Perl for .NET on anyone's radar? In-Reply-To: <745kHVsZj9120S07.1156271195@cmsweb07.cms.usa.net> References: <745kHVsZj9120S07.1156271195@cmsweb07.cms.usa.net> Message-ID: I'm beginning to learn C# for work and read somewhere that there is a compatibility between Perl and .Net, but didn't mark where I saw it. I'm interested to learn more about it, but haven't made time for it. I've also been absent from the last several SPUG meetings, so maybe this is the topic to get me involved again. D -- Duane Blanchard 206.280.1263 There are 10 kinds of people in the world; those who know binary and those who don't. From blibbet at gmail.com Tue Aug 22 12:34:19 2006 From: blibbet at gmail.com (Lee Fisher) Date: Tue, 22 Aug 2006 12:34:19 -0700 Subject: SPUG: Is Perl for .NET on anyone's radar? In-Reply-To: <745kHVsZj9120S07.1156271195@cmsweb07.cms.usa.net> References: <745kHVsZj9120S07.1156271195@cmsweb07.cms.usa.net> Message-ID: <44EB5C3B.4030604@gmail.com> Parrot recently got a .NET CIL compiler project (see the /dotnet project in the Parrot distro). it goes both ways, IL to Parrot, Parrot to IL. the potential for Perl and .NET is huge. it could use some contributors (good way to work out your depression). http://parrotcode.org/ also, there is Taubz' PerlSharp. > Has anyone heard of any similar effort for the perl language? I would dearly > love to program in Perl.NET, if there was such a thing. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 163 bytes Desc: OpenPGP digital signature Url : http://mail.pm.org/pipermail/spug-list/attachments/20060822/d3168adb/attachment.bin From jerry.gay at gmail.com Tue Aug 22 12:59:41 2006 From: jerry.gay at gmail.com (jerry gay) Date: Tue, 22 Aug 2006 12:59:41 -0700 Subject: SPUG: Is Perl for .NET on anyone's radar? In-Reply-To: <44EB5C3B.4030604@gmail.com> References: <745kHVsZj9120S07.1156271195@cmsweb07.cms.usa.net> <44EB5C3B.4030604@gmail.com> Message-ID: <1d9a3f400608221259l4d6a8b6et269c6f80ee4b67c7@mail.gmail.com> On 8/22/06, Lee Fisher wrote: > Parrot recently got a .NET CIL compiler project > (see the /dotnet project in the Parrot distro). > it goes both ways, IL to Parrot, Parrot to IL. actually, right now it only performs bytecode translation from .net to parrot. you can read about that in the overview, at http://svn.perl.org/parrot/trunk/languages/dotnet/doc/overview.pod > the potential for Perl and .NET is huge. > it could use some contributors (good way to work out your depression). > http://parrotcode.org/ this is very much true. parrot development is moving along, but it's a *huge* project, and more contributors can only make things easier. ~jerry From blibbet at gmail.com Tue Aug 22 13:08:53 2006 From: blibbet at gmail.com (Lee Fisher) Date: Tue, 22 Aug 2006 13:08:53 -0700 Subject: SPUG: Is Perl for .NET on anyone's radar? In-Reply-To: <1d9a3f400608221259l4d6a8b6et269c6f80ee4b67c7@mail.gmail.com> References: <745kHVsZj9120S07.1156271195@cmsweb07.cms.usa.net> <44EB5C3B.4030604@gmail.com> <1d9a3f400608221259l4d6a8b6et269c6f80ee4b67c7@mail.gmail.com> Message-ID: <44EB6455.1050805@gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 the other day i called it an IL to Parrot tool, but was corrected by a Parrotcoder "Dotnet is (also?) IL to Parrot, btw." maybe they meant "for now", and i've not tried the other way, so i should have disclaimed that, sorry. regardless of this correction, the potential for Perl and .NET is huge. > actually, right now it only performs bytecode translation from .net to > parrot. you can read about that in the overview, at > http://svn.perl.org/parrot/trunk/languages/dotnet/doc/overview.pod -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAkTrZFUACgkQw3D+nSm51yjaZACfT3n+5wmtUm9eFjpTKA2mbr8B kK0Ani5/BkuX7IHVmy+17FNy2w/B904W =XgCS -----END PGP SIGNATURE----- From jerry.gay at gmail.com Tue Aug 22 13:22:22 2006 From: jerry.gay at gmail.com (jerry gay) Date: Tue, 22 Aug 2006 13:22:22 -0700 Subject: SPUG: Is Perl for .NET on anyone's radar? In-Reply-To: <44EB6455.1050805@gmail.com> References: <745kHVsZj9120S07.1156271195@cmsweb07.cms.usa.net> <44EB5C3B.4030604@gmail.com> <1d9a3f400608221259l4d6a8b6et269c6f80ee4b67c7@mail.gmail.com> <44EB6455.1050805@gmail.com> Message-ID: <1d9a3f400608221322x537043f5s4d77570066d28cdf@mail.gmail.com> On 8/22/06, Lee Fisher wrote: > the other day i called it an IL to Parrot tool, but was corrected by a > Parrotcoder > > "Dotnet is (also?) IL to Parrot, btw." > > maybe they meant "for now", and i've not tried the other way, so i > should have disclaimed that, sorry. > i think that parrotcoder was me :) aka particle on #parrot or [particle] or #perl6 jonathan worthington created languages/dotnet/ in about six months time, if i recall. it's incomplete, but what is complete is excellent. .net is *huge*, so ability to translate all of it to parrot bytecode will take significant man-hours. and i expect much of the work completed so far could easily be reused to perform a parrot to .net bytecode converter. i'm sure it would be well worth the time invested. > regardless of this correction, the potential for Perl and .NET is huge. > agreed. join us! ~jerry From david.s.patterson at usa.net Tue Aug 22 14:04:46 2006 From: david.s.patterson at usa.net (David S. Patterson) Date: Tue, 22 Aug 2006 14:04:46 -0700 Subject: SPUG: Is Perl for .NET on anyone's radar? Message-ID: <490kHVVDU6368S20.1156280686@cmsweb20.cms.usa.net> An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20060822/dabbe8e0/attachment.html From jazzdev at gmail.com Tue Aug 22 14:18:33 2006 From: jazzdev at gmail.com (JD Brennan) Date: Tue, 22 Aug 2006 14:18:33 -0700 Subject: SPUG: Fwd: Is Perl for .NET on anyone's radar? In-Reply-To: References: <745kHVsZj9120S07.1156271195@cmsweb07.cms.usa.net> Message-ID: I neglected to post my reply to the list... ---------- Forwarded message ---------- From: JD Brennan Date: Aug 22, 2006 1:06 PM Subject: Re: SPUG: Is Perl for .NET on anyone's radar? To: "David S. Patterson" If you're looking for Perl written on top of the CLR, then I think that's going to be hard to find. Because it would be hard to do. Perl is great because it was designed to be easy to program in, not to be easy to implement. Mostly languages have a regular grammar that's easy to implement, like Python, Ruby, JavaScript etc. There's no JPerl (Perl on top of the Java JVM) either for the same reason. It's fairly hard to write a Perl interpreter. I've thought about writing JPerl, but the 90/10 rule would likely kill it. Getting the last 10% of the Perl syntax to work would be really hard. Perl programmers probably wouldn't be interested in a Perl where only 90% of the Perl syntax worked. And Perl modules would be a problem too. How do you use a Perl module with a C-based component on top of the JVM or the CLR? Perl programmers probably wouldn't be interested in a Perl where a lot of the CPAN modules wouldn't work. Might be more possible with the CLR. By using managed C maybe you could get Perl embed to talk to the CLR directly. I'm not familar with .NET or the CLR, so that's just speculation. JPerl seems destined to failure for the reasons mentioned above. So I'll probably never get around to it. ;-) JD P.S. Yes, there used to be something called JPerl, but it is a JNI wrapper around Perl embed so you can call Perl from Java. It's not a way to write something in Perl that can run in a JVM. On 8/22/06, David S. Patterson < david.s.patterson at usa.net> wrote: > Ok, I'm depressed... MSDN Flash news today reported that IronPython 1.0for .NET is now ready to try as release candidate. > > *http://blogs.msdn.com/somasegar/archive/2006/07/25/678615.aspx * > > I have about as much interest in programming in python as I do for > house-training a feral skunk. > > Has anyone heard of any similar effort for the perl language? I would > dearly love to program in Perl.NET, if there was such a thing. > > I hate that ActiveState seems to have cornered the market on perl > implementations for the Windows world. They made a very, very weak attempt > at porting to .NET; really it seems all you get is code colorization from > them? They haven't followed up in on .NET and creating a full language spec > that ineracts with the CLI the way others (like python) have. > > It seems like no one in the public/gnu domain (that I'm aware of, anyway) > has much interest in pushing perl in the application development direction > for this platform. Are we perl programmers becoming anacronisms? Will perl > end up being just another language swept under the rug of history, along > with awk and ksh? Say it ain't so? > > Does anyone on this list besides me have any interest in this? I'd love > some feedback... > > -- > D. S. Pat Patterson > Fishery Resource Analysis & Monitoring Division > Northwest Fisheries Science Center > 2725 Montlake Blvd E > Seattle, WA 98112-2097 > *http://www.nwfsc.noaa.gov/* > > > > _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: spug-list at pm.org SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list MEETINGS: 3rd Tuesdays WEB PAGE: http://seattleperl.org/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20060822/882fe4ff/attachment-0001.html From jazzdev at gmail.com Tue Aug 22 14:19:09 2006 From: jazzdev at gmail.com (JD Brennan) Date: Tue, 22 Aug 2006 14:19:09 -0700 Subject: SPUG: Is Perl for .NET on anyone's radar? In-Reply-To: <490kHVVDU6368S20.1156280686@cmsweb20.cms.usa.net> References: <490kHVVDU6368S20.1156280686@cmsweb20.cms.usa.net> Message-ID: I'll agree with your 3). If your 2) is representative of Perl programmers in general, then that would be great. Your 1) is going to take some more convincing, but if you can define the "basic grammar" then we could take a crack at writing an interpreter for it in C#. I'd really like to do it in such a way that I could target the JVM as well as the CLR. J#? That may be asking too much. JD On 8/22/06, David S. Patterson wrote: > > JD, > > Sorry, I don't agree with most your assessments on this. Here's why: > > 1) The basic grammar is simple enough; it's really not much more > complicated than any shell syntax, in my view. > > 2) The 90/10 rule idea is a matter of opinion. If I had 90% of perl > syntax & functionality on .NET I'd be in heaven. Obviously it would be nice > to do 100% but perl is over 14 years old and has undergone 'the Swiss Army > Knife' effect. We don't have to have all the bells and whistles at the > beginning. How about just porting perl 4 -- I'd be happy with that! > > 3) The CPAN complaint is a red herring. You can't run ANY CPAN code on > .NET right now! > > Well there -- I've vented... But I'm still Not Happy!!! > > -Pat > > > > > ------ Original Message ------ > *Received: *Tue, 22 Aug 2006 01:06:24 PM PDT > *From: *"JD Brennan" > *To: *"David S. Patterson" > *Subject: *Re: SPUG: Is Perl for .NET on anyone's radar? > > > If you're looking for Perl written on top of the CLR, then > I think that's going to be hard to find. Because it would > be hard to do. Perl is great because it was designed > to be easy to program in, not to be easy to implement. > Mostly languages have a regular grammar that's easy > to implement, like Python, Ruby, JavaScript etc. > > There's no JPerl (Perl on top of the Java JVM) either for the > same reason. It's fairly hard to write a Perl interpreter. > > I've thought about writing JPerl, but the 90/10 rule would > likely kill it. Getting the last 10% of the Perl > syntax to work would be really hard. > > Perl programmers probably wouldn't be interested in > a Perl where only 90% of the Perl syntax worked. > > And Perl modules would be a problem too. How do you > use a Perl module with a C-based component on top > of the JVM or the CLR? > > Perl programmers probably wouldn't be interested in > a Perl where a lot of the CPAN modules wouldn't work. > > Might be more possible with the CLR. By using managed > C maybe you could get Perl embed to talk to the CLR directly. > I'm not familar with .NET or the CLR, so that's just > speculation. > > JPerl seems destined to failure for the reasons mentioned > above. So I'll probably never get around to it. ;-) > > JD > > P.S. Yes, there used to be something called JPerl, but > it is a JNI wrapper around Perl embed so you can call Perl > from Java. It's not a way to write something in Perl that > can run in a JVM. > > > > > > > > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays > WEB PAGE: http://seattleperl.org/ > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20060822/22b362a2/attachment.html From david.s.patterson at usa.net Wed Aug 23 12:21:09 2006 From: david.s.patterson at usa.net (David S. Patterson) Date: Wed, 23 Aug 2006 12:21:09 -0700 Subject: SPUG: spug-list Digest, Vol 38, Issue 15 Message-ID: <910kHwTuJ4656S25.1156360869@cmsweb25.cms.usa.net> An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20060823/6c476aa9/attachment.html From david.s.patterson at usa.net Wed Aug 23 14:27:42 2006 From: david.s.patterson at usa.net (David S. Patterson) Date: Wed, 23 Aug 2006 14:27:42 -0700 Subject: SPUG: Is Perl for .NET on anyone's radar? Message-ID: <009kHwVAQ6976S22.1156368462@cmsweb22.cms.usa.net> An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20060823/f2730733/attachment.html From jazzdev at gmail.com Wed Aug 23 16:41:30 2006 From: jazzdev at gmail.com (JD Brennan) Date: Wed, 23 Aug 2006 16:41:30 -0700 Subject: SPUG: Is Perl for .NET on anyone's radar? In-Reply-To: <009kHwVAQ6976S22.1156368462@cmsweb22.cms.usa.net> References: <009kHwVAQ6976S22.1156368462@cmsweb22.cms.usa.net> Message-ID: Yes, there a number of languages you can use that will run in a JVM. Jython, J/Ruby, Rhino (JavaScript), and JScheme are just the ones I know a bit about. I'm not sure that Sun did anything to encourage this besides publishing the spec for the JVM. But that's getting off topic for this list. I can think of 3 ways to approach this problem: 1) Write a Perl interpreter in C# 2) Write a translator from Perl to C# 3) Write a translator (compiler) from Perl to CLR byte codes 2 might be interesting since you could write it in Perl. Jython and JScheme use approach 1. JScheme also does 3. And, of course, if you do 2 you get a way to do 3 also, though it'll have the performance and debugging drawbacks that the old C-front version of C++ had back in the day. JD On 8/23/06, David S. Patterson wrote: > > > I imagine writing a language translation layer for perl on top of JVM > would be a major, major project. I'm sure a worthy one, but since I don't > program in Java I'll just have to let it go by. By the way, has this been > done for any other language? I think the java people may feel like that > since they're already giving you platform independance, if you want to use > the JVM just use it via Java. > > But I do an awful lot of work in C# on the .NET platform, yet I still miss > the convenience of the perl syntax and language constructs. > > Also I'm impressed with the facilities and even coaching MS has provided > for those that want to instantiate a new language binding on top of the > CLI. That's why, I'm sure, the Python people were able to succeed. > > Most recently, the Monad group has made progress and has released Windows > Power Shell http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx which is a new way of lashing together .NET CLR objects to do useful work > using this new shell scripting language. > > But for me, I'm more interested in perl as a programming language, because > it is so expressive (you get a lot of bang for each line of code you write) > and it is precisely this linking and pipelining behavior that seems like > would be a good fit on top of the .NET API. > > Just my three cents... > > > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays > WEB PAGE: http://seattleperl.org/ > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20060823/53754178/attachment.html From david.s.patterson at usa.net Wed Aug 23 16:53:47 2006 From: david.s.patterson at usa.net (David S. Patterson) Date: Wed, 23 Aug 2006 16:53:47 -0700 Subject: SPUG: Is Perl for .NET on anyone's radar? Message-ID: <732kHwX1v5648S24.1156377227@cmsweb24.cms.usa.net> An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20060823/3f63319c/attachment.html From david.s.patterson at usa.net Wed Aug 23 17:19:43 2006 From: david.s.patterson at usa.net (David S. Patterson) Date: Wed, 23 Aug 2006 17:19:43 -0700 Subject: SPUG: Is Perl for .NET on anyone's radar? Message-ID: <496kHXasr1280S08.1156378783@uwdvg008.cms.usa.net> Interesting, and I do like your idea #2. I work with (among other things) a 15-year old, unix-based turn-key business system, and perl is the best duct tape for this thing that I know of. I'm just finishing up a 4 - 5 thousand-line perl program to do health monitoring on it. I really love how hashes and lists can be combined into ad-hoc composite objects. Essentially its object-oriented programming without all the formalization... Ya gotta love it! But a lot of the joy of C# development is in using the extremely powerful IDE. What I want is the syntax of perl, especially for certain classes of problems (hey, C# already adopted perl's pattern matching syntax, at least they threw us that bone!) Maybe the simplest answer is to add perl programming constructs to C#. You can add operators and methods, but you can't change the syntax of the language itself. But you could probably simulate a lot of perl's behavior without having to take out a second mortgage and go on a sabbatical to get it done. Hmmmm. Maybe I'll take a stab at it! -Pat > Yes, there a number of languages you can use that > will run in a JVM. Jython, J/Ruby, Rhino (JavaScript), > and JScheme are just the ones I know a bit about. > I'm not sure that Sun did anything to encourage this > besides publishing the spec for the JVM. But that's > getting off topic for this list. > > I can think of 3 ways to approach this problem: > > 1) Write a Perl interpreter in C# > 2) Write a translator from Perl to C# > 3) Write a translator (compiler) from Perl to CLR byte codes > > 2 might be interesting since you could write it in Perl. > Jython and JScheme use approach 1. JScheme also > does 3. And, of course, if you do 2 you get a way to > do 3 also, though it'll have the performance and > debugging drawbacks that the old C-front version of C++ > had back in the day. > > JD > From jazzdev at gmail.com Wed Aug 23 17:25:48 2006 From: jazzdev at gmail.com (JD Brennan) Date: Wed, 23 Aug 2006 17:25:48 -0700 Subject: SPUG: Is Perl for .NET on anyone's radar? In-Reply-To: References: <009kHwVAQ6976S22.1156368462@cmsweb22.cms.usa.net> Message-ID: Is there a JScript.net? or JavaScript.net? Translating Perl to JavaScript should be fairly straight-forward and then I could run Perl scripts in the JVM with Rhino or in the CLR (if there's a JavaScript for .NET) JD On 8/23/06, JD Brennan wrote: > > Yes, there a number of languages you can use that > will run in a JVM. Jython, J/Ruby, Rhino (JavaScript), > and JScheme are just the ones I know a bit about. > I'm not sure that Sun did anything to encourage this > besides publishing the spec for the JVM. But that's > getting off topic for this list. > > I can think of 3 ways to approach this problem: > > 1) Write a Perl interpreter in C# > 2) Write a translator from Perl to C# > 3) Write a translator (compiler) from Perl to CLR byte codes > > 2 might be interesting since you could write it in Perl. > Jython and JScheme use approach 1. JScheme also > does 3. And, of course, if you do 2 you get a way to > do 3 also, though it'll have the performance and > debugging drawbacks that the old C-front version of C++ > had back in the day. > > JD > > On 8/23/06, David S. Patterson wrote: > > > > > I imagine writing a language translation layer for perl on top of JVM > > would be a major, major project. I'm sure a worthy one, but since I don't > > program in Java I'll just have to let it go by. By the way, has this been > > done for any other language? I think the java people may feel like that > > since they're already giving you platform independance, if you want to use > > the JVM just use it via Java. > > > > But I do an awful lot of work in C# on the .NET platform, yet I still > > miss the convenience of the perl syntax and language constructs. > > > > Also I'm impressed with the facilities and even coaching MS has provided > > for those that want to instantiate a new language binding on top of the > > CLI. That's why, I'm sure, the Python people were able to succeed. > > > > Most recently, the Monad group has made progress and has released > > Windows Power Shell > > http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx which is a > > new way of lashing together .NET CLR objects to do useful work using this > > new shell scripting language. > > > > But for me, I'm more interested in perl as a programming language, > > because it is so expressive (you get a lot of bang for each line of code you > > write) and it is precisely this linking and pipelining behavior that seems > > like would be a good fit on top of the .NET API. > > > > Just my three cents... > > > > > > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays > WEB PAGE: http://seattleperl.org/ > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20060823/6db96771/attachment-0001.html From jay at scherrer.com Wed Aug 23 17:59:47 2006 From: jay at scherrer.com (Jay Scherrer) Date: Wed, 23 Aug 2006 17:59:47 -0700 Subject: SPUG: Is Perl for .NET on anyone's radar? In-Reply-To: References: <009kHwVAQ6976S22.1156368462@cmsweb22.cms.usa.net> Message-ID: <44ECFA03.7000408@scherrer.com> JD Brennan wrote: > Is there a JScript.net? or JavaScript.net? Translating > Perl to JavaScript should be fairly straight-forward and > then I could run Perl scripts in the JVM with Rhino or > in the CLR (if there's a JavaScript for .NET) > > JD > > On 8/23/06, *JD Brennan* > wrote: > > Yes, there a number of languages you can use that > will run in a JVM. Jython, J/Ruby, Rhino (JavaScript), > and JScheme are just the ones I know a bit about. > I'm not sure that Sun did anything to encourage this > besides publishing the spec for the JVM. But that's > getting off topic for this list. > > I can think of 3 ways to approach this problem: > > 1) Write a Perl interpreter in C# > 2) Write a translator from Perl to C# > 3) Write a translator (compiler) from Perl to CLR byte codes > > 2 might be interesting since you could write it in Perl. > Jython and JScheme use approach 1. JScheme also > does 3. And, of course, if you do 2 you get a way to > do 3 also, though it'll have the performance and > debugging drawbacks that the old C-front version of C++ > had back in the day. > > JD > > On 8/23/06, * David S. Patterson* > wrote: > > > I imagine writing a language translation layer for perl on top > of JVM would be a major, major project. I'm sure a worthy > one, but since I don't program in Java I'll just have to let > it go by. By the way, has this been done for any other > language? I think the java people may feel like that since > they're already giving you platform independance, if you want > to use the JVM just use it via Java. > > But I do an awful lot of work in C# on the .NET platform, yet > I still miss the convenience of the perl syntax and language > constructs. > > Also I'm impressed with the facilities and even coaching MS > has provided for those that want to instantiate a new language > binding on top of the CLI. That's why, I'm sure, the Python > people were able to succeed. > > Most recently, the Monad group has made progress and has > released Windows Power Shell > http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx > which is a new way of lashing together .NET CLR objects to do > useful work using this new shell scripting language. > > But for me, I'm more interested in perl as a programming > language, because it is so expressive (you get a lot of bang > for each line of code you write) and it is precisely this > linking and pipelining behavior that seems like would be a > good fit on top of the .NET API. > > Just my three cents... > > > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays > WEB PAGE: http://seattleperl.org/ > > > > ------------------------------------------------------------------------ > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays > WEB PAGE: http://seattleperl.org/ Have you tried inline.pm? Perl's language interpretor. Does C, Java, C++, plus the kitchen sink. How about: use Inline Java => 'DATA'; # Perl code goes here ... __DATA__ __Java__ /* Java code goes here ... */ :-) Strait from: Brian Ingerson . Jay Scherrer From jazzdev at gmail.com Wed Aug 23 18:25:26 2006 From: jazzdev at gmail.com (JD Brennan) Date: Wed, 23 Aug 2006 18:25:26 -0700 Subject: SPUG: Is Perl for .NET on anyone's radar? In-Reply-To: References: <009kHwVAQ6976S22.1156368462@cmsweb22.cms.usa.net> <44ECFA03.7000408@scherrer.com> Message-ID: Oh yes, I've used inline Java. It does 1) A fork/exec to compile the java code 2) A fork/exec to run the compiled code 3) Creates a pipe to send/receive arguments/return values So you need javac in your path, as well as java. And it adds IPC overhead. It does work, though and I've pushed a lot of data around with it. It does have some concurrency issues. JD On 8/23/06, Jay Scherrer wrote: > > JD Brennan wrote: > > Is there a JScript.net? or JavaScript.net? Translating > > Perl to JavaScript should be fairly straight-forward and > > then I could run Perl scripts in the JVM with Rhino or > > in the CLR (if there's a JavaScript for .NET) > > > > JD > > > > On 8/23/06, *JD Brennan* > > wrote: > > > > Yes, there a number of languages you can use that > > will run in a JVM. Jython, J/Ruby, Rhino (JavaScript), > > and JScheme are just the ones I know a bit about. > > I'm not sure that Sun did anything to encourage this > > besides publishing the spec for the JVM. But that's > > getting off topic for this list. > > > > I can think of 3 ways to approach this problem: > > > > 1) Write a Perl interpreter in C# > > 2) Write a translator from Perl to C# > > 3) Write a translator (compiler) from Perl to CLR byte codes > > > > 2 might be interesting since you could write it in Perl. > > Jython and JScheme use approach 1. JScheme also > > does 3. And, of course, if you do 2 you get a way to > > do 3 also, though it'll have the performance and > > debugging drawbacks that the old C-front version of C++ > > had back in the day. > > > > JD > > > > On 8/23/06, * David S. Patterson* > > wrote: > > > > > > I imagine writing a language translation layer for perl on top > > of JVM would be a major, major project. I'm sure a worthy > > one, but since I don't program in Java I'll just have to let > > it go by. By the way, has this been done for any other > > language? I think the java people may feel like that since > > they're already giving you platform independance, if you want > > to use the JVM just use it via Java. > > > > But I do an awful lot of work in C# on the .NET platform, yet > > I still miss the convenience of the perl syntax and language > > constructs. > > > > Also I'm impressed with the facilities and even coaching MS > > has provided for those that want to instantiate a new language > > binding on top of the CLI. That's why, I'm sure, the Python > > people were able to succeed. > > > > Most recently, the Monad group has made progress and has > > released Windows Power Shell > > http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx > > which is a new way of lashing together .NET CLR objects to do > > useful work using this new shell scripting language. > > > > But for me, I'm more interested in perl as a programming > > language, because it is so expressive (you get a lot of bang > > for each line of code you write) and it is precisely this > > linking and pipelining behavior that seems like would be a > > good fit on top of the .NET API. > > > > Just my three cents... > > > > > > > > _____________________________________________________________ > > Seattle Perl Users Group Mailing List > > POST TO: spug-list at pm.org > > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > > MEETINGS: 3rd Tuesdays > > WEB PAGE: http://seattleperl.org/ > > > > > > > > ------------------------------------------------------------------------ > > > > _____________________________________________________________ > > Seattle Perl Users Group Mailing List > > POST TO: spug-list at pm.org > > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > > MEETINGS: 3rd Tuesdays > > WEB PAGE: http://seattleperl.org/ > Have you tried inline.pm? Perl's language interpretor. Does C, Java, > C++, plus the kitchen sink. > How about: > use Inline Java => 'DATA'; > > # Perl code goes here ... > > __DATA__ > __Java__ > /* Java code goes here ... */ > > > :-) > Strait from: Brian Ingerson < INGY at cpan.org>. > > Jay Scherrer > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20060823/e082dcbf/attachment.html From jarich at perltraining.com.au Wed Aug 23 18:54:56 2006 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Thu, 24 Aug 2006 11:54:56 +1000 Subject: SPUG: Is Perl for .NET on anyone's radar? In-Reply-To: References: <009kHwVAQ6976S22.1156368462@cmsweb22.cms.usa.net> Message-ID: <44ED06F0.8000604@perltraining.com.au> JD Brennan wrote: > Is there a JScript.net? or JavaScript.net? Translating > Perl to JavaScript should be fairly straight-forward and > then I could run Perl scripts in the JVM with Rhino or > in the CLR (if there's a JavaScript for .NET) JScript .NET: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/jscript7/html/jsorijscript.asp My whole experience with .NET is related instead to mono. But what is possible in one, should be possible in the other, surely. Mono has a rather impressive list of supported languages at: http://www.mono-project.com/Languages It's a shame Perl's not on there, although I had previously thought it was due to their FAQ: Windows has compilers that target the virtual machine from a number of languages: (http://msdn.microsoft.com/net/thirdparty/default.asp#lang) Managed C++, Java Script, Eiffel, Component Pascal, APL, Cobol, Perl, Python, Scheme, Smalltalk, Standard ML, Haskell, Mercury and Oberon. Not quite sure what to make of that. J -- ("`-''-/").___..--''"`-._ | Jacinta Richardson | `6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia | (_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 | _..`--'_..-_/ /--'_.' ,' | contact at perltraining.com.au | (il),-'' (li),' ((!.-' | www.perltraining.com.au | From jobs-noreply at seattleperl.org Wed Aug 23 23:05:33 2006 From: jobs-noreply at seattleperl.org (SPUG Jobs) Date: Wed, 23 Aug 2006 23:05:33 -0700 (PDT) Subject: SPUG: JOB: Several new Perl Dev positions at Whitepages.com Message-ID: Whitepages.com's continued growth has created several new Perl developer positions in our downtown Seattle offices (Raniner Tower, 5th and Union). We are accepting resumes for mid and senior level developers until further notice. These are full-time permanent (W-2) positions with full Whitpeages benefits including but not limited to: * Profit sharing * Stock options * Yearly education allowance * Puget Sound Flex Pass * Free snacks and * Free Friday Lunch. For more details about the specific positions, contact me via the email address or phone number listed below. Thanks for listening! Daina Wilburn W H I T E P A G E S .C O M | I N C p: 206.812.9216 | f: 206.621.1375 dwilburn at whitepages.com www.whitepagesinc.com From jay at scherrer.com Sat Aug 26 23:13:22 2006 From: jay at scherrer.com (Jay Scherrer) Date: Sat, 26 Aug 2006 23:13:22 -0700 Subject: SPUG: Perl Journal? Message-ID: <44F13802.1090607@scherrer.com> Does the Perl Journal still exist? I thinking of submitting an article for this next Tax season. If so whom should I contact? Jay Scherrer From krahnj at telus.net Sun Aug 27 01:11:29 2006 From: krahnj at telus.net (John W. Krahn) Date: Sun, 27 Aug 2006 01:11:29 -0700 Subject: SPUG: Perl Journal? In-Reply-To: <44F13802.1090607@scherrer.com> References: <44F13802.1090607@scherrer.com> Message-ID: <44F153B1.1040206@telus.net> Jay Scherrer wrote: > Does the Perl Journal still exist? > I thinking of submitting an article for this next Tax season. If so whom > should I contact? You could always submit to The Perl Review: theperlreview at gmail.com John -- use Perl; program fulfillment From tim at consultix-inc.com Mon Aug 28 08:02:02 2006 From: tim at consultix-inc.com (Tim Maher) Date: Mon, 28 Aug 2006 08:02:02 -0700 Subject: SPUG: Perl Journal? In-Reply-To: <44F13802.1090607@scherrer.com> References: <44F13802.1090607@scherrer.com> Message-ID: <20060828150202.GA4186@jumpy.consultix-inc.com> On Sat, Aug 26, 2006 at 11:13:22PM -0700, Jay Scherrer wrote: > Does the Perl Journal still exist? > I thinking of submitting an article for this next Tax season. If so whom > should I contact? > > Jay Scherrer The Perl Journal went out of business some time ago. The Perl Review is our only remaining periodical, AFAIK. -Tim *-------------------------------------------------------------------* | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim at ( Consultix-Inc, TeachMePerl, or TeachMeUnix ) dot Com | *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-* | UPCOMING CLASSES; 9/18: UNIX/Linux Fundamentals 10/9: Basic Perl | | Watch for my Sept. '06 book: "Minimal Perl for UNIX/Linux People" | | See MinimalPerl.com for details, ordering, and email-list signup | *-------------------------------------------------------------------* From coderef at gmail.com Sat Aug 26 17:33:06 2006 From: coderef at gmail.com (Clint Moore) Date: Sat, 26 Aug 2006 17:33:06 -0700 Subject: SPUG: Is Perl for .NET on anyone's radar? In-Reply-To: References: <009kHwVAQ6976S22.1156368462@cmsweb22.cms.usa.net> Message-ID: <81eb25f70608261733ie8f7354tfa6581fc001283ec@mail.gmail.com> On 8/23/06, JD Brennan wrote: > 1) Write a Perl interpreter in C# > 2) Write a translator from Perl to C# > 3) Write a translator (compiler) from Perl to CLR byte codes Further reading on parsing perl for those that might be interested: http://www.perlmonks.org/index.pl?node_id=44722 -cm From jobs-noreply at seattleperl.org Tue Aug 29 15:35:03 2006 From: jobs-noreply at seattleperl.org (SPUG Jobs) Date: Tue, 29 Aug 2006 15:35:03 -0700 (PDT) Subject: SPUG: JOB: Contract Perl Developers Message-ID: We are assembling a task force of Automation Tool/Framework Developers! Working with our world-class engineering team, you will drive design, implementation, documentation of test automation programs and the creation of software tools used by our testers and developers. Key Qualifications: Successful candidates must possess a strong grasp of client-server development and Perl experience. Candidates need to have at least 3 years of experience developing reliable and extensible database-driven applications and tools. Other Qualifications: - Meet development milestones and business objectives on schedule. - Write maintainable code that is easy to read, maintainable, and well-documented - Communicate closely and effectively with engineering and QA Teams. - Experience working in an open source environment (Linux, CVS, etc.) - Desire to work in fast-paced team environment. - Test driven development and exceptional knowledge of the Software Development Life Cycle - Ability to plan & prioritize work with exceptional problem solving & troubleshooting skills Additional Details: This is a 3mo Contract through Agency Client company designs enterprise IT systems Rate: 30~50/hr for W-2 or 1099 Located in Seattle; No Telecommuting Interested Candidates or referrals should send resume to: resume(at)artisanconsult(dot)com