From jeremyb at univista.com Mon Mar 3 10:20:19 2003 From: jeremyb at univista.com (jeremyb@univista.com) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Mail::IMAPClient::BodyStructure::Envelope difficulty Message-ID: <405A4B20FCF8D41192CF0050DA1802C250A682@MINIBOX> I recently asked this question on linux@ctlug.org and was asked to direct it here instead. Do any of you have code examples where perl module Mail::IMAPClient::BodyStructure's ::Envelope subclass (Mail::IMAPClient::BodyStructure::Envelope) is employed? I'm having trouble figuring out how to access items in a message envelope. I am currently rereading the camel book's section on subclasses, packages and modules. ...I think I'm just missing something silly here. A code example better then the one supplied in the module doc would be very helpful. thanks, Jeremy From wwalker at broadq.com Mon Mar 3 11:16:15 2003 From: wwalker at broadq.com (Wayne Walker) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Mail::IMAPClient::BodyStructure::Envelope difficulty In-Reply-To: <405A4B20FCF8D41192CF0050DA1802C250A682@MINIBOX>; from jeremyb@univista.com on Mon, Mar 03, 2003 at 10:20:19AM -0600 References: <405A4B20FCF8D41192CF0050DA1802C250A682@MINIBOX> Message-ID: <20030303111615.C1120@broadq.com> Bit tricky that... What in particular are you trying to do with an included message? Then I can make an example that is more relevant On Mon, Mar 03, 2003 at 10:20:19AM -0600, jeremyb@univista.com wrote: > I recently asked this question on linux@ctlug.org and was asked to direct it > here instead. > > Do any of you have code examples where perl module > Mail::IMAPClient::BodyStructure's > ::Envelope subclass (Mail::IMAPClient::BodyStructure::Envelope) is employed? > I'm > having trouble figuring out how to access items in a message envelope. I am > > currently rereading the camel book's section on subclasses, packages and > modules. ...I think I'm just missing something silly here. > > A code example better then the one supplied in the module doc would be very > helpful. > > > thanks, > Jeremy > _______________________________________________ > Austin mailing list > Austin@mail.pm.org > http://mail.pm.org/mailman/listinfo/austin -- Wayne Walker www.broadq.com :) Bringing digital video and audio to the living room From jeremyb at univista.com Mon Mar 3 12:32:08 2003 From: jeremyb at univista.com (jeremyb@univista.com) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Mail::IMAPClient::BodyStructure::Envelope difficulty Message-ID: <405A4B20FCF8D41192CF0050DA1802C250A684@MINIBOX> Thanks Wayne, Given a UID I want to access the subject and the sender's address. Presently The script logs in and gets all unseen messages delivered within the last $n seconds using search. I want to access the previously mentioned data from this array of UIDs. -Jeremy -----Original Message----- From: Wayne Walker To: jeremyb@univista.com Cc: austin@mail.pm.org Sent: 3/3/03 11:16 AM Subject: Re: APM: Mail::IMAPClient::BodyStructure::Envelope difficulty Bit tricky that... What in particular are you trying to do with an included message? Then I can make an example that is more relevant On Mon, Mar 03, 2003 at 10:20:19AM -0600, jeremyb@univista.com wrote: > I recently asked this question on linux@ctlug.org and was asked to direct it > here instead. > > Do any of you have code examples where perl module > Mail::IMAPClient::BodyStructure's > ::Envelope subclass (Mail::IMAPClient::BodyStructure::Envelope) is employed? > I'm > having trouble figuring out how to access items in a message envelope. I am > > currently rereading the camel book's section on subclasses, packages and > modules. ...I think I'm just missing something silly here. > > A code example better then the one supplied in the module doc would be very > helpful. > > > thanks, > Jeremy > _______________________________________________ > Austin mailing list > Austin@mail.pm.org > http://mail.pm.org/mailman/listinfo/austin -- Wayne Walker www.broadq.com :) Bringing digital video and audio to the living room From jeremyb at univista.com Tue Mar 4 14:05:44 2003 From: jeremyb at univista.com (jeremyb@univista.com) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Mail::IMAPClient::BodyStructure::Envelope difficulty Message-ID: <405A4B20FCF8D41192CF0050DA1802C250A690@MINIBOX> Any ideas yet? -Jeremy -----Original Message----- From: Jeremy Brooks Sent: Monday, March 03, 2003 12:32 PM To: 'Wayne Walker '; Jeremy Brooks Cc: 'austin@mail.pm.org ' Subject: RE: APM: Mail::IMAPClient::BodyStructure::Envelope difficulty Thanks Wayne, Given a UID I want to access the subject and the sender's address. Presently The script logs in and gets all unseen messages delivered within the last $n seconds using search. I want to access the previously mentioned data from this array of UIDs. -Jeremy -----Original Message----- From: Wayne Walker To: jeremyb@univista.com Cc: austin@mail.pm.org Sent: 3/3/03 11:16 AM Subject: Re: APM: Mail::IMAPClient::BodyStructure::Envelope difficulty Bit tricky that... What in particular are you trying to do with an included message? Then I can make an example that is more relevant On Mon, Mar 03, 2003 at 10:20:19AM -0600, jeremyb@univista.com wrote: > I recently asked this question on linux@ctlug.org and was asked to direct it > here instead. > > Do any of you have code examples where perl module > Mail::IMAPClient::BodyStructure's ::Envelope subclass > (Mail::IMAPClient::BodyStructure::Envelope) is employed? > I'm > having trouble figuring out how to access items in a message envelope. I am > > currently rereading the camel book's section on subclasses, packages and > modules. ...I think I'm just missing something silly here. > > A code example better then the one supplied in the module doc would be very > helpful. > > > thanks, > Jeremy > _______________________________________________ > Austin mailing list > Austin@mail.pm.org > http://mail.pm.org/mailman/listinfo/austin -- Wayne Walker www.broadq.com :) Bringing digital video and audio to the living room From bob at blacklab.com Tue Mar 4 15:56:14 2003 From: bob at blacklab.com (Bob Richards) Date: Mon Aug 2 21:23:16 2004 Subject: APM: komodo Message-ID: Anyone use Komodo from Active State? If you're not familiar with it, it's a program designed to help you write/edit perl programs. (available at http://activestate.com) I've been using textpad for my programming. Good features include: on the fly error checking saving directly to a ftp site integration with cvs package control regular expression evaluation Bad only one program visible at a time can't completely "fold" a program into 2 windows to see a top part and bottom part at the same time. So any of you guys use this? If not, what do you use? Is there any other programs you recommend? Thanks! Bob Richards http://www.blacklab.com 888-654-8860 512-275-0099 bob@blacklab.com From lhunter at lhunter.com Tue Mar 4 20:28:35 2003 From: lhunter at lhunter.com (Larry Hunter) Date: Mon Aug 2 21:23:16 2004 Subject: APM: komodo In-Reply-To: Message-ID: <5.2.0.9.0.20030304202535.018bccb8@lhunter.com> I've just about decided to get komodo based on the descriptions and reviews and very positive experience with ActiveState's Perl debugger. At 03:56 PM 3/4/2003 -0600, you wrote: >Anyone use Komodo from Active State? > >If you're not familiar with it, it's a program >designed to help you write/edit perl programs. >(available at http://activestate.com) >I've been using textpad for my programming. > >Good features include: >on the fly error checking >saving directly to a ftp site >integration with cvs >package control >regular expression evaluation > >Bad >only one program visible at a time >can't completely "fold" a program into >2 windows to see a top part and bottom >part at the same time. > >So any of you guys use this? >If not, what do you use? >Is there any other programs you recommend? > >Thanks! > >Bob Richards >http://www.blacklab.com >888-654-8860 >512-275-0099 >bob@blacklab.com > >_______________________________________________ >Austin mailing list >Austin@mail.pm.org >http://mail.pm.org/mailman/listinfo/austin ------------------------------------------------------------------------ Larry Hunter lhunter@lhunter.com http://lhunter.com/ From michalk at awpi.com Thu Mar 6 09:07:36 2003 From: michalk at awpi.com (Brian Michalk) Date: Mon Aug 2 21:23:16 2004 Subject: APM: File descriptors In-Reply-To: <20020607094409.A3379@bybent.com> Message-ID: Is there a way to test if a socket can be written to without using a select() call? $fh is the handle I want to write to $bfh_select is the select object with a lot of socket handles The way it is now: foreach my $tfh ($bfh_select->can_write(0)) { if ($fh == $tfh) { write something out } } What I would like to do is have something similar without the select, like: if ($fh->can_write()) { write something to $fh}; From michalk at awpi.com Thu Mar 6 10:22:58 2003 From: michalk at awpi.com (Brian Michalk) Date: Mon Aug 2 21:23:16 2004 Subject: APM: File descriptors In-Reply-To: <20020607094409.A3379@bybent.com> Message-ID: Is there a way to test if a socket can be written to without using a select() call? $fh is the handle I want to write to $bfh_select is the select object with a lot of socket handles The way it is now: foreach my $tfh ($bfh_select->can_write(0)) { if ($fh == $tfh) { write something out } } What I would like to do is have something similar without the select, like: if ($fh->can_write()) { write something to $fh}; From jeremyb at univista.com Sat Mar 8 10:06:21 2003 From: jeremyb at univista.com (jeremyb@univista.com) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Mail::IMAPClient::BodyStructure::Envelope difficulty Message-ID: <405A4B20FCF8D41192CF0050DA1802C250A6A5@MINIBOX> After stepping away for a while I came back and skimmed the IMAPClient doc again. The get_header function can get me all I need using header definitions from RFC822. thanks anyhow, Jeremy -----Original Message----- From: jeremyb@univista.com To: austin@mail.pm.org Sent: 3/4/03 2:05 PM Subject: RE: APM: Mail::IMAPClient::BodyStructure::Envelope difficulty Any ideas yet? -Jeremy -----Original Message----- From: Jeremy Brooks Sent: Monday, March 03, 2003 12:32 PM To: 'Wayne Walker '; Jeremy Brooks Cc: 'austin@mail.pm.org ' Subject: RE: APM: Mail::IMAPClient::BodyStructure::Envelope difficulty Thanks Wayne, Given a UID I want to access the subject and the sender's address. Presently The script logs in and gets all unseen messages delivered within the last $n seconds using search. I want to access the previously mentioned data from this array of UIDs. -Jeremy -----Original Message----- From: Wayne Walker To: jeremyb@univista.com Cc: austin@mail.pm.org Sent: 3/3/03 11:16 AM Subject: Re: APM: Mail::IMAPClient::BodyStructure::Envelope difficulty Bit tricky that... What in particular are you trying to do with an included message? Then I can make an example that is more relevant On Mon, Mar 03, 2003 at 10:20:19AM -0600, jeremyb@univista.com wrote: > I recently asked this question on linux@ctlug.org and was asked to direct it > here instead. > > Do any of you have code examples where perl module > Mail::IMAPClient::BodyStructure's ::Envelope subclass > (Mail::IMAPClient::BodyStructure::Envelope) is employed? > I'm > having trouble figuring out how to access items in a message envelope. I am > > currently rereading the camel book's section on subclasses, packages and > modules. ...I think I'm just missing something silly here. > > A code example better then the one supplied in the module doc would be very > helpful. > > > thanks, > Jeremy > _______________________________________________ > Austin mailing list > Austin@mail.pm.org > http://mail.pm.org/mailman/listinfo/austin -- Wayne Walker www.broadq.com :) Bringing digital video and audio to the living room _______________________________________________ Austin mailing list Austin@mail.pm.org http://mail.pm.org/mailman/listinfo/austin From mlehmann at marklehmann.com Thu Mar 13 14:16:26 2003 From: mlehmann at marklehmann.com (Mark Lehmann) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Meeting next Wednesday - March 19 at 7:00pm Message-ID: <15984.59162.653726.711669@lehmbrain.marklehmann.com> It's time for another monthly Austin Perl Monger meeting. You'll receive two more reminders, one the day before the meeting and one the day of the meeting itself. When ==== The next APM meeting is next Wednesday, March 19 at 7:00 pm (ending at 8:30pm). What ==== Stump the experts. Come ready with some code you are having trouble with. Either email it to me or come with a floppy disk. We'll interactively learn together. Where ===== Tek Systems is on the North side of Austin and is conveniently located close to 183. Maxim Group will again be catering the meeting. Dinner ====== Feel free to join us for dinner at Pok-e-Jo's BBQ in the Arboretum at 6:00pm. Drinking/Socializing ==================== After the meeting, a small group will be going out to socialize. The group typically meets at B.B. Rover's, which serves food and drinks. Here are the directions to the Tek System offices. Going North on 183: - Take the Oak Knoll Exit. - If you are going South on 183 take the Duvall exit and take the U turn so that you are heading North. - Take your First right at Riata Trace Parkway (which is before the Oak Knoll light) - Take your second right at Riata Corporate Park. (You'll see a Netsolve sign) - IMMEDIATELY turn right again (the sign does not have our name on it) You will be facing our building and turn left into the parking lot. Take the elevator to the second floor, turn right. Tek Systems is at the end of the hall. Address: 12331-1 Riata Trace Parkway, Suite 200 Austin, TX 78727 512-257-6907 -- Mark Lehmann email mlehmann@marklehmann.com | phone 512 689-7705 From mlehmann at marklehmann.com Thu Mar 13 14:34:38 2003 From: mlehmann at marklehmann.com (Mark Lehmann) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Linux Manazine has good Perl Articles Message-ID: <15984.60254.196463.636150@lehmbrain.marklehmann.com> I got a free Linux Magazine in the mail. It has an article on Perl 6, Parrot (a new virtual machine that Perl can use), and the standard Randal Schwartz article. -- Mark Lehmann email mlehmann@marklehmann.com | phone 512 689-7705 From wwalker at broadq.com Sun Mar 16 10:37:51 2003 From: wwalker at broadq.com (Wayne Walker) Date: Mon Aug 2 21:23:16 2004 Subject: APM: perl -i "failure mode" Message-ID: <20030316103751.A3489@broadq.com> I just got bit by an interesting behavior of perl -i. The short story is that the -i option to perl will change softlinks into real files. This is a proper behavior, just not what one expects. If you understand the following command, then there's probably nothing useful for you in the rest of the email. Those who don't understand the following line, esdpecially sysadmins or config mgmt folks, may find the rest of the email well worth looking at :) find . -name Makefile | xargs -n 1 perl -i -p -e 's/...MAKE_CONTINUE../(test "\$(MAKE_CONTINUE)" -eq 1)/' For those that don't know the perl command line switches that well, here are the three I use in this example: -i "edit In place" - takes one filename at a time from the command line args and makes that file's contents STDIN, renames the file, and writes STDOUT to a new file of the same name. -p "awk Print" - essentially wraps your program in a print loop: while (<>) # reads a line into $_ { # modifies $_ as appropriate print; # prints $_ } -e "execute" - run this line of perl code I ran: find . -name Makefile | xargs -n 1 perl -i -p -e 's/...MAKE_CONTINUE../(test "\$(MAKE_CONTINUE)" -eq 1)/' which in turn ran: perl -i -p -e 's/...MAKE_CONTINUE../(test "\$(MAKE_CONTINUE)" -eq 1)/' ./Makefile # and 20 other Makefiles which ran like: while (<>) # reads a line into $_ { s/...MAKE_CONTINUE../(test "\$(MAKE_CONTINUE)" -eq 1)/; print; # prints $_ } Now this did exactly what it was supposed to do. It read and rewrote 18 Makefiles for me for a total of 54 edits. But, I was in a "shadow tree" (a directory tree full of softlinks to the real files). I expected it to modify the real files, but what it did was remove my softlinks and replace them with real files (properly edited). -- Wayne Walker www.broadq.com :) Bringing digital video and audio to the living room From tom.bakken at tx.usda.gov Mon Mar 17 12:07:20 2003 From: tom.bakken at tx.usda.gov (Tom Bakken) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Hashes and grep Message-ID: <001e01c2ecb0$0df51540$920e9dc7@agwest.one.usda.gov> I've been using CGI.pm for some time as well as Lincoln Stein's "Official Guide to programming CGI.pm". I'm trying to modify his Multi-Part Form program to use with a database and custom input screens. Because some of the fields can't be text boxes like the examples, I've had to change his code. The problem is my ignorance of how some of the code he uses works. The book doesn't explain code like the following: Foreach (values %FIELDS) { Grep($ALL_FIELDS{$_}++,@$_); } And: grep ($fields{$_}++, @fields); (@hidden_fields = grep(!$fields{$_}, keys %ALL_FIELDS); I'm getting error messages I can't resolve: Not an ARRAY reference at (eval 38) line 12, chunk 1464 Any of you familiar with this code that can give me a clue? Tom Bakken From ian at SKYLIST.net Mon Mar 17 12:23:49 2003 From: ian at SKYLIST.net (Ian Ragsdale) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Hashes and grep In-Reply-To: <001e01c2ecb0$0df51540$920e9dc7@agwest.one.usda.gov> Message-ID: On 3/17/03 12:07 PM, "Tom Bakken" wrote: > > Foreach (values %FIELDS) { > Grep($ALL_FIELDS{$_}++,@$_); > } > The @$_ in the second argument to grep is trying to dereference an array reference stored in $_. If whatever is in $_ is not a reference, it will complain. Are you using "use strict;"? I don't think it will complain about that if you aren't. You can get around it by making sure that $_ is an array reference: Foreach (values %FIELDS) { if ( ref $_ eq 'ARRAY' ) { Grep($ALL_FIELDS{$_}++,@$_); } } > And: > > grep ($fields{$_}++, @fields); > (@hidden_fields = grep(!$fields{$_}, keys %ALL_FIELDS); > The above code looks ok to me, unless you are running under 'use strict' and have forgotten to declare %fields. The first grep will stick a value in %fields for each element of @fields, and then the second grep will return an array with every key of %ALL_FIELDS that does not appear in %fields. HTH, Ian From dbii at mudpuddle.com Mon Mar 17 12:57:34 2003 From: dbii at mudpuddle.com (David Bluestein II) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Modify in place and Argument list too long Message-ID: I'm doing a perl modify in place for a directory full of html files, yet I have several directories which have too many files for this: bash# perl -pi -e 's/oldtext/newtext/g' *html bash: /bin/perl: Argument list too long Any suggestions on how to work with this? The most files in a directory are 60,000. David ---------- David H. Bluestein II President & Lead Developer dbii@interaction.net ii, inc. http://www.interaction.net - Specializing in Designing Interactive Websites - - and Searchable Internet Databases - From majcher at majcher.com Mon Mar 17 12:53:13 2003 From: majcher at majcher.com (Marc Majcher) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Modify in place and Argument list too long In-Reply-To: (dbii@mudpuddle.com) References: Message-ID: <200303171853.h2HIrDLH001543@majcher.com> dbii@mudpuddle.com (David Bluestein II): :I'm doing a perl modify in place for a directory full of html files, yet I :have several directories which have too many files for this: : :bash# perl -pi -e 's/oldtext/newtext/g' *html :bash: /bin/perl: Argument list too long Use find. Something along the lines of: find /path/to/dir -name "*html" -exec perl -pi -e 's/oldtext/newtext/g' {} \; Works slightly differently on different systems. Consult your man. -- DVS THERE COULD BE BUGS IN EVERY SINGLE MEAL YOU EAT!!! From wwalker at broadq.com Mon Mar 17 13:05:40 2003 From: wwalker at broadq.com (Wayne Walker) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Modify in place and Argument list too long In-Reply-To: ; from dbii@mudpuddle.com on Mon, Mar 17, 2003 at 12:57:34PM -0600 References: Message-ID: <20030317130540.E4860@broadq.com> On Mon, Mar 17, 2003 at 12:57:34PM -0600, David Bluestein II wrote: > I'm doing a perl modify in place for a directory full of html files, yet I > have several directories which have too many files for this: > > bash# perl -pi -e 's/oldtext/newtext/g' *html > bash: /bin/perl: Argument list too long ls | grep '\.html$' | xargs perl -pi -e 's/oldtext/newtext/g' xargs is part of the "find" package. Arg list too long comes from the kernel settings and can't be easily changed. xargs takes __words__ on standard input and makes them arguments and passes then to as many invocations of the program as needed. > Any suggestions on how to work with this? The most files in a directory are > 60,000. In this case, then perl -pi... will probably be invoked about 30 times with roughly 2000 args each time (unless the filenames are long, then more invocations with fewer args each). > > David > > ---------- > David H. Bluestein II President & Lead Developer > dbii@interaction.net ii, inc. > > http://www.interaction.net > - Specializing in Designing Interactive Websites - > - and Searchable Internet Databases - > > > > > > _______________________________________________ > Austin mailing list > Austin@mail.pm.org > http://mail.pm.org/mailman/listinfo/austin -- Wayne Walker www.broadq.com :) Bringing digital video and audio to the living room From majcher at majcher.com Mon Mar 17 13:03:06 2003 From: majcher at majcher.com (Marc Majcher) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Modify in place and Argument list too long In-Reply-To: <20030317130540.E4860@broadq.com> (message from Wayne Walker on Mon, 17 Mar 2003 13:05:40 -0600) References: <20030317130540.E4860@broadq.com> Message-ID: <200303171903.h2HJ36B6001664@majcher.com> Wayne Walker : : :ls | grep '\.html$' | xargs perl -pi -e 's/oldtext/newtext/g' Yeah, do that. It's faster than using "find". Always forget... -- DVS i know that if someone called me a starburst, i'd definitely set _something_ on fire. -jay From wwalker at broadq.com Mon Mar 17 13:15:08 2003 From: wwalker at broadq.com (Wayne Walker) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Modify in place and Argument list too long In-Reply-To: <200303171853.h2HIrDLH001543@majcher.com>; from majcher@majcher.com on Mon, Mar 17, 2003 at 10:53:13AM -0800 References: <200303171853.h2HIrDLH001543@majcher.com> Message-ID: <20030317131508.B5137@broadq.com> On Mon, Mar 17, 2003 at 10:53:13AM -0800, Marc Majcher wrote: > > dbii@mudpuddle.com (David Bluestein II): > > :I'm doing a perl modify in place for a directory full of html files, yet I > :have several directories which have too many files for this: > : > :bash# perl -pi -e 's/oldtext/newtext/g' *html > :bash: /bin/perl: Argument list too long > > Use find. Something along the lines of: > > find /path/to/dir -name "*html" -exec perl -pi -e 's/oldtext/newtext/g' {} \; One gotcha: the \ in front of the semi-colon is mandatory! Marc's solution is just as functional as the xargs solution I mentioned and more straight forward than mine. once you understand both, you'll know when to use one versus the other... The difference is that this will execute the script 60,000 times with only one filename each time. This is often exactly what you want. In the case of "one filename per invocation" use Marc's recommendation. When you want a few invocations with lots of file names, use xargs. > > Works slightly differently on different systems. Consult your man. > > -- > DVS > THERE COULD BE BUGS IN EVERY SINGLE MEAL YOU EAT!!! > _______________________________________________ > Austin mailing list > Austin@mail.pm.org > http://mail.pm.org/mailman/listinfo/austin -- Wayne Walker www.broadq.com :) Bringing digital video and audio to the living room From mike at stok.co.uk Mon Mar 17 13:17:26 2003 From: mike at stok.co.uk (Mike Stok) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Modify in place and Argument list too long In-Reply-To: <20030317130540.E4860@broadq.com> Message-ID: On Mon, 17 Mar 2003, Wayne Walker wrote: > On Mon, Mar 17, 2003 at 12:57:34PM -0600, David Bluestein II wrote: > > I'm doing a perl modify in place for a directory full of html files, yet I > > have several directories which have too many files for this: > > > > bash# perl -pi -e 's/oldtext/newtext/g' *html > > bash: /bin/perl: Argument list too long > > ls | grep '\.html$' | xargs perl -pi -e 's/oldtext/newtext/g' > > xargs is part of the "find" package. Arg list too long comes from the > kernel settings and can't be easily changed. xargs takes __words__ on > standard input and makes them arguments and passes then to as many > invocations of the program as needed. The only thing I would add is that you can use find and xargs together on files whose names include blanks, tabs, newlines etc like this [mike@ratdog tmp]$ touch foo.html [mike@ratdog tmp]$ touch 'bar baz.html' [mike@ratdog tmp]$ ls -l total 0 -rw-rw-r-- 1 mike mike 0 Mar 17 14:15 bar baz.html -rw-rw-r-- 1 mike mike 0 Mar 17 14:15 foo.html [mike@ratdog tmp]$ find . -name '*.html' | xargs ls ls: ./bar: No such file or directory ls: baz.html: No such file or directory ./foo.html [mike@ratdog tmp]$ find . -name '*.html' -print0 | xargs -0 ls ./bar baz.html ./foo.html Mike -- mike@stok.co.uk | The "`Stok' disclaimers" apply. http://www.stok.co.uk/~mike/ | GPG PGP Key 1024D/059913DA mike@exegenix.com | Fingerprint 0570 71CD 6790 7C28 3D60 http://www.exegenix.com/ | 75D2 9EC4 C1C0 0599 13DA From wwalker at broadq.com Mon Mar 17 13:24:26 2003 From: wwalker at broadq.com (Wayne Walker) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Modify in place and Argument list too long In-Reply-To: ; from mike@stok.co.uk on Mon, Mar 17, 2003 at 02:17:26PM -0500 References: <20030317130540.E4860@broadq.com> Message-ID: <20030317132426.D5137@broadq.com> On Mon, Mar 17, 2003 at 02:17:26PM -0500, Mike Stok wrote: > The only thing I would add is that you can use find and xargs together on > files whose names include blanks, tabs, newlines etc like this > > [mike@ratdog tmp]$ touch foo.html > [mike@ratdog tmp]$ touch 'bar baz.html' > [mike@ratdog tmp]$ ls -l > total 0 > -rw-rw-r-- 1 mike mike 0 Mar 17 14:15 bar baz.html > -rw-rw-r-- 1 mike mike 0 Mar 17 14:15 foo.html > [mike@ratdog tmp]$ find . -name '*.html' | xargs ls > ls: ./bar: No such file or directory > ls: baz.html: No such file or directory > ./foo.html > [mike@ratdog tmp]$ find . -name '*.html' -print0 | xargs -0 ls > ./bar baz.html ./foo.html I forgot to point that problem out (spaces and tabs in the names), but had never seen the -0 and -print0 options. Thanks! I always fixed the the hard way: find . -name '*.html' -print | sed -e 's/^/"/' -e 's/$/"/' | xargs ..... You'll need to do it the hard way on something like HP-UX, Solaris, and other inferior OS's :) > > Mike > > -- > mike@stok.co.uk | The "`Stok' disclaimers" apply. > http://www.stok.co.uk/~mike/ | GPG PGP Key 1024D/059913DA > mike@exegenix.com | Fingerprint 0570 71CD 6790 7C28 3D60 > http://www.exegenix.com/ | 75D2 9EC4 C1C0 0599 13DA -- Wayne Walker www.broadq.com :) Bringing digital video and audio to the living room From mlehmann at marklehmann.com Tue Mar 18 22:29:29 2003 From: mlehmann at marklehmann.com (Mark Lehmann) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Meeting next Wednesday - March 19 at 7:00pm Message-ID: <15991.61993.176831.550244@lehmbrain.marklehmann.com> --text follows this line-- It's time for another monthly Austin Perl Monger meeting. You'll receive two more reminders, one the day before the meeting and one the day of the meeting itself. When ==== The next APM meeting is next Wednesday, March 19 at 7:00 pm (ending at 8:30pm). What ==== Stump the experts. Come ready with some code you are having trouble with. Either email it to me or come with a floppy disk. We'll interactively learn together. Where ===== Tek Systems is on the North side of Austin and is conveniently located close to 183. Maxim Group will again be catering the meeting. Dinner ====== Feel free to join us for dinner at Pok-e-Jo's BBQ in the Arboretum at 6:00pm. Drinking/Socializing ==================== After the meeting, a small group will be going out to socialize. The group typically meets at B.B. Rover's, which serves food and drinks. Here are the directions to the Tek System offices. Going North on 183: - Take the Oak Knoll Exit. - If you are going South on 183 take the Duvall exit and take the U turn so that you are heading North. - Take your First right at Riata Trace Parkway (which is before the Oak Knoll light) - Take your second right at Riata Corporate Park. (You'll see a Netsolve sign) - IMMEDIATELY turn right again (the sign does not have our name on it) You will be facing our building and turn left into the parking lot. Take the elevator to the second floor, turn right. Tek Systems is at the end of the hall. Address: 12331-1 Riata Trace Parkway, Suite 200 Austin, TX 78727 512-257-6907 -- Mark Lehmann email mlehmann@marklehmann.com | phone 512 689-7705 From mlehmann at marklehmann.com Wed Mar 19 13:41:56 2003 From: mlehmann at marklehmann.com (Mark Lehmann) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Meeting TONIGHT - March 19 at 7:00pm Message-ID: <15992.51204.601885.527451@lehmbrain.marklehmann.com> When ==== The next APM meeting is next Wednesday, March 19 at 7:00 pm (ending at 8:30pm). What ==== Stump the experts. Come ready with some code you are having trouble with. Either email it to me or come with a floppy disk. We'll interactively learn together. Where ===== Tek Systems is on the North side of Austin and is conveniently located close to 183. Maxim Group will again be catering the meeting. Dinner ====== Feel free to join us for dinner at Pok-e-Jo's BBQ in the Arboretum at 6:00pm. Drinking/Socializing ==================== After the meeting, a small group will be going out to socialize. The group typically meets at B.B. Rover's, which serves food and drinks. Here are the directions to the Tek System offices. Going North on 183: - Take the Oak Knoll Exit. - If you are going South on 183 take the Duvall exit and take the U turn so that you are heading North. - Take your First right at Riata Trace Parkway (which is before the Oak Knoll light) - Take your second right at Riata Corporate Park. (You'll see a Netsolve sign) - IMMEDIATELY turn right again (the sign does not have our name on it) You will be facing our building and turn left into the parking lot. Take the elevator to the second floor, turn right. Tek Systems is at the end of the hall. Address: 12331-1 Riata Trace Parkway, Suite 200 Austin, TX 78727 512-257-6907 -- Mark Lehmann email mlehmann@marklehmann.com | phone 512 689-7705 From mlehmann at marklehmann.com Wed Mar 19 13:42:48 2003 From: mlehmann at marklehmann.com (Mark Lehmann) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Meeting TONIGHT - March 19 at 7:00pm Message-ID: <15992.51256.160987.678173@lehmbrain.marklehmann.com> When ==== The next APM meeting is next Wednesday, March 19 at 7:00 pm (ending at 8:30pm). What ==== Stump the experts. Come ready with some code you are having trouble with. Either email it to me or come with a floppy disk. We'll interactively learn together. Where ===== Tek Systems is on the North side of Austin and is conveniently located close to 183. Maxim Group will again be catering the meeting. Dinner ====== Feel free to join us for dinner at Pok-e-Jo's BBQ in the Arboretum at 6:00pm. Drinking/Socializing ==================== After the meeting, a small group will be going out to socialize. The group typically meets at B.B. Rover's, which serves food and drinks. Here are the directions to the Tek System offices. Going North on 183: - Take the Oak Knoll Exit. - If you are going South on 183 take the Duvall exit and take the U turn so that you are heading North. - Take your First right at Riata Trace Parkway (which is before the Oak Knoll light) - Take your second right at Riata Corporate Park. (You'll see a Netsolve sign) - IMMEDIATELY turn right again (the sign does not have our name on it) You will be facing our building and turn left into the parking lot. Take the elevator to the second floor, turn right. Tek Systems is at the end of the hall. Address: 12331-1 Riata Trace Parkway, Suite 200 Austin, TX 78727 512-257-6907 -- Mark Lehmann email mlehmann@marklehmann.com | phone 512 689-7705 From michalk at awpi.com Thu Mar 20 20:52:38 2003 From: michalk at awpi.com (Brian Michalk) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Invoking a shell In-Reply-To: <15992.51204.601885.527451@lehmbrain.marklehmann.com> Message-ID: Wayne Walker showed a way to have an interactive shell in a CGI. I need an (insecure) access to the shell via a perl script. I tried: my $pid = open2($rdrfh, $wtrfh, '/bin/sh'); But that didn't work. I'm taking input from a socket and sending it to bash, and returning the results to the socket, basically just like a telnet session would look. Why not use telnet you say? I can't get it to work that way with winsock. Now, I can do this: 46 my $cmd = <$fh>; 47 print "Command: $cmd"; 48 $results = `$cmd`; 49 $fh->send($results); Works as advertized, but the shell exits immediately, and commands issued do not remain permanent, even if I do a command with an '&' at the end. Brian Michalk Life is what you make of it ... never wish you had done something. Aviator, experimental aircraft builder, motorcyclist, SCUBA diver musician, home-brewer, entrepreneur and mostly single From wwalker at broadq.com Sun Mar 23 09:05:57 2003 From: wwalker at broadq.com (Wayne Walker) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Perl Challenge Message-ID: <20030323150557.GH1406@broadq.com> Please don't reply to the list! Below is a program with a regex that tests for prime numbers. I'll buy dinner at PokeJo's before the next meeting for the first person to send me a description of how it works. I'm assuming anyone who has seen this before won't try to get the prize. Next Monday I'll post the correct answers I got and who sent them. That email will have appropriate subject to allow those still working on the problem to not accidentally see the answer. No, I did not come up with the regex. It's attributed to an Abigail (aparently of the Athens Perl Mongers, but not certain). The coupe de graz will be to also describe the function of time versus the change in $i's max value (e.g. "if we search 1-200 instead of 1-100, it takes 1024 times as long to run, meaning that the ratio function is k * (i2/i1)^10). #!/usr/bin/perl foreach $i (1..100) { if ((1 x $i) !~ /^1?$|^(11+?)\1+$/) { print "$i is prime\n"; $j = $i; } } -- Wayne Walker www.broadq.com :) Bringing digital video and audio to the living room From eharris at puremagic.com Sun Mar 23 15:15:29 2003 From: eharris at puremagic.com (Evan Harris) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Perl Challenge In-Reply-To: <20030323150557.GH1406@broadq.com> Message-ID: I'm more interested in why I get a Segmentation fault after 7057. 7027 is prime 7039 is prime 7043 is prime 7057 is prime Segmentation fault :) Evan On Sun, 23 Mar 2003, Wayne Walker wrote: > Please don't reply to the list! > > Below is a program with a regex that tests for prime numbers. I'll buy > dinner at PokeJo's before the next meeting for the first person to send > me a description of how it works. I'm assuming anyone who has seen this > before won't try to get the prize. Next Monday I'll post the correct > answers I got and who sent them. That email will have appropriate > subject to allow those still working on the problem to not accidentally > see the answer. > > No, I did not come up with the regex. It's attributed to an Abigail > (aparently of the Athens Perl Mongers, but not certain). > > The coupe de graz will be to also describe the function of time versus > the change in $i's max value (e.g. "if we search 1-200 instead of 1-100, > it takes 1024 times as long to run, meaning that the ratio function is > k * (i2/i1)^10). > > #!/usr/bin/perl > > foreach $i (1..100) > { > if ((1 x $i) !~ /^1?$|^(11+?)\1+$/) > { > print "$i is prime\n"; > $j = $i; > } > } > > -- > > Wayne Walker > > www.broadq.com :) Bringing digital video and audio to the living room > _______________________________________________ > Austin mailing list > Austin@mail.pm.org > http://mail.pm.org/mailman/listinfo/austin > From Goldilox at teachnet.edb.utexas.edu Fri Mar 28 12:50:32 2003 From: Goldilox at teachnet.edb.utexas.edu (Goldilox) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Perl vs Micorsoft SQL 7 Message-ID: Microsoft SQL7 database. I have various cells in the database that are set to NULL (I had to spend a lot of time tracking them down to find what was causing the warnings) This one works the best so far, but still gives an uninitialized variable warning when a NULL is encountered: while(my @newdata = $newsth->fetchrow_array()){ print "Before: $newdata[1] - $newdata[2]\n"; $newdata[1] = "N/A" if $newdata[1] eq ""; $dataone=$newdata[1]; $newdata[2] = "N/A" if $newdata[2] eq ""; $datatwo=$newdata[2]; $newdata[3] = "N/A" if $newdata[3] eq ""; print "After: $newdata[1] - $newdata[2] - $newdata[3]\n"; $datathree=$newdata[3]; $htmldata=$htmldata.qq~$dataone$datatwo$datathree~; } I have tried: 1) $newdata[3] = "N/A" if undef $newdata[3]; 2) $newdata[3] = "N/A" if $newdata[3] eq "NULL";#(OK, this was dumb - but I wanted to say I tried it) 3) and I have tried: $newsth->fetchall_arrayref (with appropriate trappings) No matter what, I get an uninitialized variable warning whenever there is a database cell designated as NULL. I need the script to run without these warnings appearing. (the reason I need the warnings to disappear is: I want to use Perl for database needs, currently some Frontpage generated ASP code is being used, and the error handling of the ASP detects these NULL fields - I need Perl to run just as cleanly because the folks who maintain the ASP code don't want me using Perl since they only know ASP - it's a weird situation, I know, but I want to show Perl can do the job just as cleanly, but I haven't been able to do that yet) Help? Rhett From Goldilox at teachnet.edb.utexas.edu Fri Mar 28 12:59:33 2003 From: Goldilox at teachnet.edb.utexas.edu (Goldilox) Date: Mon Aug 2 21:23:16 2004 Subject: APM: Perl vs Micorsoft SQL 7 (addendum) Message-ID: Oh yeah - forgot to say (see previous message of same subject): use CGI;my $cg=new CGI; use DBI; use DBD::ODBC; my $dbh = DBI->connect('dbi:ODBC:HydrometSQL','user','pass') || die "Database connection not made: $DBI::errstr"; my $sql = qq{select sensordef.sensor_number, site.site_name from (sensordef INNER JOIN site ON sensordef.site_id = site.site_id) where sensordef.sensor_number > 99999 and site.in_service <> 0 and sensordef.in_service <> 0 order by site.site_number}; my $newsth = $dbh->prepare( $sql ) ||die "Couldn't prepare statement: $DBI::errstr"; From jimleona at cisco.com Sat Mar 29 08:04:37 2003 From: jimleona at cisco.com (Jim Leonard) Date: Mon Aug 2 21:23:16 2004 Subject: APM: RE: Perl vs Micorsoft SQL 7 In-Reply-To: Message-ID: <004e01c2f5fc$22d73c90$6601a8c0@amer.cisco.com> You might try this to skip warning messages that popup ( here I detect a duplicate entry in a primary key of a Mysql table and skip it cause I don't want the program to die there ): # Ignore message "DBD::mysql::st execute failed: Duplicate entry" $SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /^DBD::mysql::st execute failed: Duplicate entry/ }; HTH, Jim > -----Original Message----- > From: austin-admin@mail.pm.org > [mailto:austin-admin@mail.pm.org] On Behalf Of Goldilox > Sent: Friday, March 28, 2003 12:51 PM > To: austin-pm@pm.org > Subject: APM: Perl vs Micorsoft SQL 7 > > > Microsoft SQL7 database. I have various cells in the database > that are set to > > NULL > > (I had to spend a lot of time tracking them down to find what > was causing the > warnings) > > This one works the best so far, but still gives an > uninitialized variable > warning when a NULL is encountered: > > while(my @newdata = $newsth->fetchrow_array()){ > print "Before: $newdata[1] - $newdata[2]\n"; > $newdata[1] = "N/A" if $newdata[1] eq ""; > $dataone=$newdata[1]; > $newdata[2] = "N/A" if $newdata[2] eq ""; > $datatwo=$newdata[2]; > $newdata[3] = "N/A" if $newdata[3] eq ""; > print "After: $newdata[1] - $newdata[2] - $newdata[3]\n"; > $datathree=$newdata[3]; > $htmldata=$htmldata.qq~$dataone align="right">$datatwo align="right">$datathree~; > } > > I have tried: > > 1) > $newdata[3] = "N/A" if undef $newdata[3]; > > > 2) > $newdata[3] = "N/A" if $newdata[3] eq "NULL";#(OK, this was > dumb - but I wanted > to say I tried it) > > > 3) > and I have tried: $newsth->fetchall_arrayref (with > appropriate trappings) > > > No matter what, I get an uninitialized variable warning > whenever there is a > database cell designated as NULL. I need the script to run > without these > warnings appearing. > (the reason I need the warnings to disappear is: I want to > use Perl for > database needs, currently some Frontpage generated ASP code > is being used, and > the error handling of the ASP detects these NULL fields - I > need Perl to run > just as cleanly because the folks who maintain the ASP code > don't want me using > Perl since they only know ASP - it's a weird situation, I > know, but I want to > show Perl can do the job just as cleanly, but I haven't been > able to do that > yet) > > Help? > > Rhett > > _______________________________________________ > Austin mailing list > Austin@mail.pm.org > http://mail.pm.org/mailman/listinfo/austin > From jeremyb at univista.com Mon Mar 31 23:13:54 2003 From: jeremyb at univista.com (jeremyb@univista.com) Date: Mon Aug 2 21:23:16 2004 Subject: APM: cpan.org??? Message-ID: <405A4B20FCF8D41192CF0050DA1802C250A731@MINIBOX> Hey folks, I went to cpan.org just now and discovered that the mainpage appears to have been changed. Some guy named Matt has made it his home page.... There's still a link to the cpan.org we all know but who the hell is Matt? http://cpan.org From dbii at mudpuddle.com Mon Mar 31 23:50:11 2003 From: dbii at mudpuddle.com (David Bluestein II) Date: Mon Aug 2 21:23:16 2004 Subject: APM: cpan.org??? Message-ID: Weird. I see the same thing, and it definitely wasn't that way Saturday morning as I was just there. Internal pages seem to be the same, and it is weirder that links on the main page to the old main CPAN page don't reference CPAN. Wonder if the domain expired/the server has had the main page replaced? David > Hey folks, > I went to cpan.org just now and discovered that the mainpage appears to >have been >changed. Some guy named Matt has made it his home page.... There's still >a link >to the cpan.org we all know but who the hell is Matt? > > http://cpan.org >_______________________________________________ >Austin mailing list >Austin@mail.pm.org >http://mail.pm.org/mailman/listinfo/austin ---------- David H. Bluestein II President & Lead Developer dbii@interaction.net ii, inc. http://www.interaction.net - Specializing in Designing Interactive Websites - - and Searchable Internet Databases - From majcher at majcher.com Mon Mar 31 23:46:57 2003 From: majcher at majcher.com (Marc Majcher) Date: Mon Aug 2 21:23:16 2004 Subject: APM: cpan.org??? In-Reply-To: (dbii@mudpuddle.com) References: Message-ID: <200304010546.h315kvDI001722@majcher.com> Jeez, it's just coming up on midnight now. Starting early... dbii@mudpuddle.com (David Bluestein II): :Weird. I see the same thing, and it definitely wasn't that way Saturday :morning as I was just there. Internal pages seem to be the same, and it is :weirder that links on the main page to the old main CPAN page don't :reference CPAN. Wonder if the domain expired/the server has had the main :page replaced? : :David : :> Hey folks, :> I went to cpan.org just now and discovered that the mainpage appears to :>have been :>changed. Some guy named Matt has made it his home page.... There's still :>a link :>to the cpan.org we all know but who the hell is Matt? -- DVS Know Nyarlahotep, Know Chaos. No Nyarlahotep, No Chaos.