From jhannah at omnihotels.com Tue Oct 5 11:27:05 2004 From: jhannah at omnihotels.com (Jay Hannah) Date: Tue Oct 5 11:32:59 2004 Subject: [Omaha.pm] Test::More SKIP Message-ID: <002201c4aaf8$27870d30$4722000a@omarests2> The SKIP feature of Test::More is pretty slick. I've got a test file in which some tests will only work on one server, other tests will only work on another server, and the rest won't work anywhere. >From the first server, only the first 19 tests are valid: bash-2.03$ perl SQLManipulate.t 1..25 ok 1 - new() ok 2 - rpt_rcmnd... ok 3 - extent before ok 4 - extent_size ok 5 - next_extent_size ok 6 - manipulate ok 7 - extent after ok 8 - d_rate_code... ok 9 - index before ok 10 - manipulate ok 11 - index after ok 12 - o_bid_adj... ok 13 - 2 indexes before ok 14 - manipulate ok 15 - 2 indexes after ok 16 - rpt_comp_rates... ok 17 - index before ok 18 - manipulate ok 19 - index after ok 20 # skip omni-res server tests ok 21 # skip omni-res server tests ok 22 # skip omni-res server tests ok 23 # skip omni-res server tests ok 24 # skip omni-res server tests ok 25 # skip omni-res server tests >From the 2nd server, only test 1 and 21-25 are valid: (jhannah@omni-res.omnihotels.com) > perl SQLManipulate.t 1..25 ok 1 - new() ok 2 # skip charm server tests ok 3 # skip charm server tests ok 4 # skip charm server tests ok 5 # skip charm server tests ok 6 # skip charm server tests ok 7 # skip charm server tests ok 8 # skip charm server tests ok 9 # skip charm server tests ok 10 # skip charm server tests ok 11 # skip charm server tests ok 12 # skip charm server tests ok 13 # skip charm server tests ok 14 # skip charm server tests ok 15 # skip charm server tests ok 16 # skip charm server tests ok 17 # skip charm server tests ok 18 # skip charm server tests ok 19 # skip charm server tests ok 20 - smls_bk_codes2... ok 21 - create index ... using btree before ok 22 - extent_size ok 23 - next_extent_size ok 24 - manipulate ok 25 - create index ... using btree after And from this server, only test 1 is valid: [jhannah@king t]$ perl SQLManipulate.t 1..25 ok 1 - new() ok 2 # skip charm server tests ok 3 # skip charm server tests ok 4 # skip charm server tests ok 5 # skip charm server tests ok 6 # skip charm server tests ok 7 # skip charm server tests ok 8 # skip charm server tests ok 9 # skip charm server tests ok 10 # skip charm server tests ok 11 # skip charm server tests ok 12 # skip charm server tests ok 13 # skip charm server tests ok 14 # skip charm server tests ok 15 # skip charm server tests ok 16 # skip charm server tests ok 17 # skip charm server tests ok 18 # skip charm server tests ok 19 # skip charm server tests ok 20 # skip omni-res server tests ok 21 # skip omni-res server tests ok 22 # skip omni-res server tests ok 23 # skip omni-res server tests ok 24 # skip omni-res server tests ok 25 # skip omni-res server tests In the .t file, the first server code looks like this: ---------------------- use Sys::Hostname; my $hostname = hostname; SKIP: { skip "charm server tests", 18 unless ($hostname =~ /^charm/); # all the tests are here... } ---------------------- Neat, j From jhannah at omnihotels.com Tue Oct 5 15:45:31 2004 From: jhannah at omnihotels.com (Jay Hannah) Date: Tue Oct 5 15:45:42 2004 Subject: [Omaha.pm] [patch] Sys::Syslog POD - $Sys::Syslog::host Message-ID: <004401c4ab1c$4237e590$4722000a@omarests2> Yay! I've now had my 2nd patch to core Perl applied! http://public.activestate.com/cgi-bin/perlbrowse?patch=23341&action=patch Take that Scott!! -grin- j -----Original Message----- From: Jay Hannah [mailto:jhannah@omnihotels.com] Sent: Tuesday, October 05, 2004 3:45 PM To: 'Rafael Garcia-Suarez' Subject: RE: [patch] Sys::Syslog POD - $Sys::Syslog::host Thank you!! I'm always amazed by the gurus that keep Perl going. Thanks for all you do! j > -----Original Message----- > From: Rafael Garcia-Suarez [mailto:rgarciasuarez@mandrakesoft.com] > Sent: Thursday, September 30, 2004 11:03 AM > To: jhannah@omnihotels.com > Cc: perl5-porters@perl.org; omaha-pm@pm.org > Subject: Re: [patch] Sys::Syslog POD - $Sys::Syslog::host > > > Jay Hannah wrote: > > > > You can change $Sys::Syslog::host and the package will happily go > > connect (TCP or UDP) to a remote server. Works great. However, there is > > no interface to change $Sys::Syslog::host, and the feature isn't > > documented. > > > > Instead of changing openlog(), connect(), connect_udp(), > > connect_tcp(), and documenting all of that; I thought it would just be > > easier to document changing $Sys::Syslog::host. > > > > Objections? > > No. Thanks, applied as #23341 to bleadperl. > > > --- Syslog.pm 2004-03-06 15:30:08.000000000 -0600 > > +++ new_Syslog.pm 2004-09-15 14:11:19.000000000 -0500 From jhannah at omnihotels.com Wed Oct 6 23:47:01 2004 From: jhannah at omnihotels.com (Jay Hannah) Date: Wed Oct 6 23:47:13 2004 Subject: [Omaha.pm] Test::More is() is cool Message-ID: <000e01c4ac28$afdb4a30$4722000a@omarests2> Cool... is() and its sibling classes save a lot of tedious writing of manual verbosity when a test fails... Objects & test suites rock. j jhannah@loadbal3 ~/M/Pegasus/Message/t $ cat production_log_trailer.t use Test::More tests => 16; use Model::Pegasus::Message::t::production_log_trailer; ok(my $t = Model::Pegasus::Message::t::production_log_trailer->new( '/usr/lib/perl5/site_perl/Omni/MVC/Model/Pegasus/Message/t/production_log_trailer.t.sample' ), "new()"); is($t->get_request, "A", "get_request"); is($t->get_response, "a", "get_response"); is($t->get_time, "1.1", "get_time"); ok($t->next(), "next()"); is($t->get_request, "B", "get_request"); is($t->get_response, "b", "get_response"); is($t->get_response, "something else", "get_response"); is($t->get_time, "2.2", "get_time"); ok($t->next(), "next()"); is($t->get_request, "C", "get_request"); is($t->get_response, "c", "get_response"); is($t->get_time, "3.3", "get_time"); ok($t->next(), "next()"); is($t->get_request, "A", "get_request"); is($t->get_response, "a", "get_response"); is($t->get_time, "1.1", "get_time"); jhannah@loadbal3 ~/M/Pegasus/Message/t $ perl production_log_trailer.t 1..16 ok 1 - new() ok 2 - get_request ok 3 - get_response ok 4 - get_time ok 5 - next() ok 6 - get_request ok 7 - get_response not ok 8 - get_response # Failed test (production_log_trailer.t at line 14) # got: 'b' # expected: 'something else' ok 9 - get_time ok 10 - next() ok 11 - get_request ok 12 - get_response ok 13 - get_time ok 14 - next() ok 15 - get_request ok 16 - get_response ok 17 - get_time # Looks like you planned 16 tests but ran 1 extra. From dutch at tconl.com Mon Oct 11 15:19:05 2004 From: dutch at tconl.com (dutch) Date: Mon Oct 11 15:06:59 2004 Subject: [Omaha.pm] Maypole In-Reply-To: <001501c46f75$f92ba3a0$4722000a@omarests2> References: <001501c46f75$f92ba3a0$4722000a@omarests2> Message-ID: <200410111519.05256.dutch@tconl.com> Anyone on the list using Maypole (MVC)? Pro's, con's, Apache2 vs Apache issues? Have installed it successfully but for large chunks of my custom work rolling my own CGI/mod_perl/DBI stuff seems to work better. I do like the idea of the MVC separation and the templating - any quicker in the real world? Thanks, Dutch From jay at jays.net Wed Oct 13 10:28:33 2004 From: jay at jays.net (Jay Hannah) Date: Wed Oct 13 10:28:12 2004 Subject: [Omaha.pm] Re: [olug] Python based replacement for Procmail In-Reply-To: <1726.167.16.189.21.1097520424.squirrel@167.16.189.21> References: <1726.167.16.189.21.1097520424.squirrel@167.16.189.21> Message-ID: <8B3E8F7A-1D2C-11D9-91E6-000A95E317B8@jays.net> On Oct 11, 2004, at 1:47 PM, William E. Kempf wrote: > So, I decided I wanted a new solution. Procmail is nice, but it's just > not for me. I thought a filter in a full scripting language would be > much > better, and since I like Python, I thought that would be the best > solution > for me. I've never used either of these, but they're probably worth a glance: --- http://search.cpan.org/~simon/Mail-Audit-2.1/Audit.pm "procmail is nasty. It has a tortuous and complicated recipe format, and I don't like it. I wanted something flexible whereby I could filter my mail using Perl tests." --- http://search.cpan.org/~jv/Mail-Procmail-1.08/lib/Mail/Procmail.pm "procmail is a great mail filter program, but it has weird recipe format. It's pattern matching capabilities are basic and often insufficient. I wanted something flexible whereby I could filter my mail using the power of Perl. I've been considering to write a procmail replacement in Perl for a while, but it was Simon Cozen's Mail::Audit module, and his article in The Perl Journal #18, that set it off. I first started using Simon's great module, and then decided to write my own since I liked certain things to be done differently. And I couldn't wait for his updates." --- FWIW, j lightweight procmail user Omaha Perl Mongers: http://omaha.pm.org http://www.unix.org.ua/orelly/perl/prog3/ch10_01.htm "False Impatience... if you're determined to reinvent the wheel, at least try to invent a better one." From jay at jays.net Wed Oct 13 10:40:00 2004 From: jay at jays.net (Jay Hannah) Date: Wed Oct 13 10:39:26 2004 Subject: [Omaha.pm] Maypole In-Reply-To: <200410111519.05256.dutch@tconl.com> References: <001501c46f75$f92ba3a0$4722000a@omarests2> <200410111519.05256.dutch@tconl.com> Message-ID: <24A4C0E4-1D2E-11D9-91E6-000A95E317B8@jays.net> On Oct 11, 2004, at 3:19 PM, dutch wrote: > Anyone on the list using Maypole (MVC)? No. We looked at it, but not very hard. This is an interesting resource: http://poop.sourceforge.net/ poop-group, poop-scoop mailing lists > Pro's, con's, Apache2 vs Apache issues? Can't commment. Sorry. > Have installed it successfully but for large chunks of my custom work > rolling > my own CGI/mod_perl/DBI stuff seems to work better. I do like the > idea of > the MVC separation and the templating - any quicker in the real world? Our current poop iteration is a custom MVC structure and the Perl Template Toolkit (get the O'Reilly book). It's cruising along, and we're happy with it. A couple years ago the available poop stuff wasn't flexible enough to handle our corner cases (composite primary keys, etc.)... I believe Maypole was Simon's baby, and he recently retired the computer scene. I don't know how strong the community is. If you get into it let us know!! $0.02, j From jay at jays.net Thu Oct 14 15:04:18 2004 From: jay at jays.net (Jay Hannah) Date: Thu Oct 14 15:03:55 2004 Subject: [Omaha.pm] Challenge: Prune a directory tree Message-ID: <3AF6C10D-1E1C-11D9-B602-000A95E317B8@jays.net> Just for fun... I have a big, deep directory tree. Some directories contain files, some don't. I want to prune out all the directories for which there are no files in that directory, or any sub-directory thereof. Every directory contains zero or more sub-directories. After the solution runs, all the files should remain, untouched and unmoved. All empty directory branches should be gone. Clear as mud? I failed to Google a solution in 5 minutes. Any takers? If not maybe we'll hit it for the Perl Monger mtg next Thr. -grin- j Omaha Perl Mongers: http://omaha.pm.org From dan at linder.org Thu Oct 14 16:35:54 2004 From: dan at linder.org (Daniel Linder) Date: Thu Oct 14 16:30:59 2004 Subject: [Omaha.pm] Challenge: Prune a directory tree In-Reply-To: <3AF6C10D-1E1C-11D9-B602-000A95E317B8@jays.net> References: <3AF6C10D-1E1C-11D9-B602-000A95E317B8@jays.net> Message-ID: <20704.12.160.138.7.1097789754.squirrel@12.160.138.7> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > I have a big, deep directory tree. Some directories contain files, some > don't. > I want to prune out all the directories for which there are no files in > that directory, or any sub-directory thereof. Every directory contains > zero or more sub-directories. I know it's sacreligious, but how about a simple "find" command? cd \base\directory\to\clean find . -depth -type d -exec rmdir {} \; This goes to the maximal subdirectory depth of a tree, then works its way backwards. If a directory is empty it gets removed, if it has something an error is printed to the screen when the "rmdir" fails. Of course, this only works on a Unix-type system... The Windows/DOS find command doesn't work anywhere like this. :( Dan - - - - - "I do not fear computer, I fear the lack of them." -- Isaac Asimov -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFBbvE6NiBNyqUzGb8RAu91AJ9X0C76TcSNiX+zXUiEXy8K74OnogCeMM35 JrpbSl55ymzL2VKF6k6bD6Q= =Rn07 -----END PGP SIGNATURE----- From dan at linder.org Thu Oct 14 16:35:54 2004 From: dan at linder.org (Daniel Linder) Date: Thu Oct 14 16:31:05 2004 Subject: [Omaha.pm] Challenge: Prune a directory tree In-Reply-To: <3AF6C10D-1E1C-11D9-B602-000A95E317B8@jays.net> References: <3AF6C10D-1E1C-11D9-B602-000A95E317B8@jays.net> Message-ID: <20704.12.160.138.7.1097789754.squirrel@12.160.138.7> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > I have a big, deep directory tree. Some directories contain files, some > don't. > I want to prune out all the directories for which there are no files in > that directory, or any sub-directory thereof. Every directory contains > zero or more sub-directories. I know it's sacreligious, but how about a simple "find" command? cd \base\directory\to\clean find . -depth -type d -exec rmdir {} \; This goes to the maximal subdirectory depth of a tree, then works its way backwards. If a directory is empty it gets removed, if it has something an error is printed to the screen when the "rmdir" fails. Of course, this only works on a Unix-type system... The Windows/DOS find command doesn't work anywhere like this. :( Dan - - - - - "I do not fear computer, I fear the lack of them." -- Isaac Asimov -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFBbvE6NiBNyqUzGb8RAu91AJ9X0C76TcSNiX+zXUiEXy8K74OnogCeMM35 JrpbSl55ymzL2VKF6k6bD6Q= =Rn07 -----END PGP SIGNATURE----- From jay at jays.net Thu Oct 14 17:35:59 2004 From: jay at jays.net (Jay Hannah) Date: Thu Oct 14 17:35:32 2004 Subject: [Omaha.pm] Challenge: Prune a directory tree In-Reply-To: <20704.12.160.138.7.1097789754.squirrel@12.160.138.7> References: <3AF6C10D-1E1C-11D9-B602-000A95E317B8@jays.net> <20704.12.160.138.7.1097789754.squirrel@12.160.138.7> Message-ID: <6BE6A6DC-1E31-11D9-A875-000A95E317B8@jays.net> On Oct 14, 2004, at 4:35 PM, Daniel Linder wrote: > find . -depth -type d -exec rmdir {} \; Wow. Unreal. I didn't know -depth until now. On Oct 14, 2004, at 3:24 PM, Trent Melcher wrote: > http://www.stonehenge.com/merlyn/UnixReview/col16.html Ya... Perl's File::Find Command line ------------------- ---------------- find() find ./ finddepth() find ./ -depth (perldoc File::Find) If what I was doing was a lot more involved than 'rmdir {}' I'd use Perl instead of trying to string together some God awful -exec string on the command line. Beauty! Thanks Daniel! Looks like several of us needed to learn the -depth trick! j From thelarsons3 at cox.net Sun Oct 17 13:35:46 2004 From: thelarsons3 at cox.net (Tim & Alethea Larson) Date: Sun Oct 17 13:35:18 2004 Subject: [Omaha.pm] Re: [olug] perl cpan problem References: <20040922181115.IUVE3430.lakermmtao05.cox.net@smtp.east.cox.net> <65C33615-0CF9-11D9-BA31-000A95E317B8@jays.net> Message-ID: <4172BB82.3000405@cox.net> Whew, finally got a few free minutes to reply to this. Jay Hannah wrote: > > On Sep 22, 2004, at 1:11 PM, wrote: > >> I was trying to install XML and RSS modules from CPAN. This didn't >> work correctly, but the procedure suggested upgrading CPAN and >> installing the libnet bundle. OK, fine. When these didn't work >> either because of an "out of memory" error, I started looking closer >> by running top. > > > What were you running when you got the error? > > perl -MCPAN -e ... ? perl -MCPAN -e "install XML::Parser" perl -MCPAN -e "install Bundle::CPAN" perl -MCPAN -e "install Bundle::libnet" perl -MCPAN -e "install Net::FTP" perl -MCPAN -e "install HTTP::Date" >> While the process is running, it slowly uses more and more RAM until >> all physical memory (80 MB) on the system is exhausted, then it >> dies. I have 192 MB of swap that is barely touched - about 8 MB in >> use when Perl starts, still the same when it dies. > > > While what process is running? Can you give us the exact command(s) > you're having problems with? The Perl process. The commands are above. It's like Perl is just sucking all the RAM out of my box. Tim -- Tim & Alethea www.ChristTrek.org From jay at jays.net Tue Oct 19 21:52:02 2004 From: jay at jays.net (Jay Hannah) Date: Tue Oct 19 21:51:27 2004 Subject: [Omaha.pm] Re: [olug] perl cpan problem In-Reply-To: <4172BB82.3000405@cox.net> References: <20040922181115.IUVE3430.lakermmtao05.cox.net@smtp.east.cox.net> <65C33615-0CF9-11D9-BA31-000A95E317B8@jays.net> <4172BB82.3000405@cox.net> Message-ID: <04A7EDED-2243-11D9-9BD8-000A95E317B8@jays.net> On Oct 17, 2004, at 1:35 PM, Tim & Alethea Larson wrote: > perl -MCPAN -e "install XML::Parser" > perl -MCPAN -e "install Bundle::CPAN" > perl -MCPAN -e "install Bundle::libnet" > perl -MCPAN -e "install Net::FTP" > perl -MCPAN -e "install HTTP::Date" > >>> While the process is running, it slowly uses more and more RAM until >>> all physical memory (80 MB) on the system is exhausted, then it >>> dies. I have 192 MB of swap that is barely touched - about 8 MB in >>> use when Perl starts, still the same when it dies. >> >> >> While what process is running? Can you give us the exact command(s) >> you're having problems with? > > > The Perl process. The commands are above. It's like Perl is just > sucking all the RAM out of my box. Are all those commands in a .sh script or something? Have you tried running each separately? Is there anything in the startup that says something about "unable to write to ~/.cpan/*" or anything like that? How it should work (I think) is that stuff is downloaded into your ~/.cpan/* directory (configurable) and built, installed, etc., one package at a time out of that directory. So, as the process unfolds, several different things should be running: 1) perl -MCPAN -e "install XML::Parser" (or whichever one is running at the time. This is the master process that's launching all the other stuff) Then, one of the following will be running: 2) perl Makefile.PL (while the package is actually building) or... perl -MTest::Harness x.t (while the package is being tested) or... gcc xxxxxxxxxx (while any C components are being bult) CPAN is a serial process, so multiple things shouldn't be going on at the same time. Is there one specific package during which something is freaking out? What does the dialogue look like? Is there some infinite loop going on? I'm never had the CPAN module slurp my RAM... That probably didn't help... Sorry, j From td3201 at gmail.com Thu Oct 21 09:14:23 2004 From: td3201 at gmail.com (Terry) Date: Thu Oct 21 09:14:30 2004 Subject: [Omaha.pm] perl or system problem? Message-ID: <8ee061010410210714da12ea8@mail.gmail.com> Hello, I have a hunch this is something to do with my environment ..... I am running this program out of cron: #!/usr/local/bin/perl use Mail::Sendmail; $hostname = `hostname`; $message = `pprosvc -n -l`; unshift @{$Mail::Sendmail::mailcfg{'smtp'}} , 'plasmtp'; %mail = ( To => 'jo@hotmail.com', From => "admin\@$hostname", Subject => 'available packages', Message => "$message" ); sendmail(%mail) or die $Mail::Sendmail::error; When I run it interactively on the command line, it works fine. It gives me a full output ($message). When I run it out of cron, $message is empty......why? OS Is obviously Solaris. Here is usage for that program: usage: pprosvc [-d | -i [-n] | -l] [-h] where: d means download all patches. i means install required patches. l means list required patches. n means operate in non interactive mode. h display usage information. Thanks! Terry From Andrew.Hadenfeldt at alltel.com Thu Oct 21 09:30:00 2004 From: Andrew.Hadenfeldt at alltel.com (Andrew.Hadenfeldt@alltel.com) Date: Thu Oct 21 09:30:08 2004 Subject: [Omaha.pm] perl or system problem? Message-ID: Most likely it's a PATH problem. Cron doesn't set up much for an environment so you have to do it. You should be getting an email from cron to that effect ("pprosvc: not found"), assuming you haven't redirected STDERR in cron. My preferred solution is to write a small, generic wrapper script (e.g., "runcron myscript.pl") that sources .profile, sets PATH, etc., and then does an "exec $1" to run the actual script. Also, remember you don't have a tty in cron so avoid stty or similar commands that assume you're interactive. -Andy -----Original Message----- From: omaha-pm-bounces@mail.pm.org [mailto:omaha-pm-bounces@mail.pm.org]On Behalf Of Terry Sent: Thursday, October 21, 2004 9:14 AM To: Perl Mongers of Omaha, Nebraska USA Subject: [Omaha.pm] perl or system problem? Hello, I have a hunch this is something to do with my environment ..... I am running this program out of cron: #!/usr/local/bin/perl use Mail::Sendmail; $hostname = `hostname`; $message = `pprosvc -n -l`; unshift @{$Mail::Sendmail::mailcfg{'smtp'}} , 'plasmtp'; %mail = ( To => 'jo@hotmail.com', From => "admin\@$hostname", Subject => 'available packages', Message => "$message" ); sendmail(%mail) or die $Mail::Sendmail::error; When I run it interactively on the command line, it works fine. It gives me a full output ($message). When I run it out of cron, $message is empty......why? OS Is obviously Solaris. Here is usage for that program: usage: pprosvc [-d | -i [-n] | -l] [-h] where: d means download all patches. i means install required patches. l means list required patches. n means operate in non interactive mode. h display usage information. Thanks! Terry _______________________________________________ Omaha-pm mailing list Omaha-pm@mail.pm.org http://www.pm.org/mailman/listinfo/omaha-pm ****************************************************************************************** The information contained in this message, including attachments, may contain privileged or confidential information that is intended to be delivered only to the person identified above. If you are not the intended recipient, or the person responsible for delivering this message to the intended recipient, ALLTEL requests that you immediately notify the sender and asks that you do not read the message or its attachments, and that you delete them without copying or sending them to anyone else. From td3201 at gmail.com Thu Oct 21 09:46:23 2004 From: td3201 at gmail.com (Terry) Date: Thu Oct 21 09:46:25 2004 Subject: [Omaha.pm] perl or system problem? In-Reply-To: <8ee06101041021074273341da@mail.gmail.com> References: <8ee06101041021074273341da@mail.gmail.com> Message-ID: <8ee0610104102107464d50a88c@mail.gmail.com> I need to be thoroughly beaten...thanks for pointing out the obvious.....why the hell I thought that /opt/SUNWppro/bin was in the default $PATH is beyond me...... > wrote: > > Most likely it's a PATH problem. Cron doesn't set up much for an environment so you have to do it. You should be getting an email from cron to that effect ("pprosvc: not found"), assuming you haven't redirected STDERR in cron. > > > > My preferred solution is to write a small, generic wrapper script (e.g., "runcron myscript.pl") that sources .profile, sets PATH, etc., and then does an "exec $1" to run the actual script. Also, remember you don't have a tty in cron so avoid stty or similar commands that assume you're interactive. > > > > -Andy > > > > > > -----Original Message----- > > From: omaha-pm-bounces@mail.pm.org > > [mailto:omaha-pm-bounces@mail.pm.org]On Behalf Of Terry > > Sent: Thursday, October 21, 2004 9:14 AM > > To: Perl Mongers of Omaha, Nebraska USA > > Subject: [Omaha.pm] perl or system problem? > > > > Hello, > > > > I have a hunch this is something to do with my environment ..... > > > > I am running this program out of cron: > > > > #!/usr/local/bin/perl > > > > use Mail::Sendmail; > > > > $hostname = `hostname`; > > $message = `pprosvc -n -l`; > > unshift @{$Mail::Sendmail::mailcfg{'smtp'}} , 'plasmtp'; > > %mail = ( To => 'jo@hotmail.com', > > From => "admin\@$hostname", > > Subject => 'available packages', > > Message => "$message" > > ); > > sendmail(%mail) or die $Mail::Sendmail::error; > > > > When I run it interactively on the command line, it works fine. It > > gives me a full output ($message). When I run it out of cron, > > $message is empty......why? OS Is obviously Solaris. > > > > Here is usage for that program: > > > > usage: pprosvc [-d | -i [-n] | -l] [-h] where: > > d means download all patches. > > i means install required patches. > > l means list required patches. > > n means operate in non interactive mode. > > h display usage information. > > > > Thanks! > > Terry > > _______________________________________________ > > Omaha-pm mailing list > > Omaha-pm@mail.pm.org > > http://www.pm.org/mailman/listinfo/omaha-pm > > ****************************************************************************************** > > The information contained in this message, including attachments, may contain > > privileged or confidential information that is intended to be delivered only to the > > person identified above. If you are not the intended recipient, or the person > > responsible for delivering this message to the intended recipient, ALLTEL requests > > that you immediately notify the sender and asks that you do not read the message or its > > attachments, and that you delete them without copying or sending them to anyone else. > > > > > From jhannah at omnihotels.com Thu Oct 21 11:36:22 2004 From: jhannah at omnihotels.com (Jay Hannah) Date: Thu Oct 21 11:36:50 2004 Subject: [Omaha.pm] IO::Multiplex & signals? Message-ID: <200410211636.i9LGaQs0014079@mail-omaha.omnihotels.com> Is it possible that IO::Multiplex is not safe under load if I start using signals as triggers to run off and do complex things? I don't see signals mentioned in the IO::Multiplex docs. I have a hunch that might explain some weird behavior I'm seeing. I understand that signals on top of signals in my signal handling routine can be a problem, but that wouldn't explain what I've observed. Is it possible a signal can throw IO::Multiplex's internal queues out of whack somehow because something inside IO::Multiplex is not re-entrant when it needs to be? If it's a known issue of some sort at all I won't try to write up a demo... Thanks for your time, j From hjarce2001 at yahoo.com Thu Oct 21 18:39:54 2004 From: hjarce2001 at yahoo.com (Hugh Jarce) Date: Thu Oct 21 18:39:56 2004 Subject: [Omaha.pm] perl or system problem? In-Reply-To: <8ee061010410210714da12ea8@mail.gmail.com> Message-ID: <20041021233954.26762.qmail@web54404.mail.yahoo.com> --- Terry wrote: > Hello, > > I have a hunch this is something to do with my environment ..... > > I am running this program out of cron: > > #!/usr/local/bin/perl > > use Mail::Sendmail; > > $hostname = `hostname`; > $message = `pprosvc -n -l`; > unshift @{$Mail::Sendmail::mailcfg{'smtp'}} , 'plasmtp'; > %mail = ( To => 'jo@hotmail.com', > From => "admin\@$hostname", > Subject => 'available packages', > Message => "$message" > ); > sendmail(%mail) or die $Mail::Sendmail::error; Let perl tell you what's wrong. For example: $message = `pprosvc -n -l`; my $rc = $? >> 8; warn "command failed (rc=$rc): $!\n" if $rc != 0; Or more elaborately (taken from: perldoc -f system): if ($? == -1) { print "failed to execute: $!\n"; } elsif ($? & 127) { printf "child died with signal %d, %s coredump\n", ($? & 127), ($? & 128) ? 'with' : 'without'; } else { printf "child exited with value %d\n", $? >> 8; } Hugh _______________________________ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com From thelarsons3 at cox.net Thu Oct 21 20:26:40 2004 From: thelarsons3 at cox.net (Tim & Alethea Larson) Date: Thu Oct 21 20:25:46 2004 Subject: [Omaha.pm] Re: [olug] perl cpan problem References: <20040922181115.IUVE3430.lakermmtao05.cox.net@smtp.east.cox.net> <65C33615-0CF9-11D9-BA31-000A95E317B8@jays.net> <4172BB82.3000405@cox.net> <04A7EDED-2243-11D9-9BD8-000A95E317B8@jays.net> Message-ID: <417861D0.4020003@cox.net> Jay Hannah wrote: > On Oct 17, 2004, at 1:35 PM, Tim & Alethea Larson wrote: > >> perl -MCPAN -e "install XML::Parser" >> perl -MCPAN -e "install Bundle::CPAN" >> perl -MCPAN -e "install Bundle::libnet" >> perl -MCPAN -e "install Net::FTP" >> perl -MCPAN -e "install HTTP::Date" >> > Are all those commands in a .sh script or something? > > Have you tried running each separately? > > Is there anything in the startup that says something about "unable to > write to ~/.cpan/*" or anything like that? No, I ran them separately from the command line. No errors about not being able to write. Just some stuff about what server it was trying to contact, then a long silence as I watched the memory usage increase to max, and finally caput! > How it should work (I think) is that stuff is downloaded into your > ~/.cpan/* directory (configurable) and built, installed, etc., one > package at a time out of that directory. So, as the process unfolds, > several different things should be running: > > 1) perl -MCPAN -e "install XML::Parser" (or whichever one is running > at the time. This is the master process that's launching all the other > stuff) > > Then, one of the following will be running: > > 2) perl Makefile.PL (while the package is actually building) > or... perl -MTest::Harness x.t (while the package is being tested) > or... gcc xxxxxxxxxx (while any C components are being bult) > > CPAN is a serial process, so multiple things shouldn't be going on at > the same time. Is there one specific package during which something is > freaking out? What does the dialogue look like? Is there some infinite > loop going on? > > I'm never had the CPAN module slurp my RAM... > > That probably didn't help... Sorry, I will try again and see if I can watch for more details. It's kind of difficult because I don't have email access on the machine I'm working with, so I have to retype any messages over onto this machine. Tim -- Tim & Alethea www.ChristTrek.org From jay at jays.net Fri Oct 22 16:19:42 2004 From: jay at jays.net (Jay Hannah) Date: Fri Oct 22 16:19:45 2004 Subject: [Omaha.pm] perl cpan problem In-Reply-To: <417861D0.4020003@cox.net> References: <20040922181115.IUVE3430.lakermmtao05.cox.net@smtp.east.cox.net> <65C33615-0CF9-11D9-BA31-000A95E317B8@jays.net> <4172BB82.3000405@cox.net> <04A7EDED-2243-11D9-9BD8-000A95E317B8@jays.net> <417861D0.4020003@cox.net> Message-ID: <171E8518-2470-11D9-A227-000A95E317B8@jays.net> On Oct 21, 2004, at 8:26 PM, Tim & Alethea Larson wrote: >> On Oct 17, 2004, at 1:35 PM, Tim & Alethea Larson wrote: >>> perl -MCPAN -e "install XML::Parser" >>> perl -MCPAN -e "install Bundle::CPAN" >>> perl -MCPAN -e "install Bundle::libnet" >>> perl -MCPAN -e "install Net::FTP" >>> perl -MCPAN -e "install HTTP::Date" > > No, I ran them separately from the command line. No errors about not > being able to write. Just some stuff about what server it was trying > to contact, then a long silence as I watched the memory usage increase > to max, and finally caput! Oh... So 4 of those 5 packages are known to not be the problem? -grin- Then it would help to know which of the 5 is running when the problem occurs, and a copy-paste of the screen shot as the memory is slurping so we can see what was happening before the slurp began. > I will try again and see if I can watch for more details. It's kind > of difficult because I don't have email access on the machine I'm > working with, so I have to retype any messages over onto this machine. Copy/paste into a text file (or tee it to a text file) then scp/ftp the file to wherever...? j From jhannah at omnihotels.com Fri Oct 22 17:09:43 2004 From: jhannah at omnihotels.com (Jay Hannah) Date: Fri Oct 22 17:09:50 2004 Subject: FW: [Omaha.pm] IO::Multiplex & signals? Message-ID: <200410222209.i9MM9hs0027164@mail-omaha.omnihotels.com> From: Miller, Scott L (Omaha Networks) [mailto:scott.l.miller@hp.com] Sent: Thursday, October 21, 2004 2:45 PM To: Jay Hannah Subject: RE: [Omaha.pm] IO::Multiplex & signals? I know under the p5p mailing list, they've been discussing "safe signals", and that as currently implemented in Perl, signals are inherently unsafe as they can interrupt things you'd not normally think would be interruptable, which can cause "interesting" effects and crashes. At least that's the understanding I had after skimming through that thread. -Scott From jay at jays.net Sat Oct 23 11:43:11 2004 From: jay at jays.net (Jay Hannah) Date: Sat Oct 23 11:44:38 2004 Subject: [Omaha.pm] Mtg last Thr, next mtg Message-ID: I didn't come up with an agenda for our monthly meeting last Thr, so didn't email out a reminder, but Ron showed up anyway. After many years of Java, he's recently been declared "the Perl guy" for his team at work, so he's brushing up his Perl skills he hasn't used in a while. (And he happens to work across the street from my office. Small town, Omaha. -grin-) Ron and I walked through turning Perl code into packages and objects, and touched briefly on complex nested data structures, references, and CGI.pm, just for fun. Next meeting: Thursday, November 18th 2004 @ 7pm http://omaha.pm.org/ Below is the code we wrote during the meeting. If anyone has anything they want to go over at the meetings, I'm all ears. Otherwise, I'm just winging it every month. -grin- Cheers, j ================================================= A tiny nested complex data structures example (de/referencing) ================================================== --------------- j.pl: --------------- #!/usr/bin/perl my %hash = ( 'a' => 'A', 'b' => 'B', 'c' => { blue => 'bluer', grey => 'gray', peach => [ 7,8,9,10 ] } ); my $ref = \%hash; print "$$ref{c}{peach}[2]\n"; print "$ref->{c}->{peach}->[2]\n"; print "$ref->{c}{peach}->[2]\n"; print "$ref->{c}{peach}[2]\n"; ================================= Writing our talker object ================================= --------------- run.pl: --------------- #!/usr/bin/perl use talker; my $t = talker->new(); $t->hello("world"); $t->dance("really fast"); $t->set_jaysmiddlename('Weston'); print "..... middle name: ", $t->get_jaysmiddlename(), "\n"; --------------- talker.pm: --------------- package talker; use vars qw( $AUTOLOAD ); sub new { my %self = ( who_is_here => { # 'Jay' => 71273891, # 'Ron' => 12738917, # 'JayS' => 127893917, }, hello_count => 0, bye_count => 0 ); return bless \%self; } #sub get_hello_count { # my ($self) = @_; # return $self->{hello_count}; #} #sub get_bye_count { # my ($self) = @_; # return $self->{bye_count}; #} sub hello { my ($self, $who) = @_; $self->{who_is_here}->{$who} = time; $self->{hello_count}++; print "Hello, $who!\n"; } sub bye { my ($self, $who) = @_; $self->warn($who); delete %$self->{who_is_here}->{$who}; $self->{bye_count}++; print "Goodbye, $who!\n"; } sub warn { my ($self, $who) = @_; print "WARNING: I've been told goodbye for user '$who'\n"; } sub print_counts { my ($self) = @_; print "Hello: ", $self->get_hello_count, " Bye: ", $self->get_bye_count, "\n"; } sub AUTOLOAD { my ($self, $arg1) = @_; my $name = $AUTOLOAD; $name =~ s/.*://; # strip fully-qualified portion if ($name =~ /^get_(.*)/) { #print "get_$1? Well, I didn't program that, but OK...!\n"; return $self->{$1}; } elsif ($name =~ /^set_(.*)/) { #print "set_$1? Well, I didn't program that, but OK...!\n"; $self->{$1} = $arg1; return 1; } else { print "YOU ENVOKED NON-EXISTANT METHOD $name!\n"; } } 1; ================================================= A tiny Date::Calc example (show method exporting) ================================================= [Jay-Hannahs-Computer:~/tmp3/tmp] jhannah% more run.pl #!/usr/bin/perl use Date::Calc qw( Today Add_Delta_Days ); my @date = Today(); my $cnt = 0; while ($cnt < 10) { printf("%04d-%02d-%02d\n", @date); @date = Add_Delta_Days(@date, 1); $cnt++; } ================================================= A tiny CGI demo.... ================================================= [omaha@www omaha]$ more j2.pl #!/usr/bin/perl use CGI; my $q = CGI->new(); my $blah = $q->param('blah'); print $q->header, $q->start_html, $q->h1("Ron's First CGI.pm CGI!"), "

Jay likes manual HTML better

", "Previous entry: $blah

\n", $q->start_form; if ($q->param('blah3')) { print "Yes sir! I will process blah3 immediately!
\n"; } for (1..10) { print $q->textfield("blah$_"), "
\n"; } print $q->submit, $q->end_form, $q->end_html; From jay at jays.net Sat Oct 23 11:58:35 2004 From: jay at jays.net (Jay Hannah) Date: Sat Oct 23 11:58:57 2004 Subject: [Omaha.pm] Informix / Perl mtg in KC Oct. 27 Message-ID: Thought this might be of interest... http://www.iiug.org/kciug/ -snip!- 11:00 AM - 12:30 PM "Is your DBA Paranoid Enough? - IDS 9.4 Recommended Security Practices, Jonathan Leffler -snip!- Jonathan Leffler is the author/maintainer of Perl's DBD::Informix (*the* module that lets you IO an Informix database with perl (through DBI)), and therefore the king of Informix <-> Perl communication. So, basically, he's been one of the ubergeeks in the critical path of how I've made a living for a big chunk of the past 7 years. I finally get to meet the man, the myth, the legend; without having to fly anywhere. -grin- Dave Thacker and I are going to drive down and meet him. Oh, and we'll learn more about Informix 9.4 too. -grin- j From scott.l.miller at hp.com Tue Oct 26 10:10:25 2004 From: scott.l.miller at hp.com (Miller, Scott L (Omaha Networks)) Date: Tue Oct 26 10:10:29 2004 Subject: [Omaha.pm] [patch] Sys::Syslog POD - $Sys::Syslog::host Message-ID: <1F7C0C8F4BD7C54A8BC55012FEF3DF6D0302E726@omaexc11.americas.cpqcorp.net> Congrats! -Scott I'm more than a little behind on my "extra-curricular" email reading... -----Original Message----- From: omaha-pm-bounces@mail.pm.org [mailto:omaha-pm-bounces@mail.pm.org]On Behalf Of Jay Hannah Sent: Tuesday, October 05, 2004 3:46 PM To: omaha-pm@pm.org Subject: [Omaha.pm] [patch] Sys::Syslog POD - $Sys::Syslog::host Yay! I've now had my 2nd patch to core Perl applied! http://public.activestate.com/cgi-bin/perlbrowse?patch=23341&action=patch Take that Scott!! -grin- j -----Original Message----- From: Jay Hannah [mailto:jhannah@omnihotels.com] Sent: Tuesday, October 05, 2004 3:45 PM To: 'Rafael Garcia-Suarez' Subject: RE: [patch] Sys::Syslog POD - $Sys::Syslog::host Thank you!! I'm always amazed by the gurus that keep Perl going. Thanks for all you do! j > -----Original Message----- > From: Rafael Garcia-Suarez [mailto:rgarciasuarez@mandrakesoft.com] > Sent: Thursday, September 30, 2004 11:03 AM > To: jhannah@omnihotels.com > Cc: perl5-porters@perl.org; omaha-pm@pm.org > Subject: Re: [patch] Sys::Syslog POD - $Sys::Syslog::host > > > Jay Hannah wrote: > > > > You can change $Sys::Syslog::host and the package will happily go > > connect (TCP or UDP) to a remote server. Works great. However, there is > > no interface to change $Sys::Syslog::host, and the feature isn't > > documented. > > > > Instead of changing openlog(), connect(), connect_udp(), > > connect_tcp(), and documenting all of that; I thought it would just be > > easier to document changing $Sys::Syslog::host. > > > > Objections? > > No. Thanks, applied as #23341 to bleadperl. > > > --- Syslog.pm 2004-03-06 15:30:08.000000000 -0600 > > +++ new_Syslog.pm 2004-09-15 14:11:19.000000000 -0500 _______________________________________________ Omaha-pm mailing list Omaha-pm@mail.pm.org http://www.pm.org/mailman/listinfo/omaha-pm From scott.l.miller at hp.com Tue Oct 26 10:10:25 2004 From: scott.l.miller at hp.com (Miller, Scott L (Omaha Networks)) Date: Tue Oct 26 10:10:36 2004 Subject: [Omaha.pm] [patch] Sys::Syslog POD - $Sys::Syslog::host Message-ID: <1F7C0C8F4BD7C54A8BC55012FEF3DF6D0302E726@omaexc11.americas.cpqcorp.net> Congrats! -Scott I'm more than a little behind on my "extra-curricular" email reading... -----Original Message----- From: omaha-pm-bounces@mail.pm.org [mailto:omaha-pm-bounces@mail.pm.org]On Behalf Of Jay Hannah Sent: Tuesday, October 05, 2004 3:46 PM To: omaha-pm@pm.org Subject: [Omaha.pm] [patch] Sys::Syslog POD - $Sys::Syslog::host Yay! I've now had my 2nd patch to core Perl applied! http://public.activestate.com/cgi-bin/perlbrowse?patch=23341&action=patch Take that Scott!! -grin- j -----Original Message----- From: Jay Hannah [mailto:jhannah@omnihotels.com] Sent: Tuesday, October 05, 2004 3:45 PM To: 'Rafael Garcia-Suarez' Subject: RE: [patch] Sys::Syslog POD - $Sys::Syslog::host Thank you!! I'm always amazed by the gurus that keep Perl going. Thanks for all you do! j > -----Original Message----- > From: Rafael Garcia-Suarez [mailto:rgarciasuarez@mandrakesoft.com] > Sent: Thursday, September 30, 2004 11:03 AM > To: jhannah@omnihotels.com > Cc: perl5-porters@perl.org; omaha-pm@pm.org > Subject: Re: [patch] Sys::Syslog POD - $Sys::Syslog::host > > > Jay Hannah wrote: > > > > You can change $Sys::Syslog::host and the package will happily go > > connect (TCP or UDP) to a remote server. Works great. However, there is > > no interface to change $Sys::Syslog::host, and the feature isn't > > documented. > > > > Instead of changing openlog(), connect(), connect_udp(), > > connect_tcp(), and documenting all of that; I thought it would just be > > easier to document changing $Sys::Syslog::host. > > > > Objections? > > No. Thanks, applied as #23341 to bleadperl. > > > --- Syslog.pm 2004-03-06 15:30:08.000000000 -0600 > > +++ new_Syslog.pm 2004-09-15 14:11:19.000000000 -0500 _______________________________________________ Omaha-pm mailing list Omaha-pm@mail.pm.org http://www.pm.org/mailman/listinfo/omaha-pm