From cconstan at csc.UVic.CA Mon May 5 18:05:46 2003 From: cconstan at csc.UVic.CA (Carl B. Constantine) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] detecting non-integers Message-ID: <20030505230546.GG7206@csc> I have a web CGI that I'm modifying. I want to make it so that you can only input an integer number. So if anyone tries to type 10.44, it is detected by my CGI and refused. Since perl doesn't have types as such, what is the best way to detect this, just a regex like: =~/\d+(\.)*/ or is there an easier way? -- Carl B. Constantine University of Victoria Programmer Analyst http://www.csc.uvic.ca UNIX System Administrator Victoria, BC, Canada cconstan@csc.uvic.ca ELW A220, 721-8753 From abez at abez.ca Mon May 5 18:12:10 2003 From: abez at abez.ca (abez) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] detecting non-integers In-Reply-To: <20030505230546.GG7206@csc> References: <20030505230546.GG7206@csc> Message-ID: \d+(\.)* means any integer even if there is no period. I think what you might want is /^(\-){0,1}\d+$/ #is an integer then you can negate this if you want. /^(\-){0,1}\d+\.\d+$/ #is a float abram On Mon, 5 May 2003, Carl B. Constantine wrote: > I have a web CGI that I'm modifying. I want to make it so that you can > only input an integer number. So if anyone tries to type 10.44, it is > detected by my CGI and refused. > > Since perl doesn't have types as such, what is the best way to detect > this, just a regex like: =~/\d+(\.)*/ or is there an easier way? > > > -- abez ------------------------------------------ http://www.abez.ca/ Abram Hindle (abez@abez.ca) ------------------------------------------ abez From yf110 at victoria.tc.ca Mon May 5 18:47:33 2003 From: yf110 at victoria.tc.ca (Malcolm Dew-Jones) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] detecting non-integers In-Reply-To: <20030505230546.GG7206@csc> Message-ID: On Mon, 5 May 2003, Carl B. Constantine wrote: > Since perl doesn't have types as such, what is the best way to detect > this, just a regex like: =~/\d+(\.)*/ or is there an easier way? A regex is the most typical way. I would show some but I hate to do that without testing them cause it's so easy for something to not work quite as you expect. Well may be just one, the simplist m/^\d+$/; # only digits, and must be at least one of them I suspect that there is a page somewhere that has pre-canned regexes, but I'm afraid I don't have an address. An alternative is to accept anything and convert it to the type of number you want. If the user sees feedback then that can work fine also. (by "type" I mean things like a truncated integer, or a number rounded to some number of places, or extract a numeric portion, etc). $number = sprintf "%d" , $input ; # non-numeric gives 0 or ($number) = $input =~ m/(\d+)/; # extract an embedded number # good for "50 kgs" etc From matt at elrod.ca Mon May 5 19:36:41 2003 From: matt at elrod.ca (Matt Elrod) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] detecting non-integers In-Reply-To: References: <20030505230546.GG7206@csc> Message-ID: Why not ($foo==int($foo)) to test it or $foo=$int($foo) to force it? Matt Elrod }> I have a web CGI that I'm modifying. I want to make it so that you can }> only input an integer number. So if anyone tries to type 10.44, it is }> detected by my CGI and refused. From cconstan at csc.UVic.CA Tue May 6 11:39:30 2003 From: cconstan at csc.UVic.CA (Carl B. Constantine) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] detecting non-integers In-Reply-To: References: <20030505230546.GG7206@csc> Message-ID: <20030506163930.GC8060@csc> *On Mon May 05, 2003 at 04:47:33PM -0700, Malcolm Dew-Jones (yf110@victoria.tc.ca) wrote: > > > > On Mon, 5 May 2003, Carl B. Constantine wrote: > > > Since perl doesn't have types as such, what is the best way to detect > > this, just a regex like: =~/\d+(\.)*/ or is there an easier way? > > A regex is the most typical way. I would show some but I hate to do that > without testing them cause it's so easy for something to not work quite as > you expect. Well may be just one, the simplist Yes, regex works just fine. A private email from Draco Paladin quoted a perlfaq4 entry that had what I needed, which is simply: if ($xfrAmount =~ /^-?\d+\.?\d*$/ ) { print $cgi->p("Please enter the funds as a whole number in cents. \$1.00 = 100 cents."); print $cgi->end_html; exit 1; } Thanks everyone for your help....again! ;-) -- Carl B. Constantine University of Victoria Programmer Analyst http://www.csc.uvic.ca UNIX System Administrator Victoria, BC, Canada cconstan@csc.uvic.ca ELW A220, 721-8753 From michael at negativespace.net Tue May 6 22:24:16 2003 From: michael at negativespace.net (Michael S. Joyce) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] detecting non-integers In-Reply-To: <20030506163930.GC8060@csc> References: <20030505230546.GG7206@csc> Message-ID: <5.1.1.6.2.20030506201904.00a8cc28@negativespace.net> I don't think that will work the way you expect. The match will succeed for anything with a digit in it, giving you erroneous results. I tested your regular expression from the command line: [20:17:58][e] $perl -nle 'print qq(yes\n) if(m/^-?\d+\.?\d*$/);' 10 yes 100 yes 100.00 yes You can see that it matches the 10, when it shouldn't. The problem is that ? matches zero or one times, and * matches zero or more times. And matching zero times is considered a successful match. I think a better way to do it would be to reverse the logic somewhat. unless($xfgAmount =~ /^\d+$/) { print $cgi->p("Please enter the funds as a whole number in cents. \$1.00 = 100 cents."); print $cgi->end_html; exit 1; } Please let me know if I've missed anything, or if I've helped. Michael At 09:39 AM 05/06/2003 -0700, you wrote: >*On Mon May 05, 2003 at 04:47:33PM -0700, Malcolm Dew-Jones >(yf110@victoria.tc.ca) wrote: > > > > > > > > On Mon, 5 May 2003, Carl B. Constantine wrote: > > > > > Since perl doesn't have types as such, what is the best way to detect > > > this, just a regex like: =~/\d+(\.)*/ or is there an easier way? > > > > A regex is the most typical way. I would show some but I hate to do that > > without testing them cause it's so easy for something to not work quite as > > you expect. Well may be just one, the simplist > >Yes, regex works just fine. A private email from Draco Paladin quoted a >perlfaq4 entry that had what I needed, which is simply: > >if ($xfrAmount =~ /^-?\d+\.?\d*$/ ) { > print $cgi->p("Please enter the funds as a whole number in cents. > \$1.00 = 100 cents."); > print $cgi->end_html; > exit 1; >} > >Thanks everyone for your help....again! ;-) > >-- >Carl B. Constantine University of Victoria >Programmer Analyst http://www.csc.uvic.ca >UNIX System Administrator Victoria, BC, Canada >cconstan@csc.uvic.ca ELW A220, 721-8753 From nkuipers at uvic.ca Tue May 6 22:46:23 2003 From: nkuipers at uvic.ca (Nathanael Kuipers) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] detecting non-integers Message-ID: <3EB8E2F5@wm2.uvic.ca> I find it humorous that a perlfaq entry could miss the double "0 or more" semantics, \.?\d*. One additional note: if you use the unless-logic regex presented, you might want to account for leading zeroes in some way, although whether the best thing to do is silently strip them or..., is up to you. Nathanael P.S. On a completely different tangent, I recently purchased a book called "Writing Perl Modules for CPAN" by Sam Tregar who has written several modules including HTML::Template. Since this has been a topic of discussion in the PM on and off for a while, it should be a good read, and if so I wouldn't mind reviewing it for the PM. >===== Original Message From "Michael S. Joyce" ===== >I don't think that will work the way you expect. The match will succeed for >anything with a digit in it, giving you erroneous results. I tested your >regular expression from the command line: >[20:17:58][e] $perl -nle 'print qq(yes\n) if(m/^-?\d+\.?\d*$/);' >10 >yes > >100 >yes > >100.00 >yes > >You can see that it matches the 10, when it shouldn't. The problem is that >? matches zero or one times, and * matches zero or more times. And matching >zero times is considered a successful match. > >I think a better way to do it would be to reverse the logic somewhat. > >unless($xfgAmount =~ /^\d+$/) { > print $cgi->p("Please enter the funds as a whole number in cents. >\$1.00 = 100 cents."); > print $cgi->end_html; > exit 1; >} > >Please let me know if I've missed anything, or if I've helped. > >Michael > >At 09:39 AM 05/06/2003 -0700, you wrote: >>*On Mon May 05, 2003 at 04:47:33PM -0700, Malcolm Dew-Jones >>(yf110@victoria.tc.ca) wrote: >> > >> > >> > >> > On Mon, 5 May 2003, Carl B. Constantine wrote: >> > >> > > Since perl doesn't have types as such, what is the best way to detect >> > > this, just a regex like: =~/\d+(\.)*/ or is there an easier way? >> > >> > A regex is the most typical way. I would show some but I hate to do that >> > without testing them cause it's so easy for something to not work quite as >> > you expect. Well may be just one, the simplist >> >>Yes, regex works just fine. A private email from Draco Paladin quoted a >>perlfaq4 entry that had what I needed, which is simply: >> >>if ($xfrAmount =~ /^-?\d+\.?\d*$/ ) { >> print $cgi->p("Please enter the funds as a whole number in cents. >> \$1.00 = 100 cents."); >> print $cgi->end_html; >> exit 1; >>} >> >>Thanks everyone for your help....again! ;-) >> >>-- >>Carl B. Constantine University of Victoria >>Programmer Analyst http://www.csc.uvic.ca >>UNIX System Administrator Victoria, BC, Canada >>cconstan@csc.uvic.ca ELW A220, 721-8753 From Peter at PSDT.com Tue May 6 23:13:10 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] detecting non-integers In-Reply-To: <3EB8E2F5@wm2.uvic.ca> Message-ID: <4.3.2.7.2.20030506211235.00ab11c0@localhost> At 08:46 PM 5/6/2003 -0700, Nathanael Kuipers wrote: >P.S. On a completely different tangent, I recently purchased a book called >"Writing Perl Modules for CPAN" by Sam Tregar who has written several modules >including HTML::Template. Since this has been a topic of discussion in >the PM >on and off for a while, it should be a good read, and if so I wouldn't mind >reviewing it for the PM. Have at it. I'm only 10% of the way through, a consequence of the location in which it sits in my home and how much time I spend there... -- Peter Scott peter@psdt.com http://www.perldebugged.com From cconstan at csc.UVic.CA Wed May 7 11:31:04 2003 From: cconstan at csc.UVic.CA (Carl B. Constantine) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] detecting non-integers In-Reply-To: <5.1.1.6.2.20030506201904.00a8cc28@negativespace.net> References: <20030505230546.GG7206@csc> <5.1.1.6.2.20030506201904.00a8cc28@negativespace.net> Message-ID: <20030507163104.GA9091@csc> *On Tue May 06, 2003 at 08:24:16PM -0700, Michael S. Joyce (michael@negativespace.net) wrote: > You can see that it matches the 10, when it shouldn't. The problem is that > ? matches zero or one times, and * matches zero or more times. And matching > zero times is considered a successful match. > > I think a better way to do it would be to reverse the logic somewhat. You're right. That does work better. Thanks. -- Carl B. Constantine University of Victoria Programmer Analyst http://www.csc.uvic.ca UNIX System Administrator Victoria, BC, Canada cconstan@csc.uvic.ca ELW A220, 721-8753 From abez at abez.ca Wed May 7 11:58:06 2003 From: abez at abez.ca (abez) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] Meeting? Message-ID: We should have a meeting the week of the 19 to 23. abram -- abez ------------------------------------------ http://www.abez.ca/ Abram Hindle (abez@abez.ca) ------------------------------------------ abez From darren at DarrenDuncan.net Wed May 7 12:10:36 2003 From: darren at DarrenDuncan.net (Darren Duncan) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] Meeting? In-Reply-To: Message-ID: On Wed, 7 May 2003, abez wrote: > We should have a meeting the week of the 19 to 23. > abram I'm not currently aware of any conflict with this (other than wednesdays) but I'll have to check for sure. So it should work for me. Any suggestions for a discussion topic? -- Darren Duncan From Peter at PSDT.com Wed May 7 18:39:34 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] Meeting? In-Reply-To: References: Message-ID: <5.2.1.1.2.20030507163434.00b8d438@shell2.webquarry.com> At 10:10 AM 5/7/2003 -0700, Darren Duncan wrote: >On Wed, 7 May 2003, abez wrote: > > We should have a meeting the week of the 19 to 23. > > abram > >I'm not currently aware of any conflict with this (other than wednesdays) >but I'll have to check for sure. So it should work for me. Okay, how about Tuesday the 20th? If there's no dissent by Friday, can you book the room, Abram? >Any suggestions for a discussion topic? I can give a report from YAPC::Canada, but we need something more meaty to add on. Anyone? -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From abez at abez.ca Wed May 7 19:02:16 2003 From: abez at abez.ca (abez) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] Meeting? In-Reply-To: <5.2.1.1.2.20030507163434.00b8d438@shell2.webquarry.com> References: <5.2.1.1.2.20030507163434.00b8d438@shell2.webquarry.com> Message-ID: I'm thinking about something like an intro/tutorial on Corba and Perl or GTK and Perl. I like the 20th. I'll book the room on or after friday. abram On Wed, 7 May 2003, Peter Scott wrote: > At 10:10 AM 5/7/2003 -0700, Darren Duncan wrote: > >On Wed, 7 May 2003, abez wrote: > > > We should have a meeting the week of the 19 to 23. > > > abram > > > >I'm not currently aware of any conflict with this (other than wednesdays) > >but I'll have to check for sure. So it should work for me. > > Okay, how about Tuesday the 20th? If there's no dissent by Friday, can > you book the room, Abram? > > >Any suggestions for a discussion topic? > > I can give a report from YAPC::Canada, but we need something more meaty > to add on. Anyone? > -- abez ------------------------------------------ http://www.abez.ca/ Abram Hindle (abez@abez.ca) ------------------------------------------ abez From nkuipers at uvic.ca Wed May 7 19:08:22 2003 From: nkuipers at uvic.ca (Nathanael Kuipers) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] Meeting? Message-ID: <3EB9C935@wm2.uvic.ca> >I can give a report from YAPC::Canada, but we need something more meaty >to add on. Anyone? Hesitantly, I'm willing to be target practice for "writing a decent parser module in Perl". I recently wrote a parser called BIO::vmatchIO. It parses non-XML flatfiles with some rather convoluted output formats. You can find the source and html-ized POD on my website (http://www.csc.uvic.ca/~nkuipers/nkuipers.html) under "My Modules". I'd appreciate the inevitable criticism and since the process and thought involved in writing robust parsers is a daunting task, this could yield some valuable points too. Another challenging option would be to construct the framework for re-implementing the parser using CPAN modules...I couldn't find any but I didn't look that hard and also I thought it would be a good experience to roll my own. For example would Parse::RecDescent be appropriate? Etc. Nathanael Kuipers, B.Sc --- Bioinformatics Technician Center for Biomedical Research University of Victoria Victoria BC, Canada From peter at PSDT.com Wed May 7 19:25:59 2003 From: peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] Meeting? In-Reply-To: <3EB9C935@wm2.uvic.ca> Message-ID: <5.2.1.1.2.20030507172458.00b22ec8@shell2.webquarry.com> At 05:08 PM 5/7/2003 -0700, Nathanael Kuipers wrote: >Hesitantly, I'm willing to be target practice for "writing a decent parser >module in Perl". Good with me. >I recently wrote a parser called BIO::vmatchIO. It parses >non-XML flatfiles with some rather convoluted output formats. You can find >the source and html-ized POD on my website >(http://www.csc.uvic.ca/~nkuipers/nkuipers.html) under "My Modules". I'd >appreciate the inevitable criticism and since the process and thought >involved >in writing robust parsers is a daunting task, this could yield some valuable >points too. Another challenging option would be to construct the framework >for re-implementing the parser using CPAN modules...I couldn't find any but I >didn't look that hard and also I thought it would be a good experience >to roll >my own. For example would Parse::RecDescent be appropriate? For parsing anything that there isn't an existing module for, I'd say yes. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From Peter at PSDT.com Wed May 7 19:27:29 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] Meeting? In-Reply-To: References: <5.2.1.1.2.20030507163434.00b8d438@shell2.webquarry.com> <5.2.1.1.2.20030507163434.00b8d438@shell2.webquarry.com> Message-ID: <5.2.1.1.2.20030507172623.00b22ec8@shell2.webquarry.com> At 05:02 PM 5/7/2003 -0700, abez wrote: >I'm thinking about something like an intro/tutorial on Corba and Perl or GTK >and Perl. Any of those would be terrific. If you can be ready with any in time, I think it's closer to being your turn than Nathanael's. Nice to have a choice. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From jeremygwa at hotmail.com Wed May 7 19:46:35 2003 From: jeremygwa at hotmail.com (Jeremy Aiyadurai) Date: Wed Aug 4 00:11:22 2004 Subject: No subject Message-ID: hi all, I have the following problem, involving recursion and threads. i have a recursive subroutine that scans a directory structure from a given root, and performs operations on files it finds which meet a certain criteria. I find, that running this in a single thread is rather time consuming, especially when there are alot of files to process and directories to go through. I want a new thread created for each recursive call to the subroutine. The subroutine is called when a sub directory is found. I am not an expert on threads or forks in perl, and have had alot of errors, when trying to apply them. I am using perl 5.8 from Activestate. My OS is Windows 2000 Pro. Your help is much appreciated. thanks in advance, Jeremy A. P.S: below this line is the recursive subroutine. ------------------------------------------------------------------------------ sub rgrab ($$) { my $current = $_[0]; my $path = "$_[1]/$current"; mkdir($current); chdir($current); opendir(DDD,"."); my @files = readdir(DDD); foreach (@files) { if (-f $_) # if a file { if($_ =~ /filenamehere/ig) { # do stuff to file here } } elsif(-d $_) #if a directory { #print "$_\n"; if (($_ ne ".") && ($_ ne "..")) { print "changing to directory:$_\n"; &rgrab( $_, $path ); chdir(".."); } } } closedir(DDD); } _________________________________________________________________ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail From jeremygwa at hotmail.com Wed May 7 19:47:58 2003 From: jeremygwa at hotmail.com (Jeremy Aiyadurai) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] Perl threads recursion Message-ID: hi all, I have the following problem, involving recursion and threads. i have a recursive subroutine that scans a directory structure from a given root, and performs operations on files it finds which meet a certain criteria. I find, that running this in a single thread is rather time consuming, especially when there are alot of files to process and directories to go through. I want a new thread created for each recursive call to the subroutine. The subroutine is called when a sub directory is found. I am not an expert on threads or forks in perl, and have had alot of errors, when trying to apply them. I am using perl 5.8 from Activestate. My OS is Windows 2000 Pro. Your help is much appreciated. thanks in advance, Jeremy A. P.S: below this line is the recursive subroutine. ------------------------------------------------------------------------------ sub rgrab ($$) { my $current = $_[0]; my $path = "$_[1]/$current"; mkdir($current); chdir($current); opendir(DDD,"."); my @files = readdir(DDD); foreach (@files) { if (-f $_) # if a file { if($_ =~ /filenamehere/ig) { # do stuff to file here } } elsif(-d $_) #if a directory { #print "$_\n"; if (($_ ne ".") && ($_ ne "..")) { print "changing to directory:$_\n"; &rgrab( $_, $path ); chdir(".."); } } } closedir(DDD); } _________________________________________________________________ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail From nkuipers at uvic.ca Wed May 7 20:20:11 2003 From: nkuipers at uvic.ca (Nathanael Kuipers) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] Perl threads recursion Message-ID: <3EB9E32E@wm2.uvic.ca> Just out of curiosity, have you given File::Find (bundled with Perl) and File::Find::Rule (uber File::Find, "find" it on CPAN)? Randal Schwartz has written some columns about these modules if their documentation does not suffice. You can find them at http://www.stonehenge.com/merlyn/LinuxMag/col45.html and http://www.stonehenge.com/merlyn/LinuxMag/col46.html. It sounds like what you are wanting to do could be done much more simply with one of these modules, without the explicit recursion/threads chicanery. Nathanael Kuipers, B.Sc --- Bioinformatics Technician Center for Biomedical Research University of Victoria Victoria BC, Canada From abez at abez.ca Wed May 7 22:00:59 2003 From: abez at abez.ca (abez) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] Perl threads recursion In-Reply-To: References: Message-ID: Forkbomb alert. Trust me, you don't want that running 200+ threads waiting on I/O operations won't get you anywhere. Also the reason it is time consuming is because you're waiting on I/O operations which are often times thousands to millions of times slower than your cpu. Yes you can make some gains doing certain operations in parallel because it will read the harddisk as it travels about the platter searching for your inodes. What I think you really want is to have a limited size threadpool and have these calls using waiting on threads in the pool. Your thread pool can either just be a integer which counts how many threads or it can be an actual collection of threads ready and waiting to attack the current problem (e.g. waiting to run the recursive code on a parameter). Another issue is you have to be clear what threads you are using. If you're using user level threads your blocking operations will block all the threads and you will gain nothing. If it's kernel level threads then you'll be fine. Basically if I was doing something you were doing I'd have this: 1. A queue of the current command to run. Threads will be blocked if there is nothing on this queue. 2. Each thread goes like this do get new parameter from queue #blocking or polling run subroutine inside subroutine if we have to spawn again add that to the queue end subroutine loop ---- Totall Untested Example code --------- use threads; use threads::shared; my $qmutex : shared = 1; sub run { for(;;) { my $command=""; { lock($qmutex); $command = shift(@queue); } #unlocks mutex if ($command) { subroutine($command); } } } sub addToQ { #call this inside subroutine to add your thing to the queue my ($val) = @_; lock($qmutex); push @queue,$val; } perldoc perlthrtut On Wed, 7 May 2003, Jeremy Aiyadurai wrote: > hi all, > > I have the following problem, involving recursion and threads. i have a > recursive subroutine that scans a directory structure from a given root, and > performs operations on files it finds which meet a certain criteria. I find, > that running this in a single thread is rather time consuming, especially > when there are alot of files to process and directories to go through. > > I want a new thread created for each recursive call to the subroutine. The > subroutine is called when a sub directory is found. I am not an expert on > threads or forks in perl, and have had alot of errors, when trying to apply > them. I am using perl 5.8 from Activestate. My OS is Windows 2000 Pro. > > Your help is much appreciated. > thanks in advance, > > Jeremy A. > > P.S: below this line is the recursive subroutine. > ------------------------------------------------------------------------------ > sub rgrab ($$) { > my $current = $_[0]; > my $path = "$_[1]/$current"; > mkdir($current); > chdir($current); > opendir(DDD,"."); > my @files = readdir(DDD); > foreach (@files) { > if (-f $_) # if a file > { > if($_ =~ /filenamehere/ig) > { > # do stuff to file here > } > } > elsif(-d $_) #if a directory > { > #print "$_\n"; > if (($_ ne ".") && ($_ ne "..")) > { > print "changing to directory:$_\n"; > &rgrab( $_, $path ); > chdir(".."); > } > } > } > closedir(DDD); > } > > _________________________________________________________________ > The new MSN 8: advanced junk mail protection and 2 months FREE* > http://join.msn.com/?page=features/junkmail > -- abez ------------------------------------------ http://www.abez.ca/ Abram Hindle (abez@abez.ca) ------------------------------------------ abez From Peter at PSDT.com Sun May 11 18:30:35 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] Victoria Perl Mongers meeting May 20 Message-ID: <5.2.1.1.2.20030511122419.00b35b00@shell2.webquarry.com> Victoria.pm will meet Tuesday, May 20, 7pm, at UVic's Clearihue A206. Abram Hindle will talk on "CORBA and Perl." I'm particularly looking forward to this myself since I have never done any CORBA in Perl. (That's the Common Object Request Broker Architecture, and it's a mature three-tier distributed object-oriented RPC mechanism IIRC. If I misrepresented it, I'm sure wiser heads will rush to correct me.) For those unfamiliar with UVic, see grid C3. Parking can be found at the top centre of B3. If you don't know how to get to UVic - welcome to Victoria - see . Other topics to be covered as time permits; make requests for anything particular. (Courtesy copy to VLUG members by permission of the list manager. Victoria.pm's home page is .) -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From nkuipers at uvic.ca Tue May 13 14:47:26 2003 From: nkuipers at uvic.ca (Nathanael Kuipers) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] SQL statement Message-ID: <3EC16784@wm2.uvic.ca> Hello hello, Hope everyone is well. I have a quick question about what I think would be called a negated join but I'm not sure. I have 2 tables: 1)blastnhsp 2)blastxhsp Each of these tables has all the same fields, and no field in either table contains a null value. What I want to do is something like the following incorrect statement: SELECT query, qfrom, qto FROM blastnhsp WHERE NOT blastxhsp.query; query holds an integer. It's not serial and not designated as a primary key, though in essence it serves as one. I think you get the idea of what the goal is here: to select records from blastnhsp that do not have corresponding records in blastxhsp. What is this called? Where should I be looking? Thanks, Nathanael From yf110 at victoria.tc.ca Tue May 13 15:36:05 2003 From: yf110 at victoria.tc.ca (Malcolm Dew-Jones) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] SQL statement In-Reply-To: <3EC16784@wm2.uvic.ca> Message-ID: On Tue, 13 May 2003, Nathanael Kuipers wrote: > Hello hello, > > Hope everyone is well. I have a quick question about what I think would be > called a negated join but I'm not sure. I have 2 tables: > > 1)blastnhsp > 2)blastxhsp > > Each of these tables has all the same fields, and no field in either table > contains a null value. > > What I want to do is something like the following incorrect statement: > > SELECT query, qfrom, qto FROM blastnhsp WHERE NOT blastxhsp.query; as an outer join, oracle syntax SELECT query, qfrom, qto FROM blastnhsp , blastxhsp WHERE blastnhsp.primary_key = blastxhsp.primary_key(+) and blastxhsp.primary_key IS NULL; This joins the two tables on what ever columns are the ones that would match, but uses an outer join on the second table so that if they don't exist in the second table then the second set of columns are just null. If you then take just the set of records in which the second table columns are null then you have the records that where unique in the first table. You can also do this with a not exists, and search in table 2 for the record of table 1 SELECT something FROM table1 WHERE not exists (select * from table2 where table2.columns = table1.columns ); $0.02 From abez at abez.ca Tue May 13 15:51:56 2003 From: abez at abez.ca (abez) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] SQL statement In-Reply-To: References: Message-ID: If mysql or posgresql are being used look into their outer join syntax. abram On Tue, 13 May 2003, Malcolm Dew-Jones wrote: > > as an outer join, oracle syntax > > SELECT query, qfrom, qto > FROM blastnhsp , blastxhsp > WHERE blastnhsp.primary_key = blastxhsp.primary_key(+) > and blastxhsp.primary_key IS NULL; > > This joins the two tables on what ever columns are the ones that would > match, but uses an outer join on the second table so that if they don't > exist in the second table then the second set of columns are just null. > > If you then take just the set of records in which the second table columns > are null then you have the records that where unique in the first table. > > > You can also do this with a not exists, and search in table 2 for the > record of table 1 > > SELECT something > FROM table1 > WHERE not exists (select * > from table2 > where table2.columns = table1.columns > ); > $0.02 > -- abez ------------------------------------------ http://www.abez.ca/ Abram Hindle (abez@abez.ca) ------------------------------------------ abez From darren at DarrenDuncan.net Tue May 13 16:23:38 2003 From: darren at DarrenDuncan.net (Darren Duncan) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] SQL statement In-Reply-To: <3EC16784@wm2.uvic.ca> Message-ID: On Tue, 13 May 2003, Nathanael Kuipers wrote: > What I want to do is something like the following incorrect statement: > SELECT query, qfrom, qto FROM blastnhsp WHERE NOT blastxhsp.query; I think that how you would do this depends on what database you are using. First of all, an outer-join is the simplest thing that at least partly does what you want. Someone else gave Oracle syntax, and I'll show you the MySQL syntax here: SELECT n.query, n.qfrom, n.qto FROM blastnhsp n LEFT JOIN blastxhsp x ON x.query = n.query Now, I'm not sure whether adding a 'WHERE x.query IS NULL' would have the desired effect or not (try experimenting), due to issues of timing, such as whether the 'where' is evaluated before or after the join condition (it would have to evaluate after) but it probably would. Alternately, if as you say both tables have the exact same columns, then the best solution is actually a rowset-minus (same syntax as rowset-union), like this: SELECT query, qfrom, qto FROM blastnhsp MINUS SELECT query, qfrom, qto FROM blastxhsp This would return all the rows from blastnhsp that aren't in blastxhsp. The above syntax works in Oracle and probably MySQL 4.0 (or 4.1, but not 3.x). -- Darren Duncan From nkuipers at uvic.ca Tue May 13 16:32:35 2003 From: nkuipers at uvic.ca (Nathanael Kuipers) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] SQL statement Message-ID: <3EC17E7F@wm2.uvic.ca> Thanks to all, particularly Darren, as the outer-join syntax he showed is the same as what my supervisor wrote down, as he happened to drop in after I sent the email to the pm...I should have mentioned that we are using postgres. Some of you would argue that I should have asked my supervisor first too...but I prefer to obscure my lack of knowledge from supervisors if possible. :) Thanks again! Nathanael >===== Original Message From Darren Duncan ===== >On Tue, 13 May 2003, Nathanael Kuipers wrote: >> What I want to do is something like the following incorrect statement: >> SELECT query, qfrom, qto FROM blastnhsp WHERE NOT blastxhsp.query; > >I think that how you would do this depends on what database you are using. >First of all, an outer-join is the simplest thing that at least partly >does what you want. Someone else gave Oracle syntax, and I'll show you >the MySQL syntax here: > >SELECT n.query, n.qfrom, n.qto >FROM blastnhsp n LEFT JOIN blastxhsp x ON x.query = n.query > >Now, I'm not sure whether adding a 'WHERE x.query IS NULL' would have the >desired effect or not (try experimenting), due to issues of timing, >such as whether the 'where' is evaluated before or after the join >condition (it would have to evaluate after) but it probably would. > >Alternately, if as you say both tables have the exact same columns, then >the best solution is actually a rowset-minus (same syntax as >rowset-union), like this: > >SELECT query, qfrom, qto FROM blastnhsp >MINUS >SELECT query, qfrom, qto FROM blastxhsp > >This would return all the rows from blastnhsp that aren't in blastxhsp. >The above syntax works in Oracle and probably MySQL 4.0 (or 4.1, but not >3.x). > >-- Darren Duncan From Peter at PSDT.com Thu May 15 11:24:31 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] Fwd: [pm_groups] User Groups Can Win a Pass to an O'Reilly Conference Message-ID: <4.3.2.7.2.20030515092350.00a95dd0@localhost> I'm already signed up and paid for the conference... shall I enter Victoria.pm? How many people would go if they won? >From: "Charles Bentley" >Organization: Third Coast Telecom >To: pm_groups@pm.org >Reply-To: chuckb@linuxtx.com >Priority: normal >X-Mailer: Pegasus Mail for Windows (v4.11) >Subject: [pm_groups] User Groups Can Win a Pass to an O'Reilly Conference >Sender: pm_groups-admin@pm.org >X-Beenthere: pm_groups@pm.org >X-Mailman-Version: 2.0.9 >List-Help: >List-Post: >List-Subscribe: , > >List-Id: Perl Mongers Group Leaders List >List-Unsubscribe: , > >List-Archive: >Date: Thu, 15 May 2003 11:11:19 -600 > >Just so you know, Houston PM has been entered into this raffle. If we >win, we'll have our own raffle, so be thinking about whether you >could go. > >------- Forwarded message follows ------- >Date sent: Fri, 9 May 2003 14:30:06 -0700 (PDT) >From: Marsee Henon >To: chuckb@LinuxTX.COM >Subject: User Groups Can Win a Pass to an O'Reilly Conference > >Enter your group to win one pass to: >O'Reilly Open Source Convention >Portland Marriott Downtown, >Portland, OR >July 7-11, 2003 >http://conferences.oreilly.com/oscon/ > > > >The lucky winning group will be given a "conference sessions only" pass >to attend the conference, valued at $1095.00. O'Reilly assumes that if >your group is the lucky winner, as the user group representative, you >will distribute the winning pass to a group member, using a method >appropriate for your group (drawing, raffle, etc.) > >The winning pass* includes: >-Access to all conference sessions July 9, 10, 11 including keynotes* >-Admission to Exhibit Hall >-Admission to all on-site evening events >-All conference handouts (excluding tutorial materials) > > >*Pass does not include tutorial fees, lodging, food, and transportation. > >Please email your entry to Marsee Henon at marsee@oreilly.com. >Deadline for entries is May 21, 2003. In the subject line of your >email, please say "Raffle Entry." The winning group leader will be >contacted on May 22, 2003 by email--unless a phone call is requested >(phone number must be provided). > >Only one attendee per pass will be allowed. Two people cannot share the >same pass to attend the conference on separate days. > >For more information about the O'Reilly Open Source Convention, >please visit our web site: >http://conferences.oreilly.com/oscon/ > >Early bird registration ends May 23, 2003. O'Reilly User Group Program >members receive 20% off conference session and tutorial fees. Register >before May 23, and receive 20% off already discounted "Early Bird" >pricing. After May 23, 20% discount will be applied to standard >pricing. When registering online, please enter the discount code: DSUG, >where it says: "If you received a discount code, please enter it here." >If registering by phone, please give the customer service >representative the DSUG discount code. > >If the winner of the pass has already registered for the conference, >the winner will be reimbursed for conference session fees paid. > >If you would like brochures for your members, I'd be happy ship them. > >Now for the Rules and Regulations--I apologize for the length, they're >really quite simple: > >***These rules constitute the official rules of this raffle. By >participating in the raffle, entrants agree to be bound by the official >rules and the decision of the judges, which are final and binding in >all respects.*** > >1. Entry: >No purchase is necessary to enter the raffle. To enter the raffle, >please email Marsee Henon at marsee@oreilly.com and tell her to enter >your group for the raffle. Entries must be received at O'Reilly & >Associates by May 21, 2003. Limit one entry per group, per email >address. O'Reilly & Associates and its agents are not responsible for >lost, late, misdirected, incomplete, illegible or damaged email that >results from any source. By entering, entrant agrees to abide by and be >bound by the Official Rules. O'Reilly & Associates reserves the right >to cancel the raffle if it becomes technically corrupted. > >2. Eligibility: >The O'Reilly Raffle is open to all who are 18 years of age or older, >and reside in the U.S. or Canada, except employees of O'Reilly & >Associates. Anyone else directly involved in this raffle is ineligible >to participate. Raffle void where prohibited by law. All federal, >state, and local laws apply. > >3. Selection and Notification: >The winners will be chosen at random from all eligible entries >submitted by May 21, 2003. O'Reilly will notify winners by email or >phone. A prize not claimed by June 30, 2003 will not be awarded. >The odds of winning depend on the number of eligible entries received. > >4. Other Rules: >a) The prize is nontransferable and non-endorsable; no cash or other >substitutions will be offered. All federal, state, and local taxes and >delivery charges are the sole responsibility of the winner. > >b) The winner consents to the use of his/her name and/or likeness for >publicity, advertising, and commercial purposes, in perpetuity, without >further compensation unless prohibited by law. O'Reilly & Associates >and its agents are not responsible for lost entries, or for and >availability of information or for Internet, for whatever reason. >Entries will be disqualified if O'Reilly & Associates determines, at >its sole discretion, that entrants have attempted to circumvent the >terms and conditions of these rules. All decisions by O'Reilly & >Associates are final. > >c) By participating in this raffle, entrants agree to release and hold >O'Reilly & Associates (and their employees, agents, representatives, or >affiliated companies) harmless from any and all losses, damages, >rights, claims, and actions of any kind in connection with the prize, >including, without limitation, personal injuries, death or property >damage, and claims based on publicity rights, defamation, or invasion >of privacy. > >d) Entrant also agrees that in no event shall O'Reilly & Associates or >its agents be liable to entrant or any other person for any damage, >injuries or losses arising out of the introduction of any virus, bug or >software malfunction resulting from participation in this raffle, or >for any damage, injuries or losses arising in connection with the >prize. > >e) O'Reilly & Associates reserves the right to modify the rules of the >raffle in any way or at any time, as long as reasonable notice is >given. > >f) To receive the name of the winner, or a copy of the Official Rules, >send a self-addressed, stamped envelope to: >O'Reilly Open Source Convention UG Raffle, >c/o O'Reilly & Associates >1005 Gravenstein Highway North, Sebastopol, CA 95472, >Attn: Marsee Henon, Post-marked prior to the close of the raffle >(May 21, 2003). > > >------- End of forwarded message ------- >===================================== >Third Coast Telecom (713) 827-8133 >5644 Westheimer, #222 >Houston, TX 77056 > >_______________________________________________ >pm_groups mailing list >pm_groups@pm.org >http://www.pm.org/mailman/listinfo/pm_groups -- Peter Scott peter@psdt.com http://www.perldebugged.com From darren at DarrenDuncan.net Thu May 15 14:24:11 2003 From: darren at DarrenDuncan.net (Darren Duncan) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] Fwd: [pm_groups] User Groups Can Win a Pass to an O'Reilly Conference Message-ID: Peter Scott said: >I'm already signed up and paid for the conference... shall I enter Victoria.pm? How many people would go if they won? I would certainly be interested in going if I had the chance. I went to the Apple WWDC in 2001, which was great (and saw O'reilly there), and I'm sure that oscon would be just as great a time. But I'm not sure whether the event would be a conflict for other things I have to do or not, and what it would cost. However, I still support Victoria.pm being entered as I'm sure that if not I then someone else here can make good use of it. So go ahead. -- Darren Duncan From nkuipers at uvic.ca Thu May 15 19:40:22 2003 From: nkuipers at uvic.ca (Nathanael Kuipers) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] CGI questions, and O'Reilly Message-ID: <3EC452F4@wm2.uvic.ca> Curses, though I am interested in the O'Reilly pass, I cannot afford even accomodations/transport I am sure. Although I might be able to convince my boss to send me, I can't be certain of this...so I guess you can count me in... I also have a couple of CGI questions. I've written this CGI that creates a form (I could have used straight HTML much more easily, or functional syntax, but I am trying to learn OO CGI.pm). In every CGI tutorial I've read, printing the Content-Type header is mandatory so that the cgi knows what it's looking at. So, the first thing my CGI object does is call header(). However, in the resulting HTML page, this sticks out like a sore thumb. Question 1: am I stuck with this? I'm also getting infuriating warnings from Perl as follows: [Thu May 15 17:54:23 2003] test.cgi: Use of uninitialized value in length at (eval 8) line 11. [Thu May 15 17:54:23 2003] test.cgi: Use of uninitialized value in join or string at (eval 15) line 15. [Thu May 15 17:54:23 2003] test.cgi: Use of uninitialized value in join or string at (eval 15) line 15. I'm not sure what these mean, or if I should worry about them since they don't hinder in any way the generation of my form page. Question 2: What is the concencus on this? I've attached the script itself as well as the HTML page I get from running it. Thanks, Nathanael -------------- next part -------------- A non-text attachment was scrubbed... Name: test.cgi Type: application/octet-stream Size: 1277 bytes Desc: not available Url : http://mail.pm.org/archives/victoria-pm/attachments/20030515/c2033e86/test.obj -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/victoria-pm/attachments/20030515/c2033e86/test.html From michael at negativespace.net Thu May 15 22:49:26 2003 From: michael at negativespace.net (Michael S. Joyce) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] CGI questions, and O'Reilly In-Reply-To: <3EC452F4@wm2.uvic.ca> Message-ID: <5.1.1.6.2.20030515204529.00ade660@negativespace.net> The problem is that you are sending your output to a file. You don't need a header when your output is a file. Browsers know that html files are html files. (Sorry, that wasn't meant to sound condescending, but I couldn't think of a better way to say it.) For a CGI program, you just send your output to STDOUT. The web server intercepts the output and then sends it off to the web browser. So, short answer: if your printing into a file handle, don't bother with the header. Michael At 05:40 PM 05/15/2003 -0700, you wrote: >Curses, though I am interested in the O'Reilly pass, I cannot afford even >accomodations/transport I am sure. Although I might be able to convince my >boss to send me, I can't be certain of this...so I guess you can count me >in... > >I also have a couple of CGI questions. > >I've written this CGI that creates a form (I could have used straight HTML >much more easily, or functional syntax, but I am trying to learn OO CGI.pm). >In every CGI tutorial I've read, printing the Content-Type header is >mandatory >so that the cgi knows what it's looking at. So, the first thing my CGI >object >does is call header(). However, in the resulting HTML page, this sticks out >like a sore thumb. Question 1: am I stuck with this? I'm also getting >infuriating warnings from Perl as follows: > > >[Thu May 15 17:54:23 2003] test.cgi: Use of uninitialized value in length at >(eval 8) line 11. >[Thu May 15 17:54:23 2003] test.cgi: Use of uninitialized value in join or >string at (eval 15) line 15. >[Thu May 15 17:54:23 2003] test.cgi: Use of uninitialized value in join or >string at (eval 15) line 15. > >I'm not sure what these mean, or if I should worry about them since they >don't >hinder in any way the generation of my form page. Question 2: What is the >concencus on this? > >I've attached the script itself as well as the HTML page I get from running >it. > >Thanks, > >Nathanael > From Peter at PSDT.com Fri May 16 04:48:00 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] CGI questions, and O'Reilly In-Reply-To: <3EC452F4@wm2.uvic.ca> Message-ID: <4.3.2.7.2.20030516024105.00ab2c20@localhost> At 05:40 PM 5/15/2003 -0700, Nathanael Kuipers wrote: > I'm also getting >infuriating warnings from Perl as follows: > > >[Thu May 15 17:54:23 2003] test.cgi: Use of uninitialized value in length at >(eval 8) line 11. >[Thu May 15 17:54:23 2003] test.cgi: Use of uninitialized value in join or >string at (eval 15) line 15. >[Thu May 15 17:54:23 2003] test.cgi: Use of uninitialized value in join or >string at (eval 15) line 15. > >I'm not sure what these mean, or if I should worry about them since they >don't >hinder in any way the generation of my form page. Question 2: What is the >concencus on this? I am consensed that all warnings should be eliminated. If you're not generating undef values deliberately then you should look at why they are happening. I don't get any warnings from running your attached test.cgi. Those messages really came from the same script? You may have a broken CGI.pm. -- Peter Scott peter@psdt.com http://www.perldebugged.com From nkuipers at uvic.ca Fri May 16 12:22:02 2003 From: nkuipers at uvic.ca (Nathanael Kuipers) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] CGI questions, and O'Reilly Message-ID: <3EC53668@wm2.uvic.ca> >I don't get any warnings from running your attached test.cgi. Those >messages really came from the same script? You may have a broken CGI.pm. Yes those messages really came from the exact same script. I think you are right about a broken CGI.pm, I installed CGI.pm-2.93 this morning and even with an unclean install (bad permissions for the man directory) I got only one error (the first one), whereas when I uninstalled 2.93 and used the CGI.pm installed by root, back to the same three errors. My sysadmin is on holidays in Thailand, whatever the complete remedy, it'll have to wait. =/ Thanks, Nathanael P.S.Michael, I was not at all made to feel put down by your email, it is exactly those kinds of points that I don't know and that I need to know to mentally grasp what's going on with cgi! So thank you. From abez at abez.ca Mon May 19 16:38:32 2003 From: abez at abez.ca (abez) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] Meeting Location Has Changed! Message-ID: The next victoria.pm meeting will be hosted in ``The Center For Innovative Teaching Room 120''. On this webpage there is a map http://www.uvic.ca/maps/index.html As well an altered map for your convience can be found at: http://www.abez.ca/supernaut/campus-map.png It describes bus and parking locations. The presentation will be on CORBA and perl. abram -- abez ------------------------------------------ http://www.abez.ca/ Abram Hindle (abez@abez.ca) ------------------------------------------ abez From Peter at PSDT.com Mon May 19 19:46:48 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] Victoria Perl Mongers meeting tomorrow Message-ID: <5.2.1.1.2.20030519174240.00b24eb8@shell2.webquarry.com> Victoria.pm will meet tomorrow, Tuesday, May 20, 7pm, at UVic's Centre For Innovative Teaching Room 120. ** New location ** On this webpage there is a map http://www.uvic.ca/maps/index.html As well an altered map for your convenience can be found at: http://www.abez.ca/supernaut/campus-map.png It describes bus and parking locations... Abram Hindle will talk on "CORBA and Perl." I'm particularly looking forward to this myself since I have never done any CORBA in Perl. (That's the Common Object Request Broker Architecture, and it's a mature three-tier distributed object-oriented RPC mechanism.) I'll give a first-hand report on the first YAPC::Canada if time permits. I also have a JAPH T-shirt to give away by a fair method to be determined at the meeting. (Courtesy copy to VLUG members by permission of the list manager. Victoria.pm's home page is .) -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From abez at abez.ca Tue May 20 23:59:46 2003 From: abez at abez.ca (abez) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] CORBA::ORBit Message-ID: Abram's CORBA::ORBit slides: The tar.gz source pack: http://abez.ca/supernaut/Victoria.pm.May2003.tgz The slides: http://abez.ca/supernaut/victoriaPMMay2003Slides.pdf Nathan can you put these (download and upload) on the victoria.pm.org site? Thanks everyone, abram -- abez ------------------------------------------ http://www.abez.ca/ Abram Hindle (abez@abez.ca) ------------------------------------------ abez From peter at PSDT.com Wed May 21 11:56:01 2003 From: peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] CORBA::ORBit In-Reply-To: Message-ID: <5.2.1.1.2.20030521095445.00b7d590@shell2.webquarry.com> At 09:59 PM 5/20/2003 -0700, you wrote: >Abram's CORBA::ORBit slides: > >The tar.gz source pack: >http://abez.ca/supernaut/Victoria.pm.May2003.tgz > >The slides: >http://abez.ca/supernaut/victoriaPMMay2003Slides.pdf > >Nathan can you put these (download and upload) on the victoria.pm.org site? > >Thanks everyone, And Thank You again for an excellent presentation. I will be looking out for any opportunity to use CORBA now I know how to use it from Perl and how powerful it is. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From cconstan at csc.UVic.CA Wed May 21 12:05:35 2003 From: cconstan at csc.UVic.CA (Carl B. Constantine) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] CORBA::ORBit In-Reply-To: <5.2.1.1.2.20030521095445.00b7d590@shell2.webquarry.com> References: <5.2.1.1.2.20030521095445.00b7d590@shell2.webquarry.com> Message-ID: <20030521170535.GH25087@csc> *On Wed May 21, 2003 at 09:56:01AM -0700, Peter Scott (peter@PSDT.com) wrote: > And Thank You again for an excellent presentation. I will be looking > out for any opportunity to use CORBA now I know how to use it from Perl > and how powerful it is. I'm sorry I missed last night's presentation. I'm sitting in on csc370 this summer. It's on Wed & Thurs, which means I'm away from my family too many times during the week at times. Hope to get back to it once class is over. -- Carl B. Constantine University of Victoria Programmer Analyst http://www.csc.uvic.ca UNIX System Administrator Victoria, BC, Canada cconstan@csc.uvic.ca ELW A220, 721-8753 From Peter at PSDT.com Thu May 22 08:52:08 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] CORBA book bargain Message-ID: <4.3.2.7.2.20030522065030.00aa4a40@shell2.webquarry.com> Following on the heels of Abram's CORBA and Perl talk, anyone who wants to do CORBA might find this helpful: http://www.halfpricecomputerbooks.ca/detail.php?isbn=0201379252 I don't know whether the book is actually any good, but at $7.50 (Half Price Computer Books is having a sale), it's not an expensive mistake if it's a dud. -- Peter Scott peter@psdt.com http://www.perldebugged.com From nkuipers at uvic.ca Fri May 23 13:11:59 2003 From: nkuipers at uvic.ca (Nathanael Kuipers) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] I'm a moron: posting slides and more CGI Message-ID: <3ECE957E@wm2.uvic.ca> Hello, Abram I've tried to post your tarball and pdf (as you can see by the error-throwing links on the vicpm site) but I'm confounded. Neither a href="CORBA.pdf" nor a href="./CORBA.pdf" works because apparently the server looks at everything as starting with / Oh, ok, so it wants an absolute path, no problem: /home/groupleaders/victoria/web_docs/CORBA.pdf or home/groupleaders/victoria/web_docs/CORBA.pdf "Not found. Requested URL...was not found on this server." I know that the specified directory structure is correct. In short, I'm baffled, and I look to someone to clear this up for me. *** I also have another question regarding passing parameters from one CGI to another. Currently, the main cgi script accepts parameters from an HTML form, and this works fine. Now I want to embed links in the page served up by the cgi that activate other cgis. This is what I had thought would Do What I Mean: ... while ($hitdata = $hitsth->fetchrow_arrayref()) { last if ++$count > $best; print "$count) ",join(' // ', @$hitdata)," ", $cgi->a({href=>'showquery.cgi', query=>$hitdata->[0]},'[query]')," ", $cgi->a({href=>'showhit.cgi', query=>$hitdata->[0], hit=>$hitdata->[1]},'[hit details]'), $cgi->br(); } And here's the entire contents of query.cgi (stub form, to make sure everything works): #!/usr/bin/perl -wT use strict; use CGI; use CGI::Carp qw(fatalsToBrowser); use DBI; $| = 1; my $cgi = new CGI(); print $cgi->header(), $cgi->start_html(), "query param: ",$cgi->param('query'), $cgi->end_html(); __END__ The result of clicking on the '[query]' link is query param: and that's it. I know for a fact that $hitdata->[0] is defined. What am I missing here? Thanks, Nathanael From peter at PSDT.com Fri May 23 16:46:43 2003 From: peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] I'm a moron: posting slides and more CGI In-Reply-To: <3ECE957E@wm2.uvic.ca> Message-ID: <5.2.1.1.2.20030523120324.00b25800@shell2.webquarry.com> At 11:11 AM 5/23/2003 -0700, Nathanael Kuipers wrote: >Hello, > >Abram I've tried to post your tarball and pdf (as you can see by the >error-throwing links on the vicpm site) but I'm confounded. Neither a >href="CORBA.pdf" nor a href="./CORBA.pdf" works because apparently the server >looks at everything as starting with / > >Oh, ok, so it wants an absolute path, no problem: >/home/groupleaders/victoria/web_docs/CORBA.pdf or >home/groupleaders/victoria/web_docs/CORBA.pdf > >"Not found. Requested URL...was not found on this server." > >I know that the specified directory structure is correct. Paths != URLs. The HREF has to be everything after the hostname part of the URL. I checked it out and the server is paranoid about file modes. That's something that really annoys me about Apache. The modes were: -rwx--x--x 1 victoria apache 62587 May 23 12:44 CORBA.pdf -rwx--x--x 1 victoria apache 131050 May 23 12:44 CORBA.tgz I changed them to: -rw-r--r-- 1 victoria apache 62587 May 23 12:44 CORBA.pdf -rw-r--r-- 1 victoria apache 131050 May 23 12:44 CORBA.tgz and now the URLs http://victoria.pm.org/CORBA.pdf and http://victoria.pm.org/CORBA.tgz work fine. Go ahead and change the links back to relative links. >In short, I'm baffled, and I look to someone to clear this up for me. > >*** > >I also have another question regarding passing parameters from one CGI to >another. Currently, the main cgi script accepts parameters from an >HTML form, >and this works fine. Now I want to embed links in the page served up by the >cgi that activate other cgis. This is what I had thought would Do What I >Mean: > >... > >while ($hitdata = $hitsth->fetchrow_arrayref()) { > last if ++$count > $best; > print "$count) ",join(' // ', @$hitdata)," ", > $cgi->a({href=>'showquery.cgi', > query=>$hitdata->[0]},'[query]')," ", > $cgi->a({href=>'showhit.cgi', > query=>$hitdata->[0], > hit=>$hitdata->[1]},'[hit details]'), > $cgi->br(); >} > >And here's the entire contents of query.cgi Above refers to 'showquery.cgi', not 'query.cgi'... >(stub form, to make sure >everything works): > >#!/usr/bin/perl -wT > >use strict; >use CGI; >use CGI::Carp qw(fatalsToBrowser); >use DBI; > >$| = 1; > >my $cgi = new CGI(); > >print $cgi->header(), > $cgi->start_html(), > "query param: ",$cgi->param('query'), > $cgi->end_html(); > > >__END__ > >The result of clicking on the '[query]' link is > >query param: > >and that's it. I know for a fact that $hitdata->[0] is defined. What am I >missing here? $cgi->a({href=>'showquery.cgi', query=>$hitdata->[0]},'[query]') isn't right. % perl -MCGI=a -le 'print a({href=>"showquery.cgi",query=>"foo"},"[query]")' [query] You want: $cgi->a({href=>'showquery.cgi?query='.$hitdata->[0]},'[query]') although if $hitdata->[0] contains any characters that aren't really boring then you'll need to do URI escaping on it first. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From peter at PSDT.com Thu May 29 18:31:33 2003 From: peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] Fwd: [Yapc-talk] proceedings Message-ID: <5.2.1.1.2.20030529163042.01b41138@shell2.webquarry.com> If anyone wants to get at the contents of the CD I flourished last meeting of the YAPC::Canada proceedings, well, now you can: >Hi All, > >I've put up a copy of the proceedings of the talk, in case anybody wants >to pass around the CD to others. It includes .tgz, .tar.bz, and .zip >files of the proceedings. > >http://www.coder.com/yapc-canada/2003/proceedings/ > >Please don't hose my network. :-) > >Cheers, > >Daniel > >http://kw.pm.org/ - Kitchener-Waterloo Perlmongers - da@kw.pm.org >http://coder.com/ - Prescient Code Solutions - (519) 575-3733 da@coder.com -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From abez at abez.ca Thu May 29 19:12:18 2003 From: abez at abez.ca (abez) Date: Wed Aug 4 00:11:22 2004 Subject: [VPM] Fwd: [Yapc-talk] proceedings In-Reply-To: <5.2.1.1.2.20030529163042.01b41138@shell2.webquarry.com> References: <5.2.1.1.2.20030529163042.01b41138@shell2.webquarry.com> Message-ID: Thanks Peter some of these talks look excellent. When I saw the examples of Class::DBI, I grimaced as I've written similar things a few times over. Wish I would've seen it sooner. it looks like it definately can cut down on development time (especially of the database end). abram On Thu, 29 May 2003, Peter Scott wrote: > If anyone wants to get at the contents of the CD I flourished last > meeting of the YAPC::Canada proceedings, well, now you can: > > >Hi All, > > > >I've put up a copy of the proceedings of the talk, in case anybody wants > >to pass around the CD to others. It includes .tgz, .tar.bz, and .zip > >files of the proceedings. > > > >http://www.coder.com/yapc-canada/2003/proceedings/ > > > >Please don't hose my network. :-) > > > >Cheers, > > > >Daniel > > > >http://kw.pm.org/ - Kitchener-Waterloo Perlmongers - da@kw.pm.org > >http://coder.com/ - Prescient Code Solutions - (519) 575-3733 da@coder.com > > -- abez ------------------------------------------ http://www.abez.ca/ Abram Hindle (abez@abez.ca) ------------------------------------------ abez