From tim at consultix-inc.com Sun Apr 1 23:46:44 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: Perl+Python = Parrot! Message-ID: <20010401214644.A13855@timji.consultix.wa.com> Check out the press releases about the new language developed jointly by Larry Wall and Guido van Rossum, "Parrot", at use.perl.org! -Tim *==========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | | TIM MAHER: Unix/Perl DAMIAN CONWAY: Adv. Perl COLIN MEYER: Perl/DBI | | *We are currently scheduling On-Site Classes on UNIX and Perl topics!* | *==========================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From ericj at cubesearch.com Mon Apr 2 01:29:42 2001 From: ericj at cubesearch.com (Eric Johanson) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: Perl+Python = Parrot! In-Reply-To: <20010401214644.A13855@timji.consultix.wa.com> Message-ID: Gosh, It's not April first now, is it? Nah, probably not.... On Sun, 1 Apr 2001, Tim Maher/CONSULTIX wrote: > Check out the press releases about the new language > developed jointly by Larry Wall and Guido van Rossum, "Parrot", > at use.perl.org! > > -Tim > > *==========================================================================* > | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | > | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | > | TIM MAHER: Unix/Perl DAMIAN CONWAY: Adv. Perl COLIN MEYER: Perl/DBI | > | *We are currently scheduling On-Site Classes on UNIX and Perl topics!* | > *==========================================================================* > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 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://www.halcyon.com/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://www.halcyon.com/spug/ From asim_jalis at hp.com Mon Apr 2 14:31:01 2001 From: asim_jalis at hp.com (JALIS,ASIM (HP-FtCollins,ex1)) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: [eastside-spug] Files From Last Presentation Uploaded Message-ID: I have uploaded the files from my presentation at Eastside-SPUG last Wednesday. Please take a look at the contents of the folder called "Perl Tools" in the "Files" section of http://groups.yahoo.com/group/eastside-spug The file presentation.html contains the presentation as HTML. The .pl files are the tools I demonstrated. And Account.def and Account.pm are the examples for class_validate.pl that I used. Enjoy! Asim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From rowdenw at eskimo.com Mon Apr 2 20:36:09 2001 From: rowdenw at eskimo.com (William Rowden) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: Output files In-Reply-To: <200103221145.AA2489188670@mail.tanzatech.com> Message-ID: Did I miss a thread? I don't see that anyone has answered this question. (I notice because I wait until the end of a thread to decide if I'll save its messages. Few trim their replies, so the final message usually contains most of the thread.) On Mar 22, Jafaar Nyang'oro wrote: > I need to create a script that would format the output from > files created by processes running in Windows NT to look like > the output that has been created by UNIX processes. > > I have included the files in question below. I'll appreciate for > any pointers on how to write that sort of a script. In all, > there are three files: sysinfo.out, contacts.out, and dept.out A straightforward--but perhaps not very clever--approach would be as follows: 1. Write regular expressions for relevant information. 2. Capture changing information in variables. 3. Print new files by placing variables in standard text. > file: sysinfo.out > > > Run Date: Tue Mar 20 16:17:36 CST 2001 > Operating System: SunOS A sample that prints in this format is below. Hopefully your Perl executable isn't in the bizarre location mine is. -----8<----- #!/usr/local/bin/perl5 -w $dozfile = "nt-sysinfo.out"; $nixfile = "sysinfo.out"; open (NT, "< $dozfile\0") or die "Can't open Windoze file $dozfile for reading: $!\n"; open (NIX, "> $nixfile\0") or die "Can't open *nix file $nixfile for reading: $!\n"; while () { next if /^\s*$/; # Ignore blank lines. s/\s+$//; # Remove trailing white space. if (/^(\w{3} \w{3} \d{1,2} \d{2}:\d{2}:\d{2}) (\d{4})$/) { $date = $1; $year = $2; } elsif (/^NT Type: (.*)$/) { $OS = $1; } # elsif etc. } print NIX < file: contact.out This one looks the same to me. > file: dept.out > > Department(s): 704dss What's different about this? > file: nt-sysinfo.out > > Thu Mar 22 01:27:20 2001 > NT Type: NT Advanced Server The REs above capture these. -- -William PGP key: http://www.eskimo.com/~rowdenw/crypt/pgp/rowdenw.asc Fingerprint: 00C9 6887 F073 A261 CE06 EC88 7D75 13BD 1221 2BA9 I'm not left-handed either. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From TimBuckwalter at aol.com Tue Apr 3 13:09:18 2001 From: TimBuckwalter at aol.com (Tim Buckwalter) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: local Perl classes Message-ID: <3ACA11CE.C03DA99@aol.com> Dear SPUG: I just joined the list minutes ago. I've been doing Perl since 98 and like most people I improve my skills completely on my own. However, when I recently listed "improve my Perl skills" as one of my goals in one of those annual corporate self-improvement navel-gazing exercises, my manager suggested that I take a Perl course here is Seattle. I checked out the UW distance learning courses and they do have a CGI course (http://www.outreach.washington.edu/dl/comp.asp), but CGI is not what we do here in our Linguistics dept. (I do mostly regexps stuff and stats from processing large amounts of text). Areas of Perl that I'd like to work on the most are methods of managing/integrating lots of scattered code (my use of local vars is zero, and all my subroutines are located in the same file they're called from). I have a fairly good idea of how to learn this stuff on my own, but taking a course in something related is what I'm being encouraged to do. Do any of you have any idea where such courses would be offered? TIA, Tim -- Tim Buckwalter Senior Language Engineer AOL Mobile (formerly Tegic) 1000 Dexter Ave N, Suite 300 Seattle, WA 98109-3574 206.268.7552 phone 206.343.7004 fax 206.343.7001 front desk TimBuckwalter@aol.com www.tegic.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://www.halcyon.com/spug/ From tim at consultix-inc.com Tue Apr 3 14:52:29 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: local Perl classes Message-ID: <20010403125229.A26663@timji.consultix.wa.com> On Tue, Apr 03, 2001 at 11:09:18AM -0700, Tim Buckwalter wrote: > Dear SPUG: > I just joined the list minutes ago. I've been doing Perl since 98 and > manager suggested that I take a Perl course here is Seattle. I checked > is what I'm being encouraged to do. Do any of you have any idea where > such courses would be offered? > TIA, > Tim Buckwalter > Senior Language Engineer > AOL Mobile (formerly Tegic) > TimBuckwalter@aol.com Welcome to the World of SPUG! Funny you should ask about training! 8-} My company, Consultix, offers a wide range of classes on Perl topics. We've just finished a long run of public classes here, so at this point we're doing classes at other locations around the country, and collecting requests from Seattle corporations in preparation for setting up our next local schedule. But if you've got a few colleagues at your company who could use the same training, we might be able to schedule a special class (on-site, dedicated, or public; see http://www.consultix-inc.com/on-site.html) for your group. Descriptions of our Perl classes can be found at http://www.consultix-inc.com/perllist *==========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | | TIM MAHER: Unix/Perl DAMIAN CONWAY: Adv. Perl COLIN MEYER: Perl/DBI | | *We are currently scheduling On-Site Classes on UNIX and Perl topics!* | *==========================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From seppy at mail.tanzatech.com Tue Apr 3 22:02:25 2001 From: seppy at mail.tanzatech.com (Jafaar Nyang'oro) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: Output files Message-ID: <200104032302.AA98631990@mail.tanzatech.com> William, No. You didn't miss a thread because no one had responded to the question I had asked: To further expand on the same logic. I'm getting the output that's been generated by running an NT batch script. The batch script does 'ftp' all the info out into two zip files, and send them to an AIX box. Now, the script I'm creating is supposed to unzip the zip-ed files once they get into the AIX box, then grab the 'sysinfo.out', 'dept.out', and 'contact.out' files from among a whole bunch of extracted files. Then convert them to look like files created by the UNIX processes. And finally to 'tar.Z' the output files. The problem I run into time and again is that all the NT files contain the hostname as part of the filename. Since several people would run this batch file on their machine, it's evident that every zip file that would be ftp-ed to me would have a different name (although they will all have the '_sysinfo.out','_dept.out', and '_contact.out' suffixes. So how do I tell my script to grab the appropriate filenames without having to hard-code everything? I'm stuck in the mud here. For instance in this file 'DBWNT01_NTcontact.out', 'DBWNT01_NT' is the hostname of the machine and 'contact.out' is the supposedly filename. But I get the whole thing when the script runs. So how do I tell my script to grab that hostname info and add it into the file name. Do I make any sense here? I'm a bit confused. Thanks. ../seppy ---------- Original Message ---------------------------------- From: William Rowden Date: Mon, 2 Apr 2001 18:36:09 -0700 (PDT) >Did I miss a thread? I don't see that anyone has answered this >question. (I notice because I wait until the end of a thread to >decide if I'll save its messages. Few trim their replies, so the >final message usually contains most of the thread.) > >On Mar 22, Jafaar Nyang'oro wrote: >> I need to create a script that would format the output from >> files created by processes running in Windows NT to look like >> the output that has been created by UNIX processes. >> >> I have included the files in question below. I'll appreciate for >> any pointers on how to write that sort of a script. In all, >> there are three files: sysinfo.out, contacts.out, and dept.out > >A straightforward--but perhaps not very clever--approach would be as >follows: > > 1. Write regular expressions for relevant information. > 2. Capture changing information in variables. > 3. Print new files by placing variables in standard text. > >> file: sysinfo.out >> >> >> Run Date: Tue Mar 20 16:17:36 CST 2001 >> Operating System: SunOS > >A sample that prints in this format is below. Hopefully your Perl >executable isn't in the bizarre location mine is. > >-----8<----- >#!/usr/local/bin/perl5 -w > >$dozfile = "nt-sysinfo.out"; >$nixfile = "sysinfo.out"; > >open (NT, "< $dozfile\0") or > die "Can't open Windoze file $dozfile for reading: $!\n"; >open (NIX, "> $nixfile\0") or > die "Can't open *nix file $nixfile for reading: $!\n"; > >while () { > next if /^\s*$/; # Ignore blank lines. > s/\s+$//; # Remove trailing white space. > if (/^(\w{3} \w{3} \d{1,2} \d{2}:\d{2}:\d{2}) (\d{4})$/) { > $date = $1; > $year = $2; > } > elsif (/^NT Type: (.*)$/) { > $OS = $1; > } > # elsif etc. >} > >print NIX <Run Date: $date CST $year >Operating System: $OS >EOF ># Include additional lines above the EOF. >-----8<----- > >> file: contact.out > >This one looks the same to me. > >> file: dept.out >> >> Department(s): 704dss > >What's different about this? > >> file: nt-sysinfo.out >> >> Thu Mar 22 01:27:20 2001 >> NT Type: NT Advanced Server > >The REs above capture these. >-- > -William >PGP key: http://www.eskimo.com/~rowdenw/crypt/pgp/rowdenw.asc >Fingerprint: 00C9 6887 F073 A261 CE06 EC88 7D75 13BD 1221 2BA9 >I'm not left-handed either. > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 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://www.halcyon.com/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://www.halcyon.com/spug/ From whitneyt at agcs.com Wed Apr 4 12:13:54 2001 From: whitneyt at agcs.com (Thomas Whitney) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: File locking with flock and NFS Message-ID: <3ACB5652.4E5B59FA@agcs.com> Greetings SPUG, I am developing Perl applications where I need to do file locking. These will be running on SunOS 5.5.1 with a NFS file server. All the books and references I have researched say that flock will not work with NFS, but none offer any alternatives. Does anybody know if this is true, and if so what alternatives are there? Thanks Tom - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From mathin at mathin.com Wed Apr 4 11:16:51 2001 From: mathin at mathin.com (Dan Ebert) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: Output files In-Reply-To: <200104032302.AA98631990@mail.tanzatech.com> Message-ID: Would something like this do the trick? $file =~ /(.*)(sysinfo\.out|dept\.out|contact\.out)/; $hostname = $1; $filetype = $2; Dan. ----------------------------------------------------------- Optimists: the glass is half full. Pessimists: the glass is half empty. Engineers: the glass is twice as big as it needs to be. ----------------------------------------------------------- On Tue, 3 Apr 2001, Jafaar Nyang'oro wrote: > William, > > No. You didn't miss a thread because no one had responded to > the question I had asked: > > To further expand on the same logic. I'm getting the output > that's been generated by running an NT batch script. The batch > script does 'ftp' all the info out into two zip files, and > send them to an AIX box. > > Now, the script I'm creating is supposed to unzip the zip-ed > files once they get into the AIX box, then grab the 'sysinfo.out', 'dept.out', and 'contact.out' files from among a whole bunch of extracted files. Then convert them to look like files created by the UNIX processes. And finally to 'tar.Z' the output files. > > The problem I run into time and again is that all the NT files > contain the hostname as part of the filename. Since several > people would run this batch file on their machine, it's > evident that every zip file that would be ftp-ed to me would > have a different name (although they will all have the > '_sysinfo.out','_dept.out', and '_contact.out' suffixes. > > So how do I tell my script to grab the appropriate filenames > without having to hard-code everything? I'm stuck in the mud > here. > > For instance in this file 'DBWNT01_NTcontact.out', 'DBWNT01_NT' > is the hostname of the machine and 'contact.out' is the supposedly > filename. But I get the whole thing when the script runs. So how do I tell my script to grab that hostname info and add it into the file name. > > Do I make any sense here? I'm a bit confused. > > > > Thanks. > > ../seppy > > > ---------- Original Message ---------------------------------- > From: William Rowden > Date: Mon, 2 Apr 2001 18:36:09 -0700 (PDT) > X-Mailer-Version: 20001120 > X-Recipient: mathin@mathin.com > > >Did I miss a thread? I don't see that anyone has answered this > >question. (I notice because I wait until the end of a thread to > >decide if I'll save its messages. Few trim their replies, so the > >final message usually contains most of the thread.) > > > >On Mar 22, Jafaar Nyang'oro wrote: > >> I need to create a script that would format the output from > >> files created by processes running in Windows NT to look like > >> the output that has been created by UNIX processes. > >> > >> I have included the files in question below. I'll appreciate for > >> any pointers on how to write that sort of a script. In all, > >> there are three files: sysinfo.out, contacts.out, and dept.out > > > >A straightforward--but perhaps not very clever--approach would be as > >follows: > > > > 1. Write regular expressions for relevant information. > > 2. Capture changing information in variables. > > 3. Print new files by placing variables in standard text. > > > >> file: sysinfo.out > >> > >> > >> Run Date: Tue Mar 20 16:17:36 CST 2001 > >> Operating System: SunOS > > > >A sample that prints in this format is below. Hopefully your Perl > >executable isn't in the bizarre location mine is. > > > >-----8<----- > >#!/usr/local/bin/perl5 -w > > > >$dozfile = "nt-sysinfo.out"; > >$nixfile = "sysinfo.out"; > > > >open (NT, "< $dozfile\0") or > > die "Can't open Windoze file $dozfile for reading: $!\n"; > >open (NIX, "> $nixfile\0") or > > die "Can't open *nix file $nixfile for reading: $!\n"; > > > >while () { > > next if /^\s*$/; # Ignore blank lines. > > s/\s+$//; # Remove trailing white space. > > if (/^(\w{3} \w{3} \d{1,2} \d{2}:\d{2}:\d{2}) (\d{4})$/) { > > $date = $1; > > $year = $2; > > } > > elsif (/^NT Type: (.*)$/) { > > $OS = $1; > > } > > # elsif etc. > >} > > > >print NIX < >Run Date: $date CST $year > >Operating System: $OS > >EOF > ># Include additional lines above the EOF. > >-----8<----- > > > >> file: contact.out > > > >This one looks the same to me. > > > >> file: dept.out > >> > >> Department(s): 704dss > > > >What's different about this? > > > >> file: nt-sysinfo.out > >> > >> Thu Mar 22 01:27:20 2001 > >> NT Type: NT Advanced Server > > > >The REs above capture these. > >-- > > -William > >PGP key: http://www.eskimo.com/~rowdenw/crypt/pgp/rowdenw.asc > >Fingerprint: 00C9 6887 F073 A261 CE06 EC88 7D75 13BD 1221 2BA9 > >I'm not left-handed either. > > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > 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://www.halcyon.com/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://www.halcyon.com/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://www.halcyon.com/spug/ From billa at willapabay.org Wed Apr 4 17:09:59 2001 From: billa at willapabay.org (Bill Alford) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: File locking with flock and NFS In-Reply-To: <3ACB5652.4E5B59FA@agcs.com> Message-ID: If every instance of the script is running on the same box, you can put empty lockfiles outside of the NFS volume. E.g /tmp/my_app/target_file.lockfile If they are running on multiple machines sharing the same volume, then you can touch a file in the volume and use the existence of the file as a lock. You'd have to 1) check that the file doesn't exist, 2) sleep long enough that NFS propagation isn't an issue (seems like 1 second should be long enough, but I've been on loaded systems when it's not), 3) make sure the lock file still isn't there and create it (put your ID (machine:pid) in the file and close it), 4) sleep the same duration or more, 5) check the file, if it exists and it still contains your ID, no one stomped you and it's your turn to run. Admittedly, it's clunky. But it should work almost all the time, especially if these are processes that run infrequently or slowly. You can also put the above into a function that returns true when the lock is achieved and: sub get_hackish_lock { my $file = shift; while (! got_hackish_lock($file)) { sleep(5*60); # assuming that once the lock is achieved # the processing takes about 5 minutes } } get_hackish_lock($file_to_lock); # do your work release_hackish_lock($file_to_lock); There are probably gaping holes in this, but it might get you running well enough that it is sufficient. Bill On Wed, 4 Apr 2001, Thomas Whitney wrote: > Greetings SPUG, > > I am developing Perl applications where I need to do file locking. These will be > running on SunOS 5.5.1 with a NFS file server. All the books and references I > have researched say that flock will not work with NFS, but none offer any > alternatives. Does anybody know if this is true, and if so what alternatives are > there? > > Thanks > Tom > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 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://www.halcyon.com/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://www.halcyon.com/spug/ From ryan at e-valuations.com Wed Apr 4 18:51:26 2001 From: ryan at e-valuations.com (Ryan Ames) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: cgi help Message-ID: hello all, I am writing a cgi script that is using oraperl to query the database and post the results. My queries are somewhat on the hefty side and my browser keeps timing out. Is there any way that I can keep this from happening? thanks.... Ryan Ames E-valuations.com ryan@e-valuations.com 120 Lakeside Ave, Suite 330 phone: 206.695.6351 Seattle, WA 98122 fax: 206.328.7091 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From dancerboy at strangelight.com Wed Apr 4 19:46:20 2001 From: dancerboy at strangelight.com (dancerboy) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: cgi help In-Reply-To: References: Message-ID: At 4:51 PM -0700 4/4/01, Ryan Ames wrote: >hello all, > I am writing a cgi script that is using oraperl to query the >database and post the results. My queries are somewhat on the hefty side >and my browser keeps timing out. Is there any way that I can keep this from >happening? thanks.... If the database query is taking that long, then instead of waiting for the query to finish, you should return a token that will allow the client to get a cached copy of the results after the query has completed. E.g. (an extremely minimal example): $token_id = some_random_number_guaranteed_to_be_unique(); print qq( Query in progress. The results will be available here in approximate $n minutes. ); close STDOUT; $results = query_database(); open CACHE_FILE, ">$token_id.html"; print CACHE_FILE $results; close CACHE_FILE; This is clunky and inelegant as shown here, but you can use this basic idea in conjunction with client-side and/or server-side scripting, frames, etc. to create a page that will give the user instant feedback on what's going on, and which will automatically update when the database query is finished. -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://www.halcyon.com/spug/ From mathin at mathin.com Wed Apr 4 19:59:46 2001 From: mathin at mathin.com (Dan Ebert) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: cgi help In-Reply-To: Message-ID: I don't know if this would work ... but it might be worth a try. Turn buffering off with $| = 1; Then print something to the browser print CGI::header; print "Processing ..."; so the browser gets something. Then do the query and print the results when the query is done. Dan. ----------------------------------------------------------- Optimists: the glass is half full. Pessimists: the glass is half empty. Engineers: the glass is twice as big as it needs to be. ----------------------------------------------------------- On Wed, 4 Apr 2001, Ryan Ames wrote: > hello all, > I am writing a cgi script that is using oraperl to query the > database and post the results. My queries are somewhat on the hefty side > and my browser keeps timing out. Is there any way that I can keep this from > happening? thanks.... > > > > > Ryan Ames > E-valuations.com ryan@e-valuations.com > 120 Lakeside Ave, Suite 330 phone: 206.695.6351 > Seattle, WA 98122 fax: 206.328.7091 > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 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://www.halcyon.com/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://www.halcyon.com/spug/ From ryan at e-valuations.com Thu Apr 5 01:12:33 2001 From: ryan at e-valuations.com (Ryan Ames) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: cgi help Message-ID: thanks for the help...flushing the buffer accomplished what I needed... -----Original Message----- From: Dan Ebert To: Ryan Ames Cc: 'spug-list@pm.org' Sent: 4/4/2001 5:59 PM Subject: Re: SPUG: cgi help I don't know if this would work ... but it might be worth a try. Turn buffering off with $| = 1; Then print something to the browser print CGI::header; print "Processing ..."; so the browser gets something. Then do the query and print the results when the query is done. Dan. ----------------------------------------------------------- Optimists: the glass is half full. Pessimists: the glass is half empty. Engineers: the glass is twice as big as it needs to be. ----------------------------------------------------------- On Wed, 4 Apr 2001, Ryan Ames wrote: > hello all, > I am writing a cgi script that is using oraperl to query the > database and post the results. My queries are somewhat on the hefty side > and my browser keeps timing out. Is there any way that I can keep this from > happening? thanks.... > > > > > Ryan Ames > E-valuations.com ryan@e-valuations.com > 120 Lakeside Ave, Suite 330 phone: 206.695.6351 > Seattle, WA 98122 fax: 206.328.7091 > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 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://www.halcyon.com/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://www.halcyon.com/spug/ From doug at beaver.net Thu Apr 5 03:46:08 2001 From: doug at beaver.net (Doug Beaver) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: File locking with flock and NFS In-Reply-To: ; from billa@willapabay.org on Wed, Apr 04, 2001 at 03:09:59PM -0700 References: <3ACB5652.4E5B59FA@agcs.com> Message-ID: <20010405044608.B77196@beaver.net> On Wed, Apr 04, 2001 at 03:09:59PM -0700, Bill Alford wrote: > If every instance of the script is running on the same box, you can > put empty lockfiles outside of the NFS volume. E.g > /tmp/my_app/target_file.lockfile > > If they are running on multiple machines sharing the same volume, then > you can touch a file in the volume and use the existence of the file > as a lock. You'd have to > > 1) check that the file doesn't exist, > > 2) sleep long enough that NFS propagation isn't an issue (seems like 1 > second should be long enough, but I've been on loaded systems when > it's not), > > 3) make sure the lock file still isn't there and create it (put your > ID (machine:pid) in the file and close it), > > 4) sleep the same duration or more, > > 5) check the file, if it exists and it still contains your ID, no one > stomped you and it's your turn to run. > > Admittedly, it's clunky. But it should work almost all the time, > especially if these are processes that run infrequently or slowly. You > can also put the above into a function that returns true when the lock is > achieved and: You mentioned that this is a hack and that it probably has gaping holes. You were right, it does have a few holes. :-/ I have heard that directory creation over nfs is atomic on many/most implementations of nfs. Since mkdir fails if the directory already exists, you can use a directory as your lockfile and it should work as long as directory creation is atomic on your implementation of nfs. I also did a search on search.cpan.org for lock and found lots of modules, but my searches for 'lock nfs' and 'lock network' and didn't find anything. File::Flockdir said that File::Lockdir was described in the perl cookbook, but I don't have my copy handy so I don't know if it's what we are looking for. You could also use fcntl if client and server supported the same locks. You'll have to read your fcntl(2) manpage and figure out what flags and features you have since they differ from OS to OS. Doug > On Wed, 4 Apr 2001, Thomas Whitney wrote: > > > Greetings SPUG, > > > > I am developing Perl applications where I need to do file locking. These will be > > running on SunOS 5.5.1 with a NFS file server. All the books and references I > > have researched say that flock will not work with NFS, but none offer any > > alternatives. Does anybody know if this is true, and if so what alternatives are > > there? > > > > Thanks > > Tom > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > 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://www.halcyon.com/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://www.halcyon.com/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://www.halcyon.com/spug/ From dancerboy at strangelight.com Thu Apr 5 22:10:34 2001 From: dancerboy at strangelight.com (dancerboy) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: cgi help In-Reply-To: References: Message-ID: At 11:12 PM -0700 4/4/01, Ryan Ames wrote: > thanks for the help...flushing the buffer accomplished what I needed... You should be aware that different browsers handle this situation differently: some will display the partially-downloaded page, others will wait until the server closes the connection before displaying anything. I still say that the "correct" solution is to return an identifying token which will allow the visitor to get the query results once they're available. (Of course, doing things the "correct" way isn't always worth the extra effort.) -jason > >-----Original Message----- >From: Dan Ebert >To: Ryan Ames >Cc: 'spug-list@pm.org' >Sent: 4/4/2001 5:59 PM >Subject: Re: SPUG: cgi help > > >I don't know if this would work ... but it might be worth a try. > >Turn buffering off with > >$| = 1; > >Then print something to the browser > >print CGI::header; >print "Processing ..."; > >so the browser gets something. > >Then do the query and print the results when the query is done. > >Dan. >----------------------------------------------------------- >Optimists: the glass is half full. >Pessimists: the glass is half empty. >Engineers: the glass is twice as big as it needs to be. >----------------------------------------------------------- > > > > > >On Wed, 4 Apr 2001, Ryan Ames wrote: > >> hello all, >> I am writing a cgi script that is using oraperl to query the >> database and post the results. My queries are somewhat on the hefty >side >> and my browser keeps timing out. Is there any way that I can keep >this from >> happening? thanks.... >> >> >> >> >> Ryan Ames >> E-valuations.com ryan@e-valuations.com >> 120 Lakeside Ave, Suite 330 phone: 206.695.6351 >> Seattle, WA 98122 fax: 206.328.7091 >> >> >> >> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >- - >> 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://www.halcyon.com/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://www.halcyon.com/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://www.halcyon.com/spug/ From daryn at marinated.org Fri Apr 6 01:34:42 2001 From: daryn at marinated.org (Daryn Nakhuda) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: cgi help In-Reply-To: Message-ID: > I still say that the "correct" solution is to return an identifying > token which will allow the visitor to get the query results once > they're available. (Of course, doing things the "correct" way isn't > always worth the extra effort.) >From a usability standpoint, it may be confusing to the end user to have a situation where they get a token that they can use for retrieving the results later, especially if we're merely talking 30 seconds, versus 2 hours or something. Perhaps more "correct" would be to have an interstitial (sp?) page, like expedia or some of the other travel sites do, so that you see something, regardless of browser, while the query is running. there are numerous ways to do this, and it can be as smart or as dumb as you want it to be. . . > >-----Original Message----- >From: Dan Ebert >To: Ryan Ames >Cc: 'spug-list@pm.org' >Sent: 4/4/2001 5:59 PM >Subject: Re: SPUG: cgi help > > >I don't know if this would work ... but it might be worth a try. > >Turn buffering off with > >$| = 1; > >Then print something to the browser > >print CGI::header; >print "Processing ..."; > >so the browser gets something. > >Then do the query and print the results when the query is done. > >Dan. >----------------------------------------------------------- >Optimists: the glass is half full. >Pessimists: the glass is half empty. >Engineers: the glass is twice as big as it needs to be. >----------------------------------------------------------- > > > > > >On Wed, 4 Apr 2001, Ryan Ames wrote: > >> hello all, >> I am writing a cgi script that is using oraperl to query the >> database and post the results. My queries are somewhat on the hefty >side >> and my browser keeps timing out. Is there any way that I can keep >this from >> happening? thanks.... >> >> >> >> >> Ryan Ames >> E-valuations.com ryan@e-valuations.com >> 120 Lakeside Ave, Suite 330 phone: 206.695.6351 >> Seattle, WA 98122 fax: 206.328.7091 >> >> >> >> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >- - >> 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://www.halcyon.com/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://www.halcyon.com/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://www.halcyon.com/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://www.halcyon.com/spug/ From ronh at iainc.com Fri Apr 6 07:55:19 2001 From: ronh at iainc.com (Ron Hartikka) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: Can't ignore sigchld, setting default. < HPUX Message-ID: Hi, I get this warning when I my script is run by an in house program - a long running process. I'd like to clean it up. Should clean up happen in my script or in the program? What reason would a program have for ignoring SIGCHLD. perldiag says ignoring SIGCHLD is careless. Is that always true - or does ignoring SIGCHLD make sense sometimes? TIA Ron Hartikka Interautomation, Inc. email => ronh@iainc.com Dearborn => 313-248-5401 Mobile => 734-216-2845 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From eric.brose at attws.com Fri Apr 6 12:17:09 2001 From: eric.brose at attws.com (Brose, Eric) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: To kill a MainWindow Message-ID: <67AC2DB52118D411A8F300508B957F1204B1430F@WA-MSG02> Hello. I've been working with perl for win32 using the Tk module, trying to develop a simple GUI interface that connects to a database. I don't really have any idea what I'm doing, but I've managed to get most of the core functionality down. One thing I have yet to overcome is how to destroy an individual window (I have multiple windows) without exiting the whole app. The only command i can find is exit, but that destroys all windows. The user can always click on the x in the upper-right hand corner, but I'd like to be able to use a command initiated from a button press. So...if anyone with Tk know-how can clue me in, i'd be much obliged. Thanks, Eric - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From bill at celestial.com Fri Apr 6 12:59:37 2001 From: bill at celestial.com (Bill Campbell) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: To kill a MainWindow In-Reply-To: <67AC2DB52118D411A8F300508B957F1204B1430F@WA-MSG02>; from eric.brose@attws.com on Fri, Apr 06, 2001 at 10:17:09AM -0700 References: <67AC2DB52118D411A8F300508B957F1204B1430F@WA-MSG02> Message-ID: <20010406105936.A26149@barryg.mi.celestial.com> On Fri, Apr 06, 2001 at 10:17:09AM -0700, Brose, Eric wrote: >Hello. > >I've been working with perl for win32 using the Tk module, trying to develop >a simple GUI interface that connects to a database. I don't really have any >idea what I'm doing, but I've managed to get most of the core functionality >down. > >One thing I have yet to overcome is how to destroy an individual window (I >have multiple windows) without exiting the whole app. The only command i >can find is exit, but that destroys all windows. If $Win is the individual window, then $Win->destroy should do the trick. 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/ Those who cast the vote decide nothing. Those who count the vote decide everything. (Joseph Stalin) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From asim_jalis at hp.com Fri Apr 6 13:10:46 2001 From: asim_jalis at hp.com (JALIS,ASIM (HP-FtCollins,ex1)) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: Eastside-SPUG Update Message-ID: I have decided to step down as Eastside SPUG emperor. Primarily because I feel I am unable to give it enough time to make it grow and prosper. So it might be time once again to test the waters to see if there is truly need for Eastside-SPUG to exist. If anyone's interested in taking this baby please raise your hand. And then post a message to this effect to the list. Thanks to David Patterson for cheerfully hosting the meetings complete with cookies and coffee at the Avaya site. Asim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From alex at linuxconsulting.org Fri Apr 6 14:53:23 2001 From: alex at linuxconsulting.org (Alex Kotov) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: cgi help In-Reply-To: References: Message-ID: <65313912532.20010406125323@linuxconsulting.org> >>> I am writing a cgi script that is using oraperl to query the >>> database and post the results. My queries are somewhat on the hefty >>side >>> and my browser keeps timing out. Is there any way that I can keep >>this from >>> happening? thanks.... Depending on your situation, there may be other acceptable solutions. 1. Try to reduce the time that the queries take. Talk to a DBA. With some careful planning and indexing, we were able to reduce running time for some of our queries by an order of magnitude. Oracle can do amazing things if you tweak it just right. 2. If the queries need to run that long, maybe the browser is not a good interface for them. You can make them run via cron, or send the results to the users by email. You can also want to cache the results and show "your last 20 queries" page to the users. Best regards, Alex mailto:alex@linuxconsulting.org ICQ: 13064434 AIM: linuxcons - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From moonbeam at catmanor.com Fri Apr 6 15:21:09 2001 From: moonbeam at catmanor.com (William Julien) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: cgi help In-Reply-To: Mail from 'Alex Kotov ' dated: Fri, 6 Apr 2001 12:53:23 -0700 Message-ID: <200104062021.NAA28757@catmanor.com> > > >>>> I am writing a cgi script that is using oraperl to query the >>>> database and post the results. My queries are somewhat on the hefty >>>side >>>> and my browser keeps timing out. Is there any way that I can keep >>>this from >>>> happening? thanks.... > >Depending on your situation, there may be other acceptable solutions. > >1. Try to reduce the time that the queries take. Talk to a DBA. With >some careful planning and indexing, we were able to reduce running >time for some of our queries by an order of magnitude. Oracle can do >amazing things if you tweak it just right. > I had a query that before the oracle admins "optimised" the database was completing in sub second response time. After their changes it took up to 4 minutes. The fix for me was to add the following to my query. $query = " select /*+ CHOOSE */ .... "; This brought the time back down to about 1.5 seconds. Also, I agree with the statement above that careful construction of your query can really make a difference. If you can avoid joins though the use of a corralative sub query, that will really speed it up. For example. Here is a query where I have avoided a join with the use of a corralative sub query. $query = " select /*+ CHOOSE */ hd_helpd.device_id, hd_helpd.symptom_type, hd_helpd.symptom_qualifier from rptadmin.hd_helpd where hd_helpd.request_type = 'Resolve' and hd_helpd.sr_start_d_t >= 946713600 and ( exists ( select request_ from rptadmin.hd_helpnet where hd_helpnet.request_ = hd_helpd.request_ and hd_helpnet.remote_device_name in ('BOST','TOST','DOST') ) )"; At last resort, you could use the nph multipart protocol and fork your query into a background process. It is nasty and generally annoying. Here is a nph "hello world". -->cat nph-count.cgi #!/usr/bin/perl -- # -*-Perl-*- # # this is a demonstration of server push # # enable autoflush $| = 1; # send the http header to establish the boundry print "HTTP/1.0 200\n"; print "Content-type: multipart/x-mixed-replace; boundary=ThisRandomString\n\n" ; # start the first boundry print "--ThisRandomString\n"; # loop 10 times $i = 0; while ($i < 10) { $i++; print "Content-type: text/html\n\n"; print "This is run $i\n"; print "

This is run $i

\n"; print "--ThisRandomString\n"; sleep 2; } # send the last page print "Content-type: text/html\n\n"; print "Fin\n"; print "

Fin

\n"; print "--ThisRandomString--\n"; exit 0; --- William Julien _,'| _.-''``-...___..--'; moonbeam@catmanor.com /, \'. _..-' , ,--...--''' vi is my shepherd; < \ .`--''' ` /| i shall not font. `-,;' ; ; ; __...--'' __...--_..' .;.' (,__....----''' (,..--'' perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' perl -e '( $ ,, $ ")=("a".."z")[0,-1]; print "sh", $ ","m\n";;";;"' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From jason at strangelight.com Fri Apr 6 16:35:53 2001 From: jason at strangelight.com (Jason Lamport) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: cgi help In-Reply-To: References: Message-ID: At 11:34 PM -0700 4/5/01, Daryn Nakhuda wrote: > > I still say that the "correct" solution is to return an identifying >> token which will allow the visitor to get the query results once >> they're available. (Of course, doing things the "correct" way isn't >> always worth the extra effort.) > >>From a usability standpoint, it may be confusing to the end user to have a >situation where they get a token that they can use for retrieving the >results later, especially if we're merely talking 30 seconds, versus 2 hours >or something. Perhaps more "correct" would be to have an interstitial (sp?) >page, like expedia or some of the other travel sites do, so that you see >something, regardless of browser, while the query is running. there are >numerous ways to do this, and it can be as smart or as dumb as you want it >to be. . . Sorry, I wasn't clear: by "return a token" I meant that technically, that's what would be happening "under the hood". That basic strategy could be used to implement any number of UI schemes -- such as the interstitial page that you suggest, or a page that automatically self-updated once the query was complete, or something else entirely. My point was that,if the query is likely to take more than 5-10 seconds, then the "right" thing to do IMO is to make sure that the user gets immediate feedback of what's going on, before the query is complete. Given the inherently stateless nature of HTTP, that will necessarily involve returning some sort of token (a cookie, a URL, *something*) that will allow the results to be retrieved at a later time (though that "later time" may be a mere 10 seconds from now, and the retrieval may happen entirely automatically, without any action from the user). -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://www.halcyon.com/spug/ From asim_jalis at hp.com Tue Apr 10 21:03:49 2001 From: asim_jalis at hp.com (JALIS,ASIM (HP-FtCollins,ex1)) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: Extreme Programming Meeting: April 12, Thursday Message-ID: After the last announcement on SPUG several Perl people asked me to continue posting these announcements to the Perl list. At our next meeting this Thursday you will get to try out XP in real-life. If you've heard about it and are curious to experience it, join us this Thursday. The coding will be fueled by pizza and pop provided by the nice people at Lante, Inc. For more details see below: EXTREME PROGRAMMING MEETING TOPIC "Live Extreme Programming: The Extreme Club" Much of XP is difficult to communicate in presentations, and can best be communicated as a direct experience. And so at this next meeting we will take the bull by the horns and actually DO some eXtreme Programming. Think of this as the programmers' equivalent of a Messiah sing-in. The meeting format is inspired by the London eXtreme Tuesday Club http://www.xpdeveloper.com/. Here is how it works. People show up with laptops, ideas and fingers. And then work on them together. Since all the programming is in pairs only half the people need to bring laptops. As always the meeting will be fueled by pizza and pop from the nice people at Lante, Inc. There are some pictures on the London XTC web-site of programmers huddled around laptops and giant mugs of beer. And it looks like fun. We'll do a dry run this time. The meeting format will be quite different from the normal. It should be much more interactive, and I expect that it will be quite a bit more fun than normal too. Instead of being one-to-many it will be a many-to-many highly enjoyable interaction. The idea for this came out of a conversation I had with Eric Herman (ProductSight) and Marcus Richardson (Network Commerce) after the last meeting. WEBSITE http://groups.yahoo.com/group/extremeprogramming-seattle To get on the extremeprogramming-seattle mailing-list send a blank e-mail message to extremeprogramming-seattle-subscribe@egroups.com. DATE AND SCHEDULE Thursday, April 12, 2001 (second Thursday of the month). 6.30 pm - 7.00 pm : Pizza + Networking. 7.00 pm - 9.00 pm : Presentations and Q&A. LOCATION Suite 100, Lante's Main Conference Room 3180 139th Avenue SE Bellevue, WA 98005 425.564.8800 (main desk) DIRECTIONS I have refactored the directions into two parts. First, how to get to 139th Ave SE (which depends on which interstate you use) and then how to get to 3180 which should be same for all cases: STEP 1: How to get to 139th Ave SE From I-405 South (going towards I-90) from Bellevue, Redmond. * Take exit 10 for Coal Creek Parkway and turn LEFT at the light as you get off the ramp onto Coal Creek Parkway. * Turn LEFT at Factoria Blvd (128th Av SE). * You will cross I-90 by going under it. * Turn RIGHT onto Eastgate Way SE, immediately after crossing I-90. * Take a LEFT at the light onto 139th Ave SE. From I-405 North (going towards I-90) from Renton. * Take exit 10 for Coal Creek Parkway and turn RIGHT at the light as you get off the ramp onto Coal Creek Parkway. * Turn LEFT at Factoria Blvd (128th Av SE). * You will cross I-90 by going under it. * Turn RIGHT onto Eastgate Way SE, immediately after crossing I-90. * Take a LEFT at the light onto 139th Ave SE From I-90 West (going towards I-405) from Bellevue, Issaquah, Redmond. * Take the 161st Ave SE/156th Ave SE/150th Ave SE exit (exit 11). * Keep LEFT at the fork in the ramp. * Keep RIGHT at the fork in the ramp. * Turn LEFT onto SE Eastgate Way. * Turn RIGHT onto 139th Ave SE. From I-90 East (going towards I-405) from Seattle, Mercer Island. * Take the Richards Road exit (exit 10). * Take a LEFT at the light off the exit ramp onto Richards Rd. * You will drive under I-90 crossing it. * Take the first RIGHT onto SE Eastgate Way. * Take a LEFT at the light onto 139th Ave SE STEP 2: How to find 3180 on 139th Ave SE * Drive past the turn for SE 32nd St. * 3180 will be the first building on your RIGHT. * You will notice a parking entrance into the building on your RIGHT. * Drive into it and then drive up the parking garage to the top (the 4th floor) which has uncovered parking. * Park anywhere (parking is free). * The building entrance should be straight ahead and there will be signs pointing to the XP meeting. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From Flytowskey at aol.com Wed Apr 11 14:19:28 2001 From: Flytowskey at aol.com (Flytowskey@aol.com) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: Questions about a configuration management system Message-ID: Hi Everybody, I have got some questions that I would like to pose to the group. They regard using a configuration management system. 1. What do you dislike about current so called configuration management systems. 2. What would you like to see in a configuration management system. 3. Would you use a system that was totally automated. 4. How much interaction would you like to have with a configuration management system. Thomas R. Owskey - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From Harry.Wegley at pss.boeing.com Thu Apr 12 17:46:38 2001 From: Harry.Wegley at pss.boeing.com (Wegley, Harry L) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: Filehandle undefined error Message-ID: <11A611A7F867C24EB1968E0D60B6E7BC2709E2@XCH-NW-04.nw.nos.boeing.com> I just inherited the maintenance of a Perl program that has been running for several years in a production environment. It began misbehaving a couple of days ago. I cannot seem to pinpoint the problem. Nothing has changed with regard to this program except for the input data that causes the text file, $customerList, to be generated. Here's what the problem section of code does: if (! open(CUSTLIST,"< $customerList")) { ... handle the error } while () { ...process the file } close CUSTLIST; The program terminates after processing part of the file. The program terminates with the following error: Can't use an undefined value as a symbol reference at /bin/glatest.pl line 761, chunk 190. Line 761 has no obvious relationship with the problem. Does anyone have any idea what kinds of errors might cause CUSTLIST to become undefined (or otherwise produce the observed error)? Harry Wegley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From tim at consultix-inc.com Thu Apr 12 18:40:27 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: April Meeting: Data Storage/Retrieval for Beginners Message-ID: <20010412164027.C637@timji.consultix.wa.com> APRIL SPUG TALK, Beginner's Series: Tuesday, 4/17/01 Title: Basic Data Storage & Retrieval (using Variables) Speaker: Joel Grow, Amazon.Com (joelg@amazon.com) Time: April 17th, 2001 (Third Tuesday), 7:30pm-9pm** Location: Union Bank of California Bldg, 5th Floor Mtg Room Cost: Free! ** NOTE: Meeting will start 30 minutes later than usual! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - In addition to being a software developer at Amazon.Com, Joel is a courseware developer and instructor for the University of Washington's Perl Certificate Program. In this talk, he'll introduce the concepts of scalar, array, and hash variables, and show examples of their usage. (This is the second installment in our 2001 "Perl Beginners Series"; the next ones will be 7/17 and 10/16). *==========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | | TIM MAHER: Unix/Perl DAMIAN CONWAY: Adv. Perl COLIN MEYER: Perl/DBI | | *We are currently scheduling On-Site Classes on UNIX and Perl topics!* | *==========================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From tim at consultix-inc.com Thu Apr 12 18:41:28 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: E-SPUG Suspended, awaiting Emperor Message-ID: <20010412164128.D637@timji.consultix.wa.com> (E-)?SPUGsters, Attached (below my .sig) is what I've just posted on the SPUG page, to clarify the current status of E-SPUG. It may be time to let E-SPUG die a natural death, and call it a failed experiment. The irony is that whenever we have talked about changing the location for the SPUG meetings (from downtown), lots of Eastsiders chime in lobbying for a location on their side of the lake; yet meeting attendance is very low, unless Damian Conway is the speaker. And only two brave souls in human history have ever volunteered to take charge and revitalize the group, but neither of them (Asim and "that young guy") has been able to invest as much time as might have been required to really get things going, so I'm not convinced we really know yet whether E-SPUG could fly if properly nurtured. In any case, consider this the "last call" for E-SPUG; unless somebody volunteers to take over as Group Leader, and makes an effort to revitalize the group, it will cease to exist. Of course, East-siders (along with all other English speakers) continue to be welcome at the SPUG meetings, in downtown Seattle. -Tim ========================================================== | Tim Maher, Ph.D. Tel: (206) 781-UNIX | | SPUG Founder & Leader Email: spug@halcyon.com | | Seattle Perl Users Group HTTP: www.halcyon.com/spug | ========================================================== E-SPUG: Eastside Seattle PERL Users Group Eastside-SPUG is a Seattle-area Perl User's Group serving the high-tech communities East of Lake Washington (e.g., Kirkland, Bellevue, and Redmond). What's the need for this? The bridges over Lake Washington present formidable obstacles to vehicular traffic, discouraging many Perl enthusiasts from attending SPUG meetings in the past (which are currently held in downtown Seattle, on the West-side of Lake Washington). E-SPUG Meetings Suspended! Attendance at E-SPUG meetings has been poor in 2001, and volunteerism low, causing many of us to wonder about E-SPUG's viability. Accordingly, meetings have been suspended indefinitely, pending the emergence of a new volunteer leader to try to revitalize this group. Anyone interested in applying for this position please contact SPUG Leader Tim Maher. *==========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | | TIM MAHER: Unix/Perl DAMIAN CONWAY: Adv. Perl COLIN MEYER: Perl/DBI | | *We are currently scheduling On-Site Classes on UNIX and Perl topics!* | *==========================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From Harry.Wegley at pss.boeing.com Thu Apr 12 19:03:06 2001 From: Harry.Wegley at pss.boeing.com (Wegley, Harry L) Date: Wed Aug 4 00:07:59 2004 Subject: FW: SPUG: Filehandle undefined error Message-ID: <11A611A7F867C24EB1968E0D60B6E7BC2709E4@XCH-NW-04.nw.nos.boeing.com> > Thanks for all who responded to my request for help. As Tim suggested, line 761 > did contain the problem. There were 2 typos that had been in this code for a long > time. They only caused the program to fail when a rare 'else' condition was met. This > made the problem sporadic. I was trusting my instincts more than the Perl error > message in trying to locate the problem -- a bad mistake. > > Thanks again. > > Harry Wegley > > > ---------- > > From: Tim Maher/CONSULTIX[SMTP:tim@consultix-inc.com] > > Sent: Thursday, April 12, 2001 4:16 PM > > To: Wegley, Harry L > > Subject: Re: SPUG: Filehandle undefined error > > > > On Thu, Apr 12, 2001 at 03:46:38PM -0700, Wegley, Harry L wrote: > > > > Did you by chance upgrade to a newer version of Perl recently? > > > > You should really show us line 761, so we can judge its relevance to the > > problem too! > > > > -Tim > > *==========================================================================* > > | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | > > | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | > > | TIM MAHER: Unix/Perl DAMIAN CONWAY: Adv. Perl COLIN MEYER: Perl/DBI | > > | *We are currently scheduling On-Site Classes on UNIX and Perl topics!* | > > *==========================================================================* > > > > > I just inherited the maintenance of a Perl program that has been running for several years > > > in a production environment. It began misbehaving a couple of days ago. I cannot seem > > > to pinpoint the problem. Nothing has changed with regard to this program except for the > > > input data that causes the text file, $customerList, to be generated. Here's what the > > > problem section of code does: > > > > > > if (! open(CUSTLIST,"< $customerList")) { > > > ... handle the error > > > } > > > while () { > > > > > > ...process the file > > > > > > } > > > close CUSTLIST; > > > > > > The program terminates after processing part of the file. The program terminates with the > > > following error: > > > Can't use an undefined value as a symbol reference at /bin/glatest.pl line 761, chunk 190. > > > > > > Line 761 has no obvious relationship with the problem. Does anyone have any idea what kinds > > > of errors might cause CUSTLIST to become undefined (or otherwise produce the observed error)? > > > > > > Harry Wegley > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > > 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://www.halcyon.com/spug/ > > > > > > > > > > -- > > *==========================================================================* > > | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | > > | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | > > | TIM MAHER: Unix/Perl DAMIAN CONWAY: Adv. Perl COLIN MEYER: Perl/DBI | > > | *We are currently scheduling On-Site Classes on UNIX and Perl topics!* | > > *==========================================================================* > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From cwilkes at singingfish.com Sun Apr 15 01:41:54 2001 From: cwilkes at singingfish.com (Chris Wilkes) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: Odd read only error in 5.6 but not before? Message-ID: This little program fails with a "modification of read-only variable" error at the while() statement under 5.6 but not under previous versions. I can modify it to do a "foreach my $letter ..." and then send down "compit($letter)" which then works. Am I missing something here? Chris #!/usr/bin/perl -w use strict; foreach (qw(a.txt b.txt)) { compit($_); } sub compit { my $file = shift; open (FOO, $file) || die "Can't read file '$file'\n"; while () { chomp; } close FOO; } Version of 5.6 that fails: bash-2.03$ perl -V Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration: Platform: osname=solaris, osvers=2.7, archname=sun4-solaris My linux box: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From dcd at tc.fluke.com Sun Apr 15 23:18:22 2001 From: dcd at tc.fluke.com (David Dyck) Date: Wed Aug 4 00:07:59 2004 Subject: SPUG: Odd read only error in 5.6 but not before? In-Reply-To: Message-ID: On Sat, 14 Apr 2001, Chris Wilkes wrote: > This little program fails with a "modification of read-only > variable" error at the while() statement under 5.6 but not under > previous versions. > > I can modify it to do a "foreach my $letter ..." and then send down > "compit($letter)" which then works. > > Am I missing something here? you can see that the foreach loop is setting $_ to each readonly constant "a.txt" and "b.txt", right? the while () loop tries to assign to $_ The following patch creates a localized copy of $_ --- c.pl.orig Sun Apr 15 21:12:23 2001 +++ c.pl Sun Apr 15 21:12:47 2001 @@ -8,6 +8,7 @@ sub compit { my $file = shift; open (FOO, $file) || die "Can't read file '$file'\n"; + local ($_); while () { chomp; } > #!/usr/bin/perl -w > > use strict; > foreach (qw(a.txt b.txt)) { > compit($_); > } > > sub compit { > my $file = shift; > open (FOO, $file) || die "Can't read file '$file'\n"; > while () { > chomp; > } > close FOO; > } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From tuck at whistlingfish.net Mon Apr 16 04:01:15 2001 From: tuck at whistlingfish.net (Matt Tucker) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: Odd read only error in 5.6 but not before? In-Reply-To: Message-ID: <92490000.987411675@flashingchance> -- David Dyck spake thusly: > On Sat, 14 Apr 2001, Chris Wilkes wrote: > >> This little program fails with a "modification of read-only >> variable" error at the while() statement under 5.6 but not under >> previous versions. >> >> I can modify it to do a "foreach my $letter ..." and then send down >> "compit($letter)" which then works. >> >> Am I missing something here? > > you can see that the foreach loop is setting $_ to > each readonly constant "a.txt" and "b.txt", right? > the while () loop tries to assign to $_ > > The following patch creates a localized copy of $_ What's interesting is that following works: use strict; for (qw(/tmp/a.txt)) { compit($_); } sub compit { my $file = shift; open (FOO, $file) || die "Can't read file '$file'\n"; for () { print; } close FOO; } for (...) does something like: *_ = \"a.txt"; Which actually aliases $_ to the value in question. for (...) does this so that the values being iterated over can by modified within the loop (if they're not constant, of course). I would recommend not using $_ in the first loop (it doesn't help increase readability; it just introduces the likelihood of problems such as those you're having). Instead do something like: for my $file (qw(a.txt b.txt)) { compit ($file); } sub compit { my $file = shift; open (FOO, $file) || die "Can't read file '$file'\n"; while () { print; } close FOO; } Although arguably you should still use the local($_) call before the while loop, just to avoid this sort of thing happening again. -------------- 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/20010416/aa68e0f6/attachment.bin From tim at consultix-inc.com Tue Apr 17 13:39:14 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: Beginner's Mtg Tonight: Using Variables Message-ID: <20010417113914.A4140@timji.consultix.wa.com> APRIL SPUG TALK, Beginner's Series: Tuesday, 4/17/01 Title: Basic Data Storage & Retrieval (using Variables) Speaker: Joel Grow, Amazon.Com (joelg@amazon.com) Time: April 17th, 2001 (Third Tuesday), 7:30pm-9pm** Location: Union Bank of Cal., Madison & 5th, 5th Floor Mtg Room Cost: Free! ** NOTE: Meeting will start 30 minutes later than usual! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - In addition to being a software developer at Amazon.Com, Joel is a courseware developer and instructor for the University of Washington's Perl Certificate Program. In this talk, he'll introduce the concepts of scalar, array, and hash variables, and show examples of their usage. (This is the second installment in our 2001 "Perl Beginners Series"; the next ones will be 7/17 and 10/16). ========================================================== | Tim Maher, Ph.D. Tel: (206) 781-UNIX | | SPUG Founder & Leader Email: spug@halcyon.com | | Seattle Perl Users Group HTTP: www.halcyon.com/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://www.halcyon.com/spug/ From andy at n2h2.com Wed Apr 18 22:34:36 2001 From: andy at n2h2.com (Andrew Sweger) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: File locking with flock and NFS In-Reply-To: <3ACB5652.4E5B59FA@agcs.com> Message-ID: For the free Unix users, there is a library called lockfile (liblockfile.so) that provides NFS-safe file locking using known atomic NFS operations (file/directory creation). On Debian systems, this is delivered in a package called liblockfile1 which provides a command-line utility called dotlockfile for this purpose. This package is maintained by Miquel van Smoorenburg. I don't know if he is also the author (didn't look). I'm sure source is available somewhere. If you wish to wrap the library in a Perl module, you will need the liblockfile-dev package and would do something like: h2xs -x -n File::Lock::NFS -p lockfile_ -v 0.01 lockfile.h -llockfile But I'll bet there's an easier way to do it using Inline that I just don't know. So far, I haven't seen anyone publish this particular wrapping. In your case, it would be simpler and more appropriate to write a Perl module that simply performs the system calls directly (to create/monitor semaphore lockfiles). The algorithm is pretty well documented in the packages above. The timeouts suggested by Bill ('sup, Bill?) will fall prey to local NFS attribute cache settings which can vary or be unbearably long. Come on. You all remember the fiasco at the Perl Golf Apocalypse, right? Everyone was sitting around waiting for the directory permissions to change so folks could get in and start the contest. If you need very short duration file locks (under two minutes), NFS might still be a problem if you will have competing processes waiting for a lock to expire due to attribute caching. Do not trust the NFS locking daemon. On Apr 4, 2001 @ 10:13am, Thomas Whitney wrote: > I am developing Perl applications where I need to do file locking. These will be > running on SunOS 5.5.1 with a NFS file server. All the books and references I > have researched say that flock will not work with NFS, but none offer any > alternatives. Does anybody know if this is true, and if so what alternatives are > there? -- Andrew B. Sweger | N2H2, Incorporated Manager, ICE Development Dept. | 900 Fourth Avenue, Suite 3600 Operations Division | Seattle WA 98164-1059 v=206.336.2947 f=206.493.0906 | http://www.n2h2.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://www.halcyon.com/spug/ From jay at Scherrer.com Wed Apr 18 22:57:17 2001 From: jay at Scherrer.com (Jay Scherrer) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: Detecting a Database Message-ID: <3ADE621C.7604B32C@scherrer.com> Hello spugster's, Does any one know of a way one could detect which kind of database you are dealing with when opening a file? Ok it's after Tax time and I'm trying to open files saved by Turbo Tax for prior year's. Turbo Tax saves the files under the ".TAX" format. But I'm looking for the way they store the info. Any help is appreciated, 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://www.halcyon.com/spug/ From algard at cardomain.com Thu Apr 19 11:28:12 2001 From: algard at cardomain.com (Alex Algard) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: File locking with flock and NFS In-Reply-To: Message-ID: This thread slipped under my radar, but in case anyone still cares, I can confirm that was the case as of Nov/00 at least. We tried to "use fcntl" on an all-Linux network where each server/client had patches of nfsd and nfslock up-to-date at the time, and the flock function would not successfully maintain file locks under NFS (files would be written to simultaneously). ________________________ Alex Algard CarDomain Networks, Inc. 425-820-2244 x111 | fax: 425-820-5951 algard@cardomain.com > > On Apr 4, 2001 @ 10:13am, Thomas Whitney wrote: > > > > I am developing Perl applications where I need to do file > > locking. These will be running on SunOS 5.5.1 with a NFS > > file server. All the books and references I > > have researched say that flock will not work with NFS, but none > > offer any alternatives. Does anybody know if this is true, and if > > so what alternatives are there? > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From gfb at sdc.cs.boeing.com Wed Apr 25 11:47:20 2001 From: gfb at sdc.cs.boeing.com (Gareth Beale) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: local ISP question Message-ID: <200104251647.JAA26628@klawatti.sdc.cs.boeing.com> Anyone out there used Zipcon? I am leaving wolfenet as they have announced they will be discontinuing shell access next month. I checked around and of the local providers Zipcon looks OK. Of particular interest, they allow you to run cgi scripts (they are only at Perl 5.005_3 though), and you get 20MB disk space. You get shell access, and they appear to be running Redhat Linux. Price is about $20/month. Gareth - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From djames at serv.net Wed Apr 25 12:26:51 2001 From: djames at serv.net (Daniel James) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: local ISP question In-Reply-To: <200104251647.JAA26628@klawatti.sdc.cs.boeing.com>; from Gareth Beale on Wed, Apr 25, 2001 at 09:47:20AM -0700 References: <200104251647.JAA26628@klawatti.sdc.cs.boeing.com> Message-ID: <20010425102651.B89783@itchy.serv.net> On Wed, Apr 25, 2001 at 09:47:20AM -0700, Gareth Beale wrote: > Anyone out there used Zipcon? I have not, but just to ad to the list if ISPs that allow shell access, my ISP (serv.net) does as well. Only problem is that they don't seem to keep on top of housekeeping as often as they should. I usually end up emailing them about once a month to let them know they've got a full /var partition :) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From cmeyer at helvella.org Wed Apr 25 13:01:15 2001 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: local ISP question In-Reply-To: <200104251647.JAA26628@klawatti.sdc.cs.boeing.com> References: <200104251647.JAA26628@klawatti.sdc.cs.boeing.com> Message-ID: <20010425110115.K2607@hobart.helvella.org> Gareth, How goes the DBI programming? [Gareth attended my recent Database programming with Perl class taught to a group of Boeing programmers] On Wed, Apr 25, 2001 at 09:47:20AM -0700, Gareth Beale wrote: > > Anyone out there used Zipcon? > > I am leaving wolfenet as they have announced they will be discontinuing > shell access next month. I checked around and of the local providers Zipcon > looks OK. Of particular interest, they allow you to run cgi scripts (they > are only at Perl 5.005_3 though), and you get 20MB disk space. You get shell > access, and they appear to be running Redhat Linux. > > Price is about $20/month. I have used Zipcon as my primary ISP for about six years. I am very happy with the service that I have received. Dan Pewzner is the main man behind the operation, and he has some excellent policy practices that I just haven't seen at other ISPs. For example, he keeps the customers/phonelines ratio small and will actually not take new customers while waiting for the phone company to fill orders for more lines. Another example is that he hasn't balked about upgrading Perl at my request, and has installed every Perl module that I've asked him to. (btw, I am still running 5.00503 for production programs and 5.6.1 for devel and personal stuff. 5.6.1 seems to be fairly stable, so far.) I give zipcon.net a strong recommendation. -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://www.halcyon.com/spug/ From briani at activestate.com Wed Apr 25 12:55:46 2001 From: briani at activestate.com (Brian Ingerson) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: local ISP question References: <200104251647.JAA26628@klawatti.sdc.cs.boeing.com> Message-ID: <3AE70FA2.9E711F0B@activestate.com> Gareth Beale wrote: > > Anyone out there used Zipcon? > > I am leaving wolfenet as they have announced they will be discontinuing > shell access next month. I checked around and of the local providers Zipcon > looks OK. Of particular interest, they allow you to run cgi scripts (they > are only at Perl 5.005_3 though), and you get 20MB disk space. You get shell > access, and they appear to be running Redhat Linux. > > Price is about $20/month. I use zipcon to host my (practically non-existant) web-site. They seem like the last 'personal' ISP around. I've had a good experience with them. Colin Meyer tipped me off to them. He uses them much more extensively. For my minimal use, I pay $9.95/mo. Brian -- perl -le 'use Inline C=>q{SV*JAxH(char*x){return newSVpvf ("Just Another %s Hacker",x);}};print JAxH+Perl' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From ericj at cubesearch.com Wed Apr 25 12:57:54 2001 From: ericj at cubesearch.com (Eric Johanson) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: local ISP question In-Reply-To: <200104251647.JAA26628@klawatti.sdc.cs.boeing.com> Message-ID: I've used zipcon for about three years now. I only use them for shell access. Service has been *great* on the shell side of the house. I know Dan (the owner) has had some dialup issues (telco's issue), but otherwise it's been like a rock. (not that I've used it; he posts emails to all of his customers with any issues with service.... very professional) I know I've had the same pine session for over a month now.... :) I can't speak of the dsl quality; I think they use qwest...... 'nuf said... The shell box is Redhat 6.2, and is never overloaded. Daytime traffic is around 10-15 light logged in users. He'll let you run background processes if you ask nice, and they don't hog resources. zipcon sometimes has deals for paying for a full year; ask them about it. Overall, I'd give zipcon.net a A for service. It is a small shop, but I enjoy the personal service. The only drawback I see is not having a national POP... but I really don't need that anyway... -Eric ericjohanson@zipcon.net On Wed, 25 Apr 2001, Gareth Beale wrote: > > Anyone out there used Zipcon? > > I am leaving wolfenet as they have announced they will be discontinuing > shell access next month. I checked around and of the local providers Zipcon > looks OK. Of particular interest, they allow you to run cgi scripts (they > are only at Perl 5.005_3 though), and you get 20MB disk space. You get shell > access, and they appear to be running Redhat Linux. > > Price is about $20/month. > > Gareth > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 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://www.halcyon.com/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://www.halcyon.com/spug/ From warner at oz.net Wed Apr 25 13:26:32 2001 From: warner at oz.net (Marion Scott Warner) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: Best prices for commercial DSL Message-ID: <3AE716D8.EAC8D350@oz.net> Who has the best price for business DSL lines in Seattle. I would like to set up a Web site and use the DSL companies DSN servers. Just trying to figure out the best options price/performance trade offs. Thanks, for any info Scott Warner warner@oz.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://www.halcyon.com/spug/ From benwa at ocentrix.net Wed Apr 25 14:35:04 2001 From: benwa at ocentrix.net (Ben Burnett) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: Word boundry regex treated differently by 5.6 and 5.005033 Message-ID: <200104251935.f3PJZ4P28894@mail.ocentrix.net> Hey all, I noticed something that seems strange. I ran the following script on two machines. One of them running 5.00503 and one running 5.6 (full details attached) and got two different outputs. ---- output on 5.6 was: here it is: Cals Bosn output on 5.00503 was: here it is: C B I appears as though 5.00503 is getting rid of all \w characters in the string that aren't preceded by a word boundary(which is what I expected), while 5.6 is removing every other \w character in each word. I couldn't see anything obvious in perldelta that would indicate that the two versions should treat this differently. Does anyone know why this might happen? - Ben P.S. Joydesk doesn't lend itself well to pasting wide lines of text so i've attatched the full details of my perl installs. -------------- next part -------------- A non-text attachment was scrubbed... Name: 5_00503-details.txt Type: application/octet-stream Size: 1756 bytes Desc: not available Url : http://mail.pm.org/archives/spug-list/attachments/20010425/3f070a79/5_00503-details.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: 5_6-details.txt Type: application/octet-stream Size: 2256 bytes Desc: not available Url : http://mail.pm.org/archives/spug-list/attachments/20010425/3f070a79/5_6-details.obj From cmeyer at helvella.org Wed Apr 25 19:51:09 2001 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: Word boundry regex treated differently by 5.6 and 5.005033 In-Reply-To: <200104251935.f3PJZ4P28894@mail.ocentrix.net> References: <200104251935.f3PJZ4P28894@mail.ocentrix.net> Message-ID: <20010425175109.Q2607@hobart.helvella.org> Hey, Ben, On Wed, Apr 25, 2001 at 12:35:04PM -0700, Ben Burnett wrote: > Hey all, > > I noticed something that seems strange. I ran the following > script on two machines. One of them running 5.00503 and one > running 5.6 (full details attached) and got two different > outputs. > > ---- > > output on 5.6 was: here it is: Cals Bosn > output on 5.00503 was: here it is: C B output of 5.00405: here it is: C B 5.6.0: here it is: Cals Bosn 5.6.1: here it is: Cals Bosn 5.7.1: here it is: Cals Bosn The same effect can be seen from: perl -le '$t = "abcdefg"; print pos $t while $t =~ m/\B\w/g' prior to 5.6.0 versions print: 2 3 4 5 6 7 while post 5.6.0 print: 2 4 6 More detail can be seen from the regex debugger: perl -M're debug' -le '$t = "abcdefg"; print pos $t while $t =~ m/\B\w/g' Another interesting variety: perl -le '$t="a b c d e f g";print pos $t while $t =~ m/\b./g' > > I appears as though 5.00503 is getting rid of all \w > characters in the string that aren't preceded by a word > boundary(which is what I expected), while 5.6 is removing > every other \w character in each word. > I couldn't see anything obvious in perldelta that would > indicate that the two versions should treat this > differently. Does anyone know why this might happen? I think it is unfortunate that this difference in the interpretation of regexes is not mentioned in perldelta. It is hard for me to decide if this is a new bug or a bug fix for an old problem. The camel says that /g causes the regex to "start the next match on the same variable at a position *just past* where the last match stopped." The older versions of Perl seem to be looking at the character that the last match ended on in order to determine the border or non-border properties of the character at pos($t). Well, it's either a bug with Perl, or a bug with its documentation. In either case, a report should be submitted with perlbug. What sort of problem were you attempting to solve when you came across this one? ;-) -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://www.halcyon.com/spug/ From sweetsue at sweethomes.com Wed Apr 25 21:23:51 2001 From: sweetsue at sweethomes.com (Susanne Bullo) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: New to list and needing some serious assistance Message-ID: <0e9901c0cdf7$efce3a20$5dfd153f@address.com> A good person pointed me to this list. I am no expert in things perl but I do know a bit. At least I thought I did until I came across a program that I cannot tame. I have a project due tomorrow and it hinges on this particular program. Are there any among you that would be willing to sacrifice a few hours tonight? I'm more than willing to pay as I'm getting down to the wire and need this fixed. Very briefly, it's a program that does formmail functions but has a lot of extra features that I need - converts to pdf file, cc's and bcc's and writes to a mysql database. My problem lays in the config files that go with it, I can't seem to get it correct. Thanks! Susanne Bullo Sweet Homes Web Services http://www.sweethomes.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20010425/a06d0996/attachment.htm From benb at theriver.com Wed Apr 25 22:15:43 2001 From: benb at theriver.com (Ben Browning) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: Open source soda? In-Reply-To: <20010417113914.A4140@timji.consultix.wa.com> Message-ID: <5.0.2.1.2.20010425201508.02a7cbc8@mail.oz.net> Check this out: http://www.thinkgeek.com/stuff/things/37f3.html Will wonders never cease... ~Ben --- Ben Browning The River Internet Access Co. Network Operations 1-877-88-RIVER http://www.theriver.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://www.halcyon.com/spug/ From jdevlin at stadiumdistrict.com Thu Apr 26 01:11:50 2001 From: jdevlin at stadiumdistrict.com (Joe Devlin) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: local ISP question Message-ID: <01C0CDDD.425C8500@tac-lx100-ip2.nwnexus.net> I set up a simple web site at www.jernie-inn.com with Zipcon and Dan was just a phone call away to help us iron out the wrinkles. Later I tried to set up a mySQL account and got nothing, so I purchased space on www.cgi101.com for the mySQL data base programming. Joe Devlin Devlin Technical Consulting ---------- From: Gareth Beale[SMTP:gfb@sdc.cs.boeing.com] Sent: Wednesday, April 25, 2001 2:47 AM To: spug-list@pm.org Subject: SPUG: local ISP question Anyone out there used Zipcon? I am leaving wolfenet as they have announced they will be discontinuing shell access next month. I checked around and of the local providers Zipcon looks OK. Of particular interest, they allow you to run cgi scripts (they are only at Perl 5.005_3 though), and you get 20MB disk space. You get shell access, and they appear to be running Redhat Linux. Price is about $20/month. Gareth - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/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://www.halcyon.com/spug/ From benwa at ocentrix.com Thu Apr 26 02:09:26 2001 From: benwa at ocentrix.com (Ben Burnett) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: Word boundry regex treated differently by 5.6 and 5.005033 In-Reply-To: <20010425175109.Q2607@hobart.helvella.org> References: <200104251935.f3PJZ4P28894@mail.ocentrix.net> <200104251935.f3PJZ4P28894@mail.ocentrix.net> Message-ID: <5.0.2.1.0.20010425235423.01c494e0@mail.ocentrix.com> At 05:51 PM 4/25/01 -0700, Colin Meyer wrote: >More detail can be seen from the regex debugger: >perl -M're debug' -le '$t = "abcdefg"; print pos $t while $t =~ m/\B\w/g' I have to admin I haven't spent much time with the perl debugger I'll take a closer look at this. >It is hard for me to decide if this is a new bug or a bug fix for an old >problem. The camel says that /g causes the regex to "start the next >match on the same variable at a position *just past* where the last >match stopped." The older versions of Perl seem to be looking at the >character that the last match ended on in order to determine the border >or non-border properties of the character at pos($t). Well, it's either >a bug with Perl, or a bug with its documentation. In either case, a >report should be submitted with perlbug. I think it's probably a bug with Perl itself. I can't imagine this change in behavior was intentional. I'll have to submit it in the morning. >What sort of problem were you attempting to solve when you came across >this one? ;-) Here is an excerpt of code showing the regex hard at work in a motorcycle rental application CGI script. ... # we need to give this request a registration number while we are here. this number # will be built out of the initials of each word in the applicants name, a unique session_key, # the applicants state, and the first two letters of the city that the applicant is in my $key = time(); $key .= "-" . getppid() or $LogH->append("couldn't getppid to add to session key"); my $request_id = $PASSED_VARS{'name'}; $request_id =~ s/\B\w//g; $request_id =~ s/\W//g; $request_id .= "-" . $key; # . "-"; # $request_id .= $PASSED_VARS{'state'} . "-"; # my $city_portion = $PASSED_VARS{'city'}; # $city_portion =~ m/^([\w]{2})/; # $city_portion = $1; # $request_id .= $city_portion ; $request_id = uc($request_id); ... I'll eventually work out some other form of unique id for these requests that isn't so verbose, but I wanted it to be human readable during testing. -Ben - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From Ryan.Parr at wwireless.com Thu Apr 26 08:02:40 2001 From: Ryan.Parr at wwireless.com (Parr, Ryan) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: local ISP question Message-ID: <6D6F0541E2B1D411A75B0002A513016D0135C112@wacorpml03.wwireless.com> My girlfriend uses Zipcon for dynacarenw.com. Zipcon set up the account in short time, and responded quickly to our request for a MySQL database. They were also very responsive to my request that they install MIME::Lite, DBI, and DBD::mysql, as well as setup their ftp server to accept passive connections. All in all I've had a good experience with Zipcon. Ryan Parr FancyPants Web Design -----Original Message----- From: Joe Devlin [mailto:jdevlin@stadiumdistrict.com] Sent: Wednesday, April 25, 2001 11:12 PM To: spug-list@pm.org Subject: RE: SPUG: local ISP question I set up a simple web site at www.jernie-inn.com with Zipcon and Dan was just a phone call away to help us iron out the wrinkles. Later I tried to set up a mySQL account and got nothing, so I purchased space on www.cgi101.com for the mySQL data base programming. Joe Devlin Devlin Technical Consulting ---------- From: Gareth Beale[SMTP:gfb@sdc.cs.boeing.com] Sent: Wednesday, April 25, 2001 2:47 AM To: spug-list@pm.org Subject: SPUG: local ISP question Anyone out there used Zipcon? I am leaving wolfenet as they have announced they will be discontinuing shell access next month. I checked around and of the local providers Zipcon looks OK. Of particular interest, they allow you to run cgi scripts (they are only at Perl 5.005_3 though), and you get 20MB disk space. You get shell access, and they appear to be running Redhat Linux. Price is about $20/month. Gareth - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/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://www.halcyon.com/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://www.halcyon.com/spug/ From lagaly at eskimo.com Thu Apr 26 11:54:56 2001 From: lagaly at eskimo.com (Michael LaGaly) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: Word boundry regex treated differently by 5.6 and 5.005033 References: <200104251935.f3PJZ4P28894@mail.ocentrix.net> <200104251935.f3PJZ4P28894@mail.ocentrix.net> <5.0.2.1.0.20010425235423.01c494e0@mail.ocentrix.com> Message-ID: <011d01c0ce71$c287a630$66d61840@lagaly01> Actually, it looks like the 5.6 is not returning to the original $text="Charles Bronson" as it tests each successive character, but is instead doing something that amounts to in-place deletion and then testing again. So for: perl -e "use strict;(my $text = qq(Charles Bronson)) =~ s/\B\w//g;print qq(here it is: $text\n\n);" Charles Bronson ^ test : is on a word boundary: go to next ^ test : is not on a word boundary: delete this char C arles Bronson test : is on a word boundary: go to next ^ Why don't you try the following in 5.6. This will show you what the text left of the match, the match, and the text right of the match are as the compiler sees it: perl -le "$t = qq(Charles Bronson); print qq( <$`> $& <$'>) while $t =~ m/\B\w/g" On 5.00503 this gets: h a r l e s < Bronson> r o n s o n <> I'm curious to see what 5.6 gives you. Michael ----- Original Message ----- From: Ben Burnett To: Colin Meyer ; Ben Burnett Cc: spug-list@pm.org Sent: Thursday, April 26, 2001 12:09 AM Subject: Re: SPUG: Word boundry regex treated differently by 5.6 and 5.005033 At 05:51 PM 4/25/01 -0700, Colin Meyer wrote: >More detail can be seen from the regex debugger: >perl -M're debug' -le '$t = "abcdefg"; print pos $t while $t =~ m/\B\w/g' I have to admin I haven't spent much time with the perl debugger I'll take a closer look at this. >It is hard for me to decide if this is a new bug or a bug fix for an old >problem. The camel says that /g causes the regex to "start the next >match on the same variable at a position *just past* where the last >match stopped." The older versions of Perl seem to be looking at the >character that the last match ended on in order to determine the border >or non-border properties of the character at pos($t). Well, it's either >a bug with Perl, or a bug with its documentation. In either case, a >report should be submitted with perlbug. I think it's probably a bug with Perl itself. I can't imagine this change in behavior was intentional. I'll have to submit it in the morning. >What sort of problem were you attempting to solve when you came across >this one? ;-) Here is an excerpt of code showing the regex hard at work in a motorcycle rental application CGI script. ... # we need to give this request a registration number while we are here. this number # will be built out of the initials of each word in the applicants name, a unique session_key, # the applicants state, and the first two letters of the city that the applicant is in my $key = time(); $key .= "-" . getppid() or $LogH->append("couldn't getppid to add to session key"); my $request_id = $PASSED_VARS{'name'}; $request_id =~ s/\B\w//g; $request_id =~ s/\W//g; $request_id .= "-" . $key; # . "-"; # $request_id .= $PASSED_VARS{'state'} . "-"; # my $city_portion = $PASSED_VARS{'city'}; # $city_portion =~ m/^([\w]{2})/; # $city_portion = $1; # $request_id .= $city_portion ; $request_id = uc($request_id); ... I'll eventually work out some other form of unique id for these requests that isn't so verbose, but I wanted it to be human readable during testing. -Ben - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20010426/06d99058/attachment.htm From mathin at mathin.com Thu Apr 26 12:20:41 2001 From: mathin at mathin.com (Dan Ebert) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: Word boundry regex treated differently by 5.6 and 5.005033 In-Reply-To: <011d01c0ce71$c287a630$66d61840@lagaly01> Message-ID: I ran the test on perl 5.6 and got this: h r e r n o Dan. ----------------------------------------------------------- Optimists: the glass is half full. Pessimists: the glass is half empty. Engineers: the glass is twice as big as it needs to be. ----------------------------------------------------------- On Thu, 26 Apr 2001, Michael LaGaly wrote: > Actually, it looks like the 5.6 is not returning to the original $text="Charles Bronson" as it tests each successive character, but is instead doing something that amounts to in-place deletion and then testing again. > > So for: > > perl -e "use strict;(my $text = qq(Charles Bronson)) =~ s/\B\w//g;print qq(here it is: $text\n\n);" > > Charles Bronson > ^ test : is on a word boundary: go to next > ^ test : is not on a word boundary: delete this char > C arles Bronson test : is on a word boundary: go to next > ^ > > Why don't you try the following in 5.6. This will show you what the text left of the match, the match, and the text right of the match are as the compiler sees it: > > perl -le "$t = qq(Charles Bronson); print qq( <$`> $& <$'>) while $t =~ m/\B\w/g" > > On 5.00503 this gets: > h > a > r > l > e > s < Bronson> > r > o > n > s > o > n <> > > I'm curious to see what 5.6 gives you. > > Michael > > ----- Original Message ----- > From: Ben Burnett > To: Colin Meyer ; Ben Burnett > Cc: spug-list@pm.org > Sent: Thursday, April 26, 2001 12:09 AM > Subject: Re: SPUG: Word boundry regex treated differently by 5.6 and 5.005033 > > > At 05:51 PM 4/25/01 -0700, Colin Meyer wrote: > >More detail can be seen from the regex debugger: > >perl -M're debug' -le '$t = "abcdefg"; print pos $t while $t =~ m/\B\w/g' > > I have to admin I haven't spent much time with the perl debugger I'll take > a closer look at this. > > >It is hard for me to decide if this is a new bug or a bug fix for an old > >problem. The camel says that /g causes the regex to "start the next > >match on the same variable at a position *just past* where the last > >match stopped." The older versions of Perl seem to be looking at the > >character that the last match ended on in order to determine the border > >or non-border properties of the character at pos($t). Well, it's either > >a bug with Perl, or a bug with its documentation. In either case, a > >report should be submitted with perlbug. > > I think it's probably a bug with Perl itself. I can't imagine this change > in behavior was intentional. I'll have to submit it in the morning. > > >What sort of problem were you attempting to solve when you came across > >this one? ;-) > > Here is an excerpt of code showing the regex hard at work in a motorcycle > rental application CGI script. > ... > # we need to give this request a registration number while > we are here. this number > # will be built out of the initials of each word in the > applicants name, a unique session_key, > # the applicants state, and the first two letters of the > city that the applicant is in > my $key = time(); > $key .= "-" . getppid() or $LogH->append("couldn't > getppid to add to session key"); > my $request_id = $PASSED_VARS{'name'}; > $request_id =~ s/\B\w//g; > $request_id =~ s/\W//g; > $request_id .= "-" . $key; # . "-"; > # $request_id .= $PASSED_VARS{'state'} . "-"; > # my $city_portion = $PASSED_VARS{'city'}; > # $city_portion =~ m/^([\w]{2})/; > # $city_portion = $1; > # $request_id .= $city_portion ; > $request_id = uc($request_id); > ... > > I'll eventually work out some other form of unique id for these requests > that isn't so verbose, but I wanted it to be human readable during testing. > > > -Ben > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 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://www.halcyon.com/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://www.halcyon.com/spug/ From slagel at geospiza.com Thu Apr 26 12:22:23 2001 From: slagel at geospiza.com (Joe Slagel) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: Reading records from a filehandle or a scalar Message-ID: <3AE8594F.4DE62E67@geospiza.com> Does anyone know of a cute trick to be able to read records from either a filehandle or a scalar. I guess you would need to treat the scalar as a file handle in order to get this to work. Something like: sub getRec { my $in = shift; # if $in is a scalar...do some magic my $rec = readline( $in ); } Thanks, Joe -- Joe Slagel Geospiza, Inc. 3939 Leary Way NW, Seattle WA 98107 (206) 633-4403 slagel@geospiza.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://www.halcyon.com/spug/ From TimBuckwalter at aol.com Thu Apr 26 13:35:51 2001 From: TimBuckwalter at aol.com (Tim Buckwalter) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: Word boundry regex treated differently by 5.6 and 5.005033 References: Message-ID: <3AE86A87.B916B2F3@aol.com> I got the same results and i'm using 5.6.0 -- Tim Buckwalter Senior Language Engineer AOL Mobile (formerly Tegic) 1000 Dexter Ave N, Suite 300 Seattle, WA 98109-3574 206.268.7552 phone 206.343.7004 fax 206.343.7001 front desk TimBuckwalter@aol.com www.tegic.com Dan Ebert wrote: > > I ran the test on perl 5.6 and got this: > > h > r > e > r > n > o > > Dan. > ----------------------------------------------------------- > Optimists: the glass is half full. > Pessimists: the glass is half empty. > Engineers: the glass is twice as big as it needs to be. > ----------------------------------------------------------- > > On Thu, 26 Apr 2001, Michael LaGaly wrote: > > > Actually, it looks like the 5.6 is not returning to the original $text="Charles Bronson" as it tests each successive character, but is instead doing something that amounts to in-place deletion and then testing again. > > > > So for: > > > > perl -e "use strict;(my $text = qq(Charles Bronson)) =~ s/\B\w//g;print qq(here it is: $text\n\n);" > > > > Charles Bronson > > ^ test : is on a word boundary: go to next > > ^ test : is not on a word boundary: delete this char > > C arles Bronson test : is on a word boundary: go to next > > ^ > > > > Why don't you try the following in 5.6. This will show you what the text left of the match, the match, and the text right of the match are as the compiler sees it: > > > > perl -le "$t = qq(Charles Bronson); print qq( <$`> $& <$'>) while $t =~ m/\B\w/g" > > > > On 5.00503 this gets: > > h > > a > > r > > l > > e > > s < Bronson> > > r > > o > > n > > s > > o > > n <> > > > > I'm curious to see what 5.6 gives you. > > > > Michael > > > > ----- Original Message ----- > > From: Ben Burnett > > To: Colin Meyer ; Ben Burnett > > Cc: spug-list@pm.org > > Sent: Thursday, April 26, 2001 12:09 AM > > Subject: Re: SPUG: Word boundry regex treated differently by 5.6 and 5.005033 > > > > > > At 05:51 PM 4/25/01 -0700, Colin Meyer wrote: > > >More detail can be seen from the regex debugger: > > >perl -M're debug' -le '$t = "abcdefg"; print pos $t while $t =~ m/\B\w/g' > > > > I have to admin I haven't spent much time with the perl debugger I'll take > > a closer look at this. > > > > >It is hard for me to decide if this is a new bug or a bug fix for an old > > >problem. The camel says that /g causes the regex to "start the next > > >match on the same variable at a position *just past* where the last > > >match stopped." The older versions of Perl seem to be looking at the > > >character that the last match ended on in order to determine the border > > >or non-border properties of the character at pos($t). Well, it's either > > >a bug with Perl, or a bug with its documentation. In either case, a > > >report should be submitted with perlbug. > > > > I think it's probably a bug with Perl itself. I can't imagine this change > > in behavior was intentional. I'll have to submit it in the morning. > > > > >What sort of problem were you attempting to solve when you came across > > >this one? ;-) > > > > Here is an excerpt of code showing the regex hard at work in a motorcycle > > rental application CGI script. > > ... > > # we need to give this request a registration number while > > we are here. this number > > # will be built out of the initials of each word in the > > applicants name, a unique session_key, > > # the applicants state, and the first two letters of the > > city that the applicant is in > > my $key = time(); > > $key .= "-" . getppid() or $LogH->append("couldn't > > getppid to add to session key"); > > my $request_id = $PASSED_VARS{'name'}; > > $request_id =~ s/\B\w//g; > > $request_id =~ s/\W//g; > > $request_id .= "-" . $key; # . "-"; > > # $request_id .= $PASSED_VARS{'state'} . "-"; > > # my $city_portion = $PASSED_VARS{'city'}; > > # $city_portion =~ m/^([\w]{2})/; > > # $city_portion = $1; > > # $request_id .= $city_portion ; > > $request_id = uc($request_id); > > ... > > > > I'll eventually work out some other form of unique id for these requests > > that isn't so verbose, but I wanted it to be human readable during testing. > > > > > > -Ben > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > 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://www.halcyon.com/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://www.halcyon.com/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://www.halcyon.com/spug/ From benwa at ocentrix.net Thu Apr 26 14:11:09 2001 From: benwa at ocentrix.net (Ben Burnett) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: Fw: Ack: [ID 20010426.002] Word boundry regex treated differently by 5.6 and 5.0 Message-ID: <200104261911.f3QJB9u13591@mail.ocentrix.net> Well I submitted a bug report this morning. We'll see what becomes of it. - Ben ------- Original Copy ------- Subject: Ack: [ID 20010426.002] Word boundry regex treated differently by 5.6 and 5.00503 Date: // 0: AM From: perlbugtron@bugs.perl.org To: Bens maintenance account Cc: benwa@ocentrix.com Your e-mail has been received by the Perl Bug Squashing Team. Original subject: Word boundry regex treated differently by 5.6 and 5.00503 A Bug ID (20010426.002) has been assigned and is shown in the subject of this email. Please include this bug ID in the subject line of any followup messages. This is an automatic confirmation message. If you do not wish to recieve this confirmation, in the future, put 'ack=no' somewhere in the body of your mail. -- Perl Bug Squashing Team Message from the Perlbug squashing team at 'perlbug@perl.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://www.halcyon.com/spug/ From cmeyer at helvella.org Thu Apr 26 16:33:14 2001 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: Word boundry regex treated differently by 5.6 and 5.005033 In-Reply-To: <5.0.2.1.0.20010425235423.01c494e0@mail.ocentrix.com> References: <200104251935.f3PJZ4P28894@mail.ocentrix.net> <200104251935.f3PJZ4P28894@mail.ocentrix.net> <20010425175109.Q2607@hobart.helvella.org> <5.0.2.1.0.20010425235423.01c494e0@mail.ocentrix.com> Message-ID: <20010426143314.S2607@hobart.helvella.org> On Thu, Apr 26, 2001 at 12:09:26AM -0700, Ben Burnett wrote: > At 05:51 PM 4/25/01 -0700, Colin Meyer wrote: > >More detail can be seen from the regex debugger: > >perl -M're debug' -le '$t = "abcdefg"; print pos $t while $t =~ m/\B\w/g' > > I have to admin I haven't spent much time with the perl debugger I'll take > a closer look at this. The main Perl debugger lets you single step through code and examine variables and etc at each step. Very useful. It is invoked with: perl -d script_name The non-interactive regex debugger, which really isn't part of the main debugger spits out a ton of extra information when compiling and matching regexs. It is invoked with: perl -M're debug' script_name or from within the program: use re debug; > > >It is hard for me to decide if this is a new bug or a bug fix for an > >old problem. The camel says that /g causes the regex to "start the > >next match on the same variable at a position *just past* where the > >last match stopped." The older versions of Perl seem to be looking at > >the character that the last match ended on in order to determine the > >border or non-border properties of the character at pos($t). Well, > >it's either a bug with Perl, or a bug with its documentation. In > >either case, a report should be submitted with perlbug. > > I think it's probably a bug with Perl itself. I can't imagine this change > in behavior was intentional. I'll have to submit it in the morning. I am tending to think of the new behavior as a bug fix. The boundary (\B or \b) depends on a condition between two characters (or a character and the beginning or ending of the string). When the second match is attempted, pos($test) is 2. The pointer must move on to character 3 before it has examined two characters and can decide if \b or \B matches. Michael's post draws this out. Only when pos($test) == 0 or pos($test) == length($test)-1 can the status of \b or \B be determined with one character. Hmm. I'm still undecided. I can see arguments for either behavior being considered correct. Another way to think of it is: perl -le '$t="abcdefg"; $t=~s/\b.//g; print $t' Would you expect that to delete all of the characters in the string? For the record, here's gawk: gawk '{gsub(/\B./, ""); print}' Given 'abcdefg' as input, gawk returns 'ag'. Different than any version of Perl. Oh well. > Here is an excerpt of code showing the regex hard at work in a motorcycle > rental application CGI script. > ... > # we need to give this request a registration number while > we are here. this number > # will be built out of the initials of each word in the > applicants name, a unique session_key, > # the applicants state, and the first two letters of the > city that the applicant is in > my $key = time(); > $key .= "-" . getppid() or $LogH->append("couldn't > getppid to add to session key"); > my $request_id = $PASSED_VARS{'name'}; > $request_id =~ s/\B\w//g; > $request_id =~ s/\W//g; While you have uncovered an interesting bug, there are several other ways to do what you are after: $request_id =~ s/\b(\w)\w+\W*/$1/g; # or $request_id = join '', map substr($_,0,1), split / /, $request_id; #... Have fun, -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://www.halcyon.com/spug/ From cmeyer at helvella.org Thu Apr 26 16:49:01 2001 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: Reading records from a filehandle or a scalar In-Reply-To: <3AE8594F.4DE62E67@geospiza.com> References: <3AE8594F.4DE62E67@geospiza.com> Message-ID: <20010426144901.T2607@hobart.helvella.org> Joe, On Thu, Apr 26, 2001 at 10:22:23AM -0700, Joe Slagel wrote: > Does anyone know of a cute trick to be able to read records > from either a filehandle or a scalar. I guess you would > need to treat the scalar as a file handle in order to get > this to work. Try IO::Scalar: #!/usr/local/bin/perl use IO::Scalar; my $a=<<'eof'; line one 2nd line larry says perl6 will use .'s to designate method calls: $obj.meth(arg1); # a different char will mean concatenate eof tie *FILE, 'IO::Scalar', \$a; while () { print; $count++; } print "\n\n$count lines\n"; -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://www.halcyon.com/spug/ From slagel at geospiza.com Thu Apr 26 16:54:59 2001 From: slagel at geospiza.com (Joe Slagel) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: Reading records from a filehandle or a scalar References: <3AE8594F.4DE62E67@geospiza.com> <20010426144901.T2607@hobart.helvella.org> Message-ID: <3AE89933.BD09D4EF@geospiza.com> Colin Meyer wrote: > Try IO::Scalar: > > #!/usr/local/bin/perl > > use IO::Scalar; > > my $a=<<'eof'; > line one > 2nd line > larry says perl6 will use .'s to designate method calls: > $obj.meth(arg1); # a different char will mean concatenate > eof > > tie *FILE, 'IO::Scalar', \$a; > > while () { > print; > $count++; > } > > print "\n\n$count lines\n"; Great! Thanks!! -- Joe Slagel Geospiza, Inc. 3939 Leary Way NW, Seattle WA 98107 (206) 633-4403 slagel@geospiza.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://www.halcyon.com/spug/ From jin at gaganan.com Thu Apr 26 18:56:15 2001 From: jin at gaganan.com (Son Ho Jin) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: I got it Message-ID: <200104262359.f3QNxvg12569@gocho.pm.org> Hey, lu Sorry, it took longer than i expected but I found the site, it's http://www.multiopen.com the site will make your web surfing very convenient. And here goes one more, it's http://www.mysimon.com this one will help your online shopping Get to the site and mail me after bye~ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From amcdowall at hotmail.com Fri Apr 27 05:25:07 2001 From: amcdowall at hotmail.com (ANDRE MCDOWALL) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: chron job Message-ID: I'm running a perl script on a Unix box and need to set it up on a chron job. Anyone have an idea of where I can start? thanks! _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.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://www.halcyon.com/spug/ From briani at activestate.com Fri Apr 27 02:55:49 2001 From: briani at activestate.com (Brian Ingerson) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: Data::Denter Message-ID: <3AE92605.12A49E@activestate.com> SPUG, Well I just wanted to say that I'm no longer a one module wonder :) Data::Denter has been uploaded to CPAN. Think "Data::Dumper meets Python". It's actually quite useful. Check it out. >From the README: Data::Denter - An alternative to Data::Dumper and Storable. INTRODUCTION: Data::Denter is yet another Perl data serializer/deserializer. It formats nested data structures in an indented fashion. It is optimized for human readability/editability, safe deserialization, and (eventually) speed. NOTE: It may be optimized for Python programmers too, but please don't hold that against me ;) It exports 2 functions: C and C for serialization and deserialization respectively. It handles all of the commonly serializable Perl data types, including: scalars, hash refs, array refs, scalar refs, ref refs, undef, and blessed references. It can even properly handle circular and duplicate references. SAMPLE: use Data::Denter; print Indent bless {foo => 42, bar => [ 'happy', undef, [], 'sad' ], baz => "Bozo the Clown", }, "Small::Example"; yields: %Small::Example baz => Bozo the Clown bar => @ happy ? @ sad foo => 42 INFORMATION: For more information on Data::Denter, see 'perldoc Data::Denter'. Please send questions and comments to "Brian Ingerson" Copyright (c) 2001, Brian Ingerson. All Rights Reserved. Cheers, Brian - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From benwa at ocentrix.com Fri Apr 27 03:09:20 2001 From: benwa at ocentrix.com (Ben Burnett) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: chron job In-Reply-To: Message-ID: <5.0.2.1.0.20010427010119.00aaac20@mail.ocentrix.com> At 05:25 AM 4/27/01 +0000, ANDRE MCDOWALL wrote: >I'm running a perl script on a Unix box and need to set it up on a chron >job. Anyone have an idea of where I can start? thanks! man cron; man 1 crontab; man 5 crontab; If you're into contributing to a couple of interesting projects check out these found on search.cpan.org 2 modules found in 2 distributions matching 'cron' Schedule-Cron-0.03 by Roland Hu? Released 12th June 2000 Schedule::Cron 0.03 Set-Crontab-0.92 by Abhijit Menon-Sen Released 21st March 2001 Set::Crontab - Expand crontab(5)-style integer lists - Ben - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/ From dvergin at igc.org Fri Apr 27 11:48:13 2001 From: dvergin at igc.org (David Vergin) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: Data::Denter In-Reply-To: <3AE92605.12A49E@activestate.com> Message-ID: <000a01c0cf39$d9383980$4585fea9@bigmindmedia.com> Brian- Data::Denter looks promising. If only we knew someone who could see that this gets into the PPM library sometime soon... ;-) david > -----Original Message----- > From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org]On Behalf Of > Brian Ingerson > Sent: Thursday, April 26, 2001 11:56 PM > To: spug-list@pm.org > Subject: SPUG: Data::Denter > > > SPUG, > > Well I just wanted to say that I'm no longer a one module wonder :) > > Data::Denter has been uploaded to CPAN. Think "Data::Dumper meets > Python". It's actually quite useful. Check it out. > > From the README: > > Data::Denter - An alternative to Data::Dumper and Storable. > > INTRODUCTION: > > Data::Denter is yet another Perl data serializer/deserializer. It > formats nested data structures in an indented fashion. It is optimized > for human readability/editability, safe deserialization, and > (eventually) speed. > > NOTE: It may be optimized for Python programmers too, but please don't > hold that against me ;) > > It exports 2 functions: C and C for serialization > and deserialization respectively. It handles all of the commonly > serializable Perl data types, including: scalars, hash refs, array refs, > scalar refs, ref refs, undef, and blessed references. It can even > properly handle circular and duplicate references. > > SAMPLE: > > use Data::Denter; > print Indent bless {foo => 42, > bar => [ 'happy', undef, [], 'sad' ], > baz => "Bozo the Clown", > }, "Small::Example"; > > yields: > > %Small::Example > baz => Bozo the Clown > bar => @ > happy > ? > @ > sad > foo => 42 > > INFORMATION: > > For more information on Data::Denter, see 'perldoc Data::Denter'. > > Please send questions and comments to "Brian Ingerson" > > Copyright (c) 2001, Brian Ingerson. All Rights Reserved. > > > Cheers, Brian > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 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://www.halcyon.com/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://www.halcyon.com/spug/ From briani at activestate.com Fri Apr 27 12:45:49 2001 From: briani at activestate.com (Brian Ingerson) Date: Wed Aug 4 00:08:00 2004 Subject: SPUG: Data::Denter References: <000a01c0cf39$d9383980$4585fea9@bigmindmedia.com> Message-ID: <3AE9B04D.563D069B@activestate.com> David Vergin wrote: > > Brian- > > Data::Denter looks promising. If only we knew someone who could see that this > gets into the PPM library sometime soon... ;-) > > david I'll work on that. Actually improving PPM itself is now one of my direct responsibilities. As an alternative for Windows users, try getting the dmake binary distribution of CPAN. With this installed, you can: 1) use WinZip to extract the Data-Denter-0.11.tar.gz 2) cd Data-Denter-0.11/ 3) perl Makefile.PL 4) dmake test 5) dmake install Just like Unix. This should work for any "pure perl" module distribution. You can use 'nmake' from M$ in the same manner. I think you can find this for free on the internet. Cheers, Brian -- perl -le 'use Inline C=>q{SV*JAxH(char*x){return newSVpvf ("Just Another %s Hacker",x);}};print JAxH+Perl' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://www.halcyon.com/spug/