From benjamin at golly.com Wed Dec 5 09:54:43 2001 From: benjamin at golly.com (Benjamin Franks) Date: Wed Aug 4 00:08:29 2004 Subject: No subject Message-ID: <20011205155443.2ACC436F9@sitemail.everyone.net> I'm using the LWP::UserAgent for a small tcp/ip client/server application I've written. All that the client does is query a small http server I've written on a different host. It works. However, after a couple thousand connections, I notice the client(s) stop getting info from the server. They continue to run, but when I look at netstat, I see a high number of clients stuck in the FIN_WAIT_2 state (the second part of the disconnection sequence). They don't seem to come out of this state. Concurrent with this problem, I notice error messages from the client something like: Can't locate LWP/Authen/Negotiate.pm in @INC ... Can't locate LWP/Authen/Ntlm.pm in @INC ... But these errors only come up after the application has run for a long time, and seem to also coincide with a lot of waiting processes which haven't disconnected. Here is the rough-code for the small, custom web server. It's a single-process, no-threads, doesn't fork, etc.. I'm running FreeBSD 4.3 on both client and server system. Has anyone had problems like this before? I've been looking through Stephen's Unix Network Programming, and there are small references to things like shutting down sockets rather than closing them. Or that on BSD, there is a roughly 11 minute timeout for FIN_WAIT_2 states. Is there a sysctl variable I can set to decrease this? Am I running out of descriptors when too many get locked in FIN_WAIT_2, and is that why I can't successfully request? Any info or ideas would be appreciated. Thank you, --Ben my $socket=IO::Socket::INET->new ( LocalPort => $port, Listen => SOMAXCONN, Reuse => 1 ) or die "oops: $!"; while (#some continuation conditions#) { eval { local $SIG{HUP}=sub{$done++; die;}; ($c,$remote_addr)=$socket->accept; }; local $/ = "\015\012\015\012"; $req=<$c>; if ($c) { #do some stuff and print back to $c# close $c; } } close($socket); _____________________________________________________________ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From jimfl at colltech.com Wed Dec 5 10:40:32 2001 From: jimfl at colltech.com (Jim Flanagan) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: Re: In-Reply-To: <20011205155443.2ACC436F9@sitemail.everyone.net> References: <20011205155443.2ACC436F9@sitemail.everyone.net> Message-ID: <233897.1007541631@[0.0.0.0]> --On Wednesday, December 5, 2001 7:54 AM -0800 Benjamin Franks wrote: > I'm using the LWP::UserAgent for a small tcp/ip client/server > application I've written. All that the client does is query a small > http server I've written on a different host. It works. > > However, after a couple thousand connections, I notice the client(s) > stop getting info from the server. They continue to run, but when I > look at netstat, I see a high number of clients stuck in the > FIN_WAIT_2 state (the second part of the disconnection sequence). > They don't seem to come out of this state. Concurrent with this > problem, I notice error messages from the client something like: The FIN_WAIT_2 states will eventually time out, but you are probably getting connections faster than they are timing out (generally 4 minutes). The reason you get these is you are closing the connection at the server side. If you let the client close the connection you will not get these (the client will instead). Of course, because your server is single-threaded, a client could possibly hold up the whole process. -- Jim Flanagan jimfl@colltech.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From jay at Scherrer.com Wed Dec 5 13:13:06 2001 From: jay at Scherrer.com (Jay Scherrer) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: Perl Social Get Together 11/30 In-Reply-To: References: Message-ID: <200112051913.fB5JD6G12305@localhost.localdomain> Thanks, I just wanted to thank Jennifer for a great Social. It was fun. Jay - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From asa.martin at attws.com Wed Dec 5 13:25:07 2001 From: asa.martin at attws.com (Martin, Asa) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: Barewords and Net::SNMP Message-ID: <67FC0E2A32D0D31194500008C7CF2E6F05528F08@wa-msg09.entp.attws.com> I have a specific question about the Net::SNMP module, but it also could be a general question regarding barewords and constants. Hopefully I'll make this clear. The Net::SNMP module defines a method called set_request, that takes as an argument a reference to an array, like this: $session->set_request(-varbindlist => \@oid_value) The middle value of this array is a type value, several of which are exported by Net::SNMP. For example, the documentation shows this: my $sysContact = '1.3.6.1.2.1.1.4.0'; my $result = $session->set_request( -varbindlist => [$sysContact, OCTET_STRING, 'Help Desk x911'] ); This works all well and good. However, when I try and do something like this: my $sysContact = '1.3.6.1.2.1.1.4.0'; my $type = 'OCTET_STRING'; my $value = 'Help Desk x911'; my $result = $session->set_request( -varbindlist => [$sysContact, $type, "$value"] ); It errors out saying: Unknown ASN.1 type [OCTET_STRING]. even though according to the docs, OCTET_STRING "exported" by default. Is there a way to force the $type variable to be considered a "bareword" by Perl and have it interpolate correctly? I don't know if that is phrased correctly, but hopefully you understand the question. I'm also sending this to the author of Net::SNMP and he might be able to shed some light on the matter. Thanks so much. Asa Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20011205/b8601200/attachment.htm From jimfl at colltech.com Wed Dec 5 13:56:29 2001 From: jimfl at colltech.com (Jim Flanagan) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: Barewords and Net::SNMP In-Reply-To: <67FC0E2A32D0D31194500008C7CF2E6F05528F08@wa-msg09.entp.attws.com> References: <67FC0E2A32D0D31194500008C7CF2E6F05528F08@wa-msg09.entp.attws.co m> Message-ID: <939370.1007553389@[0.0.0.0]> --On Wednesday, December 5, 2001 11:25 AM -0800 "Martin, Asa" wrote: > my $sysContact = '1.3.6.1.2.1.1.4.0'; > my $type = 'OCTET_STRING'; > my $value = 'Help Desk x911'; > my $result = $session->set_request( > -varbindlist => [$sysContact, $type, "$value"] > ); > > It errors out saying: > Unknown ASN.1 type [OCTET_STRING]. > even though according to the docs, OCTET_STRING "exported" by > default. > > Is there a way to force the $type variable to be considered a > "bareword" by Perl and have it interpolate correctly? I don't know > if that is phrased correctly, but hopefully you understand the > question. I'm also sending this to the author of Net::SNMP and he > might be able to shed some light on the matter. OCTET_STRING is a constant, which means it is a subroutine which returns a constant, which the perl compiler will inline the constant that the subroutine returns (rather than have a subroutine call at runtime). So the assignment that you want to make is my $type = OCTET_STRING ; Then $type will have the appropriate value for be used in the set_request() call. -- Jim Flanagan jimfl@colltech.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From jeremy_kahn at yahoo.com Wed Dec 5 15:50:02 2001 From: jeremy_kahn at yahoo.com (Jeremy Kahn) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: Barewords and Net::SNMP In-Reply-To: <67FC0E2A32D0D31194500008C7CF2E6F05528F08@wa-msg09.entp.attws.com> Message-ID: <20011205215002.50375.qmail@web14510.mail.yahoo.com> --- "Martin, Asa" wrote: > The Net::SNMP module defines a method called > set_request, that takes as an > argument a reference to an array, like this: > > my $sysContact = '1.3.6.1.2.1.1.4.0'; > my $result = $session->set_request( > -varbindlist => [$sysContact, OCTET_STRING, 'Help > Desk x911'] > ); works. > my $sysContact = '1.3.6.1.2.1.1.4.0'; > my $type = 'OCTET_STRING'; > my $value = 'Help Desk x911'; > my $result = $session->set_request( > -varbindlist => [$sysContact, $type, "$value"] > ); Fails. Here's why. OCTET_STRING is actually not a string, it's a function. (Reading the code for Net::SNMP suggests that the function returns 0x04). You can't use the _string_ 'OCTET_STRING' as the argument to set_request, you have to use the return value of the function of the same name. When you use it by reference ($type above), you're actually passing in the string 'OCTET_STRING', instead of the return value from the sub &OCTET_STRING, which is what you get when you don't use singlequotes. Untested fix to the latter example: my $sysContact = '1.3.6.1.2.1.1.4.0'; my $type = OCTET_STRING; # removed the single-quotes my $value = 'Help Desk x911'; my $result = $session->set_request( -varbindlist => [$sysContact, $type, "$value"] ); HTH, Jeremy __________________________________________________ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From pdarley at kinesis-cem.com Thu Dec 6 10:19:45 2001 From: pdarley at kinesis-cem.com (Peter Darley) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: Shared memory system Message-ID: Friends, I'm interested in setting up a shared memory system on a web application, for database caching and such, and I was wondering if any of y'all had any helpful suggestions? Thanks, Peter Darley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From bill at celestial.com Thu Dec 6 11:07:40 2001 From: bill at celestial.com (Bill Campbell) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: Shared memory system In-Reply-To: ; from pdarley@kinesis-cem.com on Thu, Dec 06, 2001 at 08:19:45AM -0800 References: Message-ID: <20011206090740.A2113@barryg.mi.celestial.com> On Thu, Dec 06, 2001 at 08:19:45AM -0800, Peter Darley wrote: >Friends, > I'm interested in setting up a shared memory system on a web application, >for database caching and such, and I was wondering if any of y'all had any >helpful suggestions? Look at mm which I think is designed to share memory pool between various apache modules? Bill -- INTERNET: bill@Celestial.COM Bill Campbell; Celestial Software LLC UUCP: camco!bill PO Box 820; 6641 E. Mercer Way FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676 URL: http://www.celestial.com/ When a place gets crowded enough to require ID's, social collapse is not far away. It is time to go elsewhere. The best thing about space travel is that it made it possible to go elsewhere. -- Robert Heinlein - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From starfire at zipcon.net Thu Dec 6 12:13:58 2001 From: starfire at zipcon.net (Richard Anderson) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: Re: Shared memory system References: Message-ID: <004e01c17e81$c7a6e890$3788ddd1@aciwin> The Perl module Apache::ASP may be of interest ... Richard Anderson Software Professional 206.547.6903 starfire@zipcon.net ----- Original Message ----- From: "Peter Darley" To: "SPUG" Sent: Thursday, December 06, 2001 8:19 AM Subject: SPUG: Shared memory system > Friends, > I'm interested in setting up a shared memory system on a web application, > for database caching and such, and I was wondering if any of y'all had any > helpful suggestions? > Thanks, > Peter Darley > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From cmeyer at helvella.org Thu Dec 6 13:31:09 2001 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: Shared memory system In-Reply-To: References: Message-ID: <20011206113109.J32280@hobart.helvella.org> Hi, Peter, On Thu, Dec 06, 2001 at 08:19:45AM -0800, Peter Darley wrote: > Friends, > I'm interested in setting up a shared memory system on a web application, > for database caching and such, and I was wondering if any of y'all had any > helpful suggestions? If you are running under Apache then consider coding a mod_perl application. There are many oportunities for caching withing a mod_perl app, and there are a number of useful modules. Probably the best place to start is the guide: http://perl.apache.org/guide There's a lot of information, but it is well worth your while to read it if you are plan on doing mod_perl coding. If your question was a little more specific, then I might be able to give you more precise advice. If you are considering reading informtation from a database to cache in ram, perhaps that information belongs in a regular file, and you could let your operating system cache it in disk buffers. That is often quite fast enough. Also keep in mind that if you are reading/writing to a database on each http request of a webapp, the connection time (creating a new db handle) can be horrendous; caching the db handle between requests can save you a bundle. See Apache::DBI. Have fun, -C. Have fun, -C. > Thanks, > Peter Darley > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From pdarley at kinesis-cem.com Thu Dec 6 15:49:04 2001 From: pdarley at kinesis-cem.com (Peter Darley) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: Shared memory system In-Reply-To: <20011206113109.J32280@hobart.helvella.org> Message-ID: Colin, Thanks for the link to mod_perl guide, it's already proven quite useful. I'd forgotten about the Apache::DBI (tho it doesn't seem to make much of a difference on this system) I'm wanting to cache report data from the database so it's available for formatting when people request it. I'd like to have something in-memory, as I have tons of available memory on this machine, and would like to get some use out of it; I would also like to do this somewhat as a learning exercise. So, I want to be able to share variables between processes without writing them to disk. Thanks, Peter Darley -----Original Message----- From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org]On Behalf Of Colin Meyer Sent: Thursday, December 06, 2001 11:31 AM To: Peter Darley Cc: SPUG Subject: Re: SPUG: Shared memory system If you are running under Apache then consider coding a mod_perl application. There are many oportunities for caching withing a mod_perl app, and there are a number of useful modules. Probably the best place to start is the guide: http://perl.apache.org/guide There's a lot of information, but it is well worth your while to read it if you are plan on doing mod_perl coding. If your question was a little more specific, then I might be able to give you more precise advice. If you are considering reading informtation from a database to cache in ram, perhaps that information belongs in a regular file, and you could let your operating system cache it in disk buffers. That is often quite fast enough. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From cmeyer at helvella.org Thu Dec 6 16:18:56 2001 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: Shared memory system In-Reply-To: References: <20011206113109.J32280@hobart.helvella.org> Message-ID: <20011206141856.B4222@hobart.helvella.org> Hi, Peter, On Thu, Dec 06, 2001 at 01:49:04PM -0800, Peter Darley wrote: > Colin, > Thanks for the link to mod_perl guide, it's already proven quite useful. > I'd forgotten about the Apache::DBI (tho it doesn't seem to make much of a > difference on this system) I've experienced db connect times as high as several seconds, but if your db is quite local, then the connection time savings might not be so high. Another benefit Apache::DBI is being able to cache frequently used statement handles, if your backend driver (DBD module) supports it. > I'm wanting to cache report data from the database so it's available for > formatting when people request it. I'd like to have something in-memory, as > I have tons of available memory on this machine, and would like to get some > use out of it; I would also like to do this somewhat as a learning > exercise. The section of the guide that you'll want to study is: http://perl.apache.org/guide/performance.html#Know_Your_Operating_System The shared memory modules (IPC::*) are difficult to use (don't take well to holding Perl data structures), and somewhat buggy (at least on linux, under stress testing - I got segfaults) in my experience. The typical way to share memory in a mod_perl app is to take advantage of your os's "copy-on-write" memory handling. A forked process receives a copy of its parent's memory. But your os only copies the pages that have had data written to since the fork. By preloading data into the parent apache/mod_perl process, and not writing to it, it remains shared between all of the children. To take advantage of this scheme you'd have to restart apache on a regular basis (daily) and have the parent process do the database read before it forks the children. > So, I want to be able to share variables between processes > without writing them to disk. Another way about it would be to take advantage of your os's disk file caching ability. You could have a cron job that would at some regular interval access the db, select out report data, and save it to a file, in Storable format, or whatever. Your webapp would read the data from the file. Your os will take advantage of any excess ram, and keep the often accessed files in disk buffers - caching that is transparent to your application. If you have the time, it isn't too difficult to set up simple test scenarios and benchmark them. When dealing with webapp caching, layered with your os being clever, the results can sometimes be unpredictable. Have fun, -C. > Thanks, Peter Darley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From cmeyer at helvella.org Thu Dec 6 16:24:25 2001 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: Shared memory system In-Reply-To: <20011206141856.B4222@hobart.helvella.org> References: <20011206113109.J32280@hobart.helvella.org> <20011206141856.B4222@hobart.helvella.org> Message-ID: <20011206142425.A4838@hobart.helvella.org> On Thu, Dec 06, 2001 at 02:18:56PM -0800, Colin Meyer wrote: > > The shared memory modules (IPC::*) are difficult to use (don't take well > to holding Perl data structures), and somewhat buggy (at least on linux, > under stress testing - I got segfaults) in my experience. I shouldn't have said IPC::*, I meant IPC::Semaphore and its friends. There are alot of modules under IPC::* that I haven't played with! -C. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From pdarley at kinesis-cem.com Thu Dec 6 16:35:17 2001 From: pdarley at kinesis-cem.com (Peter Darley) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: Shared memory system In-Reply-To: <20011206142425.A4838@hobart.helvella.org> Message-ID: Colin, IPC::Shareable seems to be closest to doing what I want; is that included in IPC::Semaphore and it's friends? :) I was also considering building a very light shared variables daemon and module. The daemon would do nothing but deal with setting and retrieving variables, and the module would handle io and allow tying of variables to the external variable store. It seems like this could be very small and pretty easy to build, but I gotta admit, may have challenges that I don't foresee and am not equipped to deal with. Any thought anyone? Thanks, Peter Darley -----Original Message----- From: Colin Meyer [mailto:cmeyer@helvella.org] Sent: Thursday, December 06, 2001 2:24 PM To: Colin Meyer Cc: Peter Darley; SPUG Subject: Re: SPUG: Shared memory system On Thu, Dec 06, 2001 at 02:18:56PM -0800, Colin Meyer wrote: > > The shared memory modules (IPC::*) are difficult to use (don't take well > to holding Perl data structures), and somewhat buggy (at least on linux, > under stress testing - I got segfaults) in my experience. I shouldn't have said IPC::*, I meant IPC::Semaphore and its friends. There are alot of modules under IPC::* that I haven't played with! -C. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From kenslinux at shaw.ca Thu Dec 6 17:23:58 2001 From: kenslinux at shaw.ca (Ken Clarke) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: Shared memory system References: Message-ID: <017d01c17ead$1543ee60$94c54618@gv.shawcable.net> ----- Original Message ----- From: "Peter Darley" To: "Colin Meyer" Cc: "SPUG" Sent: December 6, 2001 1:49 PM Subject: RE: SPUG: Shared memory system > I'm wanting to cache report data from the database so it's available for > formatting when people request it. I'd like to have something in-memory, as > I have tons of available memory on this machine How about writing a server type app which runs when the system boots, queries the DB for the recordsets you want to hold in memory, then listens for connections from other scripts? >> Ken Clarke >> Contract Web Programmer / E-commerce Technologist >> www.perlprogrammer.net - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From cmeyer at helvella.org Thu Dec 6 17:49:26 2001 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: Shared memory system In-Reply-To: References: <20011206142425.A4838@hobart.helvella.org> Message-ID: <20011206154926.A4925@hobart.helvella.org> On Thu, Dec 06, 2001 at 02:35:17PM -0800, Peter Darley wrote: > Colin, > IPC::Shareable seems to be closest to doing what I want; is that included > in IPC::Semaphore and it's friends? :) Yup, IPC::Shareable sits on top of IPC::Semaphore. I do like the interface to IPC::Shareable, but don't try to store a "deep" Perl data structure with it. -C. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From ryan at e-valuations.com Thu Dec 6 20:27:19 2001 From: ryan at e-valuations.com (Ryan Ames) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: XML::Simple Message-ID: Hello, I am parsing a xml file using xml::simple and getting the following data structure when using Data::Dumper. This is my call to XMLin(): my $xsl = XML::Simple->new(forcearray => ['page','question','answer']); forcearray is supposed to force the items listed into array context. It is for 'page' and 'answer' but not for 'question'. Any reason for it not doing 'question'? Also, I am needing to grab the values of the 'answer_id' but I can't seem to figure out how to reference them. Any help would be appreciated. Thanks. $VAR1 = { 'pages' => { 'page' => [ { 'questions' => { 'question' => { 'HASH(0x837d908)' => { 'answers' => { 'answer' => [ { 'answer_id' => 257993 }, { 'answer_id' => 257994 }, { 'answer_id' => 257995 }, { 'answer_id' => 257996 }, { 'answer_id' => 257997 } ] }, 'ordering_question_id' => {} } } }, 'points' => {} } ] }, 'session_id' => 810, }; Ryan - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From dancerboy at strangelight.com Thu Dec 6 21:39:13 2001 From: dancerboy at strangelight.com (dancerboy) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: Shared memory system In-Reply-To: <20011206154926.A4925@hobart.helvella.org> References: <20011206142425.A4838@hobart.helvella.org> <20011206154926.A4925@hobart.helvella.org> Message-ID: Just a reminder: do a lot of benchmarking/profiling and testing *before* investing a lot of effort into any performance-improving scheme. Very often, the bottlenecks in your code are not where you think they are, and/or your planned optimizations won't end up improving anything. (E.g. in most cases implementing your own disk I/O caching is unlikely to improve performance -- and may even make it worse -- since the OS is doing I/O caching already, and custom Perl code is unlikely to do it any better.) (And never, ever forget this maxim: "Premature optimization is the root of all evil!") -jason At 3:49 pm -0800 12/06/2001, Colin Meyer wrote: >On Thu, Dec 06, 2001 at 02:35:17PM -0800, Peter Darley wrote: >> Colin, >> IPC::Shareable seems to be closest to doing what I want; is >>that included >> in IPC::Semaphore and it's friends? :) > >Yup, IPC::Shareable sits on top of IPC::Semaphore. I do like the interface >to IPC::Shareable, but don't try to store a "deep" Perl data structure >with it. > >-C. > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From pdarley at kinesis-cem.com Fri Dec 7 09:48:27 2001 From: pdarley at kinesis-cem.com (Peter Darley) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: Shared memory system In-Reply-To: Message-ID: Jason, That's good advice. I hadn't actually considered doing any benchmarking or anything. In this case this is to protect the database from extra work, rather than decreasing the amount of time it takes to present pages to the clients. I just hate having the database working on some huge batch job and seeing that half of it's cycles are going toward serving repetitive largely static stuff. Thanks, Peter Darley -----Original Message----- From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org]On Behalf Of dancerboy Sent: Thursday, December 06, 2001 7:39 PM To: Colin Meyer; Peter Darley Cc: Colin Meyer; SPUG Subject: Re: SPUG: Shared memory system Just a reminder: do a lot of benchmarking/profiling and testing *before* investing a lot of effort into any performance-improving scheme. Very often, the bottlenecks in your code are not where you think they are, and/or your planned optimizations won't end up improving anything. (E.g. in most cases implementing your own disk I/O caching is unlikely to improve performance -- and may even make it worse -- since the OS is doing I/O caching already, and custom Perl code is unlikely to do it any better.) (And never, ever forget this maxim: "Premature optimization is the root of all evil!") -jason At 3:49 pm -0800 12/06/2001, Colin Meyer wrote: >On Thu, Dec 06, 2001 at 02:35:17PM -0800, Peter Darley wrote: >> Colin, >> IPC::Shareable seems to be closest to doing what I want; is >>that included >> in IPC::Semaphore and it's friends? :) > >Yup, IPC::Shareable sits on top of IPC::Semaphore. I do like the interface >to IPC::Shareable, but don't try to store a "deep" Perl data structure >with it. > >-C. > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From billa at willapabay.org Fri Dec 7 19:06:50 2001 From: billa at willapabay.org (Bill Alford) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: Shared memory system In-Reply-To: <20011206154926.A4925@hobart.helvella.org> Message-ID: I've got a play project I'm working on where I'd like shared memory between processes. Unfortunately, I want it to run on Windows and Unix. The IPC routines don't work for the ActiveState libraries I have played with. And I want to avoid coding two paths for each OS. Does anyone have a suggestion other than implementing my own server to manage the data and communicating via sockets? (Which, for what I'm doing might be the better solution anyway. I just want more options. :) Thanks, Bill On Thu, 6 Dec 2001, Colin Meyer wrote: > On Thu, Dec 06, 2001 at 02:35:17PM -0800, Peter Darley wrote: > > Colin, > > IPC::Shareable seems to be closest to doing what I want; is that included > > in IPC::Semaphore and it's friends? :) > > Yup, IPC::Shareable sits on top of IPC::Semaphore. I do like the interface > to IPC::Shareable, but don't try to store a "deep" Perl data structure > with it. > > -C. > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From meonkeys at hotmail.com Sun Dec 9 20:13:53 2001 From: meonkeys at hotmail.com (Adam Monsen) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: XML::Simple Message-ID: Ryan, If you still want help with this, could you post the XML and the code you're using to parse it? It may be easier to use XML::XPath to get right at the data you want. Given this XML: --START xml --------------------------------------- amonsen@example.com meonkeys@hotmail.com MarketSuckemdry & Buy, INC. 0157H7 Honda Female --END xml --------------------------------------- To extract the content within the ClientName element, you'd do something like this: --BEGIN XML-XPath_test.pl-------------------------- #!/usr/bin/perl -w use XML::XPath; use XML::XPath::XMLParser; use strict; my $xml; while (<>) { $xml .= $_; } my $parser = XML::XPath::XMLParser->new(xml => $xml); my $root_node = $parser->parse; my $xpath = XML::XPath->new(context => $root_node); my $clientname = $xpath->find('/DataTribe/SendFunc/ClientName/text()'); print "Client is $clientname for this transaction\n"; --END XML-XPath_test.pl-------------------------- >From: "Ryan Ames" >To: >Subject: SPUG: XML::Simple >Date: Thu, 6 Dec 2001 18:27:19 -0800 > >Hello, > I am parsing a xml file using xml::simple and getting the >following data structure when using Data::Dumper. >This is my call to XMLin(): > >my $xsl = XML::Simple->new(forcearray => ['page','question','answer']); > >forcearray is supposed to force the items listed into array context. It >is for 'page' and 'answer' but not for 'question'. >Any reason for it not doing 'question'? >Also, I am needing to grab the values of the 'answer_id' but I can't >seem to figure out how to reference them. Any help >would be appreciated. Thanks. > > > >$VAR1 = { > > 'pages' => { > 'page' => [ > { > > 'questions' => { > 'question' => { > >'HASH(0x837d908)' => { > > > >'answers' => { > >'answer' => [ > >{ > > > >'answer_id' => 257993 > >}, > >{ > > > >'answer_id' => 257994 > >}, > >{ > > > >'answer_id' => 257995 > >}, > >{ > > > >'answer_id' => 257996 > >}, > >{ > > > >'answer_id' => 257997 > >} > >] > >}, > > > >'ordering_question_id' => {} > >} > } > }, > > 'points' => {} > } > ] > }, > 'session_id' => 810, > > }; > > > >Ryan > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ > > _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From daesin04 at kornet.net Mon Dec 10 00:48:13 2001 From: daesin04 at kornet.net (=?ks_c_5601-1987?B?wabB1r+px+A=?=) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: =?ks_c_5601-1987?B?W7GksO1dIHNwdWctbGlzdLTUIMGmwda/qcfgIMGkurjA1LTPtNku?= Message-ID: <200112100652.fBA6qHW06006@gocho.pm.org> ???? ??? ????? ????? ??? ??? ???? (?)????? ??? ???"????????"???. 1. ??/???? : ?? ???? ???? ????. 2. ???? ?? : ????? ????? ??? ???????. 3. ??? ?? : ??? ? ????????. ?????? ????? ????. 4. ?????? : ??? ??? ? ??? ??? ???? ????. 5. ?????? : ??? ?????? ????? ????? ????????? ????. 6. ??? ?? : 30% ??? ????? ?? ???? ??? ????.. 7. ?????? : ??? ????? ?? ??? ????.. ? ? ?? ???? ????? ??? ?? ????.. ? ?? ??? ??? ?? ? ??? ????. ???? ??? ??? ?????. ??? ??? ? ???? ?? ? ??? ????? ?? ??? ?? ??? [?? ]? ??? ?? ?????. ??? ??? ?? ??? ?? ??? ????. ??? ?? ???? ???? ? ?????? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20011210/91a5e42a/attachment.htm From tim at consultix-inc.com Mon Dec 10 22:39:29 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: Call for Lightning Talks Message-ID: <20011210203929.A24755@timji.consultix.wa.com> SPUGsters, In keeping with the joyful spirit of the holiday season, the plan for our 12/18 meeting is to have a "Festival of LIGHTNING TALKS", in which attendees give very short presentations on Perlish topics. Presentations will be limited to X minutes followed by a Y minute Q/A session, with X and Y respectively being 10/5, 7/3, or 5/2, depending on how many presenters we'll need to accommodate in the allotted time. So far, with zero arm-twisting, we've already got the following presentations lined up: * Jay and Henry (no, they don't make Cherry Garcia) showing off a program they wrote that does a 2001 Tax Return using Perl and TK, * me giving a talk on + the Perltidy beautifier, + Damian's Text::Autoformat module, and + how to use the latter to augment the capabilities of the former So now I'm asking for at least 7 more volunteers to talk on other cool topics! You won't have to spend a lot of time preparing materials (since the talks are so short), and nobody will expect a slick presentation. You can just wave your hands and yak if you want, or else bring a 3.5" VFAT, EXT2, or TAR diskette with stuff to share in text, HTML, PDF, GIF, or JPG format (for projection from my laptop). You can tell us about your favorite module, show us *your* new module, rant about what's wrong with Perl, show us glimpses of Perl 6, review a Perl book or magazine article, complain about the job market for Perl programmers, tell us what's happening at PerlMonks, or decipher for us your most cryptic JAPH-.sig. Come to think of it, if time permits, I might even show slides of my Spring GeekCruise vacation, and talk about the upcoming PerlWhirl 2001 in January! Now that's entertainment! 8-} I encourage each interested party to post a message to the group telling us what you propose to talk about, so A) we can get an inkling of what types of subjects will be covered in the meeting, and B) people interested in similar topics can find out about each other, and C) I can manage the allocation of time-slots in the schedule The "lightning talks" that were presented at the September meeting were very interesting and very well received, so I'm looking forward to another fun experience next week. Please join in to "make it so!" -Tim ============================================================= | Tim Maher, Ph.D. Tel: (206) 781-UNIX/8649 | | SPUG Founder & Leader Email: spug@seattleperl.org | | Seattle Perl Users Group HTTP: www.seattleperl.org | ============================================================= - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From Ryan.Parr at wwireless.com Tue Dec 11 11:05:05 2001 From: Ryan.Parr at wwireless.com (Parr, Ryan) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: HTTP Headers Message-ID: <6D6F0541E2B1D411A75B0002A513016D052410DA@wacorpml03.wwireless.com> I'm currently moving the intranet site I work on to be completely database based. However, I'm running into a snag with delivering documents to the user. Rather, delivering documents other than HTML to the user. If I have my CGI load a word doc that's stored in the database, and send it to the user with the appropriate mime type, the browser can handle it appropriately. Unfortunately though, I have no way to specify a filename for the content. So instead of receiving an Open/Save dialog for CMS_SOP.doc they receive an Open/Save dialog for /cgi-bin/loadpage.cgi?id=334, or the browser loads the word doc with the filename /cgi-bin/loadpage.cgi?id=334. I haven't been able to find any standard HTTP headers that deal with this scenario, nor any IE specific extension headers. I'm in a controlled environment so everyone has IE 4+. This approach to document delivery seems natural enough to me that I'm sure a thousand developers before me have attempted it, certainly some with success. Have any of you? -- Ryan Parr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From tleffler at u.washington.edu Tue Dec 11 12:35:21 2001 From: tleffler at u.washington.edu (Trevor Leffler) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: HTTP Headers References: <6D6F0541E2B1D411A75B0002A513016D052410DA@wacorpml03.wwireless.com> Message-ID: <3C1651E9.2090502@u.washington.edu> Ryan, First off, I'm going to ignore that you're storing entire binary docs in your DB, rather than letting your web server serve them up via the filesystem. Anywho... We came up with one possible solution, which assumes you're using Apache. Create a link URL such as: /download/CMS_SOP.doc?docid=334 Since the real filename is in the URL, your browser will use it in the "Save" dialog box. The /download directory has only a .htaccess file with these contents: ErrorDocument 404 /somepath/nph-download.cgi Since /download/CMS_SOP.doc doesn't actually exist, the nph-download.cgi script gets called instead. That script then finds the document via your DB thanks to the docid you passed it (we just store the private path to the doc, rather than the doc itself), prints the appropriate HTTP headers and Content-type, and streams the file contents to the browser. The reason you use an nph- script is to override the server headers, which will show a 404 "File not found" status. You'll want to start by printing something like: print "HTTP/1.1 200 OK\n", "Server: $ENV{SERVER_SOFTWARE}\n"; Then print an error page is something fails, or your Content-type and contents if everything succeeds. As an aside, you might think about using adequately random docid's, or perhaps encrypting them so that I can't download all your documents via iteration. That is, if doc access is an issue. Have fun! -- Trevor Leffler, Software Developer PETTT / Ed-Tech Development Group University of Washington (206) 616-3406 / OUGL 230, Box 353080 Parr, Ryan wrote: > I'm currently moving the intranet site I work on to be completely database > based. However, I'm running into a snag with delivering documents to the > user. Rather, delivering documents other than HTML to the user. > > If I have my CGI load a word doc that's stored in the database, and send it > to the user with the appropriate mime type, the browser can handle it > appropriately. Unfortunately though, I have no way to specify a filename for > the content. So instead of receiving an Open/Save dialog for CMS_SOP.doc > they receive an Open/Save dialog for /cgi-bin/loadpage.cgi?id=334, or the > browser loads the word doc with the filename /cgi-bin/loadpage.cgi?id=334. > > I haven't been able to find any standard HTTP headers that deal with this > scenario, nor any IE specific extension headers. I'm in a controlled > environment so everyone has IE 4+. This approach to document delivery seems > natural enough to me that I'm sure a thousand developers before me have > attempted it, certainly some with success. Have any of you? > > -- Ryan Parr > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From jope-spug at jope.net Tue Dec 11 12:48:42 2001 From: jope-spug at jope.net (El JoPe Magnifico) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: HTTP Headers In-Reply-To: <6D6F0541E2B1D411A75B0002A513016D052410DA@wacorpml03.wwireless.com> Message-ID: In the past, I've tacked on the suggested filename as (or at the end of) the PATH_INFO part of the URL, after the CGI script name, e.g. /cgi-bin/loadpage.cgi/suggested_name.doc?id=334 Works on Apache, dunno about other servers. Remember to URI-escape the filename first, to account for whitespace, etc. -jp On Tue, 11 Dec 2001, Parr, Ryan wrote: > I'm currently moving the intranet site I work on to be completely database > based. However, I'm running into a snag with delivering documents to the > user. Rather, delivering documents other than HTML to the user. > > If I have my CGI load a word doc that's stored in the database, and send it > to the user with the appropriate mime type, the browser can handle it > appropriately. Unfortunately though, I have no way to specify a filename for > the content. So instead of receiving an Open/Save dialog for CMS_SOP.doc > they receive an Open/Save dialog for /cgi-bin/loadpage.cgi?id=334, or the > browser loads the word doc with the filename /cgi-bin/loadpage.cgi?id=334. > > I haven't been able to find any standard HTTP headers that deal with this > scenario, nor any IE specific extension headers. I'm in a controlled > environment so everyone has IE 4+. This approach to document delivery seems > natural enough to me that I'm sure a thousand developers before me have > attempted it, certainly some with success. Have any of you? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From Ryan.Parr at wwireless.com Tue Dec 11 13:04:31 2001 From: Ryan.Parr at wwireless.com (Parr, Ryan) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: HTTP Headers Message-ID: <6D6F0541E2B1D411A75B0002A513016D0524112C@wacorpml03.wwireless.com> Thanks everyone for the suggestions. After testing them all here's what I've come up with: ** Disclaimer ** The following results are only my experience. Similarities between these results and the results of others, living or dead, are merely coincidence. Your results may vary. **************** Tacking on the filename as JP suggested (loadpage.cgi/filename.doc?id=xxx) works. The Open/Save dialog reports the '?id=xxx' portion, but it is removed when saved or opened, unless it's inlined and then saved. Tacking on the filename at the end of the URL per BR's suggestion works for the Open/Save dialog, however the actual opened or saved document is named the cgi. I.E. loadpage.doc. BT's suggestion of using Content-disposition: attachment; filename=filename.doc works for when the file is opened, but the Open/Save dialog is the URL. Combining / with the "Content-disposition:" HTTP headers will take care of any end-user confusion, and all methods are logged for future solutions. Thanks again for all your help! -- Ryan Parr -----Original Message----- From: El JoPe Magnifico [mailto:jope-spug@jope.net] Sent: Tuesday, December 11, 2001 10:49 AM To: Parr, Ryan Cc: Seattle Perl Users Group Subject: Re: SPUG: HTTP Headers In the past, I've tacked on the suggested filename as (or at the end of) the PATH_INFO part of the URL, after the CGI script name, e.g. /cgi-bin/loadpage.cgi/suggested_name.doc?id=334 Works on Apache, dunno about other servers. Remember to URI-escape the filename first, to account for whitespace, etc. -jp On Tue, 11 Dec 2001, Parr, Ryan wrote: > I'm currently moving the intranet site I work on to be completely database > based. However, I'm running into a snag with delivering documents to the > user. Rather, delivering documents other than HTML to the user. > > If I have my CGI load a word doc that's stored in the database, and send it > to the user with the appropriate mime type, the browser can handle it > appropriately. Unfortunately though, I have no way to specify a filename for > the content. So instead of receiving an Open/Save dialog for CMS_SOP.doc > they receive an Open/Save dialog for /cgi-bin/loadpage.cgi?id=334, or the > browser loads the word doc with the filename /cgi-bin/loadpage.cgi?id=334. > > I haven't been able to find any standard HTTP headers that deal with this > scenario, nor any IE specific extension headers. I'm in a controlled > environment so everyone has IE 4+. This approach to document delivery seems > natural enough to me that I'm sure a thousand developers before me have > attempted it, certainly some with success. Have any of you? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From tuck at whistlingfish.net Tue Dec 11 13:42:21 2001 From: tuck at whistlingfish.net (Matt Tucker) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: HTTP Headers In-Reply-To: <3C1651E9.2090502@u.washington.edu> References: <6D6F0541E2B1D411A75B0002A513016D052410DA@wacorpml03.wwireles s.com> <3C1651E9.2090502@u.washington.edu> Message-ID: <35550000.1008099740@benzene> -- Trevor Leffler spake thusly: > First off, I'm going to ignore that you're storing entire binary docs > in your DB, rather than letting your web server serve them up via the > filesystem. Anywho... > > We came up with one possible solution, which assumes you're using > Apache. Create a link URL such as: > > /download/CMS_SOP.doc?docid=334 > > Since the real filename is in the URL, your browser will use it in > the "Save" dialog box. > > The /download directory has only a .htaccess file with these contents: > > ErrorDocument 404 /somepath/nph-download.cgi A better solution to this would be to use the cgi as part of the URL, rather than repurposing the 404 handling. Instead of: /download/CMS_SOP.doc?docid=334 do: /somepath/nph-download.cgi/CMS_SOP.doc?docid=334 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/spug-list/attachments/20011211/35bc3a89/attachment.bin From Ryan.Parr at wwireless.com Tue Dec 11 14:12:13 2001 From: Ryan.Parr at wwireless.com (Parr, Ryan) Date: Wed Aug 4 00:08:29 2004 Subject: SPUG: HTTP Headers Message-ID: <6D6F0541E2B1D411A75B0002A513016D05241153@wacorpml03.wwireless.com> I like this solution very much. It works flawlessly. Thanks! -- Ryan -----Original Message----- From: Trevor Leffler [mailto:tleffler@u.washington.edu] Sent: Tuesday, December 11, 2001 10:35 AM To: spug-list@pm.org Subject: Re: SPUG: HTTP Headers Ryan, First off, I'm going to ignore that you're storing entire binary docs in your DB, rather than letting your web server serve them up via the filesystem. Anywho... We came up with one possible solution, which assumes you're using Apache. Create a link URL such as: /download/CMS_SOP.doc?docid=334 Since the real filename is in the URL, your browser will use it in the "Save" dialog box. The /download directory has only a .htaccess file with these contents: ErrorDocument 404 /somepath/nph-download.cgi Since /download/CMS_SOP.doc doesn't actually exist, the nph-download.cgi script gets called instead. That script then finds the document via your DB thanks to the docid you passed it (we just store the private path to the doc, rather than the doc itself), prints the appropriate HTTP headers and Content-type, and streams the file contents to the browser. The reason you use an nph- script is to override the server headers, which will show a 404 "File not found" status. You'll want to start by printing something like: print "HTTP/1.1 200 OK\n", "Server: $ENV{SERVER_SOFTWARE}\n"; Then print an error page is something fails, or your Content-type and contents if everything succeeds. As an aside, you might think about using adequately random docid's, or perhaps encrypting them so that I can't download all your documents via iteration. That is, if doc access is an issue. Have fun! -- Trevor Leffler, Software Developer PETTT / Ed-Tech Development Group University of Washington (206) 616-3406 / OUGL 230, Box 353080 Parr, Ryan wrote: > I'm currently moving the intranet site I work on to be completely database > based. However, I'm running into a snag with delivering documents to the > user. Rather, delivering documents other than HTML to the user. > > If I have my CGI load a word doc that's stored in the database, and send it > to the user with the appropriate mime type, the browser can handle it > appropriately. Unfortunately though, I have no way to specify a filename for > the content. So instead of receiving an Open/Save dialog for CMS_SOP.doc > they receive an Open/Save dialog for /cgi-bin/loadpage.cgi?id=334, or the > browser loads the word doc with the filename /cgi-bin/loadpage.cgi?id=334. > > I haven't been able to find any standard HTTP headers that deal with this > scenario, nor any IE specific extension headers. I'm in a controlled > environment so everyone has IE 4+. This approach to document delivery seems > natural enough to me that I'm sure a thousand developers before me have > attempted it, certainly some with success. Have any of you? > > -- Ryan Parr > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From dancerboy at strangelight.com Tue Dec 11 18:52:28 2001 From: dancerboy at strangelight.com (dancerboy) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: HTTP Headers In-Reply-To: <35550000.1008099740@benzene> References: <6D6F0541E2B1D411A75B0002A513016D052410DA@wacorpml03.wwireles s.com> <3C1651E9.2090502@u.washington.edu> <35550000.1008099740@benzene> Message-ID: There's actually a much more elegant solution. Try sending these headers: print "Content-type: application/download\n"; print "Content-Disposition: attachment; filename=foobar.doc\n\n"; BTW, you should be aware of one potential gotcha when downloading with IE: IE normally sends *two* GET requests for each file that it downloads. (Actually, I think it's probably a HEAD request followed by a GET request, but for most CGI applications, the effect is the same.) The first is sent by the browser proper, to find out what sort of file it is. The second is sent by the "Download Manager" to do the actual download. Usually, this doesn't cause any problems, but occasionally you may have reason to set up a system in which a download request also causes a state change on the server. In this case, IE's download mechanism can cause problems. E.g. I once set up a system, intended to be used by only a single client from a single location, that had a much-used "download everything that hasn't already been downloaded" feature. It took me a while to figure out why this feature worked with Netscape but IE kept downloading empty files. It was because, with IE, my script was seeing two download requests right in a row, so of course when it got the second download request, it believed that it had already downloaded everything it had, and had no new records to send. -jason - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From tim at consultix-inc.com Fri Dec 14 11:49:22 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: Bio-Perl Gig Message-ID: <20011214094922.B23234@timji.consultix.wa.com> POSITION TITLE: Perl Programmer / Analyst REQUIRED SKILL SET: This position requires a minimum of 3 years of PERL programming experience, advanced proficiency with PERL, Intermediate SQL Server DBA expertise required, C++ and/or other programming languages preferred, an AA degree or equivalent in a computer related field, BS in computer sciences preferred; and an education/training in biological sciences helpful. PERMANENT POSITION: We offer a competitive salary, stock options and a generous benefits package. For more information please refer to: www.lsbio.com. PLACEMENT: Directly with company. W-2 VS. 1099 STATUS: LifeSpan is a Corporation and has no restrictions on 1099 status. PHYSICAL LOCATION: Seattle, WA -- Telecommuting is may be possible under special circumstances. COMPANY'S PRODUCT OR SERVICE: Molecular Pathology OFFICIAL POSTING: LifeSpan BioSciences, Inc., a rapidly growing molecular pathology company located in scenic downtown Seattle overlooking Elliott Bay has an opening for a PERL Programmer / Analyst. This position designs, builds, and maintains middle tier software systems used primarily for batch processing. This position will create documentation and design specifications, troubleshoot problems with software systems, write supporting applications to maintain web content, etc. This position requires a minimum of 3 years of PERL programming experience, advanced proficiency with PERL, Intermediate SQL Server DBA expertise required, C++ and/or other programming languages preferred, an AA degree or equivalent in a computer related field, BS in computer sciences preferred; and an education/training in biological sciences helpful. We offer a competitive salary, stock options and a generous benefits package. For more information please refer to: www.lsbio.com. Qualified candidates are encourage to send a cover letter indicating position title and resume to: Human Resources LifeSpan BioSciences 2401 Fourth Avenue, Suite 900 Seattle, WA 98121 hr@lsbio.com Fax: (206) 770-7754 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From tim at consultix-inc.com Fri Dec 14 11:54:34 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: Perl Gig in Fremont/Wallingford Message-ID: <20011214095434.C23234@timji.consultix.wa.com> Friends, I'm going to have a job opening very shortly and am soliciting resumes/applications. This position is for a Perl programmer, requiring some knowledge of CGI, DBI, Apache Mod_Perl and SQL. Knowledge of PostgreSQL, DHTML, JavaScript a plus. Ability to research and solve problems is more valuable to us than breadth of current Perl knowledge. This is a contract position with pay DOE. We are hiring directly, without any pre-screening by an HR department. We are located on Stone Way between Wallingford and Freemont. Telecommuting may be possible after getting a full understanding of our needs, but would still require significant presence in the office. Kinesis CEM, LLC provides Customer Experience Management solutions to businesses. What this means is that we help our clients provide the best possible customer experience to their customers, through measurement, training, directed feedback, incentives and business consulting. Our office is a very informal setting, where there is currently one programmer. This is an excellent opportunity to work in a friendly informal environment and become our preferred vendor for future programming needs! I can be contacted at PDarley@Kinesis-CEM.com or at (206)380-9043. Thanks, Peter Darley Director of Information Technology Kinesis CEM, LLC - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From mkorb at versuslaw.com Mon Dec 17 09:57:25 2001 From: mkorb at versuslaw.com (Martin Korb) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: search algorithm Message-ID: <002401c18713$85d37240$7201a8c0@versuslaw.com> Here is the problem: I have 7000 database entries which may or may be found in the content of over 50000 files. At the moment I am using a linear search, the search patterns are the keys of a hash, find(\&wanted, $startdir) is called on each key of the hash, if the key is found, stop recursing the dir, delete this key and go the next one, start all over again. This could potentially be over 3 x 10 exp 7 searches. Obviously, this will take much to long with a linear search algorithm. Which is the best algorithm to use for such a search and where can I find out more about it? Any help is much appreciated. Thanks Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20011217/1fa793fc/attachment.htm From richard at richard-anderson.org Mon Dec 17 17:48:24 2001 From: richard at richard-anderson.org (Richard Anderson) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: Re: search algorithm References: <002401c18713$85d37240$7201a8c0@versuslaw.com> Message-ID: <008b01c18755$537dd550$2f88ddd1@aciwin> A more detailed statement of the problem might be of help here. Do you have to find every occurence of a string or just a single occurence? What is the purpose of this application? Etc. My initial inclination is that a restructuring of the data would be the best way to speed things up. Could the 7000 searches be run each time the files are updated and the results stored? How about using a B-tree search? How about looking through Knuth, The Art of Computer Programming, vol. 3 or Sedgewick, Algorithms in C++: Fundamentals, Data Structure, Sorting, Searching? Hope this helps. Richard Anderson Software Professional 206.547.6903 richard@richard-anderson.org ----- Original Message ----- From: "Martin Korb" To: Sent: Monday, December 17, 2001 7:57 AM Subject: SPUG: search algorithm Here is the problem: I have 7000 database entries which may or may be found in the content of over 50000 files. At the moment I am using a linear search, the search patterns are the keys of a hash, find(\&wanted, $startdir) is called on each key of the hash, if the key is found, stop recursing the dir, delete this key and go the next one, start all over again. This could potentially be over 3 x 10 exp 7 searches. Obviously, this will take much to long with a linear search algorithm. Which is the best algorithm to use for such a search and where can I find out more about it? Any help is much appreciated. Thanks Martin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From tim at consultix-inc.com Mon Dec 17 17:47:52 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: Dec. Meeting Tomorrow Message-ID: <20011217154752.A18645@timji.consultix.wa.com> NOTE: Due to the "underwhelming" response to the previous "Call for Lightning Talks", I'm issuing another along with a reminder about tomorrow's meeting. This is an opportunity for members to contribute something to the group by sharing something Perlish you know with the rest of us, with very little preparation needed. 'tis better to give than to receive, so please help out by participating in tomorrow's meeting! -Tim SPUGsters, In keeping with the joyful spirit of the holiday season, the plan for tomorrow's meeting is to have a "Festival of LIGHTNING TALKS", in which attendees give short presentations on Perlish topics. (Don't forget, we're now meeting at the Safeco building in the U-district). So far, with zero arm-twisting, we've already got the following presentations lined up: * Jay and Henry (no, they don't make Cherry Garcia) showing off a program they wrote that does a 2001 Tax Return using Perl and TK, * me giving a talk on + the Perltidy beautifier, + Damian's Text::Autoformat module, and + how to use the latter to augment the capabilities of the former So now I'm asking for more volunteers to talk on other cool topics! You won't have to spend a lot of time preparing materials (since the talks are so short), and nobody will expect a slick presentation. You can just wave your hands and yak if you want, or else bring a 3.5" VFAT, EXT2, or TAR diskette with stuff to share in text, HTML, PDF, GIF, or JPG format (for projection from my laptop). You can tell us about your favorite module, show us *your* new module, rant about what's wrong with Perl, show us glimpses of Perl 6, review a Perl book or magazine article, complain about the job market for Perl programmers, tell us what's happening at PerlMonks, or decipher for us your most cryptic JAPH-.sig. Come to think of it, if time permits, I might even show slides of my Spring GeekCruise vacation, and talk about the upcoming PerlWhirl 2001 in January! Now that's entertainment! 8-} Those interested in participating can either post a message to the list to give us advance notice, or just show up ready to talk. The Lightning Talks that were presented at the September meeting were very interesting and very well received, so I'm looking forward to another fun experience this time. Please join in to "make it so!" -Tim ============================================================= | Tim Maher, Ph.D. Tel: (206) 781-UNIX/8649 | | SPUG Founder & Leader Email: spug@seattleperl.org | | Seattle Perl Users Group HTTP: www.seattleperl.org | ============================================================= - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From whitneyt at agcs.com Mon Dec 17 18:07:15 2001 From: whitneyt at agcs.com (Thomas Whitney) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: search algorithm References: <002401c18713$85d37240$7201a8c0@versuslaw.com> Message-ID: <3C1E88B3.8CF7A518@agcs.com> If I am understanding correctly, it sounds like the directory search is the more expensive process. How about running through the keys on each file entry, rather then the other way around. Tom Martin Korb wrote: > Here is the problem: I have 7000 database entries which may or may be found in > the content of over 50000 files.At the moment I am using a linear search,the > search patterns are the keys of a hash, find(\&wanted, $startdir) is called on > each key of the hash, if the key is found, stop recursing the dir, delete this > key and go the next one, start all over again. This could potentially be over > 3 x 10 exp 7 searches.Obviously, this will take much to long with a linear > search algorithm. Which is the best algorithm to use for such a search and > where can I find out more about it? Any help is much appreciated. Thanks > Martin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From tuck at whistlingfish.net Mon Dec 17 19:18:56 2001 From: tuck at whistlingfish.net (Matt Tucker) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: search algorithm In-Reply-To: <3C1E88B3.8CF7A518@agcs.com> References: <002401c18713$85d37240$7201a8c0@versuslaw.com> <3C1E88B3.8CF7A518@agcs.com> Message-ID: <114040000.1008638335@benzene> -- Thomas Whitney spake thusly: > Martin Korb wrote: > >> Here is the problem: I have 7000 database entries which may or may >> be found in the content of over 50000 files.At the moment I am using >> a linear search,the search patterns are the keys of a hash, >> find(\&wanted, $startdir) is called on each key of the hash, if the >> key is found, stop recursing the dir, delete this key and go the >> next one, start all over again. This could potentially be over 3 x >> 10 exp 7 searches.Obviously, this will take much to long with a >> linear search algorithm. Which is the best algorithm to use for such >> a search and where can I find out more about it? Any help is much >> appreciated. Thanks Martin > > If I am understanding correctly, it sounds like the directory search > is the more expensive process. How about running through the keys on > each file entry, rather then the other way around. Another option might be: If the keys you're searching for have a standard format, you might be best off find all _possible_ keys in each file (using a regexp), and then looking those up in a hash of all the keys you're searching for. I suspect this would be the fastest method, since you end up reading and scanning each file once rather than 7000 times. You also get to take advantage of Perl's hashing algorithms rather than scanning through all 7000 keys for each hit. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/spug-list/attachments/20011217/6c735ede/attachment.bin From jay at Scherrer.com Mon Dec 17 20:34:10 2001 From: jay at Scherrer.com (Jay Scherrer) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: Gui's created with Perl/Tk Message-ID: <200112180234.fBI2YA202721@localhost.localdomain> Fellow SPUGERs, Henry and I will be presenting a lightning talk on Perl/Tk. Using Perl's ease in coding and Tk's strength in window management , We will show how to create a Graphical User Interface using Perl/Tk. With an example that actually calculates a tax return. See you there, Jay - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From glyph at mac.com Tue Dec 18 14:59:10 2001 From: glyph at mac.com (Geoffrey Grosenbach) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: Talk for tonight Message-ID: <157A38CE-F3FA-11D5-87A7-0050E4C54C7E@mac.com> Hey, everyone-- I'm a newcomer to the group, but am also foolhardy enough to offer to give a lightning talk tonight on how I modified Ed Hill's Webpluck program (mentioned in TPJ a few years ago) with the LWP::Parallel module from the CPAN. I was able to get it to run 3x faster (but not without a few roadblocks, the solutions to which I'll be glad to share). So, I hope you'll show up tonight and hear about it! Geoff Grosenbach http://www.GeoffreyGrosenbach.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From jeremy at weezel.com Wed Dec 19 00:16:07 2001 From: jeremy at weezel.com (Jeremy Devenport) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: Talk for tonight In-Reply-To: <157A38CE-F3FA-11D5-87A7-0050E4C54C7E@mac.com> Message-ID: <000001c18854$a5c66e80$1401a8c0@jeremydhome> I thought I remembered a way to get the URL of the initial request even after redirects. Here's some code (based on the LWP::Parallel perldoc page) that will let you get at the pre-redirection url. Hope this helps. #!/usr/bin/perl -w use strict; use LWP::Parallel::UserAgent; use HTTP::Request; my $ua = new LWP::Parallel::UserAgent; for my $url (@ARGV) { $ua->register(new HTTP::Request('GET' => $url)); } my $entries = $ua->wait(); foreach (keys %$entries) { my $res = $entries->{$_}->response; # start with the initial response set to the final response my $init_res = $res; # follow the "previous" chain back as far as possible $init_res = $init_res->previous while $init_res->previous; # are these different objects? if ($init_res != $res) { printf "redirected from %s to %s\n", $init_res->request->url, $res->request->url; } # do stuff with the $res object # $init_res->request->url is the pre-redirection location, # $res->request->url is the final location } Jeremy -----Original Message----- From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org] On Behalf Of Geoffrey Grosenbach Sent: Tuesday, December 18, 2001 12:59 PM To: spug-list@pm.org Subject: SPUG: Talk for tonight Hey, everyone-- I'm a newcomer to the group, but am also foolhardy enough to offer to give a lightning talk tonight on how I modified Ed Hill's Webpluck program (mentioned in TPJ a few years ago) with the LWP::Parallel module from the CPAN. I was able to get it to run 3x faster (but not without a few roadblocks, the solutions to which I'll be glad to share). So, I hope you'll show up tonight and hear about it! Geoff Grosenbach http://www.GeoffreyGrosenbach.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From jay at Scherrer.com Wed Dec 19 11:51:30 2001 From: jay at Scherrer.com (Jay Scherrer) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: Ptax2001 Message-ID: <200112191751.fBJHpVs12186@localhost.localdomain> Happy holidays, Thanks for giving us the time to do the presentation on Perl/Tk. Since it was my first talk ever I felt like a "Cherry Garcia". You can download Ptax2001 from my web site at . If there are any suggestions, please let me know. Jay - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From asimjalis at yahoo.com Wed Dec 19 19:29:53 2001 From: asimjalis at yahoo.com (Asim Jalis) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: Ptax2001 In-Reply-To: <200112191751.fBJHpVs12186@localhost.localdomain> Message-ID: <20011220012953.1001.qmail@web14201.mail.yahoo.com> Jay Scherrer wrote: > Happy holidays, Thanks for giving us the time to > do the presentation on Perl/Tk. Since it was my > first talk ever I felt like a "Cherry Garcia". > You can download Ptax2001 from my web site at > . If there are any > suggestions, please let me know. Jay Nice. How about putting a Windows screenshot next to the Linux screenshot. I am curious to see how this looks on Windows. Asim __________________________________________________ Do You Yahoo!? Check out Yahoo! Shopping and Yahoo! Auctions for all of your unique holiday gifts! Buy at http://shopping.yahoo.com or bid at http://auctions.yahoo.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From chris.nord at attws.com Wed Dec 19 19:39:24 2001 From: chris.nord at attws.com (Nord, Chris) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: spug: Odd number of elements in hash assignment at YYYY line XX Message-ID: Question on the below code. I get a PERL message, "Odd number of elements in hash assignment at nlerg line XX". The results of the map get populated as keys in %hash. Why the "Odd number..." error? @array_x = map m|some_pattern|,@array_y; %hash = @array_x; foreach (keys %hash){ print "$_\n"; } Odd number of elements in hash assignment at nlerg line XX line XX is %hash = @array_x; Also tried $hash{map m|some_pattern|,@array_y} = ''; but the results of the map do not generate a key list in the hash. Chris Nord - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From Ryan.Parr at wwireless.com Wed Dec 19 19:57:47 2001 From: Ryan.Parr at wwireless.com (Parr, Ryan) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: spug: Odd number of elements in hash assignment at YYYY line XX Message-ID: <6D6F0541E2B1D411A75B0002A513016D0561C28D@wacorpml03.wwireless.com> Assigning an array to a hash doesn't create a list of keys, but rather it populates the hash. For example: @array = qw(one uno two dos three tres four quatro); %hash = @array; foreach (keys %hash) { print "$_: $hash{$_}\n"; } Will print: one: uno two: dos three: tres four: quatro However, I've personally never gotten the error you mention, and tried creating a hash out of an array of 5 elements, and just ended up with one key without a value, as would be expected. Are you using any external Warnings modules of any type? Also, with map you don't need to seperate your arguments with a comma unless the first argument is a string. In other words: @array = map { m/some_pattern/ } @array_y -- and -- @array = map "This is $_\n", @array_y are valid. -- Ryan -----Original Message----- From: Nord, Chris [mailto:chris.nord@attws.com] Sent: Wednesday, December 19, 2001 5:39 PM To: 'spug list' Subject: SPUG: spug: Odd number of elements in hash assignment at YYYY line XX Question on the below code. I get a PERL message, "Odd number of elements in hash assignment at nlerg line XX". The results of the map get populated as keys in %hash. Why the "Odd number..." error? @array_x = map m|some_pattern|,@array_y; %hash = @array_x; foreach (keys %hash){ print "$_\n"; } Odd number of elements in hash assignment at nlerg line XX line XX is %hash = @array_x;l Also tried $hash{map m|some_pattern|,@array_y} = ''; but the results of the map do not generate a key list in the hash. Chris Nord - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From Daniel.Pommert at verizonwireless.com Wed Dec 19 20:04:59 2001 From: Daniel.Pommert at verizonwireless.com (Pommert, Daniel) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: spug: Odd number of elements in hash assignment at YYYY line XX Message-ID: <9B30436F511ED5118EDF0002A55C31800119D830@cairvexmb03.la.airtouch.com> Your problem is the direct assignment from an array (which contains only keys) to a hash (which contains key/value pairs). Also, I'm unsure what exactly you were wanting to do. Does "some_pattern" contain a parenthesis? If so, what should be the key to the hash and what should the value be? Or, perhaps, did you mean to use grep instead of map? Your code should either read: # "some_pattern" has a single parenthesis, which is the desired hash key @array_x = map m|some_pattern|,@array_y; %hash = map {($_, 1)} @array_x; - - O R - - # You want the key to be the element of array_y and the value to be value # found in pattern with parenthesis %hash = map {($_, m|some_pattern})} @array_y; - - O R - - # You want only those values that match the pattern and those placed as keys # in a hash @array_x = grep m|some_pattern|,@array_y; %hash = map {($_, 1)} @array_x; Or, perhaps you ment something else... Hope this helps, -- Daniel Pommert -----Original Message----- From: Nord, Chris [mailto:chris.nord@attws.com] Sent: Wednesday, December 19, 2001 5:39 PM To: 'spug list' Subject: SPUG: spug: Odd number of elements in hash assignment at YYYY line XX Question on the below code. I get a PERL message, "Odd number of elements in hash assignment at nlerg line XX". The results of the map get populated as keys in %hash. Why the "Odd number..." error? @array_x = map m|some_pattern|,@array_y; %hash = @array_x; foreach (keys %hash){ print "$_\n"; } Odd number of elements in hash assignment at nlerg line XX line XX is %hash = @array_x; Also tried $hash{map m|some_pattern|,@array_y} = ''; but the results of the map do not generate a key list in the hash. Chris Nord - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From chris.nord at attws.com Wed Dec 19 20:17:46 2001 From: chris.nord at attws.com (Nord, Chris) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: I GOT AN ANSWER: Odd number of elements in hash assignment at YYY Y line XX Message-ID: Thanks all for the replies; I found the error in my ways. CRN > -----Original Message----- > From: Nord, Chris > Sent: Wednesday, December 19, 2001 5:39 PM > To: 'spug list' > Subject: spug: Odd number of elements in hash assignment at YYYY line > XX > > Question on the below code. I get a PERL message, "Odd number of elements > in hash assignment at nlerg line XX". The results of the map get > populated as keys in %hash. Why the "Odd number..." error? > > @array_x = map m|some_pattern|,@array_y; > %hash = @array_x; > > foreach (keys %hash){ > print "$_\n"; > } > > Odd number of elements in hash assignment at nlerg line XX > line XX is %hash = @array_x; > > Also tried $hash{map m|some_pattern|,@array_y} = ''; but the results of > the map do not generate a key list in the hash. > > Chris Nord - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From andrew at sweger.net Wed Dec 19 20:19:11 2001 From: andrew at sweger.net (Andrew Sweger) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: spug: Odd number of elements in hash assignment at YYYY line XX In-Reply-To: Message-ID: To answer the question specifically, because @array_x contains an odd number of elements. It will help to know what you are attempting to accomplish. When "casting" an array into a hash, the alternating elements of the array become the keys and values of the hash. For example, @in = qw(Oz Squint Tux Grommit); %hash = @in; --- %hash = ( "Oz" => "Squint", "Tux" => "Grommit", # These "associations" aren't meant ); # to make sense Also, how are you intending to use the RE match here? The way I read this, @array_x will be populated with the list of non-zero counts of matches (RE in scalar context). I'm assuming that your RE is a non-capturing pattern (no parens). @in = qw(Oz Squint Tux Grommit); @out = map /i/, @in; %hash = @out; --- @out = (1, 1); %hash = (1 => 1); Or... my @in = qw(Oz Squint Tux Grommit); my @out = map /t/i, @in; # Note different pattern %hash = @out; --- @out = (1, 1, 1); Odd number of elements in hash assignment... On Wed, 19 Dec 2001, Nord, Chris wrote: > Question on the below code. I get a PERL message, "Odd number of elements > in hash assignment at nlerg line XX". The results of the map get populated > as keys in %hash. Why the "Odd number..." error? > > @array_x = map m|some_pattern|,@array_y; > %hash = @array_x; > > foreach (keys %hash){ > print "$_\n"; > } > > Odd number of elements in hash assignment at nlerg line XX > line XX is %hash = @array_x; > > Also tried $hash{map m|some_pattern|,@array_y} = ''; but the results of the > map do not generate a key list in the hash. -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From andrew at sweger.net Wed Dec 19 20:23:58 2001 From: andrew at sweger.net (Andrew Sweger) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: spug: Odd number of elements in hash assignment at YYYY line XX In-Reply-To: <6D6F0541E2B1D411A75B0002A513016D0561C28D@wacorpml03.wwireless.com> Message-ID: Perhaps you're not developing code with warnings turn on? On Wed, 19 Dec 2001, Parr, Ryan wrote: > However, I've personally never gotten the error you mention, and tried > creating a hash out of an array of 5 elements, and just ended up with one > key without a value, as would be expected. Are you using any external > Warnings modules of any type? -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From Ryan.Parr at wwireless.com Wed Dec 19 20:58:30 2001 From: Ryan.Parr at wwireless.com (Parr, Ryan) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: spug: Odd number of elements in hash assignment at YYYY line XX Message-ID: <6D6F0541E2B1D411A75B0002A513016D0561C296@wacorpml03.wwireless.com> No I wasn't. Turning on warnings did recreate the error. -- Ryan -----Original Message----- From: Andrew Sweger [mailto:andrew@sweger.net] Sent: Wednesday, December 19, 2001 6:24 PM To: Parr, Ryan Cc: 'spug list' Subject: RE: SPUG: spug: Odd number of elements in hash assignment at YYYY line XX Perhaps you're not developing code with warnings turn on? On Wed, 19 Dec 2001, Parr, Ryan wrote: > However, I've personally never gotten the error you mention, and tried > creating a hash out of an array of 5 elements, and just ended up with one > key without a value, as would be expected. Are you using any external > Warnings modules of any type? -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From sthoenna at efn.org Wed Dec 19 21:40:37 2001 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: spug: Odd number of elements in hash assignment at YYYY line XX References: Message-ID: <12VI8gzkgiwe092yn@efn.org> In article , "Nord, Chris" wrote: >Question on the below code. I get a PERL message, "Odd number of elements >in hash assignment at nlerg line XX". The results of the map get populated >as keys in %hash. Why the "Odd number..." error? > > @array_x = map m|some_pattern|,@array_y; > %hash = @array_x; > > foreach (keys %hash){ > print "$_\n"; > } > >Odd number of elements in hash assignment at nlerg line XX >line XX is %hash = @array_x; > >Also tried $hash{map m|some_pattern|,@array_y} = ''; but the results of the >map do not generate a key list in the hash. You almost got it. Try: @array_x = map m|some_pattern|,@array_y; # I assume some_pattern has () in it @hash{@array_x} = ('')x @array_x; (or just @hash{@array_x} = () to leave all the values undefined). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From tim at consultix-inc.com Thu Dec 20 12:22:43 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: Bio Sciences Gig in Fremont Message-ID: <20011220102243.A16820@timji.consultix.wa.com> POSITION TITLE: Perl Programmer / Analyst REQUIRED SKILL SET: This position requires a minimum of 3 years of PERL programming experience, advanced proficiency with PERL, Intermediate SQL Server DBA expertise required, C++ and/or other programming languages preferred, an AA degree or equivalent in a computer related field, BS in computer sciences preferred; and an education/training in biological sciences helpful. PERMANENT POSITION: We offer a competitive salary, stock options and a generous benefits package. For more information please refer to: www.lsbio.com. PLACEMENT: Directly with company. W-2 VS. 1099 STATUS: LifeSpan is a Corporation and has no restrictions on 1099 status. PHYSICAL LOCATION: Seattle, WA -- Telecommuting is may be possible under special circumstances. COMPANY'S PRODUCT OR SERVICE: Molecular Pathology OFFICIAL POSTING: LifeSpan BioSciences, Inc., a rapidly growing molecular pathology company located in scenic downtown Seattle overlooking Elliott Bay has an opening for a PERL Programmer / Analyst. This position designs, builds, and maintains middle tier software systems used primarily for batch processing. This position will create documentation and design specifications, troubleshoot problems with software systems, write supporting applications to maintain web content, etc. This position requires a minimum of 3 years of PERL programming experience, advanced proficiency with PERL, Intermediate SQL Server DBA expertise required, C++ and/or other programming languages preferred, an AA degree or equivalent in a computer related field, BS in computer sciences preferred; and an education/training in biological sciences helpful. We offer a competitive salary, stock options and a generous benefits package. For more information please refer to: www.lsbio.com. Qualified candidates are encourage to send a cover letter indicating position title and resume to: Human Resources LifeSpan BioSciences 2401 Fourth Avenue, Suite 900 Seattle, WA 98121 hr@lsbio.com Fax: (206) 770-7754 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From glyph at mac.com Thu Dec 20 13:32:14 2001 From: glyph at mac.com (Geoffrey Grosenbach) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: Headline Grabber Message-ID: <459F06A9-F580-11D5-9C7B-0050E4C54C7E@mac.com> Here's a link to the Perl script I use for grabbing headlines (from Tuesday's speech): http://geoffreygrosenbach.com/perl.html Thanks to Jeremy for the ideas on tracking back to pre-redirected requests...I'll look into implementing that later. Geoff http://www.GeoffreyGrosenbach.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From beckyls at u.washington.edu Thu Dec 20 17:37:25 2001 From: beckyls at u.washington.edu (Rebecca L. Schmidt) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: UW Perl Programming Certificate Message-ID: I'm writing to let you know that it is not too late to apply for the UW Perl Programming Certificate Program that begins in January. We will be accepting applications through January 2, 2002. There are three courses in the program: "Beginning Perl", "Advanced/Object Oriented Perl", and "Perl, the Web, and Databases". Classes meet once a week on Wednesday nights in Bellevue, 6-9 PM; each class lasts 10 weeks. We start with the basics and go in-depth on many Perl topics, including data types, regular expressions, I/O, complex data structures, object oriented Perl, database access, CGI programming, and lots more. Participants earn nine Continuing Education Units (CEUs) and the UW Certificate in Perl Programming. The instructors are industry experts who share their professional experience and provide personal hands-on instruction. About the instructors: * Keith Reed is Lead Software Engineer at Philips Medial Systems in Bothell. He has taught Unix and Shell scripting at UC Riverside and he has over 15 years of programming experience. * Brian Aker is Senior Software Developer at Valinux/OSDN where he is redesigning slashcode (the publishing engine for Slashdot). Brian wrote software for the VirtualHospital, one of the first and largest online medical repositories. Detailed information, including how to apply, is available here: http://www.outreach.washington.edu/extinfo/certprog/per/per_main.asp Please feel free to contact me if you have any questions. Best regards, Rebecca Schmidt Academic Programs University of Washington Extension 5001 25th Ave NE, Seattle, WA 98105-4190 rschmidt@ese.washington.edu (206) 221-6243 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From glyph at mac.com Sat Dec 22 13:21:53 2001 From: glyph at mac.com (Geoffrey Grosenbach) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: perltidy HTML colorer Message-ID: <27E16538-F711-11D5-95BB-0050E4C54C7E@mac.com> I can't believe Tim neglected to mention perltidy's incredible "-html" switch that turns sourcecode into colored html (variables one color, functions another, comments another, etc.). I've been going nuts through my hard drive, html coloring all my sourcecode. It seems this would be useful when trying to read someone else's sourcecode, especially if it wasn't commented much. Geoff http://www.GeoffreyGrosenbach.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From andrew at sweger.net Sat Dec 22 18:51:40 2001 From: andrew at sweger.net (Andrew Sweger) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: perltidy HTML colorer In-Reply-To: <27E16538-F711-11D5-95BB-0050E4C54C7E@mac.com> Message-ID: Many editors provide the same service directly on the source code in questions. vi/vim/Nedit/etc. Of course, they don't clean up your friend's code like perltidy does. Very handy on code written by those freaks that use a single space indent. I know you're out there! Picture Charlton Heston shaking his fist in the air, "Damn you single space indents! Damn you all to hell!" :) On Sat, 22 Dec 2001, Geoffrey Grosenbach wrote: > I can't believe Tim neglected to mention perltidy's incredible "-html" > switch that turns sourcecode into colored html (variables one color, > functions another, comments another, etc.). I've been going nuts through > my hard drive, html coloring all my sourcecode. > It seems this would be useful when trying to read someone else's > sourcecode, especially if it wasn't commented much. -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From MichaelRunningWolf at att.net Wed Dec 26 13:49:39 2001 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: perltidy HTML colorer In-Reply-To: References: Message-ID: Andrew Sweger writes: > Many editors provide the same service directly on the > source code in questions. vi/vim/Nedit/etc. I love the cperl-mode of gnu emacs [1]. Not only does it color the code, but it provides many handy key binding to leverage the 3 great virtues of a programmer (as defined in the "Programming Perl" Glossary): * laziness - The quality that makes you go to great effort to reduce overall energy expenditure. It makes you write labor-saving programs that other people will find useful, and document what you wrote so you don't have to answer so many questions about it. Hence, the first great virtue of a programmer. Also hence, this book. See also impatience and hubris. * impatience - The anger you feel when the computer is being lazy. This makes you write programs that don't just react to your needs, but actually anticipate them. Or at least that pretend to. Hence, the second great virtue of a programmer. See also laziness and hubris. * hubris - Excessive pride, the sort of thing Zeus zaps you for. Also the quality that makes you write (and maintain) programs that other people won't want to say bad things about. Hence, the third great virtue of a programmer. See also laziness and impatience. > Of course, they don't clean up your friend's code like > perltidy does. In emacs, it's easy to filter a region through an external pipe. The end result is that the code is reformatted according to that outside process, perltidy in this case, but it's also neat to use indent(1), cb(1), sort(1), nroff(1), uniq(1), nl(1), etc. > Very handy on code written by those freaks that use a > single space indent. I know you're out there! And even worse -- the no-space-newbies!!! I *do* have compassion for the _newbies_ (I'm a regular reader/contributer to beginners@perl.org mailing list [2]), but I dispise the style of some of their _code_. A cluttered style often indicates a cluttered brain. Sometimes de-cluttering the code helps de-cluttering the brain. Often, the brain must lead. And most frequently, it's an iterative brain-code process. Emacs - an afternoon to learn, a lifetime to master. Enjoy, Michael [1] http://www.gnu.org/software/emacs/emacs.html [2] For help and a description of available commands, send a message to: -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From scott at mail.dsab.rresearch.com Wed Dec 26 14:11:53 2001 From: scott at mail.dsab.rresearch.com (Scott Blachowicz) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: perltidy HTML colorer In-Reply-To: ; from MichaelRunningWolf@att.net on Wed, Dec 26, 2001 at 02:49:39PM -0500 References: Message-ID: <20011226121153.A33493@sabami.seaslug.org> On Wed, Dec 26, 2001 at 02:49:39PM -0500, Michael R. Wolf wrote: > Andrew Sweger writes: > > > Many editors provide the same service directly on the > > source code in questions. vi/vim/Nedit/etc. > > I love the cperl-mode of gnu emacs [1]. > ... Except that it DOES get confused by some items, like "here scripts" and some of the special $ variables, IIRC. There are times where I just give up on it and use indented-text-mode on some scripts, but it does work on most things I've tried to edit with it. Scott - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From mathin at mathin.com Wed Dec 26 14:36:00 2001 From: mathin at mathin.com (Dan Ebert) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: perltidy HTML colorer In-Reply-To: <20011226121153.A33493@sabami.seaslug.org> Message-ID: I am also a fan of emacs ... but it does have trouble with quotes/slashes/# etc in regex as well as the items Scott mentioned. I still use it almost exclusively because (other than a few minor issues) it makes neat code nearly effortless. Of course, you also have to take a lot of flak from vi nuts. :) Dan. ---------------------------------------------------------- The primary requisite for any new tax law is for it to exempt enough voters to win the next election. - Unknown ---------------------------------------------------------- On Wed, 26 Dec 2001, Scott Blachowicz wrote: > On Wed, Dec 26, 2001 at 02:49:39PM -0500, Michael R. Wolf wrote: > > Andrew Sweger writes: > > > > > Many editors provide the same service directly on the > > > source code in questions. vi/vim/Nedit/etc. > > > > I love the cperl-mode of gnu emacs [1]. > > ... > > Except that it DOES get confused by some items, like "here scripts" and some > of the special $ variables, IIRC. There are times where I just give up on it > and use indented-text-mode on some scripts, but it does work on most things > I've tried to edit with it. > > Scott > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From bill at celestial.com Wed Dec 26 15:40:07 2001 From: bill at celestial.com (Bill Campbell) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: perltidy HTML colorer In-Reply-To: ; from mathin@mathin.com on Wed, Dec 26, 2001 at 12:36:00PM -0800 References: <20011226121153.A33493@sabami.seaslug.org> Message-ID: <20011226134007.A26695@barryg.mi.celestial.com> On Wed, Dec 26, 2001 at 12:36:00PM -0800, Dan Ebert wrote: > >I am also a fan of emacs ... but it does have trouble with >quotes/slashes/# etc in regex as well as the items Scott mentioned. I've recently started using the qq(...), and similar braces around regular expressions because I find it somewhat easier to match the beginning and end of expressions using vi's ``%'' operator (I've never been able to come to grips with emacs and don't use the arrow keys in vi :-). It also tends to fewer backwhacks in the expressions. Bill -- INTERNET: bill@Celestial.COM Bill Campbell; Celestial Software LLC UUCP: camco!bill PO Box 820; 6641 E. Mercer Way FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676 URL: http://www.celestial.com/ ``I have learned what some people are like. And if some people are like that, other people must have the means to shoot them.'' Donald Hamilton -- The Vanishers - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From tuck at whistlingfish.net Wed Dec 26 16:45:30 2001 From: tuck at whistlingfish.net (Matt Tucker) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: perltidy HTML colorer In-Reply-To: <20011226121153.A33493@sabami.seaslug.org> References: <20011226121153.A33493@sabami.seaslug.org> Message-ID: <14910000.1009406729@flashingchance> -- Scott Blachowicz spake thusly: > On Wed, Dec 26, 2001 at 02:49:39PM -0500, Michael R. Wolf wrote: >> Andrew Sweger writes: >> >> > Many editors provide the same service directly on the >> > source code in questions. vi/vim/Nedit/etc. >> >> I love the cperl-mode of gnu emacs [1]. >> ... > > Except that it DOES get confused by some items, like "here scripts" > and some of the special $ variables, IIRC. There are times where I > just give up on it and use indented-text-mode on some scripts, but it > does work on most things I've tried to edit with it. I've found that most of the time when cperl-mode is getting confused, it's not set up properly. It's can help tremendously to have: (setq cperl-use-syntax-table-text-property t) (setq cperl-syntaxify-by-font-lock t) (setq cperl-use-syntax-table-text-property-for-tags t) (setq cperl-font-lock t) Some of this stuff didn't used to be possible in XEmacs, but is now in 21.4 and up due to the porting of syntax-table text properties (extents in XEmacs) from GNU Emacs. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/spug-list/attachments/20011226/94cbc6fc/attachment.bin From banks111111hk at yahoo.com.hk Thu Dec 27 02:02:11 2001 From: banks111111hk at yahoo.com.hk (Paul Mac Arthur (Rapid Internet Marketing Newsletter)) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: AMEX and Chase Visa Card, Verisign Certificate, Rapid Traffic and Eif Services for all the readers.At 20% better conditions Message-ID: <200112270021.fBR0LGZ10199@gocho.pm.org> An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20011227/ea897dc0/attachment.htm From dons at amazon.com Wed Dec 26 19:51:20 2001 From: dons at amazon.com (Don Schneider) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: perltidy HTML colorer In-Reply-To: <14910000.1009406729@flashingchance> References: <20011226121153.A33493@sabami.seaslug.org> <20011226121153.A33493@sabami.seaslug.org> Message-ID: <5.0.2.1.2.20011226173339.052d5558@smtp> For me, even with these, the emacs colorizer still gets confused by commas in a qq statement which uses balanced parentheses, braces, brackets, etc: print qq[ get rid of this, it confuses the colorizer.\n]; Using non-balanced delimiters is better, although everything after the comma isn't colorized as a string: print qq| the next sentence is less true:\n|; print qq| get rid of this, it confuses the colorizer.\n|; Escaping the comma makes the colorizer happy: print qq[ the next sentence is false:\n]; print qq[ get rid of this\, it confuses the colorizer.\n]; Any suggestions? At 02:45 PM 12/26/2001 -0800, Matt Tucker wrote: >I've found that most of the time when cperl-mode is getting confused, >it's not set up properly. It's can help tremendously to have: > > (setq cperl-use-syntax-table-text-property t) > (setq cperl-syntaxify-by-font-lock t) > (setq cperl-use-syntax-table-text-property-for-tags t) > (setq cperl-font-lock t) > >Some of this stuff didn't used to be possible in XEmacs, but is now in >21.4 and up due to the porting of syntax-table text properties (extents >in XEmacs) from GNU Emacs. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From tuck at whistlingfish.net Wed Dec 26 20:09:09 2001 From: tuck at whistlingfish.net (Matt Tucker) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: perltidy HTML colorer In-Reply-To: <5.0.2.1.2.20011226173339.052d5558@smtp> References: <20011226121153.A33493@sabami.seaslug.org> <20011226121153.A33493@sabami.seaslug.org> <5.0.2.1.2.20011226173339.052d5558@smtp> Message-ID: <453010000.1009418949@benzene> -- Don Schneider spake thusly: > For me, even with these, the emacs colorizer still gets confused by > commas in a qq statement which uses balanced parentheses, braces, > brackets, etc: > > print qq[ get rid of this, it confuses the colorizer.\n]; > > Using non-balanced delimiters is better, although everything after > the comma isn't colorized as a string: > > print qq| the next sentence is less true:\n|; > print qq| get rid of this, it confuses the colorizer.\n|; > > > Escaping the comma makes the colorizer happy: > > print qq[ the next sentence is false:\n]; > print qq[ get rid of this\, it confuses the colorizer.\n]; > > > Any suggestions? Odd. For me, all of those constructs are handled correctly (both from the standpoint of colorization and balancing/indenting). I also have no idea why a _comma_ of all things would be causing problems. What versions of Emacs and cperl-mode do you have? What other cperl-mode customization settings do you have? Are you doing anything unusual in cperl-mode-hook? You wouldn't happen to be altering the cperl-mode-syntax-table and setting comma to a quote character or anything like that, would you? :-) And finally, is it possible to reproduce this in vanilla mode ('emacs -q --no-site-file' or 'xemacs -vanilla')? I also, by the way, have set up the following hack in .emacs for situations where cperl-mode gets confused about colorization (which happens more often in XEmacs than GNU Emacs): ;; Define a refontification command (defun cperl-refontify-buffer () "Reload cperl mode and fontify current buffer" (interactive) (font-lock-fontify-buffer) ) (eval-after-load "cperl-mode" '(progn (cperl-define-key "\M-f" 'cperl-refontify-buffer [(meta f)]))) Many people, by the way, would probably prefer a different keystroke. However, that's easy to change. This hack allows me to do Alt-F at any point to refontify the buffer. I probably use it more often than I should (since it shouldn't really be necessary), but it works for now until I can get around to fixing lazy-lock in XEmacs. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/spug-list/attachments/20011226/b3d08e25/attachment.bin From mathin at mathin.com Thu Dec 27 09:28:04 2001 From: mathin at mathin.com (Dan Ebert) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: perltidy HTML colorer In-Reply-To: <5.0.2.1.2.20011226173339.052d5558@smtp> Message-ID: I get that problem, but not with commas ... with single quotes (like when they are used as an apostrophe "don't", etc.). Dan. ---------------------------------------------------------- The primary requisite for any new tax law is for it to exempt enough voters to win the next election. - Unknown ---------------------------------------------------------- On Wed, 26 Dec 2001, Don Schneider wrote: > For me, even with these, the emacs colorizer still gets confused by commas > in a qq statement which uses balanced parentheses, braces, brackets, etc: > > print qq[ get rid of this, it confuses the colorizer.\n]; > > Using non-balanced delimiters is better, although everything after the > comma isn't colorized as a string: > > print qq| the next sentence is less true:\n|; > print qq| get rid of this, it confuses the colorizer.\n|; > > > Escaping the comma makes the colorizer happy: > > print qq[ the next sentence is false:\n]; > print qq[ get rid of this\, it confuses the colorizer.\n]; > > > Any suggestions? > > At 02:45 PM 12/26/2001 -0800, Matt Tucker wrote: > > >I've found that most of the time when cperl-mode is getting confused, > >it's not set up properly. It's can help tremendously to have: > > > > (setq cperl-use-syntax-table-text-property t) > > (setq cperl-syntaxify-by-font-lock t) > > (setq cperl-use-syntax-table-text-property-for-tags t) > > (setq cperl-font-lock t) > > > >Some of this stuff didn't used to be possible in XEmacs, but is now in > >21.4 and up due to the porting of syntax-table text properties (extents > >in XEmacs) from GNU Emacs. > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From MichaelRunningWolf at att.net Thu Dec 27 09:29:22 2001 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: perltidy HTML colorer In-Reply-To: <20011226121153.A33493@sabami.seaslug.org> References: <20011226121153.A33493@sabami.seaslug.org> Message-ID: Scott Blachowicz writes: > Except that it DOES get confused by some items, like "here > scripts" and some of the special $ variables, IIRC. Unfortunately, Perl is a difficult language to parse. That makes it difficult to have tools work correctly. The syntax hilighting is only a heuristic. I know that Damian plans to make a Perl Perl parser next year. I expect that once that's available, we should start to see many tools start to be developed around it - factoring editors, perltidy act-alikes, cross-references, etc. I remember when similar things started creeping up on the back of the gnu compiler. I expect that being able to build on a stable and *accessible* Perl parser will enable all kinds of neat skunk works projects. > There are times where I just give up on it and use > indented-text-mode on some scripts, but it does work on > most things I've tried to edit with it. I sometimes rewrite my code to fit different quirks in my environment. Mostly, those quirks have to do with business logic, testability, readability, bugs in a spec, bugs in another piece of code. Occassionally, I will rewrite code around the *editor*. If there are two ways to do it, I pick the one that hilights better. It's usually not a big deal - add an extra quote in a comment, use qq() instead of single quotes, add another backslash somewhere, choose different quoting characters. Yeah, I know it sounds lame to have the editor dictate how I code, but as I've already listed, my code is constrained by a *lot* of outside influences. If it were pure *science* I'd refine it out, but balancing all the influences is the *art* of it. Think how much cleaner our science is (computer science) than most other sciences! Heck, when I read about some sciences, I think that it's just a collection of exceptions. Apparently, there are no absolutes. At least we've got a few. Michael -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From MichaelRunningWolf at att.net Thu Dec 27 09:32:53 2001 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: perltidy HTML colorer In-Reply-To: References: Message-ID: Dan Ebert writes: > Of course, you also have to take a lot of flak from vi nuts. :) Consider the source! Value the diversity. Enjoy the advantage! It's like kids on skateboards heckling me for the moth on the windshield of my Lear Jet. I can deal with it. -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From MichaelRunningWolf at att.net Thu Dec 27 09:41:45 2001 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: perltidy HTML colorer In-Reply-To: <5.0.2.1.2.20011226173339.052d5558@smtp> References: <20011226121153.A33493@sabami.seaslug.org> <20011226121153.A33493@sabami.seaslug.org> <5.0.2.1.2.20011226173339.052d5558@smtp> Message-ID: Don Schneider writes: > print qq[ get rid of this, it confuses the colorizer.\n]; > print qq| the next sentence is less true:\n|; > print qq| get rid of this, it confuses the colorizer.\n|; > print qq[ the next sentence is false:\n]; > print qq[ get rid of this\, it confuses the colorizer.\n]; > Any suggestions? All five of these lines colorized OK for me GNU Emacs 21.1.1 cperl version 4.23 # the one that came with 21.1 -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From MichaelRunningWolf at att.net Thu Dec 27 09:52:54 2001 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: perltidy HTML colorer In-Reply-To: <20011226121153.A33493@sabami.seaslug.org> References: <20011226121153.A33493@sabami.seaslug.org> Message-ID: Scott Blachowicz writes: > Except that it DOES get confused by some items, like "here > scripts" [snip] Heck *I* get confused by here files, so I don't use 'em unless I really have to. And then, I use a trick I learned in shell -- encapsulate the ugliness into a function. It's usually some big honkin' string or data structure any way. Put it in something called get_honkin_ugly_data(), or get_honkin_ugly_string(), then substitute the function call for the here file. Yeah, yeah, it incurs the overhead of a subroutine call when it runs. But without it, *I* incur the overhead of having to parse this big honkin' expression out of my way while I try to manipulate the code. IMHO, I'd rather read this code than deal with the here file. printf get_frumptus_fmt(), @args; my %honkin = get_honkin_data(); Just cause it's called a "here" file doesn't mean I have to put it here!!! -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From mcrip at cac.washington.edu Thu Dec 27 09:58:36 2001 From: mcrip at cac.washington.edu (Marvin Crippen) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: perltidy HTML colorer In-Reply-To: Message-ID: On 27 Dec 2001, Michael R. Wolf wrote: > Don Schneider writes: > > > print qq[ get rid of this, it confuses the colorizer.\n]; > > > print qq| the next sentence is less true:\n|; > > print qq| get rid of this, it confuses the colorizer.\n|; > > > > print qq[ the next sentence is false:\n]; > > print qq[ get rid of this\, it confuses the colorizer.\n]; > > > Any suggestions? > > All five of these lines colorized OK for me > GNU Emacs 21.1.1 > cperl version 4.23 # the one that came with 21.1 They also look fine with GNU Emacs 20.7.1 (i386-*-nt5.0.2195) cperl-mode.el,v 4.32 -- Marvin Crippen mcrip@cac.washington.edu DO-IT Program http://www.washington.edu/doit/ (206) 221-4166 It is by caffeine alone I set my mind in motion, It is by the beans of Java the thoughts acquire speed, The hands acquire shaking, the shaking become a warning. It is by caffeine alone I set my mind in motion. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From stevesa at microsoft.com Thu Dec 27 10:19:17 2001 From: stevesa at microsoft.com (Steve Sarapata) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: perltidy HTML colorer Message-ID: <5DD556A32C387C4493F251290A28216E02DBD030@red-msg-09.redmond.corp.microsoft.com> The nice thing about emacs is its vi mode. -----Original Message----- From: Michael R. Wolf [mailto:MichaelRunningWolf@att.net] Sent: Thursday, December 27, 2001 10:33 AM To: spug-list@pm.org Subject: Re: SPUG: perltidy HTML colorer Dan Ebert writes: > Of course, you also have to take a lot of flak from vi nuts. :) Consider the source! Value the diversity. Enjoy the advantage! It's like kids on skateboards heckling me for the moth on the windshield of my Lear Jet. I can deal with it. -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From dha at panix.com Thu Dec 27 15:15:30 2001 From: dha at panix.com (David H. Adler) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: perltidy HTML colorer In-Reply-To: <5DD556A32C387C4493F251290A28216E02DBD030@red-msg-09.redmond.corp.microsoft.com> References: <5DD556A32C387C4493F251290A28216E02DBD030@red-msg-09.redmond.corp.microsoft.com> Message-ID: <20011227161530.A23139@panix.com> On Thu, Dec 27, 2001 at 08:19:17AM -0800, Steve Sarapata wrote: > The nice thing about emacs is its vi mode. I prefer viper-mode. dha, writing in vim, currently. :-) -- David H. Adler - - http://www.panix.com/~dha/ "If it's not Jewish, it's CRAP!:)" - IsraelBeta on #DWC - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From davidinnes at chicagoscience.com Thu Dec 27 13:20:28 2001 From: davidinnes at chicagoscience.com (David Innes (CSG)) Date: Wed Aug 4 00:08:30 2004 Subject: Perl-based editor macros (was Re: SPUG: perltidy HTML colorer) References: <5DD556A32C387C4493F251290A28216E02DBD030@red-msg-09.redmond.corp.microsoft.com> Message-ID: <006401c18f0b$8b85ab90$077e5e40@converger.net> Ok, so here's a dumb question. I learned LISP in college, which made emacs very easy to extend. Then, in 1985 or so I got a job at Microsoft where everything real (including email and software development) was done in vi on Microsoft XENIX (their pre-DOS microcomputer operating system). So I learned vi and I've used it ever since, I no longer remember LISP, and since I now know Perl there's no reason to relearn it. So here's my first question: Is there a version of Emacs, vi, or any other suitable-for-development editor that uses Perl as the native macro language? Extra credit, of course, for one that's *written* in Perl. Second question: A number of editors claim to hook Perl for extensions but (because I'm a thumb-fingered dweeb?) I haven't figured how to use them. Any pointers would be appreciated. Extra credit for vi or vi-like-emacs solutions. Extra extra credit for platform independent (W2K tolerant) versions. My fantasy, of course, is to have a macro that begins with "use perltidy;" -- David Innes ----- Original Message ----- From: "Steve Sarapata" To: "Michael R. Wolf" Cc: Sent: Thursday, December 27, 2001 8:19 AM Subject: RE: SPUG: perltidy HTML colorer > The nice thing about emacs is its vi mode. > > -----Original Message----- > From: Michael R. Wolf [mailto:MichaelRunningWolf@att.net] > Sent: Thursday, December 27, 2001 10:33 AM > To: spug-list@pm.org > Subject: Re: SPUG: perltidy HTML colorer > > > Dan Ebert writes: > > > Of course, you also have to take a lot of flak from vi nuts. :) > > Consider the source! > Value the diversity. > Enjoy the advantage! > > It's like kids on skateboards heckling me for the moth on > the windshield of my Lear Jet. I can deal with it. > > -- > Michael R. Wolf > All mammals learn by playing! > MichaelRunningWolf@att.net > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your > Email-address For daily traffic, use spug-list for LIST ; for weekly, > spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From danielj at cheshirecat.net Thu Dec 27 15:33:50 2001 From: danielj at cheshirecat.net (Daniel A. Jacobs) Date: Wed Aug 4 00:08:30 2004 Subject: Perl-based editor macros (was Re: SPUG: perltidy HTML colorer) In-Reply-To: <006401c18f0b$8b85ab90$077e5e40@converger.net> Message-ID: <001801c18f1e$2cad4bb0$de01a8c0@brak> Hey, David. Take a look at http://john-edwin-tobey.org/perlmacs/ Daniel Jacobs | danielj@cheshirecat.net | Internet & Unix Consulting "In art and dream, may you proceed with abandon. In life, may you proceed with balance and stealth." - Patti Smith > -----Original Message----- > From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org] On Behalf Of > David Innes (CSG) > Sent: Thursday, December 27, 2001 11:20 AM > To: spug-list@pm.org > Subject: Perl-based editor macros (was Re: SPUG: perltidy HTML colorer) > > Ok, so here's a dumb question. I learned LISP in college, which made > emacs > very easy to extend. Then, in 1985 or so I got a job at Microsoft where > everything real (including email and software development) was done in vi > on > Microsoft XENIX (their pre-DOS microcomputer operating system). > > So I learned vi and I've used it ever since, I no longer remember LISP, > and > since I now know Perl there's no reason to relearn it. > > So here's my first question: Is there a version of Emacs, vi, or any other > suitable-for-development editor that uses Perl as the native macro > language? > Extra credit, of course, for one that's *written* in Perl. > > Second question: A number of editors claim to hook Perl for extensions but > (because I'm a thumb-fingered dweeb?) I haven't figured how to use them. > Any pointers would be appreciated. Extra credit for vi or vi-like-emacs > solutions. Extra extra credit for platform independent (W2K tolerant) > versions. > > My fantasy, of course, is to have a macro that begins with "use perltidy;" > -- David Innes > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From jay at Scherrer.com Thu Dec 27 16:01:57 2001 From: jay at Scherrer.com (Jay Scherrer) Date: Wed Aug 4 00:08:30 2004 Subject: Perl-based editor macros (was Re: SPUG: perltidy HTML colorer) In-Reply-To: <006401c18f0b$8b85ab90$077e5e40@converger.net> References: <5DD556A32C387C4493F251290A28216E02DBD030@red-msg-09.redmond.corp.microsoft.com> <006401c18f0b$8b85ab90$077e5e40@converger.net> Message-ID: <200112272201.fBRM1v701596@localhost.localdomain> Would you be willing to use Perl/Tk for you're editer? Jay On Thursday 27 December 2001 11:20 am, David Innes \(CSG\) wrote: > Ok, so here's a dumb question. I learned LISP in college, which made emacs > very easy to extend. Then, in 1985 or so I got a job at Microsoft where > everything real (including email and software development) was done in vi > on Microsoft XENIX (their pre-DOS microcomputer operating system). > > So I learned vi and I've used it ever since, I no longer remember LISP, and > since I now know Perl there's no reason to relearn it. > > So here's my first question: Is there a version of Emacs, vi, or any other > suitable-for-development editor that uses Perl as the native macro > language? Extra credit, of course, for one that's *written* in Perl. > > Second question: A number of editors claim to hook Perl for extensions but > (because I'm a thumb-fingered dweeb?) I haven't figured how to use them. > Any pointers would be appreciated. Extra credit for vi or vi-like-emacs > solutions. Extra extra credit for platform independent (W2K tolerant) > versions. > > My fantasy, of course, is to have a macro that begins with "use perltidy;" > -- David Innes > > ----- Original Message ----- > From: "Steve Sarapata" > To: "Michael R. Wolf" > Cc: > Sent: Thursday, December 27, 2001 8:19 AM > Subject: RE: SPUG: perltidy HTML colorer > > > The nice thing about emacs is its vi mode. > > > > -----Original Message----- > > From: Michael R. Wolf [mailto:MichaelRunningWolf@att.net] > > Sent: Thursday, December 27, 2001 10:33 AM > > To: spug-list@pm.org > > Subject: Re: SPUG: perltidy HTML colorer > > > > Dan Ebert writes: > > > Of course, you also have to take a lot of flak from vi nuts. :) > > > > Consider the source! > > Value the diversity. > > Enjoy the advantage! > > > > It's like kids on skateboards heckling me for the moth on > > the windshield of my Lear Jet. I can deal with it. > > > > -- > > Michael R. Wolf > > All mammals learn by playing! > > MichaelRunningWolf@att.net > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > - > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > Replace ACTION by subscribe or unsubscribe, EMAIL by your > > Email-address For daily traffic, use spug-list for LIST ; for weekly, > > spug-list-digest > > Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace > > ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily > > traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle > > Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From brian at tangent.org Thu Dec 27 16:27:02 2001 From: brian at tangent.org (Brian Aker) Date: Wed Aug 4 00:08:30 2004 Subject: Perl-based editor macros (was Re: SPUG: perltidy HTML colorer) In-Reply-To: <006401c18f0b$8b85ab90$077e5e40@converger.net> References: <5DD556A32C387C4493F251290A28216E02DBD030@red-msg-09.redmond.corp.microsoft. com> <006401c18f0b$8b85ab90$077e5e40@converger.net> Message-ID: <1009492023.8745.78.camel@avenger> On Thu, 2001-12-27 at 11:20, David Innes (CSG) wrote: > So here's my first question: Is there a version of Emacs, vi, or any other > suitable-for-development editor that uses Perl as the native macro language? > Extra credit, of course, for one that's *written* in Perl. Look at www.vim.org. VIM is a vi clone (which does a lot more) which you can compile perl into.I have never seen it documented very well as to what all you can do (I main use it to test syntax in code, and a few other parlor tricks). -Brian -- _______________________________________________________ Brian Aker, brian@tangent.org Slashdot Senior Developer Seattle, Washington http://tangent.org/~brian/ Email/Jabber brian@tangent.org _______________________________________________________ You can't grep a dead tree. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From mark at lanfear.net Thu Dec 27 18:08:16 2001 From: mark at lanfear.net (Mark Wagner) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: perl interface to Puget Sound traffic conditions Message-ID: <200112280008.fBS08G423594@moggy.lanfear.net> While working on a text version of the Eastside Journal web site I started hacking together a perl interface to the Puget Sound traffic condition data. That project was canceled but I got the interface working somewhat. Rather than let it die (perhaps it should) I've made a tarball of the source at . The following example finds the locations of heavy traffic on the main I-5 southbound lanes and the major incidents for the area: -- cut here -- use Webflow (); my $wf = new Webflow; $wf->update(stations => 'foo.sta', messages => 'foo.msg', data => 'foo.dat') or die $wf->{errmsg}; $sucks = $wf->select(highway => 'I-5', lane => 'main', direction => 'south', congestion => 'heavy') or die $wf->{errmsg}; print "Incidents:\n"; for my $message (@{$wf->{messages}}) { $message->{heading} eq 'INCIDENT' or next; for my $text (@{$message->{text}}) { print "$text\n"; } } print "\n"; print "Heavy traffic:\n"; for (@{$sucks}) { print "$wf->{stations}[$_]{location}\n"; -- cut here -- As of Thu Dec 27 15:51:15 PST 2001 the this produced the following output: -- cut here -- Incidents: CLEARED verified with camera 3:12 PM: I-5 southbound TO MERCER ST accident partially blocking RAMP verified with camera 3:08 PM A MAJOR EVENT WILL OCCUR THIS AFTERNOON AT SAFECO FIELD FROM 1:00 TO 5:30 PM. MOTORISTS SHOULD EXPECT SIGNIFICANT TRAFFIC IMPACTS AND ARE ADVISED TO PLAN ACCORDINGLY. A MAJOR EVENT WILL OCCUR THIS EVENING AT THE KEY ARENA FROM 7:30 TO 10:00 PM. MOTORISTS SHOULD EXPECT SIGNIFICANT TRAFFIC IMPACTS AND ARE ADVISED TO PLAN ACCORDINGLY. Heavy traffic: Marion St S Spokane St Columbian Way Mercer St 4th Ave S Oregon St -- cut here -- -- Mark Wagner mark@lanfear.net - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From MichaelRunningWolf at att.net Thu Dec 27 19:25:07 2001 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: perltidy HTML colorer In-Reply-To: <5DD556A32C387C4493F251290A28216E02DBD030@red-msg-09.redmond.corp.microsoft.com> References: <5DD556A32C387C4493F251290A28216E02DBD030@red-msg-09.redmond.corp.microsoft.com> Message-ID: "Steve Sarapata" writes: > The nice thing about emacs is its vi mode. The nasty thing about vi is its lack of an emacs mode. :-) emacs -- the editor that can edit itself: $ emacs emacs It works. $ vi vi It dies. Michael P.S. I've redirected followups to alt.religion.emacs.... -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From MichaelRunningWolf at att.net Thu Dec 27 19:33:03 2001 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: perltidy HTML colorer In-Reply-To: <5DD556A32C387C4493F251290A28216E02DBD030@red-msg-09.redmond.corp.microsoft.com> References: <5DD556A32C387C4493F251290A28216E02DBD030@red-msg-09.redmond.corp.microsoft.com> Message-ID: "Steve Sarapata" writes: > The nice thing about emacs is its vi mode. I posted a smart-alec answer (appropriately annotated with an emoticon). Now here's my "value diversity" answer. Yes, I'm glad a vi mode exists. That lets emacs be all things to all people. If your muscle memory happens to have been trained in vi key bindings, then you get the power of emacs with a user interface that's comfortable to you. I happen to have trained mine with emacs bindings, but it was mostly luck; it could easily have gone to vi back in my grad school days. Which ever key binding you use (emacs or vi), you can keep to them or delve into elisp. I think that is a lesson that many user interfaces could learn -- being all things to all people. -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From tim at consultix-inc.com Fri Dec 28 12:58:22 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: Damian's "Twas the Night Before Xmas" Message-ID: <20011228105822.A17526@timji.consultix.wa.com> SPUGsters, I just noticed that Damian Conway, the "Mad Serf of Perl", has penned a humorous variation on the classic "Twas the Night before Christmas" poem. To read it, go to yetanother.org , and click on Conway Channel, then Diary, then Latest Diary Entry. And once you're through chuckling, if you want to show your continued support for Damian (and new co-Serf Dan Sugalski), click on over to "perl-foundation.org", and make a donation to the Perl Development Fund while you can still get a tax deduction for this year! ============================================================= | Tim Maher, Ph.D. Tel: (206) 781-UNIX/8649 | | SPUG Founder & Leader Email: spug@seattleperl.org | | Seattle Perl Users Group HTTP: www.seattleperl.org | ============================================================= - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From MichaelRunningWolf at att.net Fri Dec 28 14:12:29 2001 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Wed Aug 4 00:08:30 2004 Subject: SPUG: Damian's "Twas the Night Before Xmas" In-Reply-To: <20011228105822.A17526@timji.consultix.wa.com> References: <20011228105822.A17526@timji.consultix.wa.com> Message-ID: Tim Maher/CONSULTIX writes: > I just noticed that Damian Conway, the "Mad Serf of Perl", > has penned a humorous variation on the classic "Twas the > Night before Christmas" poem. http://www.yetanother.org/damian/diary_December_2001.html#day_24 > click on over to "perl-foundation.org", and make a > donation to the Perl Development Fund http://www.perl-foundation.org/index.cgi?page=donate -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/ From kjk122 at simmani.com Wed Dec 12 19:34:55 2001 From: kjk122 at simmani.com (=?ks_c_5601-1987?B?wvy1yMH2tbXA2rimw6O0wrjwwNM=?=) Date: Wed Aug 4 00:08:35 2004 Subject: SPUG: =?ks_c_5601-1987?B?W8irurhdIMH2tbXA2iDD38O1IML8v6nHz7Hi?= Message-ID: <3c4a1e4c3c4ec766@relay3.kornet.net> (added by relay3.kornet.net) '??? ??' ???? ???? ???? ?? ?? ?? ?? ?? ????. spug-list?? ????? ? ?????? ?? ??? ??? ????. ????? ???? ??? ???? ? ??? ?? ???? ? site?? ???? ????? ??????, ??? ????? ??????. ???? --> ??????? '?? ???? ?? ??' ??? ????? ?? 40? ?? ?????. ??? ?? ????? ???? ??, ?? ???? ??, ???? ?? ?? '?? ??? ?? ?????'? ???? ???? ??? ?? ??? ???. CEO ???, ???? ??? ??? ???, ???, ??? ?? ??? ??? ?? ???? ??? ? ???. ??? ??? ??????? ???? ??, ??? ??, ? ?? ?? ???? ??? ?? ?? ??? ????(http://cafe17.daum.net/TrueLeader)? '?????' ??? ?? ? ????. ? ??? 1? ??? ??? ?? ??? ????, 2??? TV??? ??? ??, ??? ?? ??? ???? ???. ??? ???? ?? ??? ???? ????. 2002? 1? 19? ??? ??? ?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20011213/8e7309d0/attachment.htm