From comeaujr at sd.conexant.com Mon Dec 4 19:52:08 2000 From: comeaujr at sd.conexant.com (John R. Comeau) Date: Thu Aug 5 00:20:13 2004 Subject: Web browser providing visibility Message-ID: <200012050152.RAA11117@pirr.sd.conexant.com> ~sdpm~ This isn't exactly a Perl question, but I do have a Perl project in mind eventually. Does anyone know of a browser that provides visibility to all the HTTP commands that are sent across the network? That is, I'd like to see the full text of all the HTTP messages that I'm sending and receiving for GETs and POSTs. -- John Comeau (john.comeau@conexant.com) 858-713-3593 (W) ------------------------------------------------------- Stell dich doch nicht so dmlich an! Don't act so clumsily! ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From rkleeman at neta.com Mon Dec 4 20:02:14 2000 From: rkleeman at neta.com (Bobby Kleemann) Date: Thu Aug 5 00:20:13 2004 Subject: Web browser providing visibility In-Reply-To: <200012050152.RAA11117@pirr.sd.conexant.com> Message-ID: ~sdpm~ I beleive lib-www (LWP) provides that functionality. I think you can print out the entire GET headers as well as the entire set of headers returned. _ _ _ Bobby Kleemann http://www.neta.com/~rkleeman/ On Mon, 4 Dec 2000, John R. Comeau wrote: > ~sdpm~ > This isn't exactly a Perl question, but I do have a Perl project in > mind eventually. Does anyone know of a browser that provides > visibility to all the HTTP commands that are sent across the network? > That is, I'd like to see the full text of all the HTTP messages that > I'm sending and receiving for GETs and POSTs. > > -- > John Comeau (john.comeau@conexant.com) 858-713-3593 (W) > ------------------------------------------------------- > Stell dich doch nicht so dmlich an! > > Don't act so clumsily! > ~sdpm~ > > The posting address is: san-diego-pm-list@hfb.pm.org > > List requests should be sent to: majordomo@hfb.pm.org > > If you ever want to remove yourself from this mailing list, > you can send mail to with the following > command in the body of your email message: > > unsubscribe san-diego-pm-list > > If you ever need to get in contact with the owner of the list, > (if you have trouble unsubscribing, or have questions about the > list itself) send email to . > This is the general rule for most mailing lists when you need > to contact a human. > ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From joe at artlung.com Tue Dec 5 00:50:08 2000 From: joe at artlung.com (Joe Crawford) Date: Thu Aug 5 00:20:13 2004 Subject: Web browser providing visibility References: <200012050152.RAA11117@pirr.sd.conexant.com> Message-ID: <3A2C9018.1506EEF7@artlung.com> ~sdpm~ Hello John... "John R. Comeau" wrote: > ~sdpm~ > This isn't exactly a Perl question, but I do have a Perl project in > mind eventually. Does anyone know of a browser that provides > visibility to all the HTTP commands that are sent across the network? > That is, I'd like to see the full text of all the HTTP messages that > I'm sending and receiving for GETs and POSTs. Interesting question: found this reference from the O'Reilly book "Web Client Programming with Perl": http://www.oreilly.com/openbook/webclient/ch03.html#40010 And this article ("HTTP Headers Revealed!") : http://hotwired.lycos.com/webmonkey/99/36/index3a.html has this: Unfortunately, the most common browsers don't allow you to see the underlying HTTP communication that causes these actions. (Hey, if you happen to work on a browser development team, here's an idea for a useful new feature!) The notable exception is Lynx. If you telnet into just about any Unix box and start up Lynx with the -mime_header flag, it will give you back the raw HTTP. So if you have access to a lynx, then you can do it. [artlung@(HOST):~]$ lynx -mime_header http://www.google.com HTTP/1.0 200 OK Date: Tue, 05 Dec 2000 06:45:58 GMT Server: GWS/1.10 Connection: close Set-Cookie: PREF=ID=3106a66c4157b265:TM=975998758:LM=975998758; domain=.google.com; path=/; expires=Sun, 17-Jan-2038 19:14:07 GMT Content-Type: text/html Content-Length: 1805 Google... Now, if you're wanting to see cookies interacting, and referers and suchlike, this is not much of a solution. On another note, a great source of browsers is http://browsers.evolt.org/ - I have no idea if there's one which comes with a "view HTTP source" a la a java console window, javascript debugger window, view source window. And on another note - where's http://SanDiego.pm.org or http://san-diego.pm.org ?? Dead? Best of luck, Joe -- Joe Crawford * I am a Web Designer and Developer; * Find out about me at : http://www.ArtLung.com * A Mailing List for San Diego Web Folks : http://WebSanDiego.org ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From brick at fastpack.com Tue Dec 5 01:40:11 2000 From: brick at fastpack.com (Brick Robbins) Date: Thu Aug 5 00:20:13 2004 Subject: Web browser providing visibility In-Reply-To: <3A2C9018.1506EEF7@artlung.com> References: <200012050152.RAA11117@pirr.sd.conexant.com> Message-ID: <4.2.2.20001204233228.00d20100@fastpack.com> ~sdpm~ Here is a quick, inelegant hack I put together a while back to see the http headers and save various files the command line. works for HTML, and other binaries. It was written for a WIN box, but should work for most. Any suggestions appreciated. =========begin============== #!/usr/local/bin/perl # server.pl $save_path = "c:\\windows\\desktop\\"; use Socket; $|=1; if (!defined ($ARGV[0])){ print "you must specify a server.\n\n Proper use: perl server.pl www.domain.com/[url] [action] [file]\n where action is the http method, usually GET, HEAD, POST (HEAD is default)\n and file specifies a filename in $save_path (optional) where the stuff from the server gets saved\n"; exit; } if ($ARGV[2]){ print "opening file $save_path$ARGV[2] for writing\n"; open (SAVE, ">$save_path$ARGV[2]") || die "unable to save file $ARGV[2]: $!\n"; binmode SAVE; } $ARGV[0] =~ s/^http:\/\///i; ($remote_server,$URL) = split (/\//,$ARGV[0],2); ($remote_server,$port) = split (/:/,$remote_server,2); $port="80" unless $port; if ($ARGV[1]){ $action = uc ($ARGV[1]); }else { $action = "HEAD"; } ########################## if (!defined ($URL)){ $URL = "/"; }else { $URL = "/$URL"; } # # open the TCP socket # print "connecting to:$remote_server port $port\n"; open_TCP("FILE","$remote_server",$port) || die("open_TCP failed"); binmode FILE; # # make the POST header # $headHeader="$action $URL HTTP/1.1 User-Agent: Mozilla/4.01 [en] (Win95; I) Host: $remote_server Accept: */*, image/gif, image/x-xbitmap, image/jpeg "; print FILE "$headHeader"; #send the post header to the server print "Sending reqest for $URL to $remote_server == $headHeader == Here is the response: == "; $i=0; while (){ $a[$i++]=$_; ($_ =~ m@@i ) && close(FILE); if (($action =~ /HEAD/i) && ($_ =~ /^\s$/)){ close (FILE); } } #get the html doc back from the server close (FILE); print @a; if ($ARGV[2]){ print SAVE "@a"; close SAVE || print "error closing SAVE"; } print "\n===done===\n"; exit; ######################################### # # opens a TCP socket to the server specified # # $FS - file handle # $dest - server URL # $port - server port, defaults to 80 # ########################################### sub open_TCP{ my ($FS, $dest, $port) = @_; $port || ($port = 80); #default port to 80 my(@proto) = getprotobyname('tcp'); socket($FS, PF_INET, SOCK_STREAM, $proto[2]) || die("died in first socket call:$!"); my $sin = sockaddr_in ($port,inet_aton($dest)); connect ($FS,$sin) || die("died in connect: $!"); my ($old_fh) = select ($FS); select ($old_fh); return (1); } ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From rkleeman at neta.com Fri Dec 15 17:51:43 2000 From: rkleeman at neta.com (Bobby Kleemann) Date: Thu Aug 5 00:20:13 2004 Subject: Perl Conference 5 Message-ID: ~sdpm~ >From http://use.perl.org/news/00/12/14/1815249.shtml Perl Conference 5 Call For Participation posted by pudge on Thursday December 14, @01:09PM The Call For Participation for TPC5 is up. The conference will be held at the Sheraton San Diego Hotel and Marina, San Diego, California, July 23-27, 2001. See the link for information on proposals. Refereed paper abstracts are due January 20, 2001. Tutorial and presentation proposals are due February 1, 2001. Is anyone planning on presenting anything? What about a SD Perl Monger presentation? Or shoul we just try to arrange a gathering? _ _ _ Bobby Kleemann http://www.neta.com/~rkleeman/ ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From todd.rockhold at ontogen.com Fri Dec 15 19:55:08 2000 From: todd.rockhold at ontogen.com (Todd Rockhold) Date: Thu Aug 5 00:20:14 2004 Subject: Perl Conference 5 Message-ID: <00Dec15.181049pst.118082@gateway.ontogen.com> ~sdpm~ I'd like to see us present something, but sparse recent meeting attendance and little recent traffic on the email list lead me to suspect that it might be more realistic to try to arrange a gathering. I would not be able to do this on my own, but one idea (not very sexy but perhaps useful to some people) is a presentation on what works OK on *nix but not on Win32. > -----Original Message----- > From: Bobby Kleemann [SMTP:rkleeman@neta.com] > Sent: Friday, December 15, 2000 3:52 PM > To: San Diego Perl Mongers > Subject: Perl Conference 5 > > ~sdpm~ > From http://use.perl.org/news/00/12/14/1815249.shtml > > Perl Conference 5 Call For Participation > > posted by pudge on Thursday December 14, @01:09PM > > The Call For Participation for TPC5 is up. The > conference will be held at the Sheraton San > Diego Hotel and Marina, San Diego, > California, July 23-27, 2001. See the link for > information on proposals. Refereed paper > abstracts are due January 20, 2001. Tutorial > and presentation proposals are due February 1, > 2001. > > Is anyone planning on presenting anything? What about a SD Perl Monger > presentation? Or shoul we just try to arrange a gathering? > > _ _ _ > Bobby Kleemann > http://www.neta.com/~rkleeman/ > > ~sdpm~ > > The posting address is: san-diego-pm-list@hfb.pm.org > > List requests should be sent to: majordomo@hfb.pm.org > > If you ever want to remove yourself from this mailing list, > you can send mail to with the following > command in the body of your email message: > > unsubscribe san-diego-pm-list > > If you ever need to get in contact with the owner of the list, > (if you have trouble unsubscribing, or have questions about the > list itself) send email to . > This is the general rule for most mailing lists when you need > to contact a human. ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From canetguy at home.com Fri Dec 15 11:20:05 2000 From: canetguy at home.com (Garrett Casey) Date: Thu Aug 5 00:20:14 2004 Subject: SDPM Server Down Message-ID: <200012150920050440.0452F4CD@mail> ~sdpm~ Mike, would you check the SanDiego.pm.org server. The page is down. This is a reminder that our next Perl Mongers meeting will be this coming WED. Details will be posted on the web site. I have also received several more back issues of The Perl Journal, and will be handing them out for free at the meeting (Bruce, I have some set aside for you :) -Garrett ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From canetguy at home.com Wed Dec 20 14:06:24 2000 From: canetguy at home.com (Garrett Casey) Date: Thu Aug 5 00:20:14 2004 Subject: SDPM Meeting Tonight Message-ID: <200012201206240420.04D7D663@mail> ~sdpm~ This is a reminder notice that our monthly meeting will be held tonight. It will be a general discussion. Our friends at the head PM.org office shipped some Perl Journals on the 14th of DEC. I have not received them yet. Maybe this afternoon? At the meeting, it will be announced that Bobby Kleemann will be taking over the responsibilities of leader of our group. Bobby has been a member of the San Diego Perl Mongers since the very first meeting and I know he will do a kick a** job! I feel I can no longer do the job justice... Also, I may move to NY :) So stop by to meet (if you have not already) Bobby. Hopefully I will have the Perl Journals. I will also have some O'Reilly catalogs (which as a monger, you get 20% of their list prices). See you tonight! -Garrett Casey P.S. The location is the 8380 Miramar Mall 92121, General Meeting Room (as usual). Detailed directions are on our web page http://SanDiego.pm.org. ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From todd.rockhold at ontogen.com Fri Dec 22 14:13:26 2000 From: todd.rockhold at ontogen.com (Todd Rockhold) Date: Thu Aug 5 00:20:14 2004 Subject: New toys for Xmas Message-ID: <00Dec22.122851pst.118082@gateway.ontogen.com> ~sdpm~ Beta on Win32, "Technology Preview" (== pre-Beta?) on Linux, sssslllloooowwww (at least on my iron), but with some pretty cool features: Komodo from ActiveState: http://www.ActiveState.com/Products/Komodo/ If you want to join yet another email discussion list: http://mailarchive.ActiveState.com/subs/komodo-discuss or send a message (can be blank) to: komodo-discuss-request@listserv.ActiveState.com FWIW, I don't work for ActiveState, don't date the CEO's daughter, etc. etc. -- just thought that in case some of the SDPM's don't know about it and would like a test drive I'd mention it. ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From canetguy at home.com Thu Dec 28 19:17:36 2000 From: canetguy at home.com (Garrett Casey) Date: Thu Aug 5 00:20:14 2004 Subject: San Diego Perl Mongers Message-ID: <200012281717360120.2134F56E@mail> ~sdpm~ During last month's meeting we discussed the need to increase the activity on the mailing list. One suggestion was simply to post little code challenge. The idea is that some "thing" is presented to the group and everyone could write their own code and post it to the mailing list. Perl, of course, will allow an individual to solve a single problem many ways. This means, as a group, we will most likely have the exact same coding solution presented by two or more people. Therefore, do not post a solution or code that has already been disseminated to the group. Ok, let's start. I am currently reading "The Pleasure of Finding Things Out." It is the best short works of Richard P. Feynman. In chapter 2, Computer Machines in the Future, he talks about reducing the size of computers. He talks about a NAND gate (meaning NOT-AND). We can illustrate a NAND gate via Perl with something like $c = !($a and $b); A problem that he states is that this "gate" is irreversible. If you only know the output, you cannot recover the input. For instance, if we know that the output is now 1, we don't know whether it came from A=0, B=1, or A=1, B=0, or A=0, B=0. He then talks about a reversible gate, where no information is lost "It has three inputs and three outputs. Of the outputs, two, A` and B`, are the same as two of the inputs, A and B, but the third input works this way. C' is the same as C unless A and B are both 1, in which case it changes whatever C is. For instance, if C is 1 it is changed to 0, if C is 0 it is changed to 1 - but these changes only happen if both A and B are 1." The reversible gate is very easy to code in Perl, so everyone can participate. The first challenge will be to create a function that takes in 3 values and performs the logic of this reversible gate. When you are done, email the group with your solution. Let's see how many different coding solutions the San Diego Perl Mongers can come up with. REMEMBER, do not provide a solution that has already been posted earlier to the group. ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From todd.rockhold at ontogen.com Thu Dec 28 20:59:02 2000 From: todd.rockhold at ontogen.com (Todd Rockhold) Date: Thu Aug 5 00:20:14 2004 Subject: Another perl coding challenge Message-ID: <00Dec28.191710pst.118081@gateway.ontogen.com> ~sdpm~ Probably not as fun as Garrett's "reversible NAND gate" problem, but here is one I have encountered. I have a test system (Perl 5.6) and a production system (Perl 5.005). I would like to run the tree walker on the production system. The following code walks a directory tree if run with Perl 5.6 but fails with earlier versions. How do I modify it so that it will work with Perl 5.005? ---------------------------------------------------------------------------- -------------------------------------------------------------- my $DIR = "//yogi/yogidata/OntoCHROMRun/TestRuns"; # contains well files my $it = make_treewalker($DIR, \&is_well_file, sub {@{$_[1]}}); while (defined (my $f_it=$it->())) { # process the interesting file print "found file: $f_it\n"; } sub make_treewalker #black magic to walk the directory tree { my @queue = shift(); my ($is_interesting, $userparam) = @_; return sub { while(1) { return undef unless @queue; my $cur = shift @queue; if (-d $cur && opendir my $dh, $cur) { my @files = grep {$_ ne '.' && $_ ne '..'} (readdir $dh); push @queue, map {"$cur/$_"} @files; } return $cur if $is_interesting->($cur, $userparam); } } } sub is_well_file # what files do we care about? { return () unless -f $_[0] && -T $_[0]; # gotta be a simple file return () unless open FH, "< $_[0]"; # gotta be able to open it return ($_[0]) if $_[0] =~ /\.wel/i ; # gotta be a .WEL file return (); } ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From eugene at securityarchitects.com Fri Dec 29 04:35:56 2000 From: eugene at securityarchitects.com (Eugene Tsyrklevich) Date: Thu Aug 5 00:20:14 2004 Subject: Another perl coding challenge In-Reply-To: <00Dec28.191710pst.118081@gateway.ontogen.com>; from todd.rockhold@ontogen.com on Thu, Dec 28, 2000 at 06:59:02PM -0800 References: <00Dec28.191710pst.118081@gateway.ontogen.com> Message-ID: <20001229023556.B25572@securityarchitects.com> ~sdpm~ perldoc File::Find use File::Find; find({/\.wel$/ && -f $_ && -T _ && -r _ && print}, $DIR); good enough? ;-) cheers On Thu, Dec 28, 2000 at 06:59:02PM -0800, Todd Rockhold wrote: > ~sdpm~ > Probably not as fun as Garrett's "reversible NAND gate" problem, but here is > one I have encountered. I have a test system (Perl 5.6) and a production > system (Perl 5.005). I would like to run the tree walker on the production > system. > > The following code walks a directory tree if run with Perl 5.6 but fails > with earlier versions. How do I modify it so that it will work with Perl > 5.005? > > ---------------------------------------------------------------------------- > -------------------------------------------------------------- > > my $DIR = "//yogi/yogidata/OntoCHROMRun/TestRuns"; # contains well files > my $it = make_treewalker($DIR, \&is_well_file, sub {@{$_[1]}}); > while (defined (my $f_it=$it->())) > { > # process the interesting file > print "found file: $f_it\n"; > } > > sub make_treewalker #black magic to walk the directory tree > { > my @queue = shift(); > my ($is_interesting, $userparam) = @_; > return sub > { > while(1) > { > return undef unless @queue; > my $cur = shift @queue; > if (-d $cur && opendir my $dh, $cur) > { > my @files = grep {$_ ne '.' && $_ ne '..'} (readdir $dh); > push @queue, map {"$cur/$_"} @files; > } > return $cur if $is_interesting->($cur, $userparam); > } > } > } > > > sub is_well_file # what files do we care about? > { > return () unless -f $_[0] && -T $_[0]; # gotta be a simple file > return () unless open FH, "< $_[0]"; # gotta be able to open it > return ($_[0]) if $_[0] =~ /\.wel/i ; # gotta be a .WEL file > return (); > } ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From taa0 at cris.com Fri Dec 29 12:08:28 2000 From: taa0 at cris.com (Tom Adams) Date: Thu Aug 5 00:20:14 2004 Subject: Another perl coding challenge References: <00Dec28.191710pst.118081@gateway.ontogen.com> Message-ID: <3A4CD31C.750AE14A@cris.com> Apparently Perl 5.005 doesn't like the variable directory handle $dh (it doesn't seem to bother Perl 5.6). FWIW, I prefer Eugene's solution. Here's a dirt-simple answer to Garrett's challenge. Any more interesting ones? Todd Rockhold wrote: > ~sdpm~ > Probably not as fun as Garrett's "reversible NAND gate" problem, but here is > one I have encountered. I have a test system (Perl 5.6) and a production > system (Perl 5.005). I would like to run the tree walker on the production > system. > > The following code walks a directory tree if run with Perl 5.6 but fails > with earlier versions. How do I modify it so that it will work with Perl > 5.005? > > ---------------------------------------------------------------------------- > -------------------------------------------------------------- > > my $DIR = "//yogi/yogidata/OntoCHROMRun/TestRuns"; # contains well files > my $it = make_treewalker($DIR, \&is_well_file, sub {@{$_[1]}}); > while (defined (my $f_it=$it->())) > { > # process the interesting file > print "found file: $f_it\n"; > } > > sub make_treewalker #black magic to walk the directory tree > { > my @queue = shift(); > my ($is_interesting, $userparam) = @_; > return sub > { > while(1) > { > return undef unless @queue; > my $cur = shift @queue; > if (-d $cur && opendir my $dh, $cur) > { > my @files = grep {$_ ne '.' && $_ ne '..'} (readdir $dh); > push @queue, map {"$cur/$_"} @files; > } > return $cur if $is_interesting->($cur, $userparam); > } > } > } > > sub is_well_file # what files do we care about? > { > return () unless -f $_[0] && -T $_[0]; # gotta be a simple file > return () unless open FH, "< $_[0]"; # gotta be able to open it > return ($_[0]) if $_[0] =~ /\.wel/i ; # gotta be a .WEL file > return (); > } > > ~sdpm~ > > The posting address is: san-diego-pm-list@hfb.pm.org > > List requests should be sent to: majordomo@hfb.pm.org > > If you ever want to remove yourself from this mailing list, > you can send mail to with the following > command in the body of your email message: > > unsubscribe san-diego-pm-list > > If you ever need to get in contact with the owner of the list, > (if you have trouble unsubscribing, or have questions about the > list itself) send email to . > This is the general rule for most mailing lists when you need > to contact a human. -------------- next part -------------- A non-text attachment was scrubbed... Name: 3GATE.PL Type: application/x-perl Size: 479 bytes Desc: not available Url : http://mail.pm.org/archives/san-diego-pm/attachments/20001229/f4da00bc/3GATE.bin