From dbii at interaction.net Thu Jul 8 16:18:24 2004 From: dbii at interaction.net (David Bluestein II) Date: Mon Aug 2 21:23:25 2004 Subject: APM: Class::DBI or alternative? Message-ID: <20040708211824.GW9465@interaction.net> I know at some of the recent meetings we've discussed database abstraction layers, and I remember that DBI::Broker was not recommended. Anyone use Class::DBI or have an alternative to making database interfaces easy to maintain and synchronize as tables are changed? David David Bluestein dbii@interaction.net http://www.interaction.net/ From dbii at interaction.net Thu Jul 8 16:19:37 2004 From: dbii at interaction.net (David Bluestein II) Date: Mon Aug 2 21:23:25 2004 Subject: APM: July Meeting Message-ID: <20040708211937.GX9465@interaction.net> I know Wayne and Bill are planning a tag team session for our meeting in two weeks, where is it going to be? ARL or ServerGraph? We need to update the website with topic and location. David From ian at remmler.org Thu Jul 8 19:39:43 2004 From: ian at remmler.org (Ian Remmler) Date: Mon Aug 2 21:23:25 2004 Subject: APM: July Meeting In-Reply-To: <20040708211937.GX9465@interaction.net> References: <20040708211937.GX9465@interaction.net> Message-ID: <20040709003943.GA14766@remmler.org> On Thu, Jul 08, 2004 at 04:19:37PM -0500, David Bluestein II wrote: > I know Wayne and Bill are planning a tag team session for our > meeting in two weeks, where is it going to be? ARL or > ServerGraph? If we want to have it at ARL, I'll need to know pretty soon so I can make the reservation. That being said, Wayne might want the ServerGraph home field advantage. :) Doesn't matter to me. -- Ian Remmler | A monk asked Joshu, "Has a dog Buddha ian@remmler.org | nature or not?" Joshu replied, "Mu!" http://remmler.org | -- Mumon, "The Gateless Gate" From tom.bakken at tx.usda.gov Fri Jul 9 11:57:23 2004 From: tom.bakken at tx.usda.gov (Bakken, Tom - Temple, TX) Date: Mon Aug 2 21:23:25 2004 Subject: APM: How do you modify the @INC array? Message-ID: This should be an easy one. I want to modify the default @INC array. I don't want to prepend it, but modify the system settings. Tom Bakken Information Resource Manager Texas USDA, Rural Development From brian_clarkson at yahoo.com Fri Jul 9 13:13:27 2004 From: brian_clarkson at yahoo.com (Comrade Burnout) Date: Mon Aug 2 21:23:25 2004 Subject: APM: How do you modify the @INC array? In-Reply-To: Message-ID: <20040709181327.97218.qmail@web12105.mail.yahoo.com> --- "Bakken, Tom - Temple, TX" wrote: > This should be an easy one. I want to modify the default @INC array. I > don't want to prepend it, but modify the system settings. you want to completely change it? like: @INC = qw# /use/this/lib/set #; i don't think you can without setting the PERL5LIB or PERLLIB ENV var ... resetting in the ENV would most likely be the best bet, since that would be invoked first. next, i think, would be a BEGIN block with the above code in it. YMMV, because i'm not sure it's something that's *intended* to be done. __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail From rainking at feeding.frenzy.com Fri Jul 9 14:08:45 2004 From: rainking at feeding.frenzy.com (Dennis Moore) Date: Mon Aug 2 21:23:25 2004 Subject: APM: How do you modify the @INC array? In-Reply-To: References: Message-ID: <20040709190845.GA88254@feeding.frenzy.com> On Fri, Jul 09, 2004 at 10:57:23AM -0600, Bakken, Tom - Temple, TX wrote: > This should be an easy one. I want to modify the default @INC array. I > don't want to prepend it, but modify the system settings. If you want to change the default one, you have to recompile perl. If you want to modify it at compile time: use lib qw(/foo/bar); `man lib` for more info. -- ;for (74,1970500640,1634627444,1751478816,1348825708,543711587, 1801810465){for($x=1<<1^1;$x>=1>>1;$x--) {$q=hex ff,$r=oct($x=~s,\d,$&* 10,e,$x),$x/=1/.1,$q<<=$r,$s.=chr (($_&$q)>>$r),$t++}}while($= ||= !$|) {$o=$o?$?:$/;$|=1;print $o?$s:$"x$t if$;;print"\b"x$t;sleep 1} From dbii at interaction.net Tue Jul 13 09:33:12 2004 From: dbii at interaction.net (David Bluestein II) Date: Mon Aug 2 21:23:25 2004 Subject: APM: Activestate Perl 5.8.3 Issues (esp. threads)? Message-ID: <20040713143312.GF8441@interaction.net> I remember 2-3 meetings ago, someone was talking about Activestate perl 5.8.3 and it's stability. Anyone using it? Any issues with it? Or should I stick to 5.6.x for now from them? I have to deploy to windows so Activestate is my option. David David Bluestein II www.interaction.net From dbii at interaction.net Tue Jul 13 09:35:19 2004 From: dbii at interaction.net (David Bluestein II) Date: Mon Aug 2 21:23:25 2004 Subject: APM: Questions about Meeting next week Message-ID: <20040713143519.GG8441@interaction.net> Okay, so last week's message didn't really get a response, so I'll try again :) Wayne and Bill are going to tag team for next week Wednesday's meeting, can we get a blurb from you guys for the website (and pass it along to the person who was going to help update the website?)? Also, where are we meeting, ServerGraph or ARL? Did we miss the ARL deadline? Wayne, do you want to host and present? David David Bluestein II www.interaction.net From taylor at codecafe.com Tue Jul 13 23:29:03 2004 From: taylor at codecafe.com (Taylor Carpenter) Date: Mon Aug 2 21:23:25 2004 Subject: APM: Activestate Perl 5.8.3 Issues (esp. threads)? In-Reply-To: <20040713143312.GF8441@interaction.net> References: <20040713143312.GF8441@interaction.net> Message-ID: <1089779343.3940.200316862@webmail.messagingengine.com> On Tue, 13 Jul 2004 09:33:12 -0500, "David Bluestein II" said: > I remember 2-3 meetings ago, someone was talking about Activestate perl > 5.8.3 and it's stability. Anyone using it? Any issues with it? Or should > I stick to 5.6.x for now from them? I have to deploy to windows so > Activestate is my option. I am using it for most of my Windows projects. ActiveState 5.6 has more modules ported/compiled than 5.8. I have used 5.6 modules under 5.8 though. With 5.8 you get alot of updates to various modules of course. Some of the updates have been useful for me. I have seen an issue with modules using OpenSSL for downloads (eg. LWP and https). I can use OpenSSL 0.9.6g linked modules but OpenSSL 0.9.7c (which I believe is part of 5.8.2) fails to download "larger files" (several mb). It times out. This happens on non-windows systems also. Anyhow ActiveState is just great as long as you are not porting a module with a C extension from Linux to it. Then it is lame ;) (I am porting TFBS). ActiveState is not the only Windows option BTW. You have Cygwin and MinGW ports. Cygwin will require the cygwin dlls but MinGW does not depend on any DLLs that are not alread shipped with Windows. There are native compiles in VC++ also of just perl.. Ie download the src and compile. Then use CPAN and do the same again. Some links ActiveState Download - http://www.activestate.com/Products/Download/Download.plex?id=ActivePerl Cygwin - http://cygwin.com/ MinGW - http://www.mingw.org/ MinGW software ports - http://jrfonseca.dyndns.org/projects/gnu-win32/software/ported/ On the last link you can find Perl. From dbii at interaction.net Wed Jul 14 15:02:14 2004 From: dbii at interaction.net (David Bluestein II) Date: Mon Aug 2 21:23:25 2004 Subject: APM: July 21st Meeting Details Message-ID: <20040714200214.GV8441@interaction.net> [Will someone update the website with this information?] Austin Perl Mongers Meeting 5:30 pm'ish: Dinner at Pok-e Jo's on 5th 7:00 pm: Meeting at Servergraph Topic: Bill and Wayne Present A Round Robin of Useful Topics 1) Spawning Perl Processes 2) Perl Profilers 3) LOG Control for Logging Program Operation 4) Tie Magic and Watches 5) vim/emacs/bash Word Completion We discussed the possible topics at the June dinner meeting, and came up with these 5 as the topics we'd all like to hear a presentation on. David David Bluestein II www.interaction.net From itnomad at itnomad.net Fri Jul 16 17:06:00 2004 From: itnomad at itnomad.net (Jack Lupton) Date: Mon Aug 2 21:23:25 2004 Subject: APM: web site updates Message-ID: <40F85148.2030809@itnomad.net> If I can log in to the server with a username and password, I will update the website via SSH with the information provided by David Bluestein's email. whoever is in charge of this may call me at 917-3724. From dbii at interaction.net Mon Jul 19 09:42:40 2004 From: dbii at interaction.net (David Bluestein II) Date: Mon Aug 2 21:23:25 2004 Subject: APM: July 21st Meeting Details Reminder Message-ID: <20040719144240.GO10382@interaction.net> As a reminder, and since Jack hasn't been able to update the website (who has access to do that?), I'm reposting the meeting details for this week. Austin Perl Mongers Meeting Wednesday, July 21st. 5:30 pm'ish: Dinner at Pok-e Jo's on 5th 7:00 pm: Meeting at Servergraph -- someone will post the directions on the website, or come to Pok-e Jo's and we'll show you where we are meeting. Topic: Bill and Wayne Present A Round Robin of Useful Topics 1) Spawning Perl Processes 2) Perl Profilers 3) LOG Control for Logging Program Operation 4) Tie Magic and Watches 5) vim/emacs/bash Word Completion We discussed the possible topics at the June dinner meeting, and came up with these 5 as the topics we'd all like to hear a presentation on. David David Bluestein II www.interaction.net From austin.pm at sam-i-am.com Mon Jul 19 14:37:45 2004 From: austin.pm at sam-i-am.com (Sam Foster) Date: Mon Aug 2 21:23:25 2004 Subject: APM: July 21st Meeting Details Reminder In-Reply-To: <20040719144240.GO10382@interaction.net> References: <20040719144240.GO10382@interaction.net> Message-ID: <40FC2309.80308@sam-i-am.com> David Bluestein II wrote: > As a reminder, and since Jack hasn't been able to update the website (who has access to do that?) I have an account on austin.pm.org that Dwayne set up for me (for this purpose).. but I apparently have no clue what password I used that day. a lot of help, I know. With that problem rectified, I'm happy to do these updates - this month or any other. See you wednesday. Sam From jholder at networklogistic.com Mon Jul 19 16:32:42 2004 From: jholder at networklogistic.com (Joel Holder) Date: Mon Aug 2 21:23:25 2004 Subject: APM: Newb to the group Message-ID: Gents, I just joined the Austin pm list. Wasn't sure that the group was alive, given the dates on the website. I'm way interested in these discussion topics. Can I come to the meeting on Wed? Joel -- Network Logistic, Inc. Chameleon Appliance 512.491.9700 Secure Business Networks; Telephone Systems; Commercial Web Presence and Ecommerce Solutions; All-in-One Design, Hosting, and Management systems; Closed Circuit TV; Off-Site Data Backup and Archiving Solutions -- 13B1A500 Joel Holder (Developer Chameleon Appliance) Fingerprint = 2C28 0C60 A7ED FC5F 211B E568 C434 7AF1 13B1 A500 13B1A500 Joel Holder (Developer Chameleon Appliance) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/austin/attachments/20040719/58e7cf94/attachment.htm From dbii at interaction.net Mon Jul 19 17:14:55 2004 From: dbii at interaction.net (David Bluestein II) Date: Mon Aug 2 21:23:25 2004 Subject: APM: Newb to the group In-Reply-To: References: Message-ID: <20040719221455.GV10382@interaction.net> Joel- Sure, the meeting is open to everyone. Pok-e Jo's is the one on 5th street. The site (hopefully) will be updated and contain directions to Servergraph where the meeting will be held (it is just 1.5 blocks from Pok-e Jo's). Maybe someone has a URL for directions to servergraph? Look forward to seeing you there. David On Mon, Jul 19, 2004 at 04:32:42PM -0500, Joel Holder wrote: > Gents, I just joined the Austin pm list. Wasn't sure that the group was > alive, given the dates on the website. I'm way interested in these > discussion topics. Can I come to the meeting on Wed? > > > > Joel > > -- > > > > Network Logistic, Inc. > > Chameleon Appliance > > 512.491.9700 > > > > Secure Business Networks; Telephone Systems; Commercial Web Presence and > Ecommerce Solutions; All-in-One Design, Hosting, and Management systems; > Closed Circuit TV; Off-Site Data Backup and Archiving Solutions > > -- > > > > > > 13B1A500 > emplate=netenextract,netennomatch,netenerror> Joel Holder > (Developer Chameleon Appliance) > Fingerprint = 2C28 0C60 A7ED FC5F 211B E568 C434 7AF1 13B1 A500 > 13B1A500 Joel Holder (Developer Chameleon Appliance) > > > > > > > > _______________________________________________ > Austin mailing list > Austin@mail.pm.org > http://mail.pm.org/mailman/listinfo/austin From michalk at awpi.com Tue Jul 20 15:36:02 2004 From: michalk at awpi.com (Brian Michalk) Date: Mon Aug 2 21:23:25 2004 Subject: APM: Spawning processes In-Reply-To: Message-ID: <200407202035.i6KKZwSU009499@dax.awpi.com> I have come across a scenario where the shell environment changes. When this happens, I could clean up all of my network sockets, and restore everything, but it would be much simpler to just restart. What would the preferred method be? The respawned process needs to detach, because we will be killing the parent. Something like: System "run_my_program.pl &"; Exit 0; Maybe a fork()????? From ian at SKYLIST.net Tue Jul 20 15:42:20 2004 From: ian at SKYLIST.net (Ian Ragsdale) Date: Mon Aug 2 21:23:25 2004 Subject: APM: Spawning processes In-Reply-To: <200407202035.i6KKZwSU009499@dax.awpi.com> References: <200407202035.i6KKZwSU009499@dax.awpi.com> Message-ID: <4BAE78B7-DA8D-11D8-B2CE-000A95BE26A6@SKYLIST.net> I think just calling "exec($0, @ARGV);" will do what you want. Ian On Jul 20, 2004, at 3:36 PM, Brian Michalk wrote: > I have come across a scenario where the shell environment changes. > When > this happens, I could clean up all of my network sockets, and restore > everything, but it would be much simpler to just restart. > > What would the preferred method be? The respawned process needs to > detach, > because we will be killing the parent. > > Something like: > System "run_my_program.pl &"; > Exit 0; > > Maybe a fork()????? > > _______________________________________________ > Austin mailing list > Austin@mail.pm.org > http://mail.pm.org/mailman/listinfo/austin From tom.bakken at tx.usda.gov Wed Jul 21 09:12:46 2004 From: tom.bakken at tx.usda.gov (Bakken, Tom - Temple, TX) Date: Mon Aug 2 21:23:25 2004 Subject: APM: (no subject) Message-ID: I'm having trouble with the perl "system" function. Actually system works fine. It's the windows 2000 server programs it runs that are giving me fits. When I do this: $Status = system("uptime \\\\$MachineName > /nul"); Or $Status = system("if exist p:\nul net use p: /d"); For example, the uptime or net use will sometimes hang or stall. How can I kill these and continue without aborting the entire program? I've looked through some of the texts regarding interprocess communications but I'm not sure that's the way I should go. Tom Bakken -------------- next part -------------- A non-text attachment was scrubbed... Name: Tom.Bakken@tx.usda.gov.vcf Type: text/x-vcard Size: 460 bytes Desc: Tom.Bakken@tx.usda.gov.vcf Url : http://mail.pm.org/pipermail/austin/attachments/20040721/5b523962/Tom.Bakkentx.usda.gov.vcf From michalk at awpi.com Wed Jul 21 09:35:01 2004 From: michalk at awpi.com (Brian Michalk) Date: Mon Aug 2 21:23:25 2004 Subject: APM: Spawning processes In-Reply-To: <4BAE78B7-DA8D-11D8-B2CE-000A95BE26A6@SKYLIST.net> Message-ID: <200407211434.i6LEYuSU005260@dax.awpi.com> Thanks. That was pretty close. It turned out to need something like this: 347 exec("./$0 2>&1 &"); 348 exit 0; -----Original Message----- From: Ian Ragsdale [mailto:ian@SKYLIST.net] Sent: Tuesday, July 20, 2004 3:42 PM To: Brian Michalk Cc: austin@mail.pm.org Subject: Re: APM: Spawning processes I think just calling "exec($0, @ARGV);" will do what you want. Ian On Jul 20, 2004, at 3:36 PM, Brian Michalk wrote: > I have come across a scenario where the shell environment changes. > When > this happens, I could clean up all of my network sockets, and restore > everything, but it would be much simpler to just restart. > > What would the preferred method be? The respawned process needs to > detach, > because we will be killing the parent. > > Something like: > System "run_my_program.pl &"; > Exit 0; > > Maybe a fork()????? > > _______________________________________________ > Austin mailing list > Austin@mail.pm.org > http://mail.pm.org/mailman/listinfo/austin From tom.bakken at tx.usda.gov Thu Jul 22 08:45:41 2004 From: tom.bakken at tx.usda.gov (Bakken, Tom - Temple, TX) Date: Mon Aug 2 21:23:25 2004 Subject: APM: system call hangs Message-ID: The system I'm running this on (Windows 2000 Server) doesn't seem to support fork. I'm digging through the ActivePerl documentation and there seems to be some support for emulating UNIX. I tried: use POSIX qw(setsid); use POSIX qw(:errno_h :fcntl_h); But that didn't help. Is there another module that would work? I appreciate your help. -----Original Message----- From: Bill Raty [mailto:bill.raty@gmail.com] Sent: Wednesday, July 21, 2004 10:50 AM To: Bakken, Tom - Temple, TX Subject: Re: APM: (no subject) Tom, "System" is itself a form of IPC that has been neatly bundled to cover the majority case usage (running a well behaved short-lived subprocess). However you're needing behavior that isn't exactly covered by "system". Take a look at the 2nd edition of the Perl Cookbook, especially the piped open commands. You'll probably also need to fork off a process to do the reading so that your parent process can control how long it is willing to wait. You may also be able to tap directly into the Windows API via the COM module that are supplied with ActiveState perl interpreter, rather -- BEGIN SHAMELESS PLUG -- I'll be presenting some syntactic sugar to sweeten the experience of controling child processes at Perl monger's tonight. -- END SHAMELESS PLUG -- Here is example code that I'll be covering tonight which spawns off a child process and terminates it after five seconds. First the syntactic sugar subroutine: sub spawn (&) { my ($coderef) = @_; my $pid; unless ($pid = fork) { # start the child process. make sure we exit too! $coderef->(); exit; } # make sure we don't have ghost processes. Have perl do the waitpid $SIG{CHLD} = "IGNORE"; # return the process id of the child process. return $pid; } ############################# # Now the using code ############################# # start a process to count from 1 to 100 in 1 second intervals. Interrupt it # after 5 seconds my $kidpid = spawn { # this is running in a different process foreach (1 .. 100) { print "$_\n"; sleep 1; } }; # <--- REMEMBER THE SEMICOLON HERE!!! # let child run for 5 seconds, then stop it. sleep 5; kill TERM => $kidpid; __END__ In your case you'd probably put the system call inside the curly braces after the 'spawn' invocation. You'll probably need to include the code that acts upon the status code from the 'system' command into the curly as well, since that is running in a separate perl process. On Wed, 21 Jul 2004 08:12:46 -0600, Bakken, Tom - Temple, TX wrote: > I'm having trouble with the perl "system" function. Actually system > works fine. It's the windows 2000 server programs it runs that are > giving me fits. When I do this: > > $Status = system("uptime \\\\$MachineName > /nul"); > Or > $Status = system("if exist p:\nul net use p: /d"); > > For example, the uptime or net use will sometimes hang or stall. How > can I kill these and continue without aborting the entire program? > > I've looked through some of the texts regarding interprocess > communications but I'm not sure that's the way I should go. > > Tom Bakken > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: Tom.Bakken@tx.usda.gov.vcf Type: text/x-vcard Size: 460 bytes Desc: Tom.Bakken@tx.usda.gov.vcf Url : http://mail.pm.org/pipermail/austin/attachments/20040722/21de2770/Tom.Bakkentx.usda.gov.vcf From tom.bakken at tx.usda.gov Thu Jul 22 13:02:29 2004 From: tom.bakken at tx.usda.gov (Bakken, Tom - Temple, TX) Date: Mon Aug 2 21:23:25 2004 Subject: APM: system call hangs Message-ID: perl -v = This is perl, version 5.005_03 built for MSWin32-x86-object Surprise?!!???!! Bill, you hit the nail on the head. I've got a newer version on another machine I should be able to use instead. Thanks for all your help. Tom Bakken -----Original Message----- From: Bill Raty [mailto:bill.raty@gmail.com] Sent: Thursday, July 22, 2004 11:33 AM To: Bakken, Tom - Temple, TX Subject: Re: APM: system call hangs What version of perl? Activestate perl has support 'fork' since 5.6.mumble . Please post results of perl -v Regards, -Bill On Thu, 22 Jul 2004 07:45:41 -0600, Bakken, Tom - Temple, TX wrote: > The system I'm running this on (Windows 2000 Server) doesn't seem to > support fork. I'm digging through the ActivePerl documentation and > there seems to be some support for emulating UNIX. I tried: > > use POSIX qw(setsid); > use POSIX qw(:errno_h :fcntl_h); > > But that didn't help. Is there another module that would work? > > I appreciate your help. > > -----Original Message----- > From: Bill Raty [mailto:bill.raty@gmail.com] > Sent: Wednesday, July 21, 2004 10:50 AM > To: Bakken, Tom - Temple, TX > Subject: Re: APM: (no subject) > > Tom, > > "System" is itself a form of IPC that has been neatly bundled to cover > the majority case usage (running a well behaved short-lived > subprocess). However you're needing behavior that isn't exactly > covered by "system". > > Take a look at the 2nd edition of the Perl Cookbook, especially the > piped open commands. You'll probably also need to fork off a process > to do the reading so that your parent process can control how long it > is willing to wait. > > You may also be able to tap directly into the Windows API via the COM > module that are supplied with ActiveState perl interpreter, rather > > -- BEGIN SHAMELESS PLUG -- > I'll be presenting some syntactic sugar to sweeten the experience of > controling child processes at Perl monger's tonight. > -- END SHAMELESS PLUG -- > > Here is example code that I'll be covering tonight which spawns off a > child process and terminates it after five seconds. First the > syntactic sugar subroutine: > > sub spawn (&) { > my ($coderef) = @_; > my $pid; > unless ($pid = fork) { > # start the child process. make sure we exit too! > $coderef->(); > exit; > } > # make sure we don't have ghost processes. Have perl do the waitpid > $SIG{CHLD} = "IGNORE"; > # return the process id of the child process. > return $pid; > } > > ############################# > # Now the using code > ############################# > # start a process to count from 1 to 100 in 1 second intervals. > Interrupt it > # after 5 seconds > my $kidpid = spawn { > # this is running in a different process > foreach (1 .. 100) { > print "$_\n"; > sleep 1; > } > }; # <--- REMEMBER THE SEMICOLON HERE!!! > > # let child run for 5 seconds, then stop it. > sleep 5; > kill TERM => $kidpid; > > __END__ > > In your case you'd probably put the system call inside the curly > braces after the 'spawn' invocation. You'll probably need to include > the code that acts upon the status code from the 'system' command > into the curly as well, since that is running in a separate perl > process. > > On Wed, 21 Jul 2004 08:12:46 -0600, Bakken, Tom - Temple, TX > wrote: > > I'm having trouble with the perl "system" function. Actually system > > works fine. It's the windows 2000 server programs it runs that are > > giving me fits. When I do this: > > > > $Status = system("uptime \\\\$MachineName > /nul"); > > Or > > $Status = system("if exist p:\nul net use p: /d"); > > > > For example, the uptime or net use will sometimes hang or stall. How > > can I kill these and continue without aborting the entire program? > > > > I've looked through some of the texts regarding interprocess > > communications but I'm not sure that's the way I should go. > > > > Tom Bakken > > > > > > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: Tom.Bakken@tx.usda.gov.vcf Type: text/x-vcard Size: 460 bytes Desc: Tom.Bakken@tx.usda.gov.vcf Url : http://mail.pm.org/pipermail/austin/attachments/20040722/ccacbb0b/Tom.Bakkentx.usda.gov.vcf From john.moon at myflorida.com Fri Jul 23 08:45:49 2004 From: john.moon at myflorida.com (Moon, John) Date: Mon Aug 2 21:23:25 2004 Subject: APM: scp with perl Message-ID: <870A2C59C4C884418DD7EB4B9306124F07E51FEF@dmssem01.dms.state.fl.us> Have multiple Unix platforms that I need to pickup files from then delete on each respective platform once picked and processed. I was using ftp put they are starting to shut down that option. Any suggestions of another approach will be greatly appreciated. I have tried to use system(" scp ... ") but keep getting a request for a password. jwm From michalk at awpi.com Fri Jul 23 09:11:48 2004 From: michalk at awpi.com (Brian Michalk) Date: Mon Aug 2 21:23:25 2004 Subject: APM: Debugging print statement In-Reply-To: <870A2C59C4C884418DD7EB4B9306124F07E51FEF@dmssem01.dms.state.fl.us> Message-ID: I'm want to print a string in it's raw form, like what the perl debugger does when I issue an "x $mystring", which is different than an "p $mystring". I want to see the terminating characters at the end of the line, like "hello world\r\n". I've tried Data::Dumper. No luck. I've read about "use Dumpvalue", which mumbles something about "unctrl". What's the best way to go about this? These are embedded machines; Dumpvalue is not installed, so I'd like to gather wisdom before checking this out. From erik at debill.org Fri Jul 23 09:30:07 2004 From: erik at debill.org (erik@debill.org) Date: Mon Aug 2 21:23:25 2004 Subject: APM: scp with perl In-Reply-To: <870A2C59C4C884418DD7EB4B9306124F07E51FEF@dmssem01.dms.state.fl.us> References: <870A2C59C4C884418DD7EB4B9306124F07E51FEF@dmssem01.dms.state.fl.us> Message-ID: <20040723143006.GA13278@debill.org> On Fri, Jul 23, 2004 at 09:45:49AM -0400, Moon, John wrote: > I have tried to use system(" scp ... ") but keep getting a request for a > password. I use this pretty routinely. If you're getting a request for password you haven't set up your rhostsrsa authentication properly. I can't really think of a better way to transfer files around automatically (unless it's rsync over ssh). Erik -- Well I'm walking through the sand In the desert of my mind And I don't remember what it was That I came here to find -- Sister Machine Gun "Alone" From ian at remmler.org Fri Jul 23 09:34:13 2004 From: ian at remmler.org (Ian Remmler) Date: Mon Aug 2 21:23:25 2004 Subject: APM: scp with perl In-Reply-To: <870A2C59C4C884418DD7EB4B9306124F07E51FEF@dmssem01.dms.state.fl.us> References: <870A2C59C4C884418DD7EB4B9306124F07E51FEF@dmssem01.dms.state.fl.us> Message-ID: <20040723143413.GA12705@remmler.org> On Fri, Jul 23, 2004 at 09:45:49AM -0400, Moon, John wrote: > Have multiple Unix platforms that I need to pickup files from then delete on > each respective platform once picked and processed. I was using ftp put they > are starting to shut down that option. Any suggestions of another approach > will be greatly appreciated. > > I have tried to use system(" scp ... ") but keep getting a request for a > password. To get around the password thing, you can have scp (ssh) use public key crypto to authenticate instead. Just generate an ssh key on each machine you need to scp files from: > ssh hostname ... enter password ... > ssh-keygen -t rsa Then, get the file ~/.ssh/id_rsa.pub from each of those machines and append its contents to the file ~/.ssh/authorized_keys on the machine you'll run the script from. > scp hostname:.ssh/id_rsa.pub /tmp/id_rsa.pub.hostname Or some such, for each host. Then: > cat /tmp/id_rsa.pub.* >> ~/.ssh/authorized_keys You should now be able to ssh/scp without needing a password. If you already knew all this, well, maybe someone somewhere learned something at least. :) On the Perl side, a quick look at http://search.cpan.org reveals Net::SCP, which will probably do what you need. -- Ian Remmler | A monk asked Joshu, "Has a dog Buddha ian@remmler.org | nature or not?" Joshu replied, "Mu!" http://remmler.org | -- Mumon, "The Gateless Gate" From jholder at networklogistic.com Fri Jul 23 09:42:22 2004 From: jholder at networklogistic.com (Joel Holder) Date: Mon Aug 2 21:23:25 2004 Subject: APM: scp with perl Message-ID: Try this: #>cd ~ #>ssh-keygen -t dsa #>scp .ssh/id_dsa.pub remotehost:.ssh/authorized_keys #>ssh remotehost Then use perl to control scp. Enjoy.. -----Original Message----- From: austin-bounces@mail.pm.org [mailto:austin-bounces@mail.pm.org] On Behalf Of erik@debill.org Sent: Friday, July 23, 2004 9:30 AM To: Moon, John Cc: austin@mail.pm.org Subject: Re: APM: scp with perl On Fri, Jul 23, 2004 at 09:45:49AM -0400, Moon, John wrote: > I have tried to use system(" scp ... ") but keep getting a request for a > password. I use this pretty routinely. If you're getting a request for password you haven't set up your rhostsrsa authentication properly. I can't really think of a better way to transfer files around automatically (unless it's rsync over ssh). Erik -- Well I'm walking through the sand In the desert of my mind And I don't remember what it was That I came here to find -- Sister Machine Gun "Alone" _______________________________________________ Austin mailing list Austin@mail.pm.org http://mail.pm.org/mailman/listinfo/austin From chris at tooley.com Fri Jul 23 09:41:40 2004 From: chris at tooley.com (Chris Tooley) Date: Mon Aug 2 21:23:25 2004 Subject: APM: scp with perl In-Reply-To: <870A2C59C4C884418DD7EB4B9306124F07E51FEF@dmssem01.dms.state.fl.us> References: <870A2C59C4C884418DD7EB4B9306124F07E51FEF@dmssem01.dms.state.fl.us> Message-ID: <1090593700.18956.2.camel@localhost> Public Key authentication is your only path around the password problem. Using keys you can reasonably securely attach to a server and as long as the user that you're attaching as is limited in capabilities having no password on the private key can be more secure than using passwords with ftp. Chris On Fri, 2004-07-23 at 09:45 -0400, Moon, John wrote: > Have multiple Unix platforms that I need to pickup files from then delete on > each respective platform once picked and processed. I was using ftp put they > are starting to shut down that option. Any suggestions of another approach > will be greatly appreciated. > > I have tried to use system(" scp ... ") but keep getting a request for a > password. > > jwm > _______________________________________________ > Austin mailing list > Austin@mail.pm.org > http://mail.pm.org/mailman/listinfo/austin From tom.bakken at tx.usda.gov Fri Jul 23 09:45:29 2004 From: tom.bakken at tx.usda.gov (Bakken, Tom - Temple, TX) Date: Mon Aug 2 21:23:25 2004 Subject: APM: Killing spawned processes Message-ID: I tried Bill's spawn subroutine on a system that supports fork: SNIP---- sub spawn (&) { my ($CodeRef) = @_; my $pid; unless ($pid = fork) { $CodeRef->(); # Start the child process. Make sure it exits too! exit; } $SIG{CHLD} = "IGNORE"; # Make sure we don't have any ghost processes. Have perl do the waitpid return $pid; } sub GetWorkstationUptime { # Copy files to server using a list of machine names my $ListOfWorkstationsArrayRef = shift; my $Count = 0; foreach (sort @{$ListOfWorkstationsArrayRef}) { my ($MachineName, $Description, $DnsHostName, $OS, $WhenChanged, $WhenCreated) = split /\|/, $_; #### next unless uc($MachineName) =~ /TXTEMPLE/; next unless uc($MachineName) =~ /TXBELLVILLD/; $Count++; unless ($MachineName =~ /$StateAbbrev/i) { print "$Count ALERT!!! No MachineName for this Active Directory record.\n"; print LOGFILE "$Count ALERT!!! No MachineName for this Active Directory record.\n"; print DATAFILE "$Count\t--------------\t-------------------\t---\t---\t---\tNo Machine Name\n"; next; } print "$Count: Checking last reboot on: $MachineName\n"; my $ChildPid = spawn { print LOGFILE "$Count: Checking last reboot on: $MachineName\n"; $Status = system "uptime \\\\$MachineName > /nul"; unless ($Status == 0) { $Error++; if($OS =~ /Windows XP Professional/) { print "ALERT!!! Could not connect to $MachineName. $Description Error: $?\n"; print LOGFILE " ALERT!!! Could not connect to $MachineName. $Description Error: $?\n"; } else { print "ALERT!!! Could not connect to $MachineName. $Description Error: $?\n"; print LOGFILE " ALERT!!! Could not connect to $MachineName. $Description Error: $?\n"; print "ALERT!!! OS Not Windows XP Professional. Detected: $OS\n"; print LOGFILE " ALERT!!! OS Not Windows XP Professional. Detected: $OS\n"; } print DATAFILE "$Count\t$MachineName\t-------------------\t---\t---\t---\tCould not connect\n"; next; } }; # Don't forget the semicolon here!!!! sleep 20; # Give uptime 20 seconds to run kill TERM => $ChildPid; # Kill after that amount of time my $Results = `uptime \\\\$MachineName`; my ($Days, $Hours, $Minutes, $Seconds) = split /,/, $Results; Blah blah . . . . } # End GetWorkstationUptime subroutine And it does allow the uptime command to run for at most 20 seconds as advertised. If uptime succeeds it then reads the results of uptime and processes it as intended. However, if uptime does run for 20 seconds, the kill program terminates my perl script rather than the child process. Bill, I may have misinterpreted your instructions, but I think I'm stumbling close to what I want What am I doing wrong? Tom Bakken -------------- next part -------------- A non-text attachment was scrubbed... Name: Tom.Bakken@tx.usda.gov.vcf Type: text/x-vcard Size: 460 bytes Desc: Tom.Bakken@tx.usda.gov.vcf Url : http://mail.pm.org/pipermail/austin/attachments/20040723/82bc0985/Tom.Bakkentx.usda.gov.vcf From dbii at interaction.net Fri Jul 23 10:02:49 2004 From: dbii at interaction.net (David Bluestein II) Date: Mon Aug 2 21:23:25 2004 Subject: APM: July and August Meetings Message-ID: <20040723150249.GH10382@interaction.net> Thanks to Bill and Wayne for presenting on a variety of topics this week. Everyone was able to get something from the meeting, and lots of people asked questions and were able to get their problems solved. For the August meeting, does anyone have a topic they would like to hear or even better present? I know we had a list of topics/presenters back in May, does anyone remember them (Mark?)? Once we decide on a topic, we'll name a location. David David Bluestein www.interaction.net From vaughan99 at yahoo.com Fri Jul 23 10:03:38 2004 From: vaughan99 at yahoo.com (Chris Vaughan) Date: Mon Aug 2 21:23:25 2004 Subject: APM: scp with perl In-Reply-To: Message-ID: <20040723150338.51805.qmail@web11503.mail.yahoo.com> Don't forget, you can also drive scp using Net::SCP from CPAN. Regards, Chris --- Joel Holder wrote: > Try this: > > #>cd ~ > #>ssh-keygen -t dsa > #>scp .ssh/id_dsa.pub remotehost:.ssh/authorized_keys > #>ssh remotehost > > Then use perl to control scp. Enjoy.. > > -----Original Message----- > From: austin-bounces@mail.pm.org > [mailto:austin-bounces@mail.pm.org] On > Behalf Of erik@debill.org > Sent: Friday, July 23, 2004 9:30 AM > To: Moon, John > Cc: austin@mail.pm.org > Subject: Re: APM: scp with perl > > On Fri, Jul 23, 2004 at 09:45:49AM -0400, Moon, John wrote: > > I have tried to use system(" scp ... ") but keep getting a > request for > a > > password. > > I use this pretty routinely. If you're getting a request for > password > you haven't set up your rhostsrsa authentication properly. I > can't > really think of a better way to transfer files around > automatically > (unless it's rsync over ssh). > > > Erik > > -- > Well I'm walking through the sand > In the desert of my mind > And I don't remember what it was > That I came here to find > -- Sister Machine Gun "Alone" > _______________________________________________ > Austin mailing list > Austin@mail.pm.org > http://mail.pm.org/mailman/listinfo/austin > > > > _______________________________________________ > Austin mailing list > Austin@mail.pm.org > http://mail.pm.org/mailman/listinfo/austin > ===== ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Chris Vaughan | "I love deadlines. I like the | swooshing sound as they fly by." vaughan99@yahoo.com | - Douglas Adams __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail From john.moon at myflorida.com Fri Jul 23 09:28:18 2004 From: john.moon at myflorida.com (Moon, John) Date: Mon Aug 2 21:23:25 2004 Subject: APM: scp with perl Message-ID: <870A2C59C4C884418DD7EB4B9306124F07E51FF1@dmssem01.dms.state.fl.us> Well, actually not on all platforms... that's the problem... I can't determine what is causing some to ask and some not to ask... I have ran ssh-keygen -t dsa on all the platforms and set up, I think, the correct authorized_keys files on the appropriate platforms... Looked at Net::SCP but it appeared to have a lot of dependent modules ... I thought before installing it and all it dependents I'd see if anyone had experience with this problem... Thanks, jwm -----Original Message----- From: Comrade Burnout [mailto:brian_clarkson@yahoo.com] Sent: Friday, July 23, 2004 10:12 AM To: Moon, John Subject: Re: APM: scp with perl --- "Moon, John" wrote: > Have multiple Unix platforms that I need to pickup files from then > delete on > each respective platform once picked and processed. I was using ftp put > they > are starting to shut down that option. Any suggestions of another > approach > will be greatly appreciated. > > I have tried to use system(" scp ... ") but keep getting a request for a > password. of course ya will. how 'bout Net::SCP? http://search.cpan.org/~ivan/Net-SCP-0.07/SCP.pm ===== i'm trying to get away from this mail account as much as possible. it's become a spamtrap. please reply to , or update your address books to, geektron@comradeburnout.com __________________________________ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail From jeremy.brooks at univista.com Fri Jul 23 11:01:55 2004 From: jeremy.brooks at univista.com (Jeremy Brooks) Date: Mon Aug 2 21:23:25 2004 Subject: APM: scp with perl Message-ID: <30788BCB219F1F4CBD9AF46384EDA465053FB0@MAILROOM.THEDOGHOUSE.HMFIC> read a little about ssh-keygen in it's man page. It'll help you create and use certificates for automated authentication. -Jeremy -----Original Message----- From: austin-bounces@mail.pm.org [mailto:austin-bounces@mail.pm.org]On Behalf Of erik@debill.org Sent: Friday, July 23, 2004 9:30 AM To: Moon, John Cc: austin@mail.pm.org Subject: Re: APM: scp with perl On Fri, Jul 23, 2004 at 09:45:49AM -0400, Moon, John wrote: > I have tried to use system(" scp ... ") but keep getting a request for a > password. I use this pretty routinely. If you're getting a request for password you haven't set up your rhostsrsa authentication properly. I can't really think of a better way to transfer files around automatically (unless it's rsync over ssh). Erik -- Well I'm walking through the sand In the desert of my mind And I don't remember what it was That I came here to find -- Sister Machine Gun "Alone" _______________________________________________ Austin mailing list Austin@mail.pm.org http://mail.pm.org/mailman/listinfo/austin From tom.bakken at tx.usda.gov Mon Jul 26 10:25:09 2004 From: tom.bakken at tx.usda.gov (Bakken, Tom - Temple, TX) Date: Mon Aug 2 21:23:25 2004 Subject: APM: RE: Killing spawned processes Message-ID: I tried Bill's spawn subroutine on a system that supports fork. And it does allow the uptime command to run for at most 20 seconds as advertised. If uptime succeeds it then reads the results of uptime and processes it as intended. However, if uptime does run for 20 seconds, the kill program terminates my perl script rather than the child process. Bill, I may have misinterpreted your instructions, but I think I'm stumbling close to what I want What am I doing wrong? SNIP---- sub spawn (&) { my ($CodeRef) = @_; my $pid; unless ($pid = fork) { $CodeRef->(); # Start the child process. Make sure it exits too! exit; } $SIG{CHLD} = "IGNORE"; # Make sure we don't have any ghost processes. Have perl do the waitpid return $pid; } sub GetWorkstationUptime { # Copy files to server using a list of machine names my $ListOfWorkstationsArrayRef = shift; my $Count = 0; foreach (sort @{$ListOfWorkstationsArrayRef}) { my ($MachineName, $Description, $DnsHostName, $OS, $WhenChanged, $WhenCreated) = split /\|/, $_; #### next unless uc($MachineName) =~ /TXTEMPLE/; next unless uc($MachineName) =~ /TXBELLVILLD/; $Count++; unless ($MachineName =~ /$StateAbbrev/i) { print "$Count ALERT!!! No MachineName for this Active Directory record.\n"; print LOGFILE "$Count ALERT!!! No MachineName for this Active Directory record.\n"; print DATAFILE "$Count\t--------------\t-------------------\t---\t---\t---\tNo Machine Name\n"; next; } print "$Count: Checking last reboot on: $MachineName\n"; my $ChildPid = spawn { print LOGFILE "$Count: Checking last reboot on: $MachineName\n"; $Status = system "uptime \\\\$MachineName > /nul"; unless ($Status == 0) { $Error++; if($OS =~ /Windows XP Professional/) { print "ALERT!!! Could not connect to $MachineName. $Description Error: $?\n"; print LOGFILE " ALERT!!! Could not connect to $MachineName. $Description Error: $?\n"; } else { print "ALERT!!! Could not connect to $MachineName. $Description Error: $?\n"; print LOGFILE " ALERT!!! Could not connect to $MachineName. $Description Error: $?\n"; print "ALERT!!! OS Not Windows XP Professional. Detected: $OS\n"; print LOGFILE " ALERT!!! OS Not Windows XP Professional. Detected: $OS\n"; } print DATAFILE "$Count\t$MachineName\t-------------------\t---\t---\t---\tCould not connect\n"; next; } }; # Don't forget the semicolon here!!!! sleep 20; # Give uptime 20 seconds to run kill TERM => $ChildPid; # Kill after that amount of time my $Results = `uptime \\\\$MachineName`; my ($Days, $Hours, $Minutes, $Seconds) = split /,/, $Results; Blah blah . . . . } # End GetWorkstationUptime subroutine Tom Bakken -------------- next part -------------- A non-text attachment was scrubbed... Name: Tom.Bakken@tx.usda.gov.vcf Type: text/x-vcard Size: 460 bytes Desc: Tom.Bakken@tx.usda.gov.vcf Url : http://mail.pm.org/pipermail/austin/attachments/20040726/a1b6e8a6/Tom.Bakkentx.usda.gov.vcf From tom.bakken at tx.usda.gov Mon Jul 26 14:09:37 2004 From: tom.bakken at tx.usda.gov (Bakken, Tom - Temple, TX) Date: Mon Aug 2 21:23:25 2004 Subject: APM: RE: Killing spawned processes Message-ID: Bill, The parent id was 160, the child was -3168 Tom Bakken Information Resource Manager Texas USDA, Rural Development -----Original Message----- From: Bill Raty [mailto:bill.raty@gmail.com] Sent: Monday, July 26, 2004 12:19 PM To: Bakken, Tom - Temple, TX Subject: Re: Killing spawned processes Tom, Sorry for the delay in answering, been pushing a product deadline all weekend. We need to make sure the ChildPid is different than the parent process id. Could you add this statement to the start of your script?: print "parent pid: $$\n"; Then right before your 'kill' add print "child pid: $ChildPid\n"; Please rerun and let me know what these results are. I need to know if it is perl or Windows that is misbehaving. -Bill On Mon, 26 Jul 2004 09:25:09 -0600, Bakken, Tom - Temple, TX wrote: > I tried Bill's spawn subroutine on a system that supports fork. And it > does allow the uptime command to run for at most 20 seconds as > advertised. If uptime succeeds it then reads the results of uptime and > processes it as intended. However, if uptime does run for 20 seconds, > the kill program terminates my perl script rather than the child > process. > > Bill, I may have misinterpreted your instructions, but I think I'm > stumbling close to what I want > > What am I doing wrong? > > SNIP---- > sub spawn (&) { > my ($CodeRef) = @_; > my $pid; > unless ($pid = fork) { > $CodeRef->(); # Start the child process. Make sure it > exits too! > exit; > } > $SIG{CHLD} = "IGNORE"; # Make sure we don't have any ghost > processes. Have perl do the waitpid > return $pid; > } > sub GetWorkstationUptime { # Copy files to server using a list of > machine names > my $ListOfWorkstationsArrayRef = shift; > my $Count = 0; > foreach (sort @{$ListOfWorkstationsArrayRef}) { > my ($MachineName, $Description, $DnsHostName, > $OS, $WhenChanged, $WhenCreated) = split /\|/, $_; > #### next unless uc($MachineName) =~ /TXTEMPLE/; > next unless uc($MachineName) =~ /TXBELLVILLD/; > $Count++; > unless ($MachineName =~ /$StateAbbrev/i) { > print "$Count ALERT!!! No MachineName for this Active Directory > record.\n"; > print LOGFILE "$Count ALERT!!! No MachineName for this Active > Directory record.\n"; > print DATAFILE > "$Count\t--------------\t-------------------\t---\t---\t---\tNo Machine > Name\n"; > next; > } > print "$Count: Checking last reboot on: $MachineName\n"; > my $ChildPid = spawn { > print LOGFILE "$Count: Checking last reboot on: $MachineName\n"; > $Status = system "uptime \\\\$MachineName > /nul"; > unless ($Status == 0) { > $Error++; > if($OS =~ /Windows XP Professional/) { > print "ALERT!!! Could not connect to $MachineName. > $Description Error: $?\n"; > print LOGFILE " ALERT!!! Could not connect to > $MachineName. $Description Error: $?\n"; > } > else { > print "ALERT!!! Could not connect to $MachineName. > $Description Error: $?\n"; > print LOGFILE " ALERT!!! Could not connect to > $MachineName. $Description Error: $?\n"; > print "ALERT!!! OS Not Windows XP Professional. Detected: > $OS\n"; > print LOGFILE " ALERT!!! OS Not Windows XP Professional. > Detected: $OS\n"; > } > print DATAFILE > "$Count\t$MachineName\t-------------------\t---\t---\t---\tCould not > connect\n"; > next; > } > }; # Don't forget the semicolon here!!!! > sleep 20; # Give uptime 20 seconds to run > kill TERM => $ChildPid; # Kill after that amount of time > my $Results = `uptime \\\\$MachineName`; > my ($Days, $Hours, $Minutes, $Seconds) = split /,/, $Results; > Blah blah > .. > .. > .. > .. > } # End GetWorkstationUptime subroutine > > > Tom Bakken > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: Tom.Bakken@tx.usda.gov.vcf Type: text/x-vcard Size: 460 bytes Desc: Tom.Bakken@tx.usda.gov.vcf Url : http://mail.pm.org/pipermail/austin/attachments/20040726/ba92ea7c/Tom.Bakkentx.usda.gov.vcf