From v.velox at vvelox.net Fri Oct 1 06:49:40 2010 From: v.velox at vvelox.net (Zane C.B.) Date: Fri, 1 Oct 2010 08:49:40 -0500 Subject: [Chicago-talk] IO::Socket::SSL issues Message-ID: <20101001084940.026d6835@vixen42.vulpes.vvelox.net> Any one know of any issues with "IO::Socket::SSL"? I've been running into issues with verification with it. #!/usr/bin/perl use Data::Dumper; use IO::Socket::SSL; my $c=IO::Socket::SSL->new("google.com:443", SSL_verifycn_scheme=>"http", SSL_ca_file=>"/usr/local/share/certs/ca-root-nss.crt", SSL_verify_mode=>0x01, SSL_verifycn_name=>"google.com", # SSL_verify_callback=>\&{ print Dumper(\@_) }, # SSL_error_trap=>\&{ print Dumper(\@_) } ) || warn(IO::Socket::SSL::errstr); print Dumper( $c->errstr, $c->opened, $c->dump_peer_certificate, $c->peer_certificate, $c->peer_certificate("authority"), $c->peer_certificate("owner"), $c->peer_certificate("commonName"), ); From joshua.mcadams at gmail.com Mon Oct 4 07:00:47 2010 From: joshua.mcadams at gmail.com (Joshua) Date: Mon, 4 Oct 2010 09:00:47 -0500 Subject: [Chicago-talk] Book trade and social meeting on September 21st In-Reply-To: References: Message-ID: Any interest in doing this on Tuesday (Oct 5) or Thursday (Oct 7). I chatted with brian offline and he suggested just a purely social meetup. Preferences? On Sun, Sep 19, 2010 at 11:49 PM, Joshua wrote: > Let's have a book trade/give-away and social Perl Mongers meeting on > September 21st. Bring a good bag because I have quite a few to > contribute :) > > We can meet up at the Google office: 20 W Kinzie, 17th floor at 7:00 > pm. If anyone wants to give a talk, they are more than welcome to. > After we are done with talks and books, we can migrate over to a local > bar (Rock Bottom?) and have a few drinks to celebrate the end of > summer :) > > Please RSVP to me so that I can have you on the security list for the building. > > See you there, > Josh > From frag at ripco.com Mon Oct 4 08:14:19 2010 From: frag at ripco.com (Mike Fragassi) Date: Mon, 4 Oct 2010 10:14:19 -0500 (CDT) Subject: [Chicago-talk] Book trade and social meeting on September 21st In-Reply-To: References: Message-ID: I can't do it Thursday. Only Tuesday or Wednesday. - Mike F. From sean at blanton.com Mon Oct 4 08:57:36 2010 From: sean at blanton.com (Sean Blanton) Date: Mon, 4 Oct 2010 10:57:36 -0500 Subject: [Chicago-talk] Book trade and social meeting on September 21st In-Reply-To: References: Message-ID: I'll try yet again. Tuesday or Thursday works. On Mon, Oct 4, 2010 at 10:14 AM, Mike Fragassi wrote: > > I can't do it Thursday. Only Tuesday or Wednesday. > > - Mike F. > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joshua.mcadams at gmail.com Mon Oct 4 09:10:12 2010 From: joshua.mcadams at gmail.com (Joshua) Date: Mon, 4 Oct 2010 11:10:12 -0500 Subject: [Chicago-talk] Book trade and social meeting on September 21st In-Reply-To: References: Message-ID: Okay, sounds like we'll be having a Chicago.pm Social Meeting on Tuesday October 5th at Rock Bottom Brewery on Grand and State. I'll try to be there around 6:30 to grab a table or two. I cleaned my bookshelf for my upcoming move, so I'm going to have quite a few books to give away. Come early for the best selection :) On Mon, Oct 4, 2010 at 9:00 AM, Joshua wrote: > Any interest in doing this on Tuesday (Oct 5) or Thursday (Oct 7). > > I chatted with brian offline and he suggested just a purely social meetup. > > Preferences? > > On Sun, Sep 19, 2010 at 11:49 PM, Joshua wrote: >> Let's have a book trade/give-away and social Perl Mongers meeting on >> September 21st. Bring a good bag because I have quite a few to >> contribute :) >> >> We can meet up at the Google office: 20 W Kinzie, 17th floor at 7:00 >> pm. If anyone wants to give a talk, they are more than welcome to. >> After we are done with talks and books, we can migrate over to a local >> bar (Rock Bottom?) and have a few drinks to celebrate the end of >> summer :) >> >> Please RSVP to me so that I can have you on the security list for the building. >> >> See you there, >> Josh >> > From hwigoda at mindspring.com Mon Oct 4 10:12:06 2010 From: hwigoda at mindspring.com (Hal Wigoda) Date: Mon, 4 Oct 2010 12:12:06 -0500 Subject: [Chicago-talk] Book trade and social meeting on September 21st In-Reply-To: References: Message-ID: <36C1BF1F-C546-4DC4-867A-208C260FE194@mindspring.com> Where r u moving to? Locally or cal? ------- On Oct 4, 2010, at 11:10 AM, Joshua wrote: > Okay, sounds like we'll be having a Chicago.pm Social Meeting on > Tuesday October 5th at Rock Bottom Brewery on Grand and State. I'll > try to be there around 6:30 to grab a table or two. > > I cleaned my bookshelf for my upcoming move, so I'm going to have > quite a few books to give away. Come early for the best selection :) > > On Mon, Oct 4, 2010 at 9:00 AM, Joshua wrote: >> Any interest in doing this on Tuesday (Oct 5) or Thursday (Oct 7). >> >> I chatted with brian offline and he suggested just a purely social meetup. >> >> Preferences? >> >> On Sun, Sep 19, 2010 at 11:49 PM, Joshua wrote: >>> Let's have a book trade/give-away and social Perl Mongers meeting on >>> September 21st. Bring a good bag because I have quite a few to >>> contribute :) >>> >>> We can meet up at the Google office: 20 W Kinzie, 17th floor at 7:00 >>> pm. If anyone wants to give a talk, they are more than welcome to. >>> After we are done with talks and books, we can migrate over to a local >>> bar (Rock Bottom?) and have a few drinks to celebrate the end of >>> summer :) >>> >>> Please RSVP to me so that I can have you on the security list for the building. >>> >>> See you there, >>> Josh >>> >> > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk From merlyn at stonehenge.com Mon Oct 4 10:16:30 2010 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: Mon, 04 Oct 2010 10:16:30 -0700 Subject: [Chicago-talk] Book trade and social meeting on September 21st In-Reply-To: (Joshua's message of "Mon, 4 Oct 2010 11:10:12 -0500") References: Message-ID: <86aamt98up.fsf@red.stonehenge.com> >>>>> "Joshua" == Joshua writes: Joshua> I cleaned my bookshelf for my upcoming move, so I'm going to have Joshua> quite a few books to give away. Come early for the best Joshua> selection :) I'm moving too, and I have about 250 O'Reilly titles that won't have room in the much smaller apartment. I've decided to donate them to FreeGeek, the local commodity computer recycler and host of many open source meetings, so they can have them for their already eclectic library. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.posterous.com/ for Smalltalk discussion From joshua.mcadams at gmail.com Mon Oct 4 10:30:16 2010 From: joshua.mcadams at gmail.com (Joshua) Date: Mon, 4 Oct 2010 12:30:16 -0500 Subject: [Chicago-talk] Book trade and social meeting on September 21st In-Reply-To: <36C1BF1F-C546-4DC4-867A-208C260FE194@mindspring.com> References: <36C1BF1F-C546-4DC4-867A-208C260FE194@mindspring.com> Message-ID: Temporarily in WA On Mon, Oct 4, 2010 at 12:12 PM, Hal Wigoda wrote: > Where r u moving to? ?Locally or cal? > > ------- > > On Oct 4, 2010, at 11:10 AM, Joshua wrote: > >> Okay, sounds like we'll be having a Chicago.pm Social Meeting on >> Tuesday October 5th at Rock Bottom Brewery on Grand and State. I'll >> try to be there around 6:30 to grab a table or two. >> >> I cleaned my bookshelf for my upcoming move, so I'm going to have >> quite a few books to give away. Come early for the best selection :) >> >> On Mon, Oct 4, 2010 at 9:00 AM, Joshua wrote: >>> Any interest in doing this on Tuesday (Oct 5) or Thursday (Oct 7). >>> >>> I chatted with brian offline and he suggested just a purely social meetup. >>> >>> Preferences? >>> >>> On Sun, Sep 19, 2010 at 11:49 PM, Joshua wrote: >>>> Let's have a book trade/give-away and social Perl Mongers meeting on >>>> September 21st. Bring a good bag because I have quite a few to >>>> contribute :) >>>> >>>> We can meet up at the Google office: 20 W Kinzie, 17th floor at 7:00 >>>> pm. If anyone wants to give a talk, they are more than welcome to. >>>> After we are done with talks and books, we can migrate over to a local >>>> bar (Rock Bottom?) and have a few drinks to celebrate the end of >>>> summer :) >>>> >>>> Please RSVP to me so that I can have you on the security list for the building. >>>> >>>> See you there, >>>> Josh >>>> >>> >> _______________________________________________ >> Chicago-talk mailing list >> Chicago-talk at pm.org >> http://mail.pm.org/mailman/listinfo/chicago-talk > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > From joshua.mcadams at gmail.com Tue Oct 5 09:40:37 2010 From: joshua.mcadams at gmail.com (Joshua) Date: Tue, 5 Oct 2010 11:40:37 -0500 Subject: [Chicago-talk] Reminder: Perl Mongers Social Outing Today @ 6:30pm @ Rock Bottom Brewery Message-ID: Just a friendly reminder that some of us Perl-oriented folks will be getting together today at Rock Bottom brewery on Grand & State. I plan on arriving around 6:30 pm. See you there. From brian.d.foy at gmail.com Tue Oct 5 12:50:26 2010 From: brian.d.foy at gmail.com (brian d foy) Date: Tue, 5 Oct 2010 14:50:26 -0500 Subject: [Chicago-talk] Perl mongers at the Bulls versus some other team, Oct 15 Message-ID: Josh and I are going to the Bulls game on October 15, and Groupon has half price tickets today. Any other Perl mongers want to join us, have a drink at half-time, etc? -- brian d foy http://www.pair.com/~comdog/ From joshua.mcadams at gmail.com Tue Oct 5 12:57:14 2010 From: joshua.mcadams at gmail.com (Joshua) Date: Tue, 5 Oct 2010 14:57:14 -0500 Subject: [Chicago-talk] Perl mongers at the Bulls versus some other team, Oct 15 In-Reply-To: References: Message-ID: brian failed to mention that there is a "special guest" signing the national anthem that day :) On Tue, Oct 5, 2010 at 2:50 PM, brian d foy wrote: > Josh and I are going to the Bulls game on October 15, and Groupon has > half price tickets today. Any other Perl mongers want to join us, have > a drink at half-time, etc? > > -- > brian d foy > http://www.pair.com/~comdog/ > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > From joshua.mcadams at gmail.com Tue Oct 5 12:57:25 2010 From: joshua.mcadams at gmail.com (Joshua) Date: Tue, 5 Oct 2010 14:57:25 -0500 Subject: [Chicago-talk] Perl mongers at the Bulls versus some other team, Oct 15 In-Reply-To: References: Message-ID: And no, it is not brian or I :) On Tue, Oct 5, 2010 at 2:57 PM, Joshua wrote: > brian failed to mention that there is a "special guest" signing the > national anthem that day :) > > On Tue, Oct 5, 2010 at 2:50 PM, brian d foy wrote: >> Josh and I are going to the Bulls game on October 15, and Groupon has >> half price tickets today. Any other Perl mongers want to join us, have >> a drink at half-time, etc? >> >> -- >> brian d foy >> http://www.pair.com/~comdog/ >> _______________________________________________ >> Chicago-talk mailing list >> Chicago-talk at pm.org >> http://mail.pm.org/mailman/listinfo/chicago-talk >> > From andy at petdance.com Tue Oct 5 13:00:13 2010 From: andy at petdance.com (Andy Lester) Date: Tue, 5 Oct 2010 15:00:13 -0500 Subject: [Chicago-talk] Perl mongers at the Bulls versus some other team, Oct 15 In-Reply-To: References: Message-ID: On Oct 5, 2010, at 2:57 PM, Joshua wrote: > brian failed to mention that there is a "special guest" signing the > national anthem that day :) Do you mean someone will be translating the "Star Spangled Banner" into sign language? Or will he/she be writing his/her name on a printed copy of the lyrics? xoa -- Andy Lester => andy at petdance.com => www.theworkinggeek.com => AIM:petdance From joshua.mcadams at gmail.com Tue Oct 5 13:04:26 2010 From: joshua.mcadams at gmail.com (Joshua) Date: Tue, 5 Oct 2010 15:04:26 -0500 Subject: [Chicago-talk] Perl mongers at the Bulls versus some other team, Oct 15 In-Reply-To: References: Message-ID: Doh, fat fingers :) singing On Tue, Oct 5, 2010 at 3:00 PM, Andy Lester wrote: > > On Oct 5, 2010, at 2:57 PM, Joshua wrote: > >> brian failed to mention that there is a "special guest" signing the >> national anthem that day :) > > Do you mean someone will be translating the "Star Spangled Banner" into sign language? ?Or will he/she be writing his/her name on a printed copy of the lyrics? > > xoa > > -- > Andy Lester => andy at petdance.com => www.theworkinggeek.com => AIM:petdance > > > > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > From andy at petdance.com Tue Oct 5 13:05:23 2010 From: andy at petdance.com (Andy Lester) Date: Tue, 5 Oct 2010 15:05:23 -0500 Subject: [Chicago-talk] Perl mongers at the Bulls versus some other team, Oct 15 In-Reply-To: References: Message-ID: <470086F8-A886-47B6-BCD0-628B73EDA904@petdance.com> On Oct 5, 2010, at 3:04 PM, Joshua wrote: > Doh, fat fingers :) > > singing That's disappointing, 'cause when I first read it I was thinking there would be an actual signing, like a book signing. xoa -- Andy Lester => andy at petdance.com => www.theworkinggeek.com => AIM:petdance From michael at potter.name Sat Oct 9 13:18:10 2010 From: michael at potter.name (Michael Potter) Date: Sat, 9 Oct 2010 16:18:10 -0400 Subject: [Chicago-talk] Cron replacement Message-ID: Mongers, I am looking for a batch processing control program and hope that something has been written in Perl. Some features I am hoping this cron replacement would have: 1) a web interface that would allow the system administrator to suspend all or select tasks. 2) web interface should also display which tasks are currently running. 3) support complex start times such as each weekday as long as that day is not a holiday. 4) start tasks a specified number of minutes after it previously finished. 5) start tasks only after a set of previously specified tasks finish successfully. 6) track runtimes so unusual runtimes can be identified. I see a program called norc written in Python, but I don't think Python will fly at the client site. -- Michael Potter From tprinty at mail.edisonave.net Sat Oct 9 13:21:06 2010 From: tprinty at mail.edisonave.net (Tom Printy) Date: Sat, 09 Oct 2010 15:21:06 -0500 Subject: [Chicago-talk] Cron replacement In-Reply-To: References: Message-ID: <4CB0CEB2.2010300@mail.edisonave.net> How about hudson http://wiki.hudson-ci.org/display/HUDSON/Meet+Hudson On 10/9/10 3:18 PM, Michael Potter wrote: > Mongers, > > I am looking for a batch processing control program and hope that > something has been written in Perl. > > Some features I am hoping this cron replacement would have: > 1) a web interface that would allow the system administrator to > suspend all or select tasks. > 2) web interface should also display which tasks are currently running. > 3) support complex start times such as each weekday as long as that > day is not a holiday. > 4) start tasks a specified number of minutes after it previously finished. > 5) start tasks only after a set of previously specified tasks finish > successfully. > 6) track runtimes so unusual runtimes can be identified. > > I see a program called norc written in Python, but I don't think > Python will fly at the client site. -- -Tom Printy Office Hours: M-F 9:00am CT to 12:00pm CT www.edisonave.com 847-558-9154 From sean at blanton.com Mon Oct 11 10:27:47 2010 From: sean at blanton.com (Sean Blanton) Date: Mon, 11 Oct 2010 12:27:47 -0500 Subject: [Chicago-talk] Cron replacement In-Reply-To: <4CB0CEB2.2010300@mail.edisonave.net> References: <4CB0CEB2.2010300@mail.edisonave.net> Message-ID: I have similar needs for scheduling Perl script execution, and my goal is to use Terracotta Quartz via Java to execute Mojo jobs (which manage and run Perl execution). Mojo is for more general job execution than Hudson, which I find too simple and build-focused. Quartz has lots of features, like it understands holiday calendars - use a standard one or supply your own. The advantage of using Mojo is that you have a real time monitoring display from any client, and you get structure around executing Perl scripts or any other cmd line, like Git, including keeping arguments and environment variables. It has a web interface that will show HTML-wrappered logs, job summaries and execute jobs, and it also has a standalone Eclipse RCP GUI, which can instead be as plug-ins in to an existing Eclipse. So, while quartz may execute the Mojo job via a cmdline program, Mojo will execute the Perl, managing chaining or parallelization, capture the Perl output in HTML, assess success or failure, display red or green lines in the job monitor, email you a link to the HTML log, etc. With the job monitor, you can click a green or red line information line corresponding to a job step/perl script execution and it will pop up the HTML log. This lets you see within seconds of a failure the Perl stack trace from another machine on your desktop - that really helps me in my current role. Disclosure: Mojo is from my former employer OpenMake Software (in which I still have a microscopic share) and I had a hand in the design of features specifically for executing Perl-based jobs, but I had no hand in any bugs as I only helped in design ;) In my new job, I tried to give Hudson a fair evaluation, but it didn't have enough of the features I liked and was used to in Mojo. Clearly I'm still excited about using Mojo. Although Mojo is free, I'd recommend the few hundred dollars for a support contract if you can afford it.Being more general and sophisticated than Hudson also means more pieces to get working and more setup time. Support is very personal and responsive. Also, if you want to execute jobs on many servers, I think you have to buy additional agents, but I used Perl that looped over machines using ssh to Linux and WMI for Windows instead of having to install a Mojo agent on every machine, which wasn't very practical regardless of cost. Quartz is free, too - you may only get some queries from their sales staff asking if you want to buy some related enterprise software. So far, I've gotten a Java program to use Quartz to schedule and execute a Perl-script-Mojo-job via Mojo's Java API, but I haven't coded in all the special scheduling needs due to priorities. I'm using Mojo's cron-like scheduler, ironically based on Quartz, in a brute force approach where jobs execute on holidays, but nothing bad happens. Regards, Sean Sean Blanton, Ph.D. Connect: http://www.linkedin.com/in/seanblanton On Sat, Oct 9, 2010 at 3:21 PM, Tom Printy wrote: > How about hudson http://wiki.hudson-ci.org/display/HUDSON/Meet+Hudson > > > > On 10/9/10 3:18 PM, Michael Potter wrote: > >> Mongers, >> >> I am looking for a batch processing control program and hope that >> something has been written in Perl. >> >> Some features I am hoping this cron replacement would have: >> 1) a web interface that would allow the system administrator to >> suspend all or select tasks. >> 2) web interface should also display which tasks are currently running. >> 3) support complex start times such as each weekday as long as that >> day is not a holiday. >> 4) start tasks a specified number of minutes after it previously finished. >> 5) start tasks only after a set of previously specified tasks finish >> successfully. >> 6) track runtimes so unusual runtimes can be identified. >> >> I see a program called norc written in Python, but I don't think >> Python will fly at the client site. >> > > > -- > -Tom Printy > Office Hours: M-F 9:00am CT to 12:00pm CT > www.edisonave.com > 847-558-9154 > > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From imranjj at gmail.com Mon Oct 11 10:37:41 2010 From: imranjj at gmail.com (imran javaid) Date: Mon, 11 Oct 2010 12:37:41 -0500 Subject: [Chicago-talk] Cron replacement In-Reply-To: References: Message-ID: Most solutions out there seem to be written in Java (e.g. Open Source Job Scheduler http://jobscheduler.sourceforge.net/ ). For a perl based solution, take a look at TaskForest: http://www.taskforest.com/ -imran On Sat, Oct 9, 2010 at 3:18 PM, Michael Potter wrote: > Mongers, > > I am looking for a batch processing control program and hope that > something has been written in Perl. > > Some features I am hoping this cron replacement would have: > 1) a web interface that would allow the system administrator to > suspend all or select tasks. > 2) web interface should also display which tasks are currently running. > 3) support complex start times such as each weekday as long as that > day is not a holiday. > 4) start tasks a specified number of minutes after it previously finished. > 5) start tasks only after a set of previously specified tasks finish > successfully. > 6) track runtimes so unusual runtimes can be identified. > > I see a program called norc written in Python, but I don't think > Python will fly at the client site. > -- > Michael Potter > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > From Andy_Bach at wiwb.uscourts.gov Tue Oct 12 08:28:10 2010 From: Andy_Bach at wiwb.uscourts.gov (Andy_Bach at wiwb.uscourts.gov) Date: Tue, 12 Oct 2010 10:28:10 -0500 Subject: [Chicago-talk] Fw: What problems do threads solve for you and how could your languagemake it easier Message-ID: I really like the question: "What kinds of non-sequential programming tasks do we want to make easy...and how would we like to be able to specify those tasks?" in a language design sort of way - but I've not needed threads (save for on http related hack) so - anybody out there got any ideas? Over on a P6 list: Damian Conway wrote: > Leon Timmermans wrote: > For the love of $DEITY, let's please not repeat ithreads! $AMEN! Backwards compatibility is not the major design criterion for Perl 6, so there's no need to recapitulate our own phylogeny here. The problem is: while most people can agree on what have proved to be unsatisfactory threading models, not many people can seem to agree on what would constititute a satisfactory threading model (or, possibly, models). What we really need is some anecdotal evidence from folks who are actually using threading in real-world situations (in *any* languages). What has worked in practice? What has worked well? What was painful? What was error-prone? And for which kinds of tasks? And we also need to stand back a little further and ask: is "threading" the right approach at all? Do threads work in *any* language? Are there better metaphors? Perhaps we need to think more Perlishly and reframe the entire question. Not: "What threading model do we need?", but: "What kinds of non-sequential programming tasks do we want to make easy...and how would we like to be able to specify those tasks?" As someone who doesn't (need to) use threading to solve the kinds of problems I work on, I'm well aware that I'm not the right person to help in this design work. We need those poor souls who already suffer under threads to share their tales of constant misery (and their occasional moments of triumph) so we can identify successful patterns of use and steal^Wborg^Wborrow the very best available solutions. Damian -------------- next part -------------- An HTML attachment was scrubbed... URL: From clydeforrester at gmail.com Wed Oct 13 20:14:37 2010 From: clydeforrester at gmail.com (Clyde Forrester) Date: Wed, 13 Oct 2010 22:14:37 -0500 Subject: [Chicago-talk] Which cgi-bin in Ubuntu? Message-ID: <4CB6759D.6080601@gmail.com> I am about to attempt primitive web experiments with Perl, and I've hit a snag. I'm using Ubuntu Linux 9.10 and Apache2. The general area for the server is in /var/www/, but the cgi-bin directory is in /usr/lib/. The two recommendations I've found by Googling are: 1. edit /etc/apache2/httpd.conf, or 2. create a symlink. Does anyone here have any strong opinions on this matter? Casual guesses? Reasonable advice? Clyde From andy at petdance.com Wed Oct 13 20:15:50 2010 From: andy at petdance.com (Andy Lester) Date: Wed, 13 Oct 2010 22:15:50 -0500 Subject: [Chicago-talk] Which cgi-bin in Ubuntu? In-Reply-To: <4CB6759D.6080601@gmail.com> References: <4CB6759D.6080601@gmail.com> Message-ID: On Oct 13, 2010, at 10:14 PM, Clyde Forrester wrote: > > The two recommendations I've found by Googling are: 1. edit /etc/apache2/httpd.conf, or 2. create a symlink. > > Does anyone here have any strong opinions on this matter? Casual guesses? Reasonable advice? It's a conf file. It's meant to be edited. Edit it. xoxo, Andy -- Andy Lester => andy at petdance.com => www.theworkinggeek.com => AIM:petdance From briank at kappacs.com Thu Oct 14 05:37:46 2010 From: briank at kappacs.com (Brian Katzung) Date: Thu, 14 Oct 2010 07:37:46 -0500 Subject: [Chicago-talk] Which cgi-bin in Ubuntu? In-Reply-To: <4CB6759D.6080601@gmail.com> References: <4CB6759D.6080601@gmail.com> Message-ID: <4CB6F99A.1060000@kappacs.com> Like so many things, I think the answer is either one, depending on what you want to accomplish. I would say that, more often then not, my servers end up being some sort of virtual host (either named or port-based). Therefore, my directory structure is usually along the lines of: /var/www/dom.ain.1/html/ /var/www/dom.ain.1/cgi/ /var/www/dom.ain.2/html/ /var/www/dom.ain.2/cgi/ This structure assumes that you will have different CGI (application-specific) scripts for different domains. If this is at least partially true, but you want to share some scripts across domains, you can link to specific scripts (residing in /usr/lib/cgi-bin) from the appropriate cgi sub-directory. If the domain is going to *only* use common/shared CGI (application-independent) scripts, you can skip the per-domain cgi directory and just ScriptAlias cgi off to /usr/lib/cgi-bin. If you need to use both models heavily, you might want to use separate cgi paths in order to use both directories at the same time. Another consideration is if there are some scripts in the /usr/lib/cgi-bin collection that you do NOT want to make available, in which case you are probably better going with the per-domain directory with links to the scripts you want available. Does that help you make an informed decision? - Brian On 2010-10-13 22:14, Clyde Forrester wrote: > I am about to attempt primitive web experiments with Perl, and I've > hit a snag. I'm using Ubuntu Linux 9.10 and Apache2. The general area > for the server is in /var/www/, but the cgi-bin directory is in > /usr/lib/. > > The two recommendations I've found by Googling are: 1. edit > /etc/apache2/httpd.conf, or 2. create a symlink. > > Does anyone here have any strong opinions on this matter? Casual > guesses? Reasonable advice? > > Clyde > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > > -- Brian Katzung, Kappa Computer Solutions, LLC Leveraging UNIX, GNU/Linux, open source, and custom software solutions for business and beyond Phone: 877.367.8837 x1 http://www.kappacs.com From clydeforrester at gmail.com Fri Oct 15 12:01:05 2010 From: clydeforrester at gmail.com (Clyde Forrester) Date: Fri, 15 Oct 2010 14:01:05 -0500 Subject: [Chicago-talk] Which cgi-bin in Ubuntu? In-Reply-To: <4CB6759D.6080601@gmail.com> References: <4CB6759D.6080601@gmail.com> Message-ID: <4CB8A4F1.3060703@gmail.com> I did not need to modify anything. A post from Craig Van Tassle on LUNI answered my questions. There is no ScriptAlias in httpd.conf, but there is one in /etc/apache2/sites-available/. So this allows the scripts in /usr/lib/cgi-bin/ to run from a phantom /var/www/cgi-bin/, but the files are otherwise isolated. And the trivial "Hello, CGI!" script worked just fine. Having taken the first few steps, I can now take more. Today the universe, tomorrow the world! Clyde Forrester wrote: > I am about to attempt primitive web experiments with Perl, and I've hit > a snag. I'm using Ubuntu Linux 9.10 and Apache2. The general area for > the server is in /var/www/, but the cgi-bin directory is in /usr/lib/. > > The two recommendations I've found by Googling are: 1. edit > /etc/apache2/httpd.conf, or 2. create a symlink. > > Does anyone here have any strong opinions on this matter? Casual > guesses? Reasonable advice? > > Clyde > From tigerpeng2001 at yahoo.com Tue Oct 19 09:41:10 2010 From: tigerpeng2001 at yahoo.com (tiger peng) Date: Tue, 19 Oct 2010 09:41:10 -0700 (PDT) Subject: [Chicago-talk] logging in and out files Message-ID: <784754.19176.qm@web120520.mail.ne1.yahoo.com> Hello all, Does anyone have the experience on tracing input/output files used by Perl script? I am think if there is anyway to over write the build-in open function, so the new open function can log the file name, IO type (R, W, or RW), as well as the open/close timestamp. Any suggestion is highly appreciated. Thanks, Tiger -------------- next part -------------- An HTML attachment was scrubbed... URL: From briank at kappacs.com Tue Oct 19 11:48:21 2010 From: briank at kappacs.com (Brian Katzung) Date: Tue, 19 Oct 2010 13:48:21 -0500 Subject: [Chicago-talk] logging in and out files In-Reply-To: <784754.19176.qm@web120520.mail.ne1.yahoo.com> References: <784754.19176.qm@web120520.mail.ne1.yahoo.com> Message-ID: <4CBDE7F5.6080007@kappacs.com> Tiger, Does the solution have to be in Perl? If you're on a *NIX platform, you might consider strace or truss to track the system calls you want at the OS level. - Brian On 2010-10-19 11:41, tiger peng wrote: > Hello all, > > Does anyone have the experience on tracing input/output files used by > Perl script? > > I am think if there is anyway to over write the build-in open > function, so the new open function can log the file name, IO type (R, > W, or RW), as well as the open/close timestamp. Any suggestion is > highly appreciated. > > Thanks, > Tiger > > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk -- Brian Katzung, Kappa Computer Solutions, LLC Leveraging UNIX, GNU/Linux, open source, and custom software solutions for business and beyond Phone: 877.367.8837 x1 http://www.kappacs.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From tigerpeng2001 at yahoo.com Wed Oct 20 07:55:44 2010 From: tigerpeng2001 at yahoo.com (tiger peng) Date: Wed, 20 Oct 2010 07:55:44 -0700 (PDT) Subject: [Chicago-talk] logging in and out files In-Reply-To: <784754.19176.qm@web120520.mail.ne1.yahoo.com> References: <784754.19176.qm@web120520.mail.ne1.yahoo.com> Message-ID: <249119.24778.qm@web120504.mail.ne1.yahoo.com> I wrapped the open as below, and it works for the open $fh, $file but not open FH, $file. As I need to apply the wrapping open function to lots of old script, I prefer only add one line: use myLoger 'open'; into the scripts Is there any suggestion? sub open{ my ($package, $file, $line_number) = caller(); my $fullpath = Cwd::abs_path($file); my $host = hostname(); _open_log({host=>hostname(), script=>Cwd::abs_path($file), file=>$_[1], } ); CORE::open(shift, shift) or die "Cannot open : $!\n"; } sub _open_log { ... } ________________________________ From: tiger peng To: Chicago.pm chatter Sent: Tue, October 19, 2010 11:41:10 AM Subject: [Chicago-talk] logging in and out files Hello all, Does anyone have the experience on tracing input/output files used by Perl script? I am think if there is anyway to over write the build-in open function, so the new open function can log the file name, IO type (R, W, or RW), as well as the open/close timestamp. Any suggestion is highly appreciated. Thanks, Tiger -------------- next part -------------- An HTML attachment was scrubbed... URL: From joshua.mcadams at gmail.com Wed Oct 20 13:29:53 2010 From: joshua.mcadams at gmail.com (Joshua) Date: Wed, 20 Oct 2010 15:29:53 -0500 Subject: [Chicago-talk] logging in and out files In-Reply-To: <249119.24778.qm@web120504.mail.ne1.yahoo.com> References: <784754.19176.qm@web120520.mail.ne1.yahoo.com> <249119.24778.qm@web120504.mail.ne1.yahoo.com> Message-ID: I haven't done this myself before, but it looks like some folks have and have put their work on CPAN: http://search.cpan.org/~cwest/ex-override-1.1/override.pm On Wed, Oct 20, 2010 at 9:55 AM, tiger peng wrote: > I wrapped the open as below, and it works for the open $fh, $file but not > open FH, $file. > > As I need to apply the wrapping open function to lots of old script, I > prefer only add one line: use myLoger 'open'; into the scripts > > Is there any suggestion? > > sub open{ > ??? my ($package, $file, $line_number) = caller(); > ??? my $fullpath? = Cwd::abs_path($file); > ??? my $host = hostname(); > ??? _open_log({host=>hostname(), > ?????????????? script=>Cwd::abs_path($file), > ?????????????? file=>$_[1], > ????????????? } > ????????????? ); > ??? CORE::open(shift, shift) or die "Cannot open : $!\n"; > } > > sub _open_log { > ... > } > > > ________________________________ > From: tiger peng > To: Chicago.pm chatter > Sent: Tue, October 19, 2010 11:41:10 AM > Subject: [Chicago-talk] logging in and out files > > Hello all, > > Does anyone have the experience on tracing input/output files used by Perl > script? > > I am think if there is anyway to over write the build-in open function, so > the new open function can log the file name, IO type (R, W, or RW), as well > as the open/close timestamp. Any suggestion is highly appreciated. > > Thanks, > Tiger > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > From tigerpeng2001 at yahoo.com Thu Oct 21 10:34:45 2010 From: tigerpeng2001 at yahoo.com (tiger peng) Date: Thu, 21 Oct 2010 10:34:45 -0700 (PDT) Subject: [Chicago-talk] logging in and out files In-Reply-To: References: <784754.19176.qm@web120520.mail.ne1.yahoo.com> <249119.24778.qm@web120504.mail.ne1.yahoo.com> Message-ID: <545936.91567.qm@web120511.mail.ne1.yahoo.com> Thanks, it looks a good tool and I will try it later. But my problem now is how to pass in and back the FH. It complains with error message: Can't use string ("FH") as a symbol ref while "strict refs" in use at /my/lib/myLogger.pm ... When I let it do not complain with "no strict 'refs';", it does not complain but FH seems not opened or not passed back, as the caller read nothing out. ________________________________ From: Joshua To: Chicago.pm chatter Sent: Wed, October 20, 2010 3:29:53 PM Subject: Re: [Chicago-talk] logging in and out files I haven't done this myself before, but it looks like some folks have and have put their work on CPAN: http://search.cpan.org/~cwest/ex-override-1.1/override.pm On Wed, Oct 20, 2010 at 9:55 AM, tiger peng wrote: > I wrapped the open as below, and it works for the open $fh, $file but not > open FH, $file. > > As I need to apply the wrapping open function to lots of old script, I > prefer only add one line: use myLoger 'open'; into the scripts > > Is there any suggestion? > > sub open{ > my ($package, $file, $line_number) = caller(); > my $fullpath = Cwd::abs_path($file); > my $host = hostname(); > _open_log({host=>hostname(), > script=>Cwd::abs_path($file), > file=>$_[1], > } > ); > CORE::open(shift, shift) or die "Cannot open : $!\n"; > } > > sub _open_log { > ... > } > > > ________________________________ > From: tiger peng > To: Chicago.pm chatter > Sent: Tue, October 19, 2010 11:41:10 AM > Subject: [Chicago-talk] logging in and out files > > Hello all, > > Does anyone have the experience on tracing input/output files used by Perl > script? > > I am think if there is anyway to over write the build-in open function, so > the new open function can log the file name, IO type (R, W, or RW), as well > as the open/close timestamp. Any suggestion is highly appreciated. > > Thanks, > Tiger > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > _______________________________________________ Chicago-talk mailing list Chicago-talk at pm.org http://mail.pm.org/mailman/listinfo/chicago-talk -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at petdance.com Thu Oct 21 11:29:18 2010 From: andy at petdance.com (Andy Lester) Date: Thu, 21 Oct 2010 13:29:18 -0500 Subject: [Chicago-talk] logging in and out files In-Reply-To: <545936.91567.qm@web120511.mail.ne1.yahoo.com> References: <784754.19176.qm@web120520.mail.ne1.yahoo.com> <249119.24778.qm@web120504.mail.ne1.yahoo.com> <545936.91567.qm@web120511.mail.ne1.yahoo.com> Message-ID: <0B928D9D-3D6D-4BA6-A00D-6F4759D020E8@petdance.com> On Oct 21, 2010, at 12:34 PM, tiger peng wrote: > It complains with error message: > Can't use string ("FH") as a symbol ref while "strict refs" in use at /my/lib/myLogger.pm ... > > When I let it do not complain with "no strict 'refs';", it does not complain but FH seems not opened or not passed back, as the caller read nothing out. All you have done by saying "no strict 'refs'" is to tell Perl to not tell you about your error. It's like covering your oil light on the dashboard of your car with a piece of tape. You don't get the annoying red blinking, but it doesn't change the fact that something is fundamentally wrong. xoa -- Andy Lester => andy at petdance.com => www.techworklove.com => AIM:petdance From imranjj at gmail.com Thu Oct 21 12:46:29 2010 From: imranjj at gmail.com (imran javaid) Date: Thu, 21 Oct 2010 14:46:29 -0500 Subject: [Chicago-talk] logging in and out files In-Reply-To: <545936.91567.qm@web120511.mail.ne1.yahoo.com> References: <784754.19176.qm@web120520.mail.ne1.yahoo.com> <249119.24778.qm@web120504.mail.ne1.yahoo.com> <545936.91567.qm@web120511.mail.ne1.yahoo.com> Message-ID: This might get you somewhere: use strict; use Symbol; sub myopen { if (ref(\$_[0]) eq 'SCALAR') { open ($_[0], $_[1]); } else { my $in = qualify_to_ref($_[0]); open($in, $_[1]); } } myopen(*FILE, ">file.txt") or die $!; print FILE "testing\n"; myopen(my $FILE2, ">file2.txt") or die $!; print $FILE2 "testing2\n"; If you remove "use strict;" then you can replace "*FILE" with "FILE", but can and should are not the same thing. -imran On Thu, Oct 21, 2010 at 12:34 PM, tiger peng wrote: > Thanks, it looks a good tool and I will try it later. > > But my problem now is how to pass in and back the FH. > > It complains with error message: > Can't use string ("FH") as a symbol ref while "strict refs" in use at > /my/lib/myLogger.pm ... > > When I let it do not complain with "no strict 'refs';", it does not complain > but FH seems not opened or not passed back, as the caller read nothing out. > > ________________________________ > From: Joshua > To: Chicago.pm chatter > Sent: Wed, October 20, 2010 3:29:53 PM > Subject: Re: [Chicago-talk] logging in and out files > > I haven't done this myself before, but it looks like some folks have > and have put their work on CPAN: > http://search.cpan.org/~cwest/ex-override-1.1/override.pm > > On Wed, Oct 20, 2010 at 9:55 AM, tiger peng wrote: >> I wrapped the open as below, and it works for the open $fh, $file but not >> open FH, $file. >> >> As I need to apply the wrapping open function to lots of old script, I >> prefer only add one line: use myLoger 'open'; into the scripts >> >> Is there any suggestion? >> >> sub open{ >> ??? my ($package, $file, $line_number) = caller(); >> ??? my $fullpath? = Cwd::abs_path($file); >> ??? my $host = hostname(); >> ??? _open_log({host=>hostname(), >> ?????????????? script=>Cwd::abs_path($file), >> ?????????????? file=>$_[1], >> ????????????? } >> ????????????? ); >> ??? CORE::open(shift, shift) or die "Cannot open : $!\n"; >> } >> >> sub _open_log { >> ... >> } >> >> >> ________________________________ >> From: tiger peng >> To: Chicago.pm chatter >> Sent: Tue, October 19, 2010 11:41:10 AM >> Subject: [Chicago-talk] logging in and out files >> >> Hello all, >> >> Does anyone have the experience on tracing input/output files used by Perl >> script? >> >> I am think if there is anyway to over write the build-in open function, so >> the new open function can log the file name, IO type (R, W, or RW), as >> well >> as the open/close timestamp. Any suggestion is highly appreciated. >> >> Thanks, >> Tiger >> >> _______________________________________________ >> Chicago-talk mailing list >> Chicago-talk at pm.org >> http://mail.pm.org/mailman/listinfo/chicago-talk >> > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > From tigerpeng2001 at yahoo.com Fri Oct 22 12:11:07 2010 From: tigerpeng2001 at yahoo.com (tiger peng) Date: Fri, 22 Oct 2010 12:11:07 -0700 (PDT) Subject: [Chicago-talk] logging in and out files In-Reply-To: References: <784754.19176.qm@web120520.mail.ne1.yahoo.com> <249119.24778.qm@web120504.mail.ne1.yahoo.com> <545936.91567.qm@web120511.mail.ne1.yahoo.com> Message-ID: <352535.67937.qm@web120512.mail.ne1.yahoo.com> I tried out a working version below. It works for $FH and FH, but not clear why. sub open{ my ($package, $file, $line_number) = caller(); my $fullpath = Cwd::abs_path($file); my $host = hostname(); _open_log({host=>hostname(), script=>Cwd::abs_path($file), file=>$_[1], } ); if ($_[0]) { no strict 'refs'; CORE::open("::$_[0]", $_[1]) or die "Cannot open $_[1]: $!\n"; } else { CORE::open($_[0], $_[1]) or die "Cannot open $_[1]: $!\n"; } } ________________________________ From: imran javaid To: Chicago.pm chatter Sent: Thu, October 21, 2010 2:46:29 PM Subject: Re: [Chicago-talk] logging in and out files This might get you somewhere: use strict; use Symbol; sub myopen { if (ref(\$_[0]) eq 'SCALAR') { open ($_[0], $_[1]); } else { my $in = qualify_to_ref($_[0]); open($in, $_[1]); } } myopen(*FILE, ">file.txt") or die $!; print FILE "testing\n"; myopen(my $FILE2, ">file2.txt") or die $!; print $FILE2 "testing2\n"; If you remove "use strict;" then you can replace "*FILE" with "FILE", but can and should are not the same thing. -imran On Thu, Oct 21, 2010 at 12:34 PM, tiger peng wrote: > Thanks, it looks a good tool and I will try it later. > > But my problem now is how to pass in and back the FH. > > It complains with error message: > Can't use string ("FH") as a symbol ref while "strict refs" in use at > /my/lib/myLogger.pm ... > > When I let it do not complain with "no strict 'refs';", it does not complain > but FH seems not opened or not passed back, as the caller read nothing out. > > ________________________________ > From: Joshua > To: Chicago.pm chatter > Sent: Wed, October 20, 2010 3:29:53 PM > Subject: Re: [Chicago-talk] logging in and out files > > I haven't done this myself before, but it looks like some folks have > and have put their work on CPAN: > http://search.cpan.org/~cwest/ex-override-1.1/override.pm > > On Wed, Oct 20, 2010 at 9:55 AM, tiger peng wrote: >> I wrapped the open as below, and it works for the open $fh, $file but not >> open FH, $file. >> >> As I need to apply the wrapping open function to lots of old script, I >> prefer only add one line: use myLoger 'open'; into the scripts >> >> Is there any suggestion? >> >> sub open{ >> my ($package, $file, $line_number) = caller(); >> my $fullpath = Cwd::abs_path($file); >> my $host = hostname(); >> _open_log({host=>hostname(), >> script=>Cwd::abs_path($file), >> file=>$_[1], >> } >> ); >> CORE::open(shift, shift) or die "Cannot open : $!\n"; >> } >> >> sub _open_log { >> ... >> } >> >> >> ________________________________ >> From: tiger peng >> To: Chicago.pm chatter >> Sent: Tue, October 19, 2010 11:41:10 AM >> Subject: [Chicago-talk] logging in and out files >> >> Hello all, >> >> Does anyone have the experience on tracing input/output files used by Perl >> script? >> >> I am think if there is anyway to over write the build-in open function, so >> the new open function can log the file name, IO type (R, W, or RW), as >> well >> as the open/close timestamp. Any suggestion is highly appreciated. >> >> Thanks, >> Tiger >> >> _______________________________________________ >> Chicago-talk mailing list >> Chicago-talk at pm.org >> http://mail.pm.org/mailman/listinfo/chicago-talk >> > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > _______________________________________________ Chicago-talk mailing list Chicago-talk at pm.org http://mail.pm.org/mailman/listinfo/chicago-talk -------------- next part -------------- An HTML attachment was scrubbed... URL: From tigerpeng2001 at yahoo.com Fri Oct 22 12:25:16 2010 From: tigerpeng2001 at yahoo.com (tiger peng) Date: Fri, 22 Oct 2010 12:25:16 -0700 (PDT) Subject: [Chicago-talk] logging in and out files Message-ID: <138090.21245.qm@web120504.mail.ne1.yahoo.com> Also if you glob $FH and FH. I got message below. Localize $FH with my, the message gone. Attempt to free unreferenced scalar: SV 0x1242a0 during global destruction. ________________________________ From: tiger peng To: Chicago.pm chatter Sent: Fri, October 22, 2010 2:11:07 PM Subject: Re: [Chicago-talk] logging in and out files I tried out a working version below. It works for $FH and FH, but I do not know clearly why it works sub open{ my ($package, $file, $line_number) = caller(); my $fullpath = Cwd::abs_path($file); my $host = hostname(); _open_log({host=>hostname(), script=>Cwd::abs_path($file), file=>$_[1], } ); if ($_[0]) { no strict 'refs'; CORE::open("::$_[0]", $_[1]) or die "Cannot open $_[1]: $!\n"; } else { CORE::open($_[0], $_[1]) or die "Cannot open $_[1]: $!\n"; } } ________________________________ From: imran javaid To: Chicago.pm chatter Sent: Thu, October 21, 2010 2:46:29 PM Subject: Re: [Chicago-talk] logging in and out files This might get you somewhere: use strict; use Symbol; sub myopen { if (ref(\$_[0]) eq 'SCALAR') { open ($_[0], $_[1]); } else { my $in = qualify_to_ref($_[0]); open($in, $_[1]); } } myopen(*FILE, ">file.txt") or die $!; print FILE "testing\n"; myopen(my $FILE2, ">file2.txt") or die $!; print $FILE2 "testing2\n"; If you remove "use strict;" then you can replace "*FILE" with "FILE", but can and should are not the same thing. -imran On Thu, Oct 21, 2010 at 12:34 PM, tiger peng wrote: > Thanks, it looks a good tool and I will try it later. > > But my problem now is how to pass in and back the FH. > > It complains with error message: > Can't use string ("FH") as a symbol ref while "strict refs" in use at > /my/lib/myLogger.pm ... > > When I let it do not complain with "no strict 'refs';", it does not complain > but FH seems not opened or not passed back, as the caller read nothing out. > > ________________________________ > From: Joshua > To: Chicago.pm chatter > Sent: Wed, October 20, 2010 3:29:53 PM > Subject: Re: [Chicago-talk] logging in and out files > > I haven't done this myself before, but it looks like some folks have > and have put their work on CPAN: > http://search.cpan.org/%7Ecwest/ex-override-1.1/override.pm > > On Wed, Oct 20, 2010 at 9:55 AM, tiger peng wrote: >> I wrapped the open as below, and it works for the open $fh, $file but not >> open FH, $file. >> >> As I need to apply the wrapping open function to lots of old script, I >> prefer only add one line: use myLoger 'open'; into the scripts >> >> Is there any suggestion? >> >> sub open{ >> my ($package, $file, $line_number) = caller(); >> my $fullpath = Cwd::abs_path($file); >> my $host = hostname(); >> _open_log({host=>hostname(), >> script=>Cwd::abs_path($file), >> file=>$_[1], >> } >> ); >> CORE::open(shift, shift) or die "Cannot open : $!\n"; >> } >> >> sub _open_log { >> ... >> } >> >> >> ________________________________ >> From: tiger peng >> To: Chicago.pm chatter >> Sent: Tue, October 19, 2010 11:41:10 AM >> Subject: [Chicago-talk] logging in and out files >> >> Hello all, >> >> Does anyone have the experience on tracing input/output files used by Perl >> script? >> >> I am think if there is anyway to over write the build-in open function, so >> the new open function can log the file name, IO type (R, W, or RW), as >> well >> as the open/close timestamp. Any suggestion is highly appreciated. >> >> Thanks, >> Tiger >> >> _______________________________________________ >> Chicago-talk mailing list >> Chicago-talk at pm.org >> http://mail.pm.org/mailman/listinfo/chicago-talk >> > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > _______________________________________________ Chicago-talk mailing list Chicago-talk at pm.org http://mail.pm.org/mailman/listinfo/chicago-talk -------------- next part -------------- An HTML attachment was scrubbed... URL: From tigerpeng2001 at yahoo.com Mon Oct 25 11:23:36 2010 From: tigerpeng2001 at yahoo.com (tiger peng) Date: Mon, 25 Oct 2010 11:23:36 -0700 (PDT) Subject: [Chicago-talk] logging in and out files In-Reply-To: <352535.67937.qm@web120512.mail.ne1.yahoo.com> References: <784754.19176.qm@web120520.mail.ne1.yahoo.com> <249119.24778.qm@web120504.mail.ne1.yahoo.com> <545936.91567.qm@web120511.mail.ne1.yahoo.com> <352535.67937.qm@web120512.mail.ne1.yahoo.com> Message-ID: <715689.97211.qm@web120515.mail.ne1.yahoo.com> Weird, when I tested the module, with open FH, $filename; with use strict; It complain with message: Bareword "FH" not allowed while "strict subs" in use... ________________________________ From: tiger peng To: Chicago.pm chatter Sent: Fri, October 22, 2010 2:11:07 PM Subject: Re: [Chicago-talk] logging in and out files I tried out a working version below. It works for $FH and FH, but not clear why. sub open{ my ($package, $file, $line_number) = caller(); my $fullpath = Cwd::abs_path($file); my $host = hostname(); _open_log({host=>hostname(), script=>Cwd::abs_path($file), file=>$_[1], } ); if ($_[0]) { no strict 'refs'; CORE::open("::$_[0]", $_[1]) or die "Cannot open $_[1]: $!\n"; } else { CORE::open($_[0], $_[1]) or die "Cannot open $_[1]: $!\n"; } } ________________________________ From: imran javaid To: Chicago.pm chatter Sent: Thu, October 21, 2010 2:46:29 PM Subject: Re: [Chicago-talk] logging in and out files This might get you somewhere: use strict; use Symbol; sub myopen { if (ref(\$_[0]) eq 'SCALAR') { open ($_[0], $_[1]); } else { my $in = qualify_to_ref($_[0]); open($in, $_[1]); } } myopen(*FILE, ">file.txt") or die $!; print FILE "testing\n"; myopen(my $FILE2, ">file2.txt") or die $!; print $FILE2 "testing2\n"; If you remove "use strict;" then you can replace "*FILE" with "FILE", but can and should are not the same thing. -imran On Thu, Oct 21, 2010 at 12:34 PM, tiger peng wrote: > Thanks, it looks a good tool and I will try it later. > > But my problem now is how to pass in and back the FH. > > It complains with error message: > Can't use string ("FH") as a symbol ref while "strict refs" in use at > /my/lib/myLogger.pm ... > > When I let it do not complain with "no strict 'refs';", it does not complain > but FH seems not opened or not passed back, as the caller read nothing out. > > ________________________________ > From: Joshua > To: Chicago.pm chatter > Sent: Wed, October 20, 2010 3:29:53 PM > Subject: Re: [Chicago-talk] logging in and out files > > I haven't done this myself before, but it looks like some folks have > and have put their work on CPAN: > http://search.cpan.org/%7Ecwest/ex-override-1.1/override.pm > > On Wed, Oct 20, 2010 at 9:55 AM, tiger peng wrote: >> I wrapped the open as below, and it works for the open $fh, $file but not >> open FH, $file. >> >> As I need to apply the wrapping open function to lots of old script, I >> prefer only add one line: use myLoger 'open'; into the scripts >> >> Is there any suggestion? >> >> sub open{ >> my ($package, $file, $line_number) = caller(); >> my $fullpath = Cwd::abs_path($file); >> my $host = hostname(); >> _open_log({host=>hostname(), >> script=>Cwd::abs_path($file), >> file=>$_[1], >> } >> ); >> CORE::open(shift, shift) or die "Cannot open : $!\n"; >> } >> >> sub _open_log { >> ... >> } >> >> >> ________________________________ >> From: tiger peng >> To: Chicago.pm chatter >> Sent: Tue, October 19, 2010 11:41:10 AM >> Subject: [Chicago-talk] logging in and out files >> >> Hello all, >> >> Does anyone have the experience on tracing input/output files used by Perl >> script? >> >> I am think if there is anyway to over write the build-in open function, so >> the new open function can log the file name, IO type (R, W, or RW), as >> well >> as the open/close timestamp. Any suggestion is highly appreciated. >> >> Thanks, >> Tiger >> >> _______________________________________________ >> Chicago-talk mailing list >> Chicago-talk at pm.org >> http://mail.pm.org/mailman/listinfo/chicago-talk >> > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > _______________________________________________ Chicago-talk mailing list Chicago-talk at pm.org http://mail.pm.org/mailman/listinfo/chicago-talk -------------- next part -------------- An HTML attachment was scrubbed... URL: From danel at speakeasy.net Mon Oct 25 13:10:10 2010 From: danel at speakeasy.net (Alexander Danel) Date: Mon, 25 Oct 2010 14:10:10 -0600 Subject: [Chicago-talk] logging in and out files In-Reply-To: <715689.97211.qm@web120515.mail.ne1.yahoo.com> Message-ID: <009101cb7480$a0c65720$6800a8c0@dsmsik7n2d2> Tiger, Firstly, I noticed you named your function "open()" - I wouldn't use that name, it is the name of a Perl operator; In fact, you use Perl "open()" within your "open()". Secondly, the error message might be indicating a simple syntax error in preceding code. Look for a missing semi-colon, etc., in the code just before the error. Alexander Danel _____ From: chicago-talk-bounces+danel=speakeasy.net at pm.org [mailto:chicago-talk-bounces+danel=speakeasy.net at pm.org] On Behalf Of tiger peng Sent: Monday, October 25, 2010 12:24 PM To: Chicago.pm chatter Subject: Re: [Chicago-talk] logging in and out files Weird, when I tested the module, with open FH, $filename; with use strict; It complain with message: Bareword "FH" not allowed while "strict subs" in use... _____ From: tiger peng To: Chicago.pm chatter Sent: Fri, October 22, 2010 2:11:07 PM Subject: Re: [Chicago-talk] logging in and out files I tried out a working version below. It works for $FH and FH, but not clear why. sub open{ my ($package, $file, $line_number) = caller(); my $fullpath = Cwd::abs_path($file); my $host = hostname(); _open_log({host=>hostname(), script=>Cwd::abs_path($file), file=>$_[1], } ); if ($_[0]) { no strict 'refs'; CORE::open("::$_[0]", $_[1]) or die "Cannot open $_[1]: $!\n"; } else { CORE::open($_[0], $_[1]) or die "Cannot open $_[1]: $!\n"; } } _____ From: imran javaid To: Chicago.pm chatter Sent: Thu, October 21, 2010 2:46:29 PM Subject: Re: [Chicago-talk] logging in and out files This might get you somewhere: use strict; use Symbol; sub myopen { if (ref(\$_[0]) eq 'SCALAR') { open ($_[0], $_[1]); } else { my $in = qualify_to_ref($_[0]); open($in, $_[1]); } } myopen(*FILE, ">file.txt") or die $!; print FILE "testing\n"; myopen(my $FILE2, ">file2.txt") or die $!; print $FILE2 "testing2\n"; If you remove "use strict;" then you can replace "*FILE" with "FILE", but can and should are not the same thing. -imran On Thu, Oct 21, 2010 at 12:34 PM, tiger peng wrote: > Thanks, it looks a good tool and I will try it later. > > But my problem now is how to pass in and back the FH. > > It complains with error message: > Can't use string ("FH") as a symbol ref while "strict refs" in use at > /my/lib/myLogger.pm ... > > When I let it do not complain with "no strict 'refs';", it does not complain > but FH seems not opened or not passed back, as the caller read nothing out. > > ________________________________ > From: Joshua > To: Chicago.pm chatter > Sent: Wed, October 20, 2010 3:29:53 PM > Subject: Re: [Chicago-talk] logging in and out files > > I haven't done this myself before, but it looks like some folks have > and have put their work on CPAN: > http://search.cpan.org/%7Ecwest/ex-override-1.1/override.pm > > On Wed, Oct 20, 2010 at 9:55 AM, tiger peng wrote: >> I wrapped the open as below, and it works for the open $fh, $file but not >> open FH, $file. >> >> As I need to apply the wrapping open function to lots of old script, I >> prefer only add one line: use myLoger 'open'; into the scripts >> >> Is there any suggestion? >> >> sub open{ >> my ($package, $file, $line_number) = caller(); >> my $fullpath = Cwd::abs_path($file); >> my $host = hostname(); >> _open_log({host=>hostname(), >> script=>Cwd::abs_path($file), >> file=>$_[1], >> } >> ); >> CORE::open(shift, shift) or die "Cannot open : $!\n"; >> } >> >> sub _open_log { >> ... >> } >> >> >> ________________________________ >> From: tiger peng >> To: Chicago.pm chatter >> Sent: Tue, October 19, 2010 11:41:10 AM >> Subject: [Chicago-talk] logging in and out files >> >> Hello all, >> >> Does anyone have the experience on tracing input/output files used by Perl >> script? >> >> I am think if there is anyway to over write the build-in open function, so >> the new open function can log the file name, IO type (R, W, or RW), as >> well >> as the open/close timestamp. Any suggestion is highly appreciated. >> >> Thanks, >> Tiger >> >> _______________________________________________ >> Chicago-talk mailing list >> Chicago-talk at pm.org >> http://mail.pm.org/mailman/listinfo/chicago-talk >> > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > _______________________________________________ Chicago-talk mailing list Chicago-talk at pm.org http://mail.pm.org/mailman/listinfo/chicago-talk -------------- next part -------------- An HTML attachment was scrubbed... URL: From tigerpeng2001 at yahoo.com Mon Oct 25 13:29:39 2010 From: tigerpeng2001 at yahoo.com (tiger peng) Date: Mon, 25 Oct 2010 13:29:39 -0700 (PDT) Subject: [Chicago-talk] logging in and out files In-Reply-To: <009101cb7480$a0c65720$6800a8c0@dsmsik7n2d2> References: <009101cb7480$a0c65720$6800a8c0@dsmsik7n2d2> Message-ID: <803653.53867.qm@web120504.mail.ne1.yahoo.com> Alex, I am trying create a module, say myLog.pm, to override the built-in open function, adding auxiliary abilities (logging the file access information). I am looking for minor modification, adding one line "use myLog 'open';' in a hundreds of scripts. The developing module works for the scripts without using typeglob filehandle (open FH, $filename); if no using "use stricts", it also works for the typeglob filehandle. It seems after overriding, the compiler take the 'FH' in the open function as calling a subroutine. Tiger, ________________________________ From: Alexander Danel To: Chicago.pm chatter Sent: Mon, October 25, 2010 3:10:10 PM Subject: Re: [Chicago-talk] logging in and out files Tiger, Firstly, I noticed you named your function ?open()? ? I wouldn?t use that name, it is the name of a Perl operator; In fact, you use Perl ?open()? within your ?open()?. Secondly, the error message might be indicating a simple syntax error in preceding code. Look for a missing semi-colon, etc., in the code just before the error. Alexander Danel ________________________________ From:chicago-talk-bounces+danel=speakeasy.net at pm.org [mailto:chicago-talk-bounces+danel=speakeasy.net at pm.org] On Behalf Of tiger peng Sent: Monday, October 25, 2010 12:24 PM To: Chicago.pm chatter Subject: Re: [Chicago-talk] logging in and out files Weird, when I tested the module, with open FH, $filename; with use strict; It complain with message: Bareword "FH" not allowed while "strict subs" in use... ________________________________ From:tiger peng To: Chicago.pm chatter Sent: Fri, October 22, 2010 2:11:07 PM Subject: Re: [Chicago-talk] logging in and out files I tried out a working version below. It works for $FH and FH, but not clear why. sub open{ my ($package, $file, $line_number) = caller(); my $fullpath = Cwd::abs_path($file); my $host = hostname(); _open_log({host=>hostname(), script=>Cwd::abs_path($file), file=>$_[1], } ); if ($_[0]) { no strict 'refs'; CORE::open("::$_[0]", $_[1]) or die "Cannot open $_[1]: $!\n"; } else { CORE::open($_[0], $_[1]) or die "Cannot open $_[1]: $!\n"; } } ________________________________ From:imran javaid To: Chicago.pm chatter Sent: Thu, October 21, 2010 2:46:29 PM Subject: Re: [Chicago-talk] logging in and out files This might get you somewhere: use strict; use Symbol; sub myopen { if (ref(\$_[0]) eq 'SCALAR') { open ($_[0], $_[1]); } else { my $in = qualify_to_ref($_[0]); open($in, $_[1]); } } myopen(*FILE, ">file.txt") or die $!; print FILE "testing\n"; myopen(my $FILE2, ">file2.txt") or die $!; print $FILE2 "testing2\n"; If you remove "use strict;" then you can replace "*FILE" with "FILE", but can and should are not the same thing. -imran On Thu, Oct 21, 2010 at 12:34 PM, tiger peng wrote: > Thanks, it looks a good tool and I will try it later. > > But my problem now is how to pass in and back the FH. > > It complains with error message: > Can't use string ("FH") as a symbol ref while "strict refs" in use at > /my/lib/myLogger.pm ... > > When I let it do not complain with "no strict 'refs';", it does not complain > but FH seems not opened or not passed back, as the caller read nothing out. > > ________________________________ > From: Joshua > To: Chicago.pm chatter > Sent: Wed, October 20, 2010 3:29:53 PM > Subject: Re: [Chicago-talk] logging in and out files > > I haven't done this myself before, but it looks like some folks have > and have put their work on CPAN: > http://search.cpan.org/%7Ecwest/ex-override-1.1/override.pm > > On Wed, Oct 20, 2010 at 9:55 AM, tiger peng wrote: >> I wrapped the open as below, and it works for the open $fh, $file but not >> open FH, $file. >> >> As I need to apply the wrapping open function to lots of old script, I >> prefer only add one line: use myLoger 'open'; into the scripts >> >> Is there any suggestion? >> >> sub open{ >> my ($package, $file, $line_number) = caller(); >> my $fullpath = Cwd::abs_path($file); >> my $host = hostname(); >> _open_log({host=>hostname(), >> script=>Cwd::abs_path($file), >> file=>$_[1], >> } >> ); >> CORE::open(shift, shift) or die "Cannot open : $!\n"; >> } >> >> sub _open_log { >> ... >> } >> >> >> ________________________________ >> From: tiger peng >> To: Chicago.pm chatter >> Sent: Tue, October 19, 2010 11:41:10 AM >> Subject: [Chicago-talk] logging in and out files >> >> Hello all, >> >> Does anyone have the experience on tracing input/output files used by Perl >> script? >> >> I am think if there is anyway to over write the build-in open function, so >> the new open function can log the file name, IO type (R, W, or RW), as >> well >> as the open/close timestamp. Any suggestion is highly appreciated. >> >> Thanks, >> Tiger >> >> _______________________________________________ >> Chicago-talk mailing list >> Chicago-talk at pm.org >> http://mail.pm.org/mailman/listinfo/chicago-talk >> > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > _______________________________________________ Chicago-talk mailing list Chicago-talk at pm.org http://mail.pm.org/mailman/listinfo/chicago-talk -------------- next part -------------- An HTML attachment was scrubbed... URL: From danel at speakeasy.net Tue Oct 26 10:39:10 2010 From: danel at speakeasy.net (Alexander Danel) Date: Tue, 26 Oct 2010 11:39:10 -0600 Subject: [Chicago-talk] logging in and out files In-Reply-To: <803653.53867.qm@web120504.mail.ne1.yahoo.com> Message-ID: <00e401cb7534$b30b6a10$6800a8c0@dsmsik7n2d2> Brian - yep, I jumped in without any context. Tiger - the code below illustrates the problem, and a solution. Firstly, note that the situation you are encountering seems to match with the documentation, as correct and expected behavior. Here is the URL to "perldoc.org": http://perldoc.perl.org/functions/open.html And here is an excerpt from the first paragraph: . . . otherwise if FILEHANDLE is an expression, its value is used as the name of the real filehandle wanted. (This is considered a symbolic reference, so use strict 'refs' should not be in effect.) Secondly, based on my tests just now, it seems "strict" is making a special exception for file based operations. That would explain why we routinely use a naked string in an open, without getting it flagged. So, "strict" seems to make an exception for: open FH, 'someFile.txt"; In the sample code, the following is not allowed by "strict"; I assume this illustrates the problem you are having. myLog::open(FH2,'someFile.txt'); However, in the sample code, I was able to alias the original symbol "open()" in "main"; in other words, I aliased "main::open()". In that case, "strict" applies the (apparent) special handling. # Alias *open = \&myLog::open; open(FH3,'someFile.txt'); So, that is your solution. Note - in the sample code you will also see an attempt to use the "Exporter" module. That didn't work; it seems that "Exporter" also makes a special case of "open()" - it refused to export it. (That code is commented out, the "__DATA__" directive.) Code appears below. Have fun. Alexander Danel #!/usr/bin/perl my $fName = "t.pl"; my $fMode = "<"; package myLog; sub open{ use Cwd; my ($package, $file, $line_number) = caller(); my $fullpath = Cwd::abs_path($file); if ($_[0]) { no strict 'refs'; CORE::open("::$_[0]", $_[1]) or die "Cannot open $_[1]: $!\n"; } else { CORE::open($_[0], $_[1]) or die "Cannot open $_[1]: $!\n"; } } package main; use strict; open(FH1,"$fMode $fName"); print "Here is first line of FH1: ", scalar(), "\n"; close(FH1); # Uncomment the following code to see the problem -- "strict" will flag it. #myLog::open(FH2,"$fMode $fName"); #print "Here is first line of FH2: ", scalar(), "\n"; #close(FH2); # Alias *open = \&myLog::open; open(FH3,"$fMode $fName"); print "Here is first line of FH3: ", scalar(), "\n"; close(FH3); __DATA__ package myLogExported; use Exporter 'open()' ; sub open{ use Cwd; my ($package, $file, $line_number) = caller(); my $fullpath = Cwd::abs_path($file); if ($_[0]) { #no strict 'refs'; CORE::open("::$_[0]", $_[1]) or die "Cannot open $_[1]: $!\n"; } else { CORE::open($_[0], $_[1]) or die "Cannot open $_[1]: $!\n"; } } package main; use strict; open(FH4,"$fMode $fName"); print "Here is first line of FH4: ", scalar(), "\n"; close(FH4); _____ From: chicago-talk-bounces+danel=speakeasy.net at pm.org [mailto:chicago-talk-bounces+danel=speakeasy.net at pm.org] On Behalf Of tiger peng Sent: Monday, October 25, 2010 2:30 PM To: Chicago.pm chatter Subject: Re: [Chicago-talk] logging in and out files Alex, I am trying create a module, say myLog.pm, to override the built-in open function, adding auxiliary abilities (logging the file access information). I am looking for minor modification, adding one line "use myLog 'open';' in a hundreds of scripts. The developing module works for the scripts without using typeglob filehandle (open FH, $filename); if no using "use stricts", it also works for the typeglob filehandle. It seems after overriding, the compiler take the 'FH' in the open function as calling a subroutine. Tiger, _____ From: Alexander Danel To: Chicago.pm chatter Sent: Mon, October 25, 2010 3:10:10 PM Subject: Re: [Chicago-talk] logging in and out files Tiger, Firstly, I noticed you named your function "open()" - I wouldn't use that name, it is the name of a Perl operator; In fact, you use Perl "open()" within your "open()". Secondly, the error message might be indicating a simple syntax error in preceding code. Look for a missing semi-colon, etc., in the code just before the error. Alexander Danel _____ From: chicago-talk-bounces+danel=speakeasy.net at pm.org [mailto:chicago-talk-bounces+danel=speakeasy.net at pm.org] On Behalf Of tiger peng Sent: Monday, October 25, 2010 12:24 PM To: Chicago.pm chatter Subject: Re: [Chicago-talk] logging in and out files Weird, when I tested the module, with open FH, $filename; with use strict; It complain with message: Bareword "FH" not allowed while "strict subs" in use... _____ From: tiger peng To: Chicago.pm chatter Sent: Fri, October 22, 2010 2:11:07 PM Subject: Re: [Chicago-talk] logging in and out files I tried out a working version below. It works for $FH and FH, but not clear why. sub open{ my ($package, $file, $line_number) = caller(); my $fullpath = Cwd::abs_path($file); my $host = hostname(); _open_log({host=>hostname(), script=>Cwd::abs_path($file), file=>$_[1], } ); if ($_[0]) { no strict 'refs'; CORE::open("::$_[0]", $_[1]) or die "Cannot open $_[1]: $!\n"; } else { CORE::open($_[0], $_[1]) or die "Cannot open $_[1]: $!\n"; } } _____ From: imran javaid To: Chicago.pm chatter Sent: Thu, October 21, 2010 2:46:29 PM Subject: Re: [Chicago-talk] logging in and out files This might get you somewhere: use strict; use Symbol; sub myopen { if (ref(\$_[0]) eq 'SCALAR') { open ($_[0], $_[1]); } else { my $in = qualify_to_ref($_[0]); open($in, $_[1]); } } myopen(*FILE, ">file.txt") or die $!; print FILE "testing\n"; myopen(my $FILE2, ">file2.txt") or die $!; print $FILE2 "testing2\n"; If you remove "use strict;" then you can replace "*FILE" with "FILE", but can and should are not the same thing. -imran On Thu, Oct 21, 2010 at 12:34 PM, tiger peng wrote: > Thanks, it looks a good tool and I will try it later. > > But my problem now is how to pass in and back the FH. > > It complains with error message: > Can't use string ("FH") as a symbol ref while "strict refs" in use at > /my/lib/myLogger.pm ... > > When I let it do not complain with "no strict 'refs';", it does not complain > but FH seems not opened or not passed back, as the caller read nothing out. > > ________________________________ > From: Joshua > To: Chicago.pm chatter > Sent: Wed, October 20, 2010 3:29:53 PM > Subject: Re: [Chicago-talk] logging in and out files > > I haven't done this myself before, but it looks like some folks have > and have put their work on CPAN: > http://search.cpan.org/%7Ecwest/ex-override-1.1/override.pm > > On Wed, Oct 20, 2010 at 9:55 AM, tiger peng wrote: >> I wrapped the open as below, and it works for the open $fh, $file but not >> open FH, $file. >> >> As I need to apply the wrapping open function to lots of old script, I >> prefer only add one line: use myLoger 'open'; into the scripts >> >> Is there any suggestion? >> >> sub open{ >> my ($package, $file, $line_number) = caller(); >> my $fullpath = Cwd::abs_path($file); >> my $host = hostname(); >> _open_log({host=>hostname(), >> script=>Cwd::abs_path($file), >> file=>$_[1], >> } >> ); >> CORE::open(shift, shift) or die "Cannot open : $!\n"; >> } >> >> sub _open_log { >> ... >> } >> >> >> ________________________________ >> From: tiger peng >> To: Chicago.pm chatter >> Sent: Tue, October 19, 2010 11:41:10 AM >> Subject: [Chicago-talk] logging in and out files >> >> Hello all, >> >> Does anyone have the experience on tracing input/output files used by Perl >> script? >> >> I am think if there is anyway to over write the build-in open function, so >> the new open function can log the file name, IO type (R, W, or RW), as >> well >> as the open/close timestamp. Any suggestion is highly appreciated. >> >> Thanks, >> Tiger >> >> _______________________________________________ >> Chicago-talk mailing list >> Chicago-talk at pm.org >> http://mail.pm.org/mailman/listinfo/chicago-talk >> > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > _______________________________________________ Chicago-talk mailing list Chicago-talk at pm.org http://mail.pm.org/mailman/listinfo/chicago-talk -------------- next part -------------- An HTML attachment was scrubbed... URL: From danel at speakeasy.net Tue Oct 26 10:59:37 2010 From: danel at speakeasy.net (Alexander Danel) Date: Tue, 26 Oct 2010 11:59:37 -0600 Subject: [Chicago-talk] logging in and out files In-Reply-To: <803653.53867.qm@web120504.mail.ne1.yahoo.com> Message-ID: <00ef01cb7537$8e814a40$6800a8c0@dsmsik7n2d2> Tiger, Given what you are trying to do, I suppose you want to force export somehow. (In other words, I assume you have many program files that you want to just add one line "use MyLogs;" and be done, and not have to add the aliasing line into each individual code file.) You might try the following, which is probably a little controversial, but might suit your purposes. In the module file "MyLog.pm", try ending it with a reset to "pachage main", and then do the export (or "alias") operation. So the module file would end like this: # . . . ending of "MyLog.pm" module forces export. package main; # Alias *open = \&myLog::open; 1; Any comments about this idea are welcomed. Alexander Danel -------------- next part -------------- An HTML attachment was scrubbed... URL: From tigerpeng2001 at yahoo.com Wed Oct 27 07:46:15 2010 From: tigerpeng2001 at yahoo.com (tiger peng) Date: Wed, 27 Oct 2010 07:46:15 -0700 (PDT) Subject: [Chicago-talk] logging in and out files In-Reply-To: <00ef01cb7537$8e814a40$6800a8c0@dsmsik7n2d2> References: <00ef01cb7537$8e814a40$6800a8c0@dsmsik7n2d2> Message-ID: <577360.23217.qm@web120501.mail.ne1.yahoo.com> Alex, I use the "@EXPORT_OK = qw (open);" to export the function as I expect more functions should be overridden. I tried your alias approach, but it does not work for me. My temporary solution is adding "no strict 'subs'". use myLog 'open'; no strict 'subs'; Tiger. ________________________________ From: Alexander Danel To: Chicago.pm chatter Sent: Tue, October 26, 2010 12:59:37 PM Subject: Re: [Chicago-talk] logging in and out files Tiger, Given what you are trying to do, I suppose you want to force export somehow. (In other words, I assume you have many program files that you want to just add one line ?use MyLogs;? and be done, and not have to add the aliasing line into each individual code file.) You might try the following, which is probably a little controversial, but might suit your purposes. In the module file ?MyLog.pm?, try ending it with a reset to ?pachage main?, and then do the export (or ?alias?) operation. So the module file would end like this: # . . . ending of ?MyLog.pm? module forces export. package main; # Alias *open = \&myLog::open; 1; Any comments about this idea are welcomed. Alexander Danel -------------- next part -------------- An HTML attachment was scrubbed... URL: From lembark at wrkhors.com Wed Oct 27 19:21:14 2010 From: lembark at wrkhors.com (Steven Lembark) Date: Wed, 27 Oct 2010 21:21:14 -0500 Subject: [Chicago-talk] Fw: What problems do threads solve for you and how could your languagemake it easier In-Reply-To: References: Message-ID: <20101027212114.73add7aclembark@wrkhors.com@wrkhors.com> On Tue, 12 Oct 2010 10:28:10 -0500 Andy_Bach at wiwb.uscourts.gov wrote: > I really like the question: > "What kinds of non-sequential programming tasks do we want to make > easy...and how would we like to be able to specify those tasks?" > > in a language design sort of way - but I've not needed threads (save > for on http related hack) so - anybody out there got any ideas? > > Over on a P6 list: > Damian Conway wrote: > > Leon Timmermans wrote: > > For the love of $DEITY, let's please not repeat ithreads! > > $AMEN! > > Backwards compatibility is not the major design criterion for Perl 6, > so there's no need to recapitulate our own phylogeny here. > > The problem is: while most people can agree on what have proved to be > unsatisfactory threading models, not many people can seem to agree on > what would constititute a satisfactory threading model (or, possibly, > models). > > What we really need is some anecdotal evidence from folks who are actually > using threading in real-world situations (in *any* languages). What has > worked > in practice? What has worked well? What was painful? What was error-prone? > And for which kinds of tasks? > > And we also need to stand back a little further and ask: is "threading" > the right approach at all? Do threads work in *any* language? Are there > better metaphors? > > Perhaps we need to think more Perlishly and reframe the entire question. > Not: "What threading model do we need?", but: "What kinds of > non-sequential > programming tasks do we want to make easy...and how would we like to be > able to specify those tasks?" > > As someone who doesn't (need to) use threading to solve the kinds of > problems I work on, I'm well aware that I'm not the right person to help > in this design work. We need those poor souls who already suffer under > threads to share their tales of constant misery (and their occasional > moments of triumph) so we can identify successful patterns of use > and steal^Wborg^Wborrow the very best available solutions. The best use of thread's I've seen is in dealing with low-level I/O issues where a portion of the running collection can voluntarily give up the CPU to another portion when it knows that the next machine instruction will cause the collection to block during a timeslice. Threads work wonderfully for this, and other kernel-level tasks where many data struct's are accessed and blocking is relatively common. None of which has anything to do with Perl -- unless someone is going to write Perlnix sometime soon? For *NIX systems, forking will gracefully handle about 90% of the parallel execution issues; MSW doesn't support true forks and has its own issues that threads might support; VMS supports spawning which is far too expensive, but still does most of what is needed; I don't know of anyone using Perl on a 360 mainframe with JCL. What people want in threads is ususally the ability to: - spawn off some task to run in parallel. - easily have the task update a structure in memory. - then discard the task's context, or recyclce it for another task (a.k.a. "worker threads"). The downside to this is syncing the update points. Perly shared memory requires not only locking the structure but serializing it so that the memory offsets used in ref's are accessable to the forked process. With threads you'd be able to access $foo->{ bar } without that overhead, at the expsen of locking $foo->{ bar }. The biggest headache to threading is keeping track of the sync points. Previous perly threading attempts tried to deal with this by making lexicals private to the thread (still not so bad an idea) and bulk copying the shared portion. Problem there was that it prevented the sharing we all wanted from threads in the first place. Aside from the issue of updating complex memory struct's, there really isn't anything you can to with threads that you cannot do with forks, and Perl already has good support for forks on the systems that support them. So, a problem description would be something like: - Let's find a way to allow for parallel execution of tasks in a Perl program that makes private variables simple and [largely] automatically deals with sync points and locking of the shared structures. enjoi -- Steven Lembark 3646 Flora Pl Workhorse Computing St Louis, MO 63110 lembark at wrkhors.com +1 888 359 3508