From rcarlino at home.com Tue Feb 1 00:07:20 2000 From: rcarlino at home.com (Ray Carlino) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] http/1.1 question In-Reply-To: References: Message-ID: <00013123110701.22125@c70511-a.lakwod1.co.home.com> Here is the script. It works great with netscape but not with IE5. This runs on our web server so that users can view the site in text only without us having to make dup pages. The error I get is that hostname not sent by client which is the server address. If I change the settings in ie5 not to use http/1.1 then it works also. Thanks Ray On Mon, 31 Jan 2000, you wrote: > On Mon, 31 Jan 2000, Ray Carlino wrote: > > > I have a perl script that pares html pages for a text only output. It works > > great on netscape but IE uses http/1.1 and I get an error saying hostname not > > in header. How do I get the hostname for a vhost under apache? I am using ip > > based vhosts and they have different names. > > > > Thanks > > Ray > > Hi, > > I'm not clear exactly what you're trying to do -- posting some code > might be helpful if I'm off-base where you're going. > > It sounds like what you're asking is how to get the hostname for > an IP address? > > use Socket; > $hostname = gethostbyaddr(inet_aton($ip_address), AF_INET); > > But if you're doing this on your own systems, you can code the info into > a hash and it'll be much quicker and more robust: > > %addresses = ( > "1.2.3.4" => "foo.bar.com", > "1.2.3.5" => "baz.bar.com", > ); > if ( defined $addresses{$ip_address} ) { > $hostname = $addresses{$ip_address}; > } else { > # your whoops function > print "Whoops!\n"; # Well, maybe something more better than this! > } > > Walter -------------- next part -------------- A non-text attachment was scrubbed... Name: nph-text-filter.pl Type: application/x-perl Size: 4748 bytes Desc: not available Url : http://mail.pm.org/archives/boulder-pm/attachments/20000131/8d62a55e/nph-text-filter.bin From Robert.L.Harris at rnd-consulting.com Tue Feb 1 09:30:50 2000 From: Robert.L.Harris at rnd-consulting.com (Robert L. Harris) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] IPC::Shareable Message-ID: <20000201083050.A5792@rnd-consulting.com> Is anyone using IPC::Shareable? I'm getting some oddities and am a bit lost. Robert :wq! --------------------------------------------------------------------------- Robert L. Harris | Low quality in a product happens. Senior System Engineer | That doesn't mean it's right and at RnD Consulting. | definitely doesn't mean it should \_ be accepted. Require quality. http://www.rnd-consulting.com/~nomad DISCLAIMER: These are MY OPINIONS ALONE. I speak for no-one else. FYI: perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' From walter at frii.com Tue Feb 1 09:42:43 2000 From: walter at frii.com (Walter Pienciak) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] http/1.1 question In-Reply-To: <00013123110701.22125@c70511-a.lakwod1.co.home.com> Message-ID: On Mon, 31 Jan 2000, Ray Carlino wrote: > Here is the script. It works great with netscape but not with IE5. This runs on > our web server so that users can view the site in text only without us having > to make dup pages. The error I get is that hostname not sent by client which is > the server address. If I change the settings in ie5 not to use http/1.1 then it > works also. > > Thanks > Ray Hi, Okay. There's a web doc on this program at http://www.ssc.com/websmith/issues/i2/ws22.html for anyone who wants a summary of this program. The general issue is that this program is assuming HTTP 1.0 behavior (RFC 1945) on the part of clients, but now some some clients are using HTTP 1.1 (RFC 2616), which does try to deal with virtual hosts. Apparently, some environment variables have changed. Two possible solutions: 1) You can pore over the RFCs and try to figure out what in blazes has changed. 2) You can just look at what the problematic browser is actually sending, by using both it and a "good" browser to access a CGI program like #!/usr/bin/perl -T print "Content-type: text/html\n\n"; while (($key, $val) = each %ENV) { print "$key = $val
\n"; } and then comparing the outputs. I strongly recommend 2), though using the RFCs is invaluable sometimes. So, let's say just for giggles that you do that and find that while in HTTP 1.0 clients the information you want is contained in $ENV{SERVER_NAME}, in HTTP 1.1 clients it's in $ENV{HOST}. In this case you'd look at the line $host = $ENV{SERVER_NAME}; and modify it: $host = defined( $ENV{SERVER_NAME} ) ? $ENV{SERVER_NAME} : $ENV{HOST}; or, in more readable syntax, if ( defined($ENV{SERVER_NAME}) ) { # HTTP 1.0 behavior $host = $ENV{SERVER_NAME}; } else { # HTTP 1.1 $host = $ENV{HOST}; } Walter From walter at frii.com Tue Feb 1 10:38:51 2000 From: walter at frii.com (Walter Pienciak) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] tonight's meeting Message-ID: Hi, Just a reminder: We'll be having an informal meeting tonight at 7 pm in the big common room near the food court area at the University Memorial Center on the CU campus. It's open late, and people who want to eat can grab something from a vendor, and people who want to stay and talk won't get kicked out till midnight. Here are the directions, thanks to Joel Sevinsky: > Below are links to maps of the University and Boulder. The UMC is building > #86 and there is a parking deck #24 right next store. It costs (I think) > $1.25 to park after 5pm. The meters on the street are free after 5pm but > nearly impossible to find vacant during the semester. The common area is > one floor down and to the rear if you enter from the main entrance on > Euclid. Hope that helps. > > Joel > > http://www.colorado.edu/Directories/WebMap/ > http://www.colorado.edu/Directories/WebMap/BoulderMap.html I'll have a laptop (with Perl -- anyone want any particular CPAN modules on this thing?) to putter around, and the latest Perl Journal. If you have questions, this will be a good environment to ask them. How will we find each other? Hmmm. I don't have any Perl-wear. I'll wear a white O'Reilly Open Source Conference t shirt and try to face the entrance. My face (albeit less worn) is on the net at http://standards.ieee.org/people/w.pienciak/. Sorry. No facial tattoos of camels or anything like that. Hope to see a bunch of new faces tonight. Walter From jay.kominek at colorado.edu Tue Feb 1 12:11:11 2000 From: jay.kominek at colorado.edu (Jay Kominek) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] tonight's meeting In-Reply-To: Your message of "Tue, 01 Feb 2000 09:38:51 MST." References: Message-ID: > I'll have a laptop (with Perl -- anyone want any particular CPAN > modules on this thing?) to putter around, and the latest Perl Journal. > If you have questions, this will be a good environment to ask them. > > How will we find each other? Hmmm. I don't have any Perl-wear. > I'll wear a white O'Reilly Open Source Conference t shirt and try to face > the entrance. My face (albeit less worn) is on the net at > http://standards.ieee.org/people/w.pienciak/. Sorry. No facial tattoos of > camels or anything like that. The commons thingy is pretty big and there can be a pretty large number of people in there at any given time. Maybe you should pick a corner to congregate in or something. (I'd suggest northwest, myself) Or sit under/near the picture of Alfred Packer. Or if it turns out that the place is packed when you get there, hover around the little kiosk they have setup on the west side browsing Perl web pages. :) - Jay Kominek Did you poison the coffee? Not any more than I usually do. From walter at frii.com Tue Feb 1 13:30:13 2000 From: walter at frii.com (Walter Pienciak) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] tonight's meeting In-Reply-To: Message-ID: On Tue, 1 Feb 2000, Jay Kominek wrote: > > > I'll have a laptop (with Perl -- anyone want any particular CPAN > > modules on this thing?) to putter around, and the latest Perl Journal. > > If you have questions, this will be a good environment to ask them. > > > > How will we find each other? Hmmm. I don't have any Perl-wear. > > I'll wear a white O'Reilly Open Source Conference t shirt and try to face > > the entrance. My face (albeit less worn) is on the net at > > http://standards.ieee.org/people/w.pienciak/. Sorry. No facial tattoos of > > camels or anything like that. > > The commons thingy is pretty big and there can be a pretty large number of > people in there at any given time. Maybe you should pick a corner to > congregate in or something. (I'd suggest northwest, myself) Or sit > under/near the picture of Alfred Packer. Or if it turns out that the place > is packed when you get there, hover around the little kiosk they have setup > on the west side browsing Perl web pages. :) > > - Jay Kominek > Did you poison the coffee? > Not any more than I usually do. Thanks. if ( &is_available("northwest corner") ) { print "Here we are, in the northwest corner!\n"; } elsif ( &is_available("near this Alfred Packer dude") ) { print "Here we are, near the picture of this Alfred Packer dude!\n"; } else { print "Here we are, milling around and looking uncertain . . . ?\n"; } Walter From bmozart at frii.com Wed Feb 2 07:28:43 2000 From: bmozart at frii.com (Randall Fowle) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] bookstore with good computer section? In-Reply-To: <64003B21ECCAD11185C500805F31EC03040AC6DF@houston.matchlogic.com> Message-ID: On Mon, 31 Jan 2000, Jason Van Slyke wrote: > Walter, > I too have heard that SoftPro is a good store but haven't made the personal > investment (time/driving in town/finding it/etc) to know first hand. I used to work down there. It's way the heck down in South Denver near the DTC, but they have a big selection. Go east on Arapahoe (or take the Arapahoe exit off I-25 and head west) then turn south on Yosemite. As Yosemite curves there's a little strip mall on the left, and SoftPro is in there. They're in the Denver phone book, too. I haven't been in Bibliotek here in Boulder, but I know it's on Walnut Street between 16th and 17th, on the north side in the red brick professional building. -Randy. amateur buildings? From kmoore at trustamerica.com Wed Feb 2 11:17:07 2000 From: kmoore at trustamerica.com (Kyle Moore) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] Softpro References: Message-ID: <38986693.1D646B14@trustamerica.com> I just got an email last night from Softpro saying that thier Boulder store just opened. You might check their web site for details. http://www.softpro.com I think -- ---- Kyle Moore UNIX Systems Administrator Webmaster --------------------------------------- Trust Company of America / Gemisys 7103 South Revere Parkway Englewood, CO 80112 --------------------------------------- Email: kmoore@trustamerica.com Voice: 303-705-6212 Pager: 303-656-1131 Fax: 303-705-6171 Web Site: http://www.trustamerica.com --------------------------------------- From walter at frii.com Wed Feb 2 14:34:36 2000 From: walter at frii.com (Walter Pienciak) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] Softpro In-Reply-To: <38986693.1D646B14@trustamerica.com> Message-ID: On Wed, 2 Feb 2000, Kyle Moore wrote: > I just got an email last night from Softpro saying that their Boulder > store just opened. You might check their web site for details. > http://www.softpro.com I think Oh, man. It's in the mall at Baseline and Foothills, and I just checked it out. I also checked out Bibliotek yesterday. Bibliotek is a great general technical bookstore -- I even picked up a book on roadside Colorado geology. Softpro is computers only -- and they had all the books I had on my want list (except one that's just out), even the new mysql book by DuBois. The store's even organized into coherent sections. 10% off if you sign up as a "member" -- no cost. They opened Monday and are still shelving books. A big thumbs-up to the store, and a bigger thankyou to everyone who made store suggestions. The books I got are going to save me a lot of time ramping up for a new project. Walter From jvanslyk at matchlogic.com Wed Feb 2 14:46:18 2000 From: jvanslyk at matchlogic.com (Jason Van Slyke) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] Softpro Message-ID: <64003B21ECCAD11185C500805F31EC03040AC703@houston.matchlogic.com> Walter, Hey! A) thanks for the review. B) remind me where Bibliotek is located. Thx, jvs PS: My VISA card is crying for mercy already. :) -----Original Message----- From: Walter Pienciak [mailto:walter@frii.com] Sent: Wednesday, February 02, 2000 1:35 PM To: boulder-pm-list@happyfunball.pm.org Subject: Re: [boulder.pm] Softpro On Wed, 2 Feb 2000, Kyle Moore wrote: > I just got an email last night from Softpro saying that their Boulder > store just opened. You might check their web site for details. > http://www.softpro.com I think Oh, man. It's in the mall at Baseline and Foothills, and I just checked it out. I also checked out Bibliotek yesterday. Bibliotek is a great general technical bookstore -- I even picked up a book on roadside Colorado geology. Softpro is computers only -- and they had all the books I had on my want list (except one that's just out), even the new mysql book by DuBois. The store's even organized into coherent sections. 10% off if you sign up as a "member" -- no cost. They opened Monday and are still shelving books. A big thumbs-up to the store, and a bigger thankyou to everyone who made store suggestions. The books I got are going to save me a lot of time ramping up for a new project. Walter From walter at frii.com Wed Feb 2 14:55:20 2000 From: walter at frii.com (Walter Pienciak) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] Softpro In-Reply-To: <64003B21ECCAD11185C500805F31EC03040AC703@houston.matchlogic.com> Message-ID: On Wed, 2 Feb 2000, Jason Van Slyke wrote: > Walter, > Hey! Hey! > A) thanks for the review. They gave me a t-shirt -- it was the least I could do ;^) > B) remind me where Bibliotek is located. 1655 Walnut (across from the 7-Eleven) > Thx, jvs > > PS: My VISA card is crying for mercy already. :) You're on your own with this one . . . Walter From walter at frii.com Wed Feb 2 15:03:42 2000 From: walter at frii.com (Walter Pienciak) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] Softpro In-Reply-To: Message-ID: On Wed, 2 Feb 2000, Dave wrote: > is that the o'reilly title on mySQL and mSQL? > if not, i'd be interested in hearing what you think of it. > > thank you for your time and have a nice day. It's *not* the O'Reilly title, which has gotten toasted by many people in many forums. I'm not a database or mysql guru, so maybe my review wouldn't be very knowledgeable. But once I've had a chance to go through it and actually use it to get work done, I'd be happy to share my feelings on whether I want to put it at arms reach or through a window. Walter From jvanslyk at matchlogic.com Fri Feb 4 09:34:14 2000 From: jvanslyk at matchlogic.com (Jason Van Slyke) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] DBI question Message-ID: <64003B21ECCAD11185C500805F31EC03040AC721@houston.matchlogic.com> Perl Mongers: Good Friday Morning! Got a little project that uses DBI. The following syntax is based off TPJ article Using Databases with DBI: What Not To Do by Thomas Akin. My problem seems to be related to variable interpolation in the where statement because: This works. 1 #!/usr/local/bin/perl -w 2 3 $CA = "PG" ; 4 5 use DBI ; 6 $drh = DBI->install_driver('Oracle') ; 7 $dbh = $drh->connect('logp','ml_gobob','ml_gobob', 8 { RaiseError => 1}) ; 9 10 $sql = "select cust_abbr, pid, date_time 11 from ra_online 12 where cust_abbr = 'PG'" ; 13 14 $sth = $dbh->prepare($sql) ; 15 $sth->execute ; 16 17 my ($CustAbbr, $PID, $DT, $Count) ; 18 $sth->bind_columns(undef, \$CustAbbr, \$PID, \$DT) ; 19 20 while ( $sth->fetch) { 21 $Count += 1 ; 22 print "$CustAbbr\t$PID\t$DT\t$Count\t$CA\n" ; 23 } 24 25 $dbh->disconnect ; giving these results: :>perl -w count_ra_online.pl Name "main::CA" used only once: possible typo at count_ra_online.pl line 3. PG 1099 03-FEB-00 1 PG 1100 03-FEB-00 2 PG 1181 03-FEB-00 3 **************************************************************************** *************************** While this does not. 1 #!/usr/local/bin/perl -w 2 3 $CA = "PG" ; 4 5 use DBI ; 6 $drh = DBI->install_driver('Oracle') ; 7 $dbh = $drh->connect('logp','ml_gobob','ml_gobob', 8 { RaiseError => 1}) ; 9 10 $sql = "select cust_abbr, pid, date_time 11 from ra_online 12 where cust_abbr = $CA" ; 13 14 $sth = $dbh->prepare($sql) ; 15 $sth->execute ; 16 17 my ($CustAbbr, $PID, $DT, $Count) ; 18 $sth->bind_columns(undef, \$CustAbbr, \$PID, \$DT) ; 19 20 while ( $sth->fetch) { 21 $Count += 1 ; 22 print "$CustAbbr\t$PID\t$DT\t$Count\t$CA\n" ; 23 } 24 25 $dbh->disconnect ; giving this error: Statement has no result columns to bind (perhaps you need to successfully call execute first) at count_ra_online.pl line 18. In line 10, I have also used the qq{ } syntax; no change. Any ideas? Thx, Jason From jvanslyk at matchlogic.com Fri Feb 4 17:29:09 2000 From: jvanslyk at matchlogic.com (Jason Van Slyke) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] FW: DBI question Message-ID: <64003B21ECCAD11185C500805F31EC03040AC734@houston.matchlogic.com> Perl Mongers: I don't believe it, not a single response to my question posted nearly 8 hours ago! So, I'll respond to it myself. In between work things today I've been searching for an answer under rocks and things. It turns our that O'Reilly has a sample chapter of the new, soon to be available, DBI book by Descartes & Bunce. And that chapter has the answer, "the most important utility method is quote()": #!/usr/bin/perl -w # # ch04/util/quote1: Demonstrates the use of the $dbh->quote() method use DBI; ### The string to quote my $string = "Don't view in monochrome (it looks 'fuzzy')!"; ### Connect to the database my $dbh = DBI->connect( "dbi:Oracle:archaeo", "username", "password" , { RaiseError => 1 } ); ### Escape the string quotes ... my $quotedString = $dbh->quote( $string ); ### Use quoted string as a string literal in a SQL statement my $sth = $dbh->prepare( " SELECT * FROM media WHERE description = $quotedString " ); $sth->execute(); exit; http://www.oreilly.com/catalog/perldbi/chapter/ch04.html Have a good weekend everyone. (Sorry I didn't make the meeting last Tue evening.) jvs > -----Original Message----- > From: Jason Van Slyke > Sent: Friday, February 04, 2000 8:34 AM > To: 'boulder-pm-list@happyfunball.pm.org' > Subject: DBI question > > Perl Mongers: > > Good Friday Morning! > > Got a little project that uses DBI. The following syntax is based off TPJ > article Using Databases with DBI: What Not To Do by Thomas Akin. > > My problem seems to be related to variable interpolation in the where > statement because: > > This works. > > 1 #!/usr/local/bin/perl -w > 2 > 3 $CA = "PG" ; > 4 > 5 use DBI ; > 6 $drh = DBI->install_driver('Oracle') ; > 7 $dbh = $drh->connect('logp','ml_gobob','ml_gobob', > 8 { RaiseError => 1}) ; > 9 > 10 $sql = "select cust_abbr, pid, date_time > 11 from ra_online > 12 where cust_abbr = 'PG'" ; > 13 > 14 $sth = $dbh->prepare($sql) ; > 15 $sth->execute ; > 16 > 17 my ($CustAbbr, $PID, $DT, $Count) ; > 18 $sth->bind_columns(undef, \$CustAbbr, \$PID, \$DT) ; > 19 > 20 while ( $sth->fetch) { > 21 $Count += 1 ; > 22 print "$CustAbbr\t$PID\t$DT\t$Count\t$CA\n" ; > 23 } > 24 > 25 $dbh->disconnect ; > > giving these results: > :>perl -w count_ra_online.pl > Name "main::CA" used only once: possible typo at count_ra_online.pl line > 3. > PG 1099 03-FEB-00 1 > PG 1100 03-FEB-00 2 > PG 1181 03-FEB-00 3 > > ************************************************************************** > ***************************** > > While this does not. > > 1 #!/usr/local/bin/perl -w > 2 > 3 $CA = "PG" ; > 4 > 5 use DBI ; > 6 $drh = DBI->install_driver('Oracle') ; > 7 $dbh = $drh->connect('logp','ml_gobob','ml_gobob', > 8 { RaiseError => 1}) ; > 9 > 10 $sql = "select cust_abbr, pid, date_time > 11 from ra_online > 12 where cust_abbr = $CA" ; > 13 > 14 $sth = $dbh->prepare($sql) ; > 15 $sth->execute ; > 16 > 17 my ($CustAbbr, $PID, $DT, $Count) ; > 18 $sth->bind_columns(undef, \$CustAbbr, \$PID, \$DT) ; > 19 > 20 while ( $sth->fetch) { > 21 $Count += 1 ; > 22 print "$CustAbbr\t$PID\t$DT\t$Count\t$CA\n" ; > 23 } > 24 > 25 $dbh->disconnect ; > > giving this error: Statement has no result columns to bind (perhaps > you need to successfully call execute first) at count_ra_online.pl line > 18. > > In line 10, I have also used the qq{ } syntax; no change. > > > Any ideas? > > Thx, Jason From jay.kominek at colorado.edu Fri Feb 4 17:46:56 2000 From: jay.kominek at colorado.edu (Jay Kominek) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] DBI question In-Reply-To: Your message of "Fri, 04 Feb 2000 08:34:14 MST." <64003B21ECCAD11185C500805F31EC03040AC721@houston.matchlogic.com> References: <64003B21ECCAD11185C500805F31EC03040AC721@houston.matchlogic.com> Message-ID: Oopsie. I meant to respond to this, I swear. :) I just forgot until Jason posted again. So I'll just elaborate on two more things he could've done: He had: > 10 $sql = "select cust_abbr, pid, date_time > 11 from ra_online > 12 where cust_abbr = 'PG'" ; And that worked, but this didn't: > 10 $sql = "select cust_abbr, pid, date_time > 11 from ra_online > 12 where cust_abbr = $CA" ; You could also do: 10 $sql = "select cust_abbr, pid, date_time 11 from ra_online 12 where cust_abbr = '$CA'" ; or: 10 $sql = "select cust_abbr, pid, date_time 11 from ra_online 12 where cust_abbr = ?" ; ?? $sth = $dbh->prepare($sql); ?? $sth->execute($CA); - Jay Kominek Hi, NSA sniffer guys! From justin.crawford at cusys.edu Tue Feb 8 09:00:44 2000 From: justin.crawford at cusys.edu (Justin Crawford) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] Newbie question... Message-ID: <01BF720A.9A7E9690@crawford.cusys.edu> Hi, I'm new to the list and not sure that I qualify as a Monger yet. In any event, I've got a script question maybe someone can help with.... Trying to make a basic server program using IO::Socket. I copied the whole script from a 'how-to' in a perl magazine. First, here is the output (assuming a successful client connection) on the server: AspDev/____> server Server ready. Waiting for connections. . . Im starting a fork Im too far down in the script!! Im WAY too far down now!! Next, the script: AspDev/____> cat server #!/usr/local/bin/perl -w use strict; use IO::Socket; use POSIX 'WNOHANG'; use constant PORT => 42444; $SIG{CHLD} = sub { while ( waitpid (-1, WNOHANG) > 0 ) { } }; my $listen_socket = IO::Socket::INET->new(LocalPort => PORT, Listen => 20, Proto => 'tcp', Reuse => 1); die "Can't create a listening socket: $@" unless $listen_socket; warn "Server ready. Waiting for connections. . .\n"; while (my $connection = $listen_socket->accept) { print "Im starting a fork\n"; die "Can't fork: $!" unless defined (my $child = fork()); if ($child == 0) { $listen_socket->close; interact($connection); exit 0; } } continue { $connection->close; } print "Im too far down in the script!!\n"; sub interact { my $sock = shift(@_); print $sock "This is being printed on Delphi.\n"; } print "Im WAY too far down now!!\n"; The question, of course, is why is the script only passing through the while-loop once? Thanks a lot for reading! -justin Justin Crawford Oracle DBA Group University Management Systems (303) 492-9083 justin.crawford@cusys.edu From CWA at DISC.com Tue Feb 8 10:08:35 2000 From: CWA at DISC.com (William Atkinson) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] Newbie question... Message-ID: Well I'll take a crack at a partial answer. Are you trying to run this script on a Windows machine? I ran it on a linux box and it worked just fine. I was able to telnet into port 42444 and got the message. I ran it on my nt box and got the message that fork is an unsupported function. Depending on whose and which version of perl, that may be the problem. Chip > -----Original Message----- > From: Justin Crawford [mailto:justin.crawford@cusys.edu] > Sent: Tuesday, February 08, 2000 8:01 AM > To: 'boulder-pm-list@happyfunball.pm.org' > Subject: [boulder.pm] Newbie question... > > > Hi, I'm new to the list and not sure that I qualify as a > Monger yet. In any event, I've got a script question maybe > someone can help with.... > > Trying to make a basic server program using IO::Socket. I > copied the whole script from a 'how-to' in a perl magazine. > First, here is the output (assuming a successful client > connection) on the server: > > AspDev/____> server > Server ready. Waiting for connections. . . > Im starting a fork > Im too far down in the script!! > Im WAY too far down now!! > > Next, the script: > > AspDev/____> cat server > #!/usr/local/bin/perl -w > use strict; > use IO::Socket; > use POSIX 'WNOHANG'; > > use constant PORT => 42444; > > $SIG{CHLD} = sub { while ( waitpid (-1, WNOHANG) > 0 ) { } }; > > my $listen_socket = IO::Socket::INET->new(LocalPort => PORT, > Listen => 20, > Proto => 'tcp', > Reuse => 1); > > die "Can't create a listening socket: $@" unless $listen_socket; > warn "Server ready. Waiting for connections. . .\n"; > > > while (my $connection = $listen_socket->accept) { > print "Im starting a fork\n"; > die "Can't fork: $!" unless defined (my $child = fork()); > if ($child == 0) { > $listen_socket->close; > interact($connection); > exit 0; > } > } > continue { > $connection->close; > } > > print "Im too far down in the script!!\n"; > > sub interact { > my $sock = shift(@_); > print $sock "This is being printed on Delphi.\n"; > } > > print "Im WAY too far down now!!\n"; > > > > The question, of course, is why is the script only passing > through the while-loop once? Thanks a lot for reading! > > -justin > > > Justin Crawford > Oracle DBA Group > University Management Systems > (303) 492-9083 > justin.crawford@cusys.edu > From justin.crawford at cusys.edu Tue Feb 8 10:38:49 2000 From: justin.crawford at cusys.edu (Justin Crawford) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] Newbie question... Message-ID: <01BF7218.4E363460@crawford.cusys.edu> It's running on Solaris, perl version 5005_02. I was really surprised (because I'm not much of a coder yet) when it worked for me from the client (i.e. I got the message "This is being printed on Delphi"), but the real problem is that the script _should_ be running as a listener. So that when the server gets a client attachment on 42444, it forks and continues listening on that port for more clients. Instead, in my case, the server is handling only 1 connection, and then it forks, and then both parent and child exit with no errors. And I really think it's just a problem in the way I've structured it, but I'm plumb out of ideas. Did you find in your test that the server process printed out the "This is way to far down in the script" stuff, or did it keep waiting for connections? Thanks! -justin -----Original Message----- From: William Atkinson [SMTP:CWA@DISC.com] Sent: Tuesday, February 08, 2000 9:09 AM To: 'boulder-pm-list@happyfunball.pm.org' Subject: RE: [boulder.pm] Newbie question... Well I'll take a crack at a partial answer. Are you trying to run this script on a Windows machine? I ran it on a linux box and it worked just fine. I was able to telnet into port 42444 and got the message. I ran it on my nt box and got the message that fork is an unsupported function. Depending on whose and which version of perl, that may be the problem. Chip > -----Original Message----- > From: Justin Crawford [mailto:justin.crawford@cusys.edu] > Sent: Tuesday, February 08, 2000 8:01 AM > To: 'boulder-pm-list@happyfunball.pm.org' > Subject: [boulder.pm] Newbie question... > > > Hi, I'm new to the list and not sure that I qualify as a > Monger yet. In any event, I've got a script question maybe > someone can help with.... > > Trying to make a basic server program using IO::Socket. I > copied the whole script from a 'how-to' in a perl magazine. > First, here is the output (assuming a successful client > connection) on the server: > > AspDev/____> server > Server ready. Waiting for connections. . . > Im starting a fork > Im too far down in the script!! > Im WAY too far down now!! > > Next, the script: > > AspDev/____> cat server > #!/usr/local/bin/perl -w > use strict; > use IO::Socket; > use POSIX 'WNOHANG'; > > use constant PORT => 42444; > > $SIG{CHLD} = sub { while ( waitpid (-1, WNOHANG) > 0 ) { } }; > > my $listen_socket = IO::Socket::INET->new(LocalPort => PORT, > Listen => 20, > Proto => 'tcp', > Reuse => 1); > > die "Can't create a listening socket: $@" unless $listen_socket; > warn "Server ready. Waiting for connections. . .\n"; > > > while (my $connection = $listen_socket->accept) { > print "Im starting a fork\n"; > die "Can't fork: $!" unless defined (my $child = fork()); > if ($child == 0) { > $listen_socket->close; > interact($connection); > exit 0; > } > } > continue { > $connection->close; > } > > print "Im too far down in the script!!\n"; > > sub interact { > my $sock = shift(@_); > print $sock "This is being printed on Delphi.\n"; > } > > print "Im WAY too far down now!!\n"; > > > > The question, of course, is why is the script only passing > through the while-loop once? Thanks a lot for reading! > > -justin > > > Justin Crawford > Oracle DBA Group > University Management Systems > (303) 492-9083 > justin.crawford@cusys.edu > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3927 bytes Desc: not available Url : http://mail.pm.org/archives/boulder-pm/attachments/20000208/d9721ed8/attachment.bin From CWA at DISC.com Tue Feb 8 11:49:40 2000 From: CWA at DISC.com (William Atkinson) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] Newbie question... Message-ID: That's really weird. On the linux box, it works great, just like you would expect. I cut and pasted so the code that's running is just the same as you sent. Here's the output from the server which is still running: [chip@wwa lab]$ ./monger.pl Server ready. Waiting for connections. . . Im starting a fork Im starting a fork Im starting a fork Im starting a fork >From my other window running the client: [chip@wwa chip]$ telnet wwa 42444 Trying 192.69.46.102... Connected to wwa.disc.com. Escape character is '^]'. This is being printed on Delphi. Connection closed by foreign host. [chip@wwa chip]$ telnet wwa 42444 Trying 192.69.46.102... Connected to wwa.disc.com. Escape character is '^]'. This is being printed on Delphi. Connection closed by foreign host. [chip@wwa chip]$ telnet wwa 42444 Trying 192.69.46.102... Connected to wwa.disc.com. Escape character is '^]'. This is being printed on Delphi. Connection closed by foreign host. [chip@wwa chip]$ I just checked it on an HPUX box running 5005_02 like you have and it worked fine. I was going to try it on our Solaris box but that perl is missing the IO/Socket.pm file. I see why you're baffled -- everything seems to work and the code is right on at least two boxes. Chip > -----Original Message----- > From: justin.crawford@cusys.edu [mailto:justin.crawford@cusys.edu] > Sent: Tuesday, February 08, 2000 9:39 AM > To: 'boulder-pm-list@happyfunball.pm.org' > Subject: RE: [boulder.pm] Newbie question... > > It's running on Solaris, perl version 5005_02. I was really > surprised (because I'm not much of a coder yet) when it > worked for me from the client (i.e. I got the message "This > is being printed on Delphi"), but the real problem is that > the script _should_ be running as a listener. So that when > the server gets a client attachment on 42444, it forks and > continues listening on that port for more clients. Instead, > in my case, the server is handling only 1 connection, and > then it forks, and then both parent and child exit with no > errors. And I really think it's just a problem in the way > I've structured it, but I'm plumb out of ideas. > > Did you find in your test that the server process printed out > the "This is way to far down in the script" stuff, or did it > keep waiting for connections? > > Thanks! > > -justin > > -----Original Message----- > From: William Atkinson [SMTP:CWA@DISC.com] > Sent: Tuesday, February 08, 2000 9:09 AM > To: 'boulder-pm-list@happyfunball.pm.org' > Subject: RE: [boulder.pm] Newbie question... > > Well I'll take a crack at a partial answer. Are you trying > to run this > script on a Windows machine? I ran it on a linux box and it > worked just > fine. I was able to telnet into port 42444 and got the > message. I ran it > on my nt box and got the message that fork is an unsupported function. > Depending on whose and which version of perl, that may be the problem. > > Chip > > > -----Original Message----- > > From: Justin Crawford [mailto:justin.crawford@cusys.edu] > > Sent: Tuesday, February 08, 2000 8:01 AM > > To: 'boulder-pm-list@happyfunball.pm.org' > > Subject: [boulder.pm] Newbie question... > > > > > > Hi, I'm new to the list and not sure that I qualify as a > > Monger yet. In any event, I've got a script question maybe > > someone can help with.... > > > > Trying to make a basic server program using IO::Socket. I > > copied the whole script from a 'how-to' in a perl magazine. > > First, here is the output (assuming a successful client > > connection) on the server: > > > > AspDev/____> server > > Server ready. Waiting for connections. . . > > Im starting a fork > > Im too far down in the script!! > > Im WAY too far down now!! > > > > Next, the script: > > > > AspDev/____> cat server > > #!/usr/local/bin/perl -w > > use strict; > > use IO::Socket; > > use POSIX 'WNOHANG'; > > > > use constant PORT => 42444; > > > > $SIG{CHLD} = sub { while ( waitpid (-1, WNOHANG) > 0 ) { } }; > > > > my $listen_socket = IO::Socket::INET->new(LocalPort => PORT, > > Listen => 20, > > Proto => 'tcp', > > Reuse => 1); > > > > die "Can't create a listening socket: $@" unless $listen_socket; > > warn "Server ready. Waiting for connections. . .\n"; > > > > > > while (my $connection = $listen_socket->accept) { > > print "Im starting a fork\n"; > > die "Can't fork: $!" unless defined (my $child = fork()); > > if ($child == 0) { > > $listen_socket->close; > > interact($connection); > > exit 0; > > } > > } > > continue { > > $connection->close; > > } > > > > print "Im too far down in the script!!\n"; > > > > sub interact { > > my $sock = shift(@_); > > print $sock "This is being printed on Delphi.\n"; > > } > > > > print "Im WAY too far down now!!\n"; > > > > > > > > The question, of course, is why is the script only passing > > through the while-loop once? Thanks a lot for reading! > > > > -justin > > > > > > Justin Crawford > > Oracle DBA Group > > University Management Systems > > (303) 492-9083 > > justin.crawford@cusys.edu > > > From justin.crawford at cusys.edu Tue Feb 8 15:08:29 2000 From: justin.crawford at cusys.edu (Justin Crawford) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] Newbie question... Message-ID: <01BF723D.F9FD6CD0@crawford.cusys.edu> Huh! So, like Chip, I ran the server component on HPUX 10.20 and it went perfectly. But on two different Solaris 2.6 boxes, the while-loop just drops out as soon as the first client connection is made. All three machines are using perl 5.005_02. I guess I'll run it by our kernel kings, and see whether they can tell me about a difference in 'fork' on these two platforms. Thanks, Chip, for figuring that out! If anyone has any advice on getting this thing to work on Solaris 2.6, I'm all eyes.... -Justin AspDev/____> server Server ready. Waiting for connections. . . Im starting a fork Im too far down in the script!! Im WAY too far down now!! AspDev/____> -----Original Message----- From: William Atkinson [SMTP:CWA@DISC.com] Sent: Tuesday, February 08, 2000 10:50 AM To: 'boulder-pm-list@happyfunball.pm.org' Subject: RE: [boulder.pm] Newbie question... That's really weird. On the linux box, it works great, just like you would expect. I cut and pasted so the code that's running is just the same as you sent. Here's the output from the server which is still running: [chip@wwa lab]$ ./monger.pl Server ready. Waiting for connections. . . Im starting a fork Im starting a fork Im starting a fork Im starting a fork >From my other window running the client: [chip@wwa chip]$ telnet wwa 42444 Trying 192.69.46.102... Connected to wwa.disc.com. Escape character is '^]'. This is being printed on Delphi. Connection closed by foreign host. [chip@wwa chip]$ telnet wwa 42444 Trying 192.69.46.102... Connected to wwa.disc.com. Escape character is '^]'. This is being printed on Delphi. Connection closed by foreign host. [chip@wwa chip]$ telnet wwa 42444 Trying 192.69.46.102... Connected to wwa.disc.com. Escape character is '^]'. This is being printed on Delphi. Connection closed by foreign host. [chip@wwa chip]$ I just checked it on an HPUX box running 5005_02 like you have and it worked fine. I was going to try it on our Solaris box but that perl is missing the IO/Socket.pm file. I see why you're baffled -- everything seems to work and the code is right on at least two boxes. [Justin Crawford] -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3159 bytes Desc: not available Url : http://mail.pm.org/archives/boulder-pm/attachments/20000208/4332d48a/attachment.bin From Robert.L.Harris at rnd-consulting.com Wed Feb 9 16:27:15 2000 From: Robert.L.Harris at rnd-consulting.com (Robert L. Harris) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] RegExpn Matching, not Message-ID: <20000209152715.C27283@rnd-consulting.com> Ok, I'm screwing around with my own Web Page generator for some comics I like. Really an excuse to mess with LWP and some RegExpressions. I have The following lines: Defined when reading a config file: $ComicsMatch{userfriendly}= cartoons\/archives\/\w*\/\w*.gif; In the Main script: This Works perfectly $content =~ /(cartoons\/archives\/\w*\/\w*.gif)/; Does Not Work: $content =~ /($ComicsMatch{$key})/; Does Not Work: $TmpMUrl=$ComicsMatch{$key}; $content =~ /($TmpMUrl)/; I really need to user iteration #2, or #3 so I can keep a config file instead of hardwiring into the script itself. Robert :wq! --------------------------------------------------------------------------- Robert L. Harris | Low quality in a product happens. Senior System Engineer | That doesn't mean it's right and at RnD Consulting. | definitely doesn't mean it should \_ be accepted. Require quality. http://www.rnd-consulting.com/~nomad DISCLAIMER: These are MY OPINIONS ALONE. I speak for no-one else. FYI: perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' From longmore at fsl.noaa.gov Wed Feb 9 16:39:25 2000 From: longmore at fsl.noaa.gov (Scott Longmore) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] RegExpn Matching, not Message-ID: <200002092239.WAA10862@opal.fsl.noaa.gov> > Ok, > I'm screwing around with my own Web Page generator for some comics I > like. Really an excuse to mess with LWP and some RegExpressions. I have > > The following lines: > > > Defined when reading a config file: > $ComicsMatch{userfriendly}= cartoons\/archives\/\w*\/\w*.gif; > > > In the Main script: > > This Works perfectly > $content =~ /(cartoons\/archives\/\w*\/\w*.gif)/; > > Does Not Work: > $content =~ /($ComicsMatch{$key})/; > > Does Not Work: > $TmpMUrl=$ComicsMatch{$key}; > $content =~ /($TmpMUrl)/; > > > I really need to user iteration #2, or #3 so I can keep a config file > instead of hardwiring into the script itself. > > > Robert Robert, You need single quotes around your regular expression during assignment or it will be evaluated during assignment..i.e.: $ComicsMatch{userfriendly}='cartoons\/archives\/\w*\/\w*.gif'; This has burned me several times...especially when reading regexps from configuration files. One of those little interpreted vs compiled language things. Regards, Scott ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ Scott Longmore - CIRA Research Associate \\\\\\\\\\\\ | ~ ~ DOC\NOAA\OAR\FSL\MD\E-Team & FSL\RRV Project \\\\\\\\\ - * - ~ ~ 325 Broadway R/FS6, 2C311 DSRC ~\__n__\ | ~ ~ Boulder, CO 80303 USA \\\\\\\ ~ ~ E-mail: longmore@fsl.noaa.gov \MMMM\ ~ ~ URL: http://www-md.fsl.noaa.gov/~longmore \\\\\ ~ ~ Phone: (303) 497-6443 Fax: (303) 497-3096 \\\\\Dust\Devil/~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In the immortal words of Socrates..."I drank what?" -Chris Knight- From jay.kominek at colorado.edu Wed Feb 9 17:03:52 2000 From: jay.kominek at colorado.edu (Jay Kominek) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] RegExpn Matching, not In-Reply-To: Your message of "Wed, 09 Feb 2000 15:27:15 MST." <20000209152715.C27283@rnd-consulting.com> References: <20000209152715.C27283@rnd-consulting.com> Message-ID: > Defined when reading a config file: > $ComicsMatch{userfriendly}= cartoons\/archives\/\w*\/\w*.gif; I think you need your Perl license taken away for barewording that. :) $ComicsMatch{'userfriendly'} = 'cartoons/archives/\w*/\w*.gif'; Is much nicer, but since I just noticed that somebody else responded and I don't want my typing to go to waste, I'll point out a bit of pedantry. :) Your regexp above will match "cartoons/archives//!giflkjasdfljsadlfkjsadf" Which, while a pathological case, probably isn't something you want. Consider using the regexp 'cartoons/archives/\w+/\w+\.gif$', which is less likely to match things you don't want. - Jay Kominek Hail Eris! From Robert.L.Harris at rnd-consulting.com Wed Feb 9 17:08:03 2000 From: Robert.L.Harris at rnd-consulting.com (Robert L. Harris) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] RegExpn Matching, not In-Reply-To: <200002092239.WAA10862@opal.fsl.noaa.gov>; from Scott Longmore on Wed, Feb 09, 2000 at 03:39:25PM -0700 References: <200002092239.WAA10862@opal.fsl.noaa.gov> Message-ID: <20000209160803.G27283@rnd-consulting.com> In reality it's more like this: while() { ($stitle, $title, $source, $match)=split('\#',$_); $Comics{$stitle}="Conf"; $ComicsTitle{$stitle}=$title; $ComicsSource{$stitle}='$source'; } I need to back tick it like this? Thus spake Scott Longmore (longmore@fsl.noaa.gov): > > > Ok, > > I'm screwing around with my own Web Page generator for some comics I > > like. Really an excuse to mess with LWP and some RegExpressions. I have > > > > The following lines: > > > > > > Defined when reading a config file: > > $ComicsMatch{userfriendly}= cartoons\/archives\/\w*\/\w*.gif; > > > > > > In the Main script: > > > > This Works perfectly > > $content =~ /(cartoons\/archives\/\w*\/\w*.gif)/; > > > > Does Not Work: > > $content =~ /($ComicsMatch{$key})/; > > > > Does Not Work: > > $TmpMUrl=$ComicsMatch{$key}; > > $content =~ /($TmpMUrl)/; > > > > > > I really need to user iteration #2, or #3 so I can keep a config file > > instead of hardwiring into the script itself. > > > > > > Robert > > Robert, > > You need single quotes around your regular expression during > assignment or it will be evaluated during assignment..i.e.: > > $ComicsMatch{userfriendly}='cartoons\/archives\/\w*\/\w*.gif'; > > This has burned me several times...especially when reading regexps > from configuration files. One of those little interpreted vs compiled > language things. > > Regards, > Scott > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ~ Scott Longmore - CIRA Research Associate \\\\\\\\\\\\ | ~ > ~ DOC\NOAA\OAR\FSL\MD\E-Team & FSL\RRV Project \\\\\\\\\ - * - ~ > ~ 325 Broadway R/FS6, 2C311 DSRC ~\__n__\ | ~ > ~ Boulder, CO 80303 USA \\\\\\\ ~ > ~ E-mail: longmore@fsl.noaa.gov \MMMM\ ~ > ~ URL: http://www-md.fsl.noaa.gov/~longmore \\\\\ ~ > ~ Phone: (303) 497-6443 Fax: (303) 497-3096 \\\\\Dust\Devil/~ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > In the immortal words of Socrates..."I drank what?" -Chris Knight- :wq! --------------------------------------------------------------------------- Robert L. Harris | Low quality in a product happens. Senior System Engineer | That doesn't mean it's right and at RnD Consulting. | definitely doesn't mean it should \_ be accepted. Require quality. http://www.rnd-consulting.com/~nomad DISCLAIMER: These are MY OPINIONS ALONE. I speak for no-one else. FYI: perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' From longmore at fsl.noaa.gov Wed Feb 9 17:46:09 2000 From: longmore at fsl.noaa.gov (Scott Longmore) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] RegExpn Matching, not Message-ID: <200002092346.XAA11110@opal.fsl.noaa.gov> > > In reality it's more like this: > while() { > ($stitle, $title, $source, $match)=split('\#',$_); > $Comics{$stitle}="Conf"; > $ComicsTitle{$stitle}=$title; > $ComicsSource{$stitle}='$source'; > } > > I need to back tick it like this? > In this case...no...I just looked at the code that I wrote which looks very similar and I didnt need to single quote the split variable i.e. $source . When reading the string from the file, it does not evaluate the string. So that all ya need is: $ComicsSource{$stitle}=$source; It depends on whether your regexp is being interally assigned or being read it from a file. Regards, Scott ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ Scott Longmore - CIRA Research Associate \\\\\\\\\\\\ | ~ ~ DOC\NOAA\OAR\FSL\MD\E-Team & FSL\RRV Project \\\\\\\\\ - * - ~ ~ 325 Broadway R/FS6, 2C311 DSRC ~\__n__\ | ~ ~ Boulder, CO 80303 USA \\\\\\\ ~ ~ E-mail: longmore@fsl.noaa.gov \MMMM\ ~ ~ URL: http://www-md.fsl.noaa.gov/~longmore \\\\\ ~ ~ Phone: (303) 497-6443 Fax: (303) 497-3096 \\\\\Dust\Devil/~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In the immortal words of Socrates..."I drank what?" -Chris Knight- From Robert.L.Harris at rnd-consulting.com Wed Feb 9 18:17:08 2000 From: Robert.L.Harris at rnd-consulting.com (Robert L. Harris) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] RegExpn Matching, not In-Reply-To: <200002092346.XAA11110@opal.fsl.noaa.gov>; from Scott Longmore on Wed, Feb 09, 2000 at 04:46:09PM -0700 References: <200002092346.XAA11110@opal.fsl.noaa.gov> Message-ID: <20000209171708.I27283@rnd-consulting.com> That's what I have currently and it's not working. Thus spake Scott Longmore (longmore@fsl.noaa.gov): > > > > > In reality it's more like this: > > while() { > > ($stitle, $title, $source, $match)=split('\#',$_); > > $Comics{$stitle}="Conf"; > > $ComicsTitle{$stitle}=$title; > > $ComicsSource{$stitle}='$source'; > > } > > > > I need to back tick it like this? > > > > In this case...no...I just looked at the code that I wrote > which looks very similar and I didnt need to single quote > the split variable i.e. $source . When reading the string > from the file, it does not evaluate the string. > > So that all ya need is: > > $ComicsSource{$stitle}=$source; > > It depends on whether your regexp is being interally assigned > or being read it from a file. > > Regards, > Scott > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ~ Scott Longmore - CIRA Research Associate \\\\\\\\\\\\ | ~ > ~ DOC\NOAA\OAR\FSL\MD\E-Team & FSL\RRV Project \\\\\\\\\ - * - ~ > ~ 325 Broadway R/FS6, 2C311 DSRC ~\__n__\ | ~ > ~ Boulder, CO 80303 USA \\\\\\\ ~ > ~ E-mail: longmore@fsl.noaa.gov \MMMM\ ~ > ~ URL: http://www-md.fsl.noaa.gov/~longmore \\\\\ ~ > ~ Phone: (303) 497-6443 Fax: (303) 497-3096 \\\\\Dust\Devil/~ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > In the immortal words of Socrates..."I drank what?" -Chris Knight- :wq! --------------------------------------------------------------------------- Robert L. Harris | Low quality in a product happens. Senior System Engineer | That doesn't mean it's right and at RnD Consulting. | definitely doesn't mean it should \_ be accepted. Require quality. http://www.rnd-consulting.com/~nomad DISCLAIMER: These are MY OPINIONS ALONE. I speak for no-one else. FYI: perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' From CWA at DISC.com Fri Feb 11 15:11:50 2000 From: CWA at DISC.com (William Atkinson) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] Non-blocking IO on NT Message-ID: Greetings, Has anyone gotten non-blocking reads from a pipe on NT to work? Here's my situation: I have a program that I want to run locally from a perl script. This perl script will check to see if any output is available from that program and print it. Otherwise, it will continue to do the rest of what it's supposed to be doing. I've looked at the perl cookbook at recipe 7.13 but that appeared to not work. From the Active State perl docs, it appears that select and ioctl both only work on sockets. Here's my "program", a shell script for emulating the real program: ------------ for i in 1 2 3 4 5 6 7 8 9 10; do echo "Hello number $i" sleep 1 done ------------ Here's the perl script: ------------ use strict; use Fcntl; use IO::File; use IO::Handle; use IO::Select; use vars qw ($handle $buffer $select $flags @ready); $handle = new IO::File; if (! $handle->open ("qa.emu |")) { print ("Error: Unable to open qa.emu\n"); } $select = IO::Select->new(); $select->add($handle); while (1) { if (@ready = $select->can_read()) { print ("got something to read\n"); } else { print ("Nothing found to read\n"); } if (@ready = $select->has_error(10)) { print ("Something has an error\n"); } } $handle->close; ------------- On linux it shows that there is something to read. On NT, it constantly says "Nothing found to read". Not surprising since it appears that select hasn't been implemented. Thanks for any and all help. Chip From rcarlino at home.com Sat Feb 12 18:53:08 2000 From: rcarlino at home.com (Ray Carlino) Date: Wed Aug 4 23:58:15 2004 Subject: No subject Message-ID: <00021217531500.05280@c70511-a.lakwod1.co.home.com> unsubscribe From Robert.L.Harris at rnd-consulting.com Fri Feb 18 13:07:58 2000 From: Robert.L.Harris at rnd-consulting.com (Robert L. Harris) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] https, Net:SSLeay and redirector = death? Message-ID: <20000218120758.A30787@rnd-consulting.com> Ok, I'm using a script someone else wrote. Bassicaly the syntax is: httpget /index.html type=https If I use a real IP on a web server it works just fine. If I use a virtual IP that is redirected by a Cisco Local director it seg faults immediately. ------------- Cut Here ----------- #!/usr/local/bin/perl5 -w # # # # Usage: httpget [:port] use Socket; use Net::SSLeay; print "1\n"; $debug=1; ## ## simple script to break out of a 'hung' telnet. ------------- Cut Here ----------- I don't even get the "1" printed. Robert :wq! --------------------------------------------------------------------------- Robert L. Harris | Low quality in a product happens. Senior System Engineer | That doesn't mean it's right and at RnD Consulting | definitely doesn't mean it should \_ be accepted. Require quality. DISCLAIMER: These are MY OPINIONS ALONE. I speak for no-one else. FYI: perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' From jvanslyk at matchlogic.com Mon Feb 28 09:46:54 2000 From: jvanslyk at matchlogic.com (Jason Van Slyke) Date: Wed Aug 4 23:58:15 2004 Subject: [boulder.pm] FW: Check out Moving Eyes Message-ID: <5FE9B713CCCDD311A03400508B8B3013112C67@bdr-xcln.is.matchlogic.com> OLD29FORD fwd'ed this, pretty funny. jvs Click here: Moving Eyes MOVE YOUR MOUSE AROUND THE SCREEN