From cakrum at cox.net Thu Jan 1 09:57:42 2004 From: cakrum at cox.net (Chris Krum) Date: Thu Aug 5 00:17:12 2004 Subject: Phoenix.pm: wxPerl on Mac OS X Message-ID: <3B8E0FF6-3C73-11D8-8B82-000A958ED2FE@cox.net> Hi folks. My wife recently got so fed up with MSWindoze that she made the command decision to switch us to a Macintosh. OS X comes with Perl built in so I promptly installed wxWindows and wxPerl. I've started playing with some of the sample code and I've discovered that it takes about 12 seconds to launch even the simplest ones. Does anyone know if this is common with wxPerl on other platforms or is it possible I have something I have installed wrong? (Remote as this possibility seems. :) I have a wxWindows based program called Audacity installed and it loads up fast enough. Could it be because I'm running these samples from the command line? Anyway, any suggestions are welcome. (Except the ones that involve a lobotomy.) Thanks, Chris. From tran_fors at yahoo.com Thu Jan 1 20:49:06 2004 From: tran_fors at yahoo.com (Tran Forsythe) Date: Thu Aug 5 00:17:12 2004 Subject: Phoenix.pm: You can never tell with some people... In-Reply-To: <.24.221.96.25.1072199615.squirrel@www.phoenixinternet.com> Message-ID: <20040102024906.9599.qmail@web60708.mail.yahoo.com> --- doug@phoenixinternet.com wrote: > > http://www.malevole.com/mv/misc/killerquiz/ > > > > -Kurt > > > > ps: Say, inn't that you as #6 on one of your > fuzzier > > days, Scott? > > Completely off topic... > > Hey Kurt! How was the cruise? Wonderful, thanks ;) Quite the experience I'd recommend to others ;) -Kurt ps: Better late than never, hey? :p __________________________________ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree From doug at phoenixinternet.com Mon Jan 5 16:07:49 2004 From: doug at phoenixinternet.com (doug@phoenixinternet.com) Date: Thu Aug 5 00:17:12 2004 Subject: Phoenix.pm: wxPerl on Mac OS X In-Reply-To: <3B8E0FF6-3C73-11D8-8B82-000A958ED2FE@cox.net> References: <3B8E0FF6-3C73-11D8-8B82-000A958ED2FE@cox.net> Message-ID: <.24.221.96.25.1073340469.squirrel@www.phoenixinternet.com> > Hi folks. > > My wife recently got so fed up with MSWindoze that she made the command > decision to switch us to a Macintosh. OS X comes with Perl built in so > I promptly installed wxWindows and wxPerl. I've started playing with > some of the sample code and I've discovered that it takes about 12 > seconds to launch even the simplest ones. Does anyone know if this is > common with wxPerl on other platforms or is it possible I have > something I have installed wrong? (Remote as this possibility seems. :) > I have a wxWindows based program called Audacity installed and it loads > up fast enough. Could it be because I'm running these samples from the > command line? Anyway, any suggestions are welcome. (Except the ones > that involve a lobotomy.) You might want to try the mailing list archives: http://sourceforge.net/mailarchive/forum.php?forum=wxperl-users The search doesn't appear to be working correctly right now though. :( I did a little work with OS X and wxPerl several months ago, so the details are a little fuzzy. I had other issues though - toolbar images weren't showing up. This may be fixed now, but I don't have access to an OS X box to check. If all else fails, join the mailing list: http://lists.sourceforge.net/lists/listinfo/wxperl-users From doug at phoenixinternet.com Mon Jan 5 16:09:14 2004 From: doug at phoenixinternet.com (doug@phoenixinternet.com) Date: Thu Aug 5 00:17:12 2004 Subject: Phoenix.pm: You can never tell with some people... In-Reply-To: <20040102024906.9599.qmail@web60708.mail.yahoo.com> References: <.24.221.96.25.1072199615.squirrel@www.phoenixinternet.com> <20040102024906.9599.qmail@web60708.mail.yahoo.com> Message-ID: <.24.221.96.25.1073340554.squirrel@www.phoenixinternet.com> > > --- doug@phoenixinternet.com wrote: >> > http://www.malevole.com/mv/misc/killerquiz/ >> > >> > -Kurt >> > >> > ps: Say, inn't that you as #6 on one of your >> fuzzier >> > days, Scott? >> >> Completely off topic... >> >> Hey Kurt! How was the cruise? > > Wonderful, thanks ;) Quite the experience I'd > recommend to others ;) > > -Kurt > > ps: Better late than never, hey? :p Yeah, I noticed that your resolutions included checking your email. :) From doug at phoenixinternet.com Mon Jan 5 16:14:50 2004 From: doug at phoenixinternet.com (doug@phoenixinternet.com) Date: Thu Aug 5 00:17:12 2004 Subject: Phoenix.pm: Meeting this week Message-ID: <.24.221.96.25.1073340890.squirrel@www.phoenixinternet.com> I'd like to have a meeting this week if possible. It seems like I had talked to someone about presenting. Time, however, has clouded my weak memory. If you'd like to present (or wouldn't like to and can) this Thursday, let me know. Thanks! From friedman at highwire.stanford.edu Mon Jan 5 16:37:25 2004 From: friedman at highwire.stanford.edu (Michael Friedman) Date: Thu Aug 5 00:17:12 2004 Subject: Phoenix.pm: Meeting this week In-Reply-To: <.24.221.96.25.1073340890.squirrel@www.phoenixinternet.com> References: <.24.221.96.25.1073340890.squirrel@www.phoenixinternet.com> Message-ID: I hope it wasn't me you're thinking of... I'm in California this week and won't be able to make the meeting. :-( OTOH, I get to go to MacWorldExpo on Friday... :-) -- Mike On Jan 5, 2004, at 2:14 PM, doug@phoenixinternet.com wrote: > I'd like to have a meeting this week if possible. It seems like I had > talked to someone about presenting. Time, however, has clouded my weak > memory. If you'd like to present (or wouldn't like to and can) this > Thursday, let me know. Thanks! > --------------------------------------------------------------------- Michael Friedman HighWire Press, Stanford Southwest Phone: 480-456-0880 Tempe, Arizona FAX: 270-721-8034 --------------------------------------------------------------------- From scott at illogics.org Mon Jan 5 17:02:32 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:12 2004 Subject: Phoenix.pm: Meeting this week Message-ID: <20040105230232.GJ19546@illogics.org> Tim Ayers suggested the possibility of doing something on perl golf, which I'd like to see. Bill Lindley is working himself up to present his autosite program. Doug Miles found a robot thing in Tk good for a programming competition. I owe you the last installment of the FuzzyLogic presentation, but I haven't started that yet, still. I could do something on Object::Lexical but that's just more boring object stuff. I could do an intro on Perl 5 virtual machine assembly. Oh, and I've been playing with Coro - I'd love to do a presentation on it and I'm working on something using it that might be in a presentable state. Coro is coroutines for Perl - coroutines both do and don't return. It is useful as a sort of cooperative multithreading, and is a heck of alot more usable than perl's threads - easier to comprehend the sublteties of and less buggy. -scott On 0, doug@phoenixinternet.com wrote: > > I'd like to have a meeting this week if possible. It seems like I had > talked to someone about presenting. Time, however, has clouded my weak > memory. If you'd like to present (or wouldn't like to and can) this > Thursday, let me know. Thanks! From doug at phoenixinternet.com Tue Jan 6 10:59:54 2004 From: doug at phoenixinternet.com (doug@phoenixinternet.com) Date: Thu Aug 5 00:17:12 2004 Subject: Phoenix.pm: Meeting 01/08/2004 Message-ID: <.24.221.96.25.1073408394.squirrel@www.phoenixinternet.com> We'll be having a Phoenix.pm meeting Thursday, January 8th at 7:00PM. It will be held at Bowne, which is located at 1500 N. Central Avenue, which is on the Southwest corner of Central and McDowell. The parking lot is gated, so just press the button on the intercom, and tell the receptionist that you are there for the Perl meeting. Park in the lot that is straight ahead from the entrance on the South side of McDowell. Park in any uncovered, non-reserved space. Proceed to the main lobby, which is on the Northeast side of the parking lot. I will be presenting my HTML Templating system. I'll be covering parsing, design choices, and Perl bugs among other things. From scott at illogics.org Thu Jan 8 15:04:41 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:12 2004 Subject: Phoenix.pm: Meeting 01/08/2004 Message-ID: <20040108210441.GX19546@illogics.org> Don't know I'll make it, but I didn't see any other RSVPs either... I'm *just* getting to bed and it's only a few hours until the meeting. And I think everyone is probably tired of manic-zombie-scott. -scott On 0, doug@phoenixinternet.com wrote: > > We'll be having a Phoenix.pm meeting Thursday, January 8th at 7:00PM. > It will be held at Bowne, which is located at 1500 N. Central Avenue, > which is on the Southwest corner of Central and McDowell. The parking > lot is gated, so just press the button on the intercom, and tell the > receptionist that you are there for the Perl meeting. Park in the lot > that is straight ahead from the entrance on the South side of McDowell. > Park in any uncovered, non-reserved space. Proceed to the main lobby, > which is on the Northeast side of the parking lot. > > I will be presenting my HTML Templating system. I'll be covering parsing, > design choices, and Perl bugs among other things. From doug at phoenixinternet.com Thu Jan 8 15:10:25 2004 From: doug at phoenixinternet.com (doug@phoenixinternet.com) Date: Thu Aug 5 00:17:12 2004 Subject: Phoenix.pm: Reminder: Meeting 01/08/2004 Message-ID: <.24.221.96.25.1073596225.squirrel@www.phoenixinternet.com> Please RSVP... We'll be having a Phoenix.pm meeting Thursday, January 8th at 7:00PM. It will be held at Bowne, which is located at 1500 N. Central Avenue, which is on the Southwest corner of Central and McDowell. The parking lot is gated, so just press the button on the intercom, and tell the receptionist that you are there for the Perl meeting. Park in the lot that is straight ahead from the entrance on the South side of McDowell. Park in any uncovered, non-reserved space. Proceed to the main lobby, which is on the Northeast side of the parking lot. I will be presenting my HTML Templating system. I'll be covering parsing, design choices, and Perl bugs among other things. -- Doug Miles From doug at phoenixinternet.com Thu Jan 8 16:29:33 2004 From: doug at phoenixinternet.com (doug@phoenixinternet.com) Date: Thu Aug 5 00:17:12 2004 Subject: Phoenix.pm: Meeting 01/08/2004 Message-ID: <.24.221.96.25.1073600973.squirrel@www.phoenixinternet.com> Scott Walters said: > Don't know I'll make it, but I didn't see any other RSVPs either... > > I'm *just* getting to bed and it's only a few hours until the > meeting. And I think everyone is probably tired of manic-zombie-scott. > Well, I'll give it 'til 5:00PM If nobody has responded by then, I'll c@ncel. -- Doug Miles From cakrum at cox.net Thu Jan 8 17:26:22 2004 From: cakrum at cox.net (Chris Krum) Date: Thu Aug 5 00:17:12 2004 Subject: Phoenix.pm: Reminder: Meeting 01/08/2004 In-Reply-To: <.24.221.96.25.1073596225.squirrel@www.phoenixinternet.com> Message-ID: <11EAADB6-4232-11D8-A44C-000A958ED2FE@cox.net> I would like to attend but please call me at 623-332-4299 if the meeting is cancelled. Thanks, Chris Krum On Thursday, January 8, 2004, at 02:10 PM, doug@phoenixinternet.com wrote: > Please RSVP... > > We'll be having a Phoenix.pm meeting Thursday, January 8th at 7:00PM. > It > will be held at Bowne, which is located at 1500 N. Central Avenue, > which > is on the Southwest corner of Central and McDowell. The parking lot is > gated, so just press the button on the intercom, and tell the > receptionist > that you are there for the Perl meeting. Park in the lot that is > straight > ahead from the entrance on the South side of McDowell. Park in any > uncovered, non-reserved space. Proceed to the main lobby, which is on > the > Northeast side of the parking lot. > > I will be presenting my HTML Templating system. I'll be covering > parsing, > design choices, and Perl bugs among other things. > > -- > > Doug Miles > From cakrum at cox.net Thu Jan 8 17:28:03 2004 From: cakrum at cox.net (Chris Krum) Date: Thu Aug 5 00:17:12 2004 Subject: Phoenix.pm: 1/8/04 Meeting Message-ID: <4E0F41F6-4232-11D8-A44C-000A958ED2FE@cox.net> I would like to attend the meeting tonight! Please call me at 623-332-4299 if the meeting is cancelled. I won't be able to check email before leaving for the meeting! Thanks, Chris Krum From doug at phoenixinternet.com Thu Jan 8 17:41:33 2004 From: doug at phoenixinternet.com (doug@phoenixinternet.com) Date: Thu Aug 5 00:17:12 2004 Subject: Phoenix.pm: Meeting 01/08/2004 C@NCELLED!!! In-Reply-To: <.24.221.96.25.1073600973.squirrel@www.phoenixinternet.com> References: <.24.221.96.25.1073600973.squirrel@www.phoenixinternet.com> Message-ID: <.24.221.96.25.1073605293.squirrel@www.phoenixinternet.com> doug@phoenixinternet.com said: > Scott Walters said: >> Don't know I'll make it, but I didn't see any other RSVPs either... >> >> I'm *just* getting to bed and it's only a few hours until the >> meeting. And I think everyone is probably tired of manic-zombie-scott. >> > > Well, I'll give it 'til 5:00PM If nobody has responded by then, I'll > c@ncel. I haven't heard from anybody, so there is NO meeting tonight! I'm going home, so please don't show up. We'll try again next month. -- Doug Miles From johngnub at cox.net Thu Jan 8 21:37:31 2004 From: johngnub at cox.net (johnb) Date: Thu Aug 5 00:17:12 2004 Subject: Phoenix.pm: Meeting 01/08/2004 C@NCELLED!!! In-Reply-To: <.24.221.96.25.1073605293.squirrel@www.phoenixinternet.com> Message-ID: <280D5454-4255-11D8-8F8B-000A9585B970@cox.net> Maybe we should have a dinner meeting ? Like a chat and eat ? One to ponder...JB On Thursday, January 8, 2004, at 04:41 PM, doug@phoenixinternet.com wrote: > > doug@phoenixinternet.com said: >> Scott Walters said: >>> Don't know I'll make it, but I didn't see any other RSVPs either... >>> >>> I'm *just* getting to bed and it's only a few hours until the >>> meeting. And I think everyone is probably tired of >>> manic-zombie-scott. >>> >> >> Well, I'll give it 'til 5:00PM If nobody has responded by then, I'll >> c@ncel. > > I haven't heard from anybody, so there is NO meeting tonight! I'm > going > home, so please don't show up. We'll try again next month. > > -- > > Doug Miles > From doug at phoenixinternet.com Fri Jan 9 13:00:30 2004 From: doug at phoenixinternet.com (doug@phoenixinternet.com) Date: Thu Aug 5 00:17:12 2004 Subject: Phoenix.pm: Meeting 01/08/2004 C@NCELLED!!! In-Reply-To: <280D5454-4255-11D8-8F8B-000A9585B970@cox.net> References: <.24.221.96.25.1073605293.squirrel@www.phoenixinternet.com> <280D5454-4255-11D8-8F8B-000A9585B970@cox.net> Message-ID: <.24.221.96.25.1073674830.squirrel@phoenixinternet.com> johnb said: > Maybe we should have a dinner meeting ? Like a chat and eat ? > One to ponder...JB > Sounds fine to me. Does someone want to volunteer to set it up? Maybe for next Thurs? -- Doug Miles From johngnub at cox.net Sat Jan 10 11:09:59 2004 From: johngnub at cox.net (johnb) Date: Thu Aug 5 00:17:12 2004 Subject: Phoenix.pm: Meeting 01/08/2004 C@NCELLED!!! In-Reply-To: <.24.221.96.25.1073674830.squirrel@phoenixinternet.com> Message-ID: What side of town ? North, like Desert Ridge off the 101, or....open to ideas... On Friday, January 9, 2004, at 12:00 PM, doug@phoenixinternet.com wrote: > > johnb said: >> Maybe we should have a dinner meeting ? Like a chat and eat ? >> One to ponder...JB >> > > > Sounds fine to me. Does someone want to volunteer to set it up? Maybe > for next Thurs? > > -- > > Doug Miles > From doug at phoenixinternet.com Mon Jan 12 11:12:36 2004 From: doug at phoenixinternet.com (doug@phoenixinternet.com) Date: Thu Aug 5 00:17:12 2004 Subject: Phoenix.pm: Meeting 01/08/2004 C@NCELLED!!! In-Reply-To: References: <.24.221.96.25.1073674830.squirrel@phoenixinternet.com> Message-ID: <.24.221.96.25.1073927556.squirrel@www.phoenixinternet.com> johnb said: > What side of town ? North, like Desert Ridge off the 101, or....open to > ideas... North would work fine for me, but I suggest something more centraly located; or as I like to say "equally as inconvenient for everyone". -- Doug Miles From johngnub at cox.net Mon Jan 12 21:36:15 2004 From: johngnub at cox.net (johnb) Date: Thu Aug 5 00:17:12 2004 Subject: Phoenix.pm: Meeting 01/08/2004 C@NCELLED!!! In-Reply-To: <.24.221.96.25.1073927556.squirrel@www.phoenixinternet.com> Message-ID: I am still waiting for votes my self? Any idea any one? Ponders the JB $foo =~ s/eat/where/g; On Monday, January 12, 2004, at 10:12 AM, doug@phoenixinternet.com wrote: > > johnb said: >> What side of town ? North, like Desert Ridge off the 101, or....open >> to >> ideas... > > North would work fine for me, but I suggest something more centraly > located; or as I like to say "equally as inconvenient for everyone". > > -- > > Doug Miles > From scott at illogics.org Mon Jan 12 21:52:17 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:12 2004 Subject: Phoenix.pm: Meeting 01/08/2004 C@NCELLED!!! Message-ID: <20040113035217.GN19546@illogics.org> I don't know that area. I can suggest some good places around the Scottsdale airpark area. Aladdin's cafe is a little hole in the wall place with good middle eastern cuisine. Mom and pop place. Nello's Pizza is very good too. And downtown Tempe has some nice haunts. -scott On 0, johnb wrote: > > I am still waiting for votes my self? Any idea any one? > Ponders the JB > > $foo =~ s/eat/where/g; > > On Monday, January 12, 2004, at 10:12 AM, doug@phoenixinternet.com > wrote: > > > > > johnb said: > >> What side of town ? North, like Desert Ridge off the 101, or....open > >> to > >> ideas... > > > > North would work fine for me, but I suggest something more centraly > > located; or as I like to say "equally as inconvenient for everyone". > > > > -- > > > > Doug Miles > > > From johngnub at cox.net Mon Jan 12 23:20:44 2004 From: johngnub at cox.net (johnb) Date: Thu Aug 5 00:17:12 2004 Subject: Phoenix.pm: Meeting 01/08/2004 C@NCELLED!!! In-Reply-To: <20040113035217.GN19546@illogics.org> Message-ID: <3CAAE458-4588-11D8-89B9-000A9585B970@cox.net> Tempe sound like fun; But do we dare go where Scott goes? On Monday, January 12, 2004, at 08:52 PM, Scott Walters wrote: > I don't know that area. I can suggest some good places around the > Scottsdale > airpark area. Aladdin's cafe is a little hole in the wall place with > good > middle eastern cuisine. Mom and pop place. Nello's Pizza is very good > too. > And downtown Tempe has some nice haunts. > > -scott > > On 0, johnb wrote: >> >> I am still waiting for votes my self? Any idea any one? >> Ponders the JB >> >> $foo =~ s/eat/where/g; >> >> On Monday, January 12, 2004, at 10:12 AM, doug@phoenixinternet.com >> wrote: >> >>> >>> johnb said: >>>> What side of town ? North, like Desert Ridge off the 101, or....open >>>> to >>>> ideas... >>> >>> North would work fine for me, but I suggest something more centraly >>> located; or as I like to say "equally as inconvenient for everyone". >>> >>> -- >>> >>> Doug Miles >>> >> > From wlindley at wlindley.com Tue Jan 13 08:33:56 2004 From: wlindley at wlindley.com (Bill Lindley) Date: Thu Aug 5 00:17:12 2004 Subject: Phoenix.pm: Meeting 01/08/2004 C@NCELLED!!! In-Reply-To: <3CAAE458-4588-11D8-89B9-000A9585B970@cox.net> References: <3CAAE458-4588-11D8-89B9-000A9585B970@cox.net> Message-ID: <400401D4.1000203@wlindley.com> Tempe sounds a winner. From doug at phoenixinternet.com Tue Jan 13 10:42:44 2004 From: doug at phoenixinternet.com (doug@phoenixinternet.com) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Meeting 01/08/2004 C@NCELLED!!! In-Reply-To: <400401D4.1000203@wlindley.com> References: <3CAAE458-4588-11D8-89B9-000A9585B970@cox.net> <400401D4.1000203@wlindley.com> Message-ID: <.24.221.96.25.1074012164.squirrel@www.phoenixinternet.com> Bill Lindley said: > Tempe sounds a winner. > > Well, somebody set up us the bomb. I mean, set it up. I'm not sure that I'll be able to make it, but that's not a requirement. :) -- Doug Miles From scott at illogics.org Wed Jan 14 02:22:40 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Meeting 01/08/2004 C@NCELLED!!! Message-ID: <20040114082240.GP19546@illogics.org> Four Peaks is my Tempe recommendation. Good beer, good food, good atmosphere - old fish warehouse in a huge old brick warehouse on the tracks. -scott On 0, Bill Lindley wrote: > > Tempe sounds a winner. > From intertwingled at qwest.net Wed Jan 14 03:12:35 2004 From: intertwingled at qwest.net (intertwingled) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Meeting 01/08/2004 C@NCELLED!!! In-Reply-To: <20040114082240.GP19546@illogics.org> References: <20040114082240.GP19546@illogics.org> Message-ID: <40050803.3070500@qwest.net> Heh, that's right down the street from me =) Tony Scott Walters wrote: >Four Peaks is my Tempe recommendation. Good beer, good food, good >atmosphere - old fish warehouse in a huge old brick warehouse on >the tracks. > >-scott > > > >On 0, Bill Lindley wrote: > > >>Tempe sounds a winner. >> >> >> > > > > From intertwingled at qwest.net Wed Jan 14 03:26:05 2004 From: intertwingled at qwest.net (intertwingled) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Four Peaks P.S. In-Reply-To: <40050803.3070500@qwest.net> References: <20040114082240.GP19546@illogics.org> <40050803.3070500@qwest.net> Message-ID: <40050B2D.9020900@qwest.net> P.S. The peach ale is excellent. intertwingled wrote: > Heh, that's right down the street from me =) > > Tony > > Scott Walters wrote: > >> Four Peaks is my Tempe recommendation. Good beer, good food, good >> atmosphere - old fish warehouse in a huge old brick warehouse on >> the tracks. >> -scott >> >> >> >> On 0, Bill Lindley wrote: >> >> >>> Tempe sounds a winner. >>> >>> >> >> >> >> >> > > > > From wlindley at wlindley.com Wed Jan 14 07:34:43 2004 From: wlindley at wlindley.com (Bill Lindley) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Meeting 01/08/2004 C@NCELLED!!! In-Reply-To: <20040114082240.GP19546@illogics.org> References: <20040114082240.GP19546@illogics.org> Message-ID: <40054573.7080303@wlindley.com> I second $peaks=4. \\/ From m at pdxlug.org Wed Jan 14 09:06:56 2004 From: m at pdxlug.org (Matt Alexander) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Net::Telnet Message-ID: <20040114070059.N14473@kraken.magnetinternet.com> I'm trying to use Net::Telnet to connect to a device that simply outputs data after a connection is made. There's no prompt and there's no indication of when it's done sending data, however I know that after about 10 seconds that I should have received all the data that was available. I then want to save all the output from this device to a log file. I think the problem with my script is that it's looking for a prompt from the device. I've tried setting Prompt => undef and Prompt => "", but these both generate warnings and I never retrieve any data. Any suggestions? Thanks, ~M From phx-pm-list at grueslayer.com Wed Jan 14 09:43:58 2004 From: phx-pm-list at grueslayer.com (David A. Sinck) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Net::Telnet References: <20040114070059.N14473@kraken.magnetinternet.com> Message-ID: <16389.25534.452195.175429@magnitude.righthandgraphics.com> \_ SMTP quoth Matt Alexander on 1/14/2004 07:06 as having spake thusly: \_ \_ I'm trying to use Net::Telnet to connect to a device that simply outputs \_ data after a connection is made. There's no prompt and there's no \_ indication of when it's done sending data, however I know that after about \_ 10 seconds that I should have received all the data that was available. I \_ then want to save all the output from this device to a log file. \_ \_ I think the problem with my script is that it's looking for a prompt from \_ the device. I've tried setting Prompt => undef and Prompt => "", but \_ these both generate warnings and I never retrieve any data. Why not go with one of the Socket modules or with building your own sockets? David From johngnub at cox.net Wed Jan 14 09:53:32 2004 From: johngnub at cox.net (johnb) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Meeting 01/08/2004 C@NCELLED!!! In-Reply-To: <40054573.7080303@wlindley.com> Message-ID: Peaks sound good; :) On Wednesday, January 14, 2004, at 06:34 AM, Bill Lindley wrote: > I second $peaks=4. > \\/ > From m at pdxlug.org Wed Jan 14 10:10:25 2004 From: m at pdxlug.org (Matt Alexander) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Net::Telnet In-Reply-To: <16389.25534.452195.175429@magnitude.righthandgraphics.com> References: <20040114070059.N14473@kraken.magnetinternet.com> <16389.25534.452195.175429@magnitude.righthandgraphics.com> Message-ID: <20040114080953.K14562@kraken.magnetinternet.com> On Wed, 14 Jan 2004, David A. Sinck wrote: > > > \_ SMTP quoth Matt Alexander on 1/14/2004 07:06 as having spake thusly: > \_ > \_ I'm trying to use Net::Telnet to connect to a device that simply outputs > \_ data after a connection is made. There's no prompt and there's no > \_ indication of when it's done sending data, however I know that after about > \_ 10 seconds that I should have received all the data that was available. I > \_ then want to save all the output from this device to a log file. > \_ > \_ I think the problem with my script is that it's looking for a prompt from > \_ the device. I've tried setting Prompt => undef and Prompt => "", but > \_ these both generate warnings and I never retrieve any data. > > Why not go with one of the Socket modules or with building your own > sockets? Because I was looking for the easy way out... ;-) From johngnub at cox.net Wed Jan 14 13:24:05 2004 From: johngnub at cox.net (johngnub@cox.net) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Net::Telnet Message-ID: <20040114192405.ZTBF3905.fed1mtao04.cox.net@smtp.west.cox.net> The cmd method will hold data till the next prompt is found; So the distance of a cmd is the measure of prompt to prompt. If you encounter a nasty prompt try this; Issue a cmd to set the prompt right away. @lines = $tango->cmd("PS1='foo';stty kill '^U';export TERM=vt100") Now you can set the prompt to 'foo' Prompt => '/foo/'o' Or from the perldoc Net::Telnet: " Use a combination of "print()" and "waitfor()" as an alternative to "login()" or "cmd()" when they don't what you want. EXAMPLE, note the '/ is a gregex... $t->waitfor('/continue:.*$/'); $t->print(""); Examples on request....JB Or get angery and find out just what that "non-prompt is" >From the perldoc get - read block of data $data = $obj->get([Binmode => $mode,] [Errmode => $errmode,] [Telnetmode => $mode,] [Timeout => $secs,]); This method reads a block of data from the object and returns it along with any buffered data. If no buffered data is available to return, it will wait for data to read using the timeout specified in the object. You can override that timeout using $secs. Also see "timeout()". If buffered data is available to return, it also checks for a block of data that can be immediately read. > > From: Matt Alexander > Date: 2004/01/14 Wed AM 10:06:56 EST > To: PHXPERL > Subject: Phoenix.pm: Net::Telnet > > I'm trying to use Net::Telnet to connect to a device that simply outputs > data after a connection is made. There's no prompt and there's no > indication of when it's done sending data, however I know that after about > 10 seconds that I should have received all the data that was available. I > then want to save all the output from this device to a log file. > > I think the problem with my script is that it's looking for a prompt from > the device. I've tried setting Prompt => undef and Prompt => "", but > these both generate warnings and I never retrieve any data. > > Any suggestions? > Thanks, > ~M > From johngnub at cox.net Wed Jan 14 13:24:57 2004 From: johngnub at cox.net (johngnub@cox.net) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Net::Telnet Message-ID: <20040114192455.KNHY11788.fed1mtao08.cox.net@smtp.west.cox.net> The cmd method will hold data till the next prompt is found; So the distance of a cmd is the measure of prompt to prompt. If you encounter a nasty prompt try this; Issue a cmd to set the prompt right away. @lines = $tango->cmd("PS1='foo';stty kill '^U';export TERM=vt100") Now you can set the prompt to 'foo' Prompt => '/foo/'o' Or from the perldoc Net::Telnet: " Use a combination of "print()" and "waitfor()" as an alternative to "login()" or "cmd()" when they don't what you want. EXAMPLE, note the '/ is a gregex... $t->waitfor('/continue:.*$/'); $t->print(""); Examples on request... > > From: Matt Alexander > Date: 2004/01/14 Wed AM 10:06:56 EST > To: PHXPERL > Subject: Phoenix.pm: Net::Telnet > > I'm trying to use Net::Telnet to connect to a device that simply outputs > data after a connection is made. There's no prompt and there's no > indication of when it's done sending data, however I know that after about > 10 seconds that I should have received all the data that was available. I > then want to save all the output from this device to a log file. > > I think the problem with my script is that it's looking for a prompt from > the device. I've tried setting Prompt => undef and Prompt => "", but > these both generate warnings and I never retrieve any data. > > Any suggestions? > Thanks, > ~M > From scott at illogics.org Wed Jan 14 17:20:20 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: [nick@unfortu.net: 5.8.3] Message-ID: <20040114232020.GU19546@illogics.org> ----- Forwarded message from Nicholas Clark ----- ID: <20040114192716.GA13579@Bagpuss.unfortu.net> List: contact perl5-porters-help@perl.org; run by ezmlm Status: No, hits=-0.6 required=7.0 tests=CARRIAGE_RETURNS,SPAM_PHRASE_00_01,USER_AGENT,USER_AGENT_MUTT version=2.44 post: By: one.develooper.com SMTPD: qpsmtpd/0.26, http://develooper.com/code/qpsmtpd/ Disposition: inline Type: text/plain; charset=us-ascii Spam-Index: -8.2 Filter-Rule: None, default is delivery Archive: help: Agent: Mutt/1.4i Received: from onion.perl.org (onion.develooper.com [63.251.223.166]) (qmail 14314 invoked by uid 1005); 14 Jan 2004 19:32:36 -0000 (qmail 14295 invoked by uid 76); 14 Jan 2004 19:32:36 -0000 Subject: 5.8.3 unsubscribe: Spam-Is-Higher-Than: 5 Date: Wed, 14 Jan 2004 19:27:17 +0000 Version: 1.0 Precedence: bulk To: mailing list perl5-porters@perl.org perl5-porters@perl.org perl5-porters@perl.org From: Nicholas Clark We are the music makers, And we are the dreamers of dreams, Wandering by lonely sea-breakers, And sitting by desolate streams; -- World-losers and world-forsakers, On whom the pale moon gleams: Yet we are the movers and shakers Of the world for ever, it seems. stanza 1 from Ode - Arthur William Edgar O'Shaugnessy 1844-1881 Get it while its hot: http://www.ccl4.org/~nick/P/perl-5.8.3.tar.bz2 http://www.ccl4.org/~nick/P/perl-5.8.3.tar.gz coming soon to a CPAN near you: ftp://ftp.perl.org/pub/CPAN/src/perl-5.8.3.tar.bz2 ftp://ftp.perl.org/pub/CPAN/src/perl-5.8.3.tar.gz md5sums are 92bdd4e8280e3d83c6e9d65444fc6f4c perl-5.8.3.tar.bz2 6d2b389f8c6424b7af303f417947714f perl-5.8.3.tar.gz The use.perl announcement should follow tomorrow evening. Nicholas Clark ----- End forwarded message ----- From scott at illogics.org Wed Jan 14 17:26:19 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Net::Telnet Message-ID: <20040114232619.GW19546@illogics.org> There is an example of raw sockets on phoenix.pm.org website, but IO::Socket::INET is about the right level of abstraction for what you're doing. Clearly Net::Telnet is too much of the wrong abstraction. Raw sockets are usually too little abstraction. >From the man page: $sock = IO::Socket::INET->new(PeerAddr => 'www.perl.org', PeerPort => '80', Proto => 'tcp'); You can then print to $sock, $sock->print("foo!\n"), read from it, read $sock, my $buffer, 8192, read lines from it, my $line = readline $sock, and so on, just like a normal IO::Handle. Hope this helps! -scott On 0, johngnub@cox.net wrote: > > The cmd method will hold data till the next prompt is found; So the distance of a cmd is the measure of prompt to prompt. > > If you encounter a nasty prompt try this; > Issue a cmd to set the prompt right away. > @lines = $tango->cmd("PS1='foo';stty kill '^U';export TERM=vt100") > > Now you can set the prompt to 'foo' > > Prompt => '/foo/'o' > > Or from the perldoc Net::Telnet: > > " Use a combination of "print()" and "waitfor()" as an > alternative to "login()" or "cmd()" when they don't > what you want. > > EXAMPLE, note the '/ is a gregex... > > $t->waitfor('/continue:.*$/'); > $t->print(""); > > Examples on request... > > > > From: Matt Alexander > > Date: 2004/01/14 Wed AM 10:06:56 EST > > To: PHXPERL > > Subject: Phoenix.pm: Net::Telnet > > > > I'm trying to use Net::Telnet to connect to a device that simply outputs > > data after a connection is made. There's no prompt and there's no > > indication of when it's done sending data, however I know that after about > > 10 seconds that I should have received all the data that was available. I > > then want to save all the output from this device to a log file. > > > > I think the problem with my script is that it's looking for a prompt from > > the device. I've tried setting Prompt => undef and Prompt => "", but > > these both generate warnings and I never retrieve any data. > > > > Any suggestions? > > Thanks, > > ~M > > > From m at pdxlug.org Wed Jan 14 18:40:53 2004 From: m at pdxlug.org (Matt Alexander) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Net::Telnet In-Reply-To: <20040114232619.GW19546@illogics.org> References: <20040114232619.GW19546@illogics.org> Message-ID: <20040114163613.C55522@kraken.magnetinternet.com> On Wed, 14 Jan 2004, Scott Walters wrote: > There is an example of raw sockets on phoenix.pm.org website, > but IO::Socket::INET is about the right level of abstraction for > what you're doing. Clearly Net::Telnet is too much of the wrong > abstraction. Raw sockets are usually too little abstraction. > > >From the man page: > > $sock = IO::Socket::INET->new(PeerAddr => 'www.perl.org', > PeerPort => '80', > Proto => 'tcp'); > > You can then print to $sock, $sock->print("foo!\n"), read from it, > read $sock, my $buffer, 8192, read lines from it, my $line = readline $sock, > and so on, just like a normal IO::Handle. I ended up using raw sockets and I can now grab all the data, but I'm not sure how to disconnect after a certain period of time. The device I'm connecting to doesn't give any indication of when it's done sending data. So I basically need to grab everything, set an overall time limit of say, 5 seconds, and then disconnect after that time limit. Any suggestions? Thanks, ~M From scott at illogics.org Wed Jan 14 19:44:03 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Net::Telnet Message-ID: <20040115014403.GY19546@illogics.org> The remote side should disconnect when it is done sending data. Perl insulates you from errors, so it is easy not to ever notice that you've been disconnected. Do this: while(read $fh, my $stuff, 8192) { # process $stuff } read() returns 0 on EOF or undef on error. There is also an eof() built-in that is only valid after the first time you read from a socket (don't do while(!eof($fh)) { read stuff.. }, use a do { } while instead). On 0, Matt Alexander wrote: > > On Wed, 14 Jan 2004, Scott Walters wrote: > > > There is an example of raw sockets on phoenix.pm.org website, > > but IO::Socket::INET is about the right level of abstraction for > > what you're doing. Clearly Net::Telnet is too much of the wrong > > abstraction. Raw sockets are usually too little abstraction. > > > > >From the man page: > > > > $sock = IO::Socket::INET->new(PeerAddr => 'www.perl.org', > > PeerPort => '80', > > Proto => 'tcp'); > > > > You can then print to $sock, $sock->print("foo!\n"), read from it, > > read $sock, my $buffer, 8192, read lines from it, my $line = readline $sock, > > and so on, just like a normal IO::Handle. > > I ended up using raw sockets and I can now grab all the data, but I'm not > sure how to disconnect after a certain period of time. The device I'm > connecting to doesn't give any indication of when it's done sending data. > So I basically need to grab everything, set an overall time limit of say, > 5 seconds, and then disconnect after that time limit. > Any suggestions? > Thanks, > ~M From m at pdxlug.org Wed Jan 14 19:50:10 2004 From: m at pdxlug.org (Matt Alexander) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Net::Telnet In-Reply-To: <20040115014403.GY19546@illogics.org> References: <20040115014403.GY19546@illogics.org> Message-ID: <20040114174808.W55522@kraken.magnetinternet.com> Yeah... the problem is that the remote side doesn't disconnect when it's done sending data... It's an ethernet-to-serial adapter that sends out data whenever the device connected to the serial side happens to generate new data. There's no signal that the system has sent all the data it currently has. On Wed, 14 Jan 2004, Scott Walters wrote: > The remote side should disconnect when it is done sending data. > Perl insulates you from errors, so it is easy not to ever notice > that you've been disconnected. Do this: > > while(read $fh, my $stuff, 8192) { > # process $stuff > } > > read() returns 0 on EOF or undef on error. There is also an eof() > built-in that is only valid after the first time you read from a > socket (don't do while(!eof($fh)) { read stuff.. }, use a do { } while > instead). > > On 0, Matt Alexander wrote: > > > > On Wed, 14 Jan 2004, Scott Walters wrote: > > > > > There is an example of raw sockets on phoenix.pm.org website, > > > but IO::Socket::INET is about the right level of abstraction for > > > what you're doing. Clearly Net::Telnet is too much of the wrong > > > abstraction. Raw sockets are usually too little abstraction. > > > > > > >From the man page: > > > > > > $sock = IO::Socket::INET->new(PeerAddr => 'www.perl.org', > > > PeerPort => '80', > > > Proto => 'tcp'); > > > > > > You can then print to $sock, $sock->print("foo!\n"), read from it, > > > read $sock, my $buffer, 8192, read lines from it, my $line = readline $sock, > > > and so on, just like a normal IO::Handle. > > > > I ended up using raw sockets and I can now grab all the data, but I'm not > > sure how to disconnect after a certain period of time. The device I'm > > connecting to doesn't give any indication of when it's done sending data. > > So I basically need to grab everything, set an overall time limit of say, > > 5 seconds, and then disconnect after that time limit. > > Any suggestions? > > Thanks, > > ~M > From scott at illogics.org Wed Jan 14 19:48:08 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Net::Telnet Message-ID: <20040115014807.GZ19546@illogics.org> They almost certainly disconnect you when they're done sending stuff, but if you really want to time-out, use select: my $readbits = 1 << fileno($fh); select(my $readbitsout = $readbits, undef, undef, 0.5); # half a second read $fh, my $buf, 8192; You'd want to do something like that in loop. See the example in perldoc -f select - this is a gross simplification. If you did it in a loop, you'd want to actually test when the select timed out rather than got data in. -scott On 0, Matt Alexander wrote: > > On Wed, 14 Jan 2004, Scott Walters wrote: > > > There is an example of raw sockets on phoenix.pm.org website, > > but IO::Socket::INET is about the right level of abstraction for > > what you're doing. Clearly Net::Telnet is too much of the wrong > > abstraction. Raw sockets are usually too little abstraction. > > > > >From the man page: > > > > $sock = IO::Socket::INET->new(PeerAddr => 'www.perl.org', > > PeerPort => '80', > > Proto => 'tcp'); > > > > You can then print to $sock, $sock->print("foo!\n"), read from it, > > read $sock, my $buffer, 8192, read lines from it, my $line = readline $sock, > > and so on, just like a normal IO::Handle. > > I ended up using raw sockets and I can now grab all the data, but I'm not > sure how to disconnect after a certain period of time. The device I'm > connecting to doesn't give any indication of when it's done sending data. > So I basically need to grab everything, set an overall time limit of say, > 5 seconds, and then disconnect after that time limit. > Any suggestions? > Thanks, > ~M From scott at illogics.org Wed Jan 14 19:56:19 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Net::Telnet Message-ID: <20040115015619.GA19546@illogics.org> That's truely bizarre. Serial data -> Ethernet -> TCP/IP, all automatically. The select() stuff is the way to go. You can say, "end the loop when I haven't gotten any new data in in the last half a second", for example. -scott On 0, Matt Alexander wrote: > > Yeah... the problem is that the remote side doesn't disconnect when it's > done sending data... It's an ethernet-to-serial adapter that sends out > data whenever the device connected to the serial side happens to generate > new data. There's no signal that the system has sent all the data it > currently has. > > > > On Wed, 14 Jan 2004, Scott Walters wrote: > > > The remote side should disconnect when it is done sending data. > > Perl insulates you from errors, so it is easy not to ever notice > > that you've been disconnected. Do this: > > > > while(read $fh, my $stuff, 8192) { > > # process $stuff > > } > > > > read() returns 0 on EOF or undef on error. There is also an eof() > > built-in that is only valid after the first time you read from a > > socket (don't do while(!eof($fh)) { read stuff.. }, use a do { } while > > instead). > > > > On 0, Matt Alexander wrote: > > > > > > On Wed, 14 Jan 2004, Scott Walters wrote: > > > > > > > There is an example of raw sockets on phoenix.pm.org website, > > > > but IO::Socket::INET is about the right level of abstraction for > > > > what you're doing. Clearly Net::Telnet is too much of the wrong > > > > abstraction. Raw sockets are usually too little abstraction. > > > > > > > > >From the man page: > > > > > > > > $sock = IO::Socket::INET->new(PeerAddr => 'www.perl.org', > > > > PeerPort => '80', > > > > Proto => 'tcp'); > > > > > > > > You can then print to $sock, $sock->print("foo!\n"), read from it, > > > > read $sock, my $buffer, 8192, read lines from it, my $line = readline $sock, > > > > and so on, just like a normal IO::Handle. > > > > > > I ended up using raw sockets and I can now grab all the data, but I'm not > > > sure how to disconnect after a certain period of time. The device I'm > > > connecting to doesn't give any indication of when it's done sending data. > > > So I basically need to grab everything, set an overall time limit of say, > > > 5 seconds, and then disconnect after that time limit. > > > Any suggestions? > > > Thanks, > > > ~M > > From m at pdxlug.org Wed Jan 14 20:31:48 2004 From: m at pdxlug.org (Matt Alexander) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Net::Telnet In-Reply-To: <20040115015619.GA19546@illogics.org> References: <20040115015619.GA19546@illogics.org> Message-ID: <20040114182922.Q55522@kraken.magnetinternet.com> Here's some info on the device, if you're curious: http://www.bb-elec.com/product.asp?sku=ESP901 On Wed, 14 Jan 2004, Scott Walters wrote: > That's truely bizarre. Serial data -> Ethernet -> TCP/IP, all automatically. > > The select() stuff is the way to go. You can say, "end the loop when I > haven't gotten any new data in in the last half a second", for example. > > -scott > > On 0, Matt Alexander wrote: > > > > Yeah... the problem is that the remote side doesn't disconnect when it's > > done sending data... It's an ethernet-to-serial adapter that sends out > > data whenever the device connected to the serial side happens to generate > > new data. There's no signal that the system has sent all the data it > > currently has. > > > > > > > > On Wed, 14 Jan 2004, Scott Walters wrote: > > > > > The remote side should disconnect when it is done sending data. > > > Perl insulates you from errors, so it is easy not to ever notice > > > that you've been disconnected. Do this: > > > > > > while(read $fh, my $stuff, 8192) { > > > # process $stuff > > > } > > > > > > read() returns 0 on EOF or undef on error. There is also an eof() > > > built-in that is only valid after the first time you read from a > > > socket (don't do while(!eof($fh)) { read stuff.. }, use a do { } while > > > instead). > > > > > > On 0, Matt Alexander wrote: > > > > > > > > On Wed, 14 Jan 2004, Scott Walters wrote: > > > > > > > > > There is an example of raw sockets on phoenix.pm.org website, > > > > > but IO::Socket::INET is about the right level of abstraction for > > > > > what you're doing. Clearly Net::Telnet is too much of the wrong > > > > > abstraction. Raw sockets are usually too little abstraction. > > > > > > > > > > >From the man page: > > > > > > > > > > $sock = IO::Socket::INET->new(PeerAddr => 'www.perl.org', > > > > > PeerPort => '80', > > > > > Proto => 'tcp'); > > > > > > > > > > You can then print to $sock, $sock->print("foo!\n"), read from it, > > > > > read $sock, my $buffer, 8192, read lines from it, my $line = readline $sock, > > > > > and so on, just like a normal IO::Handle. > > > > > > > > I ended up using raw sockets and I can now grab all the data, but I'm not > > > > sure how to disconnect after a certain period of time. The device I'm > > > > connecting to doesn't give any indication of when it's done sending data. > > > > So I basically need to grab everything, set an overall time limit of say, > > > > 5 seconds, and then disconnect after that time limit. > > > > Any suggestions? > > > > Thanks, > > > > ~M > > > > From johngnub at cox.net Wed Jan 14 21:05:48 2004 From: johngnub at cox.net (johnb) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Net::Telnet In-Reply-To: <20040114163613.C55522@kraken.magnetinternet.com> Message-ID: Use net::telnet or us a shell telnet scr...examples on request... On Wednesday, January 14, 2004, at 05:40 PM, Matt Alexander wrote: > On Wed, 14 Jan 2004, Scott Walters wrote: > >> There is an example of raw sockets on phoenix.pm.org website, >> but IO::Socket::INET is about the right level of abstraction for >> what you're doing. Clearly Net::Telnet is too much of the wrong >> abstraction. Raw sockets are usually too little abstraction. >> >>> From the man page: >> >> $sock = IO::Socket::INET->new(PeerAddr => >> 'www.perl.org', >> PeerPort => '80', >> Proto => 'tcp'); >> >> You can then print to $sock, $sock->print("foo!\n"), read from it, >> read $sock, my $buffer, 8192, read lines from it, my $line = readline >> $sock, >> and so on, just like a normal IO::Handle. > > I ended up using raw sockets and I can now grab all the data, but I'm > not > sure how to disconnect after a certain period of time. The device I'm > connecting to doesn't give any indication of when it's done sending > data. > So I basically need to grab everything, set an overall time limit of > say, > 5 seconds, and then disconnect after that time limit. > Any suggestions? > Thanks, > ~M > From johngnub at cox.net Wed Jan 14 21:46:27 2004 From: johngnub at cox.net (johnb) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Meeting 01/08/2004 C@NCELLED!!! In-Reply-To: <20040113035217.GN19546@illogics.org> Message-ID: <65E1C72C-470D-11D8-BB69-000A9585B970@cox.net> Hmmmm, maybe the silly box does not have a prompt, ,,, Then maybe the prompt method will take the regex like Prompt => '/^$/' Maybe ? Ponders the JB... On Monday, January 12, 2004, at 08:52 PM, Scott Walters wrote: > I don't know that area. I can suggest some good places around the > Scottsdale > airpark area. Aladdin's cafe is a little hole in the wall place with > good > middle eastern cuisine. Mom and pop place. Nello's Pizza is very good > too. > And downtown Tempe has some nice haunts. > > -scott > > On 0, johnb wrote: >> >> I am still waiting for votes my self? Any idea any one? >> Ponders the JB >> >> $foo =~ s/eat/where/g; >> >> On Monday, January 12, 2004, at 10:12 AM, doug@phoenixinternet.com >> wrote: >> >>> >>> johnb said: >>>> What side of town ? North, like Desert Ridge off the 101, or....open >>>> to >>>> ideas... >>> >>> North would work fine for me, but I suggest something more centraly >>> located; or as I like to say "equally as inconvenient for everyone". >>> >>> -- >>> >>> Doug Miles >>> >> > From doug at phoenixinternet.com Fri Jan 16 15:19:51 2004 From: doug at phoenixinternet.com (doug@phoenixinternet.com) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Meeting next month Message-ID: <.24.221.96.25.1074287991.squirrel@www.phoenixinternet.com> I'm flip-flopping between topics nobody wants to hear. :) How many are interested in having the Perl 101 topic next month? I tried this a little while back, and I know there is some interest out there, but it didn't work out. If there is enough interest, I'm shooting for Feb 5th. Otherwise, I'll go back to the drawing board. -- Doug Miles From johngnub at cox.net Sat Jan 17 09:44:30 2004 From: johngnub at cox.net (johnb) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Meeting next month In-Reply-To: <.24.221.96.25.1074287991.squirrel@www.phoenixinternet.com> Message-ID: <09F72E63-4904-11D8-9207-000A9585B970@cox.net> 101! It never hurts to cover the ground work! On Friday, January 16, 2004, at 02:19 PM, doug@phoenixinternet.com wrote: > I'm flip-flopping between topics nobody wants to hear. :) How many are > interested in having the Perl 101 topic next month? I tried this a > little > while back, and I know there is some interest out there, but it didn't > work out. If there is enough interest, I'm shooting for Feb 5th. > Otherwise, I'll go back to the drawing board. > > -- > > Doug Miles > From scott at illogics.org Sat Jan 17 10:23:02 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Meeting next month Message-ID: <20040117162301.GI19546@illogics.org> http://phoenix.pm.org/wiki/index.cgi?PerlMongersIdeas - that's the current meeting idea suggestion list. Feel free to add to it, everyone. Here's another suggestion - Perl 6 101 =) There was a pretty good consensus on the Four Peaks Tempe thing. Perhaps we could do the real meeting, do 101 there, then retire to Four Peaks for discussion and geek pissing matches. Er, I mean getting pissed and watching footie matches. Meet at Four Peeks around 9:30. This way, there is something for everyone. Intro Perl, free discussion, getting home early and spending time with the kids and wife, showing up at 2 am reaking of alcohol. If no one protests, I'll piggy back on Doug's announcement. -scott On 0, johnb wrote: > > 101! > It never hurts to cover the ground work! > > On Friday, January 16, 2004, at 02:19 PM, doug@phoenixinternet.com > wrote: > > > I'm flip-flopping between topics nobody wants to hear. :) How many are > > interested in having the Perl 101 topic next month? I tried this a > > little > > while back, and I know there is some interest out there, but it didn't > > work out. If there is enough interest, I'm shooting for Feb 5th. > > Otherwise, I'll go back to the drawing board. > > > > -- > > > > Doug Miles > > > From intertwingled at qwest.net Sat Jan 17 18:32:16 2004 From: intertwingled at qwest.net (intertwingled) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Meeting next month In-Reply-To: <20040117162301.GI19546@illogics.org> References: <20040117162301.GI19546@illogics.org> Message-ID: <4009D410.2090800@qwest.net> Errm, about Four Peaks, one thing I gotta warn you about, parking can be a bitch. Not that I will be showing up because I guess I am perlsona non grata at phoenix.pm meetings now. Tempe.PM, on the other hand, is going like gangbusters! =) Tony Scott Walters wrote: >http://phoenix.pm.org/wiki/index.cgi?PerlMongersIdeas - that's the >current meeting idea suggestion list. Feel free to add to it, everyone. > >Here's another suggestion - Perl 6 101 =) > >There was a pretty good consensus on the Four Peaks Tempe thing. >Perhaps we could do the real meeting, do 101 there, then retire to >Four Peaks for discussion and geek pissing matches. Er, I mean >getting pissed and watching footie matches. Meet at Four Peeks around >9:30. > >This way, there is something for everyone. Intro Perl, free discussion, >getting home early and spending time with the kids and wife, showing up at >2 am reaking of alcohol. > >If no one protests, I'll piggy back on Doug's announcement. > >-scott > >On 0, johnb wrote: > > >>101! >>It never hurts to cover the ground work! >> >>On Friday, January 16, 2004, at 02:19 PM, doug@phoenixinternet.com >>wrote: >> >> >> >>>I'm flip-flopping between topics nobody wants to hear. :) How many are >>>interested in having the Perl 101 topic next month? I tried this a >>>little >>>while back, and I know there is some interest out there, but it didn't >>>work out. If there is enough interest, I'm shooting for Feb 5th. >>>Otherwise, I'll go back to the drawing board. >>> >>>-- >>> >>>Doug Miles >>> >>> >>> > > > > From bob at brogmoid.com Sun Jan 18 21:30:08 2004 From: bob at brogmoid.com (Robert Lindley) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Mystery perl module failure Message-ID: <400B4F40.70900@brogmoid.com> Here is a puzzle. I am constructing an assembler for a circa 1979 computer that is on the Apache. Tried to use Text::ParseWords module. It almost worked. I expect it to parse out a quoted token only if the quote immediately follows a word delimiter. I need it to work that way (and the regex looks like it should) but it grabs the whole word at the front and back of the quoted token. What is really bad is that if there is an unmatched single or double quote anywhere on the line it throws the entire line away by returning an empty array of words. I have extracted the part of Text::ParseWords that I am using and put it in a error demo program that is as small as is needed to show the error. Question: Does anybody know how to modify the main regex to: 1. only tokenize a quoted string when that string starts with a single or double quote 2. return all the tokens (including the quote in place) when any unmatched quotes are present. To run, copy both enclosed files somewhere and run with this command: ./parse-error-demo.pl test.src I made one change to parse_line -- deleted reference to $PERL_SINGLE_QUOTE -- that should not effect this problem. Does anyone know of another perl module to parse input lines into tokens treating quoted strings as single units by ignoring enclosed delimiters? Thanks for any help. Bob Lindley -------------- next part -------------- #!/usr/bin/perl # use strict 'vars'; use warnings; # use Text::ParseWords; my($file, $input, $inline, @words1) ; $file = shift; open IN, $file or die "Can't open $file:\n $!\n"; # read all lines in current input file. while($inline = ) { $inline =~ s/\s+$//; # trim trailing white space $inline =~ s/^\s+//; # trim leading white space print "|$inline|\n"; if($inline eq "") { next; } # Skip blank lines @words1 = &parse_line('\s+' , 'delimiters', $inline); print join "|", @words1, "\n--------\n"; # Each item in @words holds: # empty string '' (e.g. word starts in col 1.) # word with only delimiters present # delimited word # } close IN; exit; sub parse_line { # We will be testing undef strings no warnings; use re 'taint'; # if it's tainted, leave it as such my($delimiter, $keep, $line) = @_; my($quote, $quoted, $unquoted, $delim, $word, @pieces); while (length($line)) { ($quote, $quoted, undef, $unquoted, $delim, undef) = $line =~ m/^(["']) # a $quote ((?:\\.|(?!\1)[^\\])*) # and $quoted text \1 # followed by the same quote ([\000-\377]*) # and the rest | # --OR-- ^((?:\\.|[^\\"'])*?) # an $unquoted text (\Z(?!\n)|(?-x:$delimiter)|(?!^)(?=["'])) # plus EOL, delimiter, or quote ([\000-\377]*) # the rest /x; # extended layout return() unless( $quote || length($unquoted) || length($delim)); $line = $+; if ($keep) { $quoted = "$quote$quoted$quote"; } else { $unquoted =~ s/\\(.)/$1/g; if (defined $quote) { $quoted =~ s/\\(.)/$1/g if ($quote eq '"'); $quoted =~ s/\\([\\'])/$1/g if ($quote eq "'"); } } $word .= defined $quote ? $quoted : $unquoted; if (length($delim)) { push(@pieces, $word); push(@pieces, $delim) if ($keep eq 'delimiters'); undef $word; } if (!length($line)) { push(@pieces, $word); } } return(@pieces); } __END__ -------------- next part -------------- An ordinary line parses just fine 'this has a space in it.' Mismatched quotes throw away the whole line "mismatched quotes.' Dave O'Neil worked with George O'Malley on this project. My name is David O'Neil ^ENABLES THE "SSS" MSG'S TO THE DTC, {57-000 ^ NOTE THE '' ABOVE MEANS TO USE ONE ' CHARACTER {57-002 From scott at illogics.org Mon Jan 19 01:06:34 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Mystery perl module failure Message-ID: <20040119070634.GK19546@illogics.org> Text::Balanced. Okey, it took me three hours to type that. Sorry if this reply is short. Post a status later... That will get things quoted by an arbitrary character of set of matching characters. If you know when you're expecting something quoted and when you're expecting something, you should be able to mix those. Parse::RecDescent is much more powerful, and the power carries a price. There is some learning involved. I usually just hack up a quick parsing using the \G trick from perldoc perlre. \G in a regex matches where the last match left off, so you can match... while(1) { if($str =~ m/\G(['"])(.*)\1\s+/gcs) { # $1 will contain the qouting character # $2 contains what was between them # \s+ eats up whitespace # the /gc are needed for \G to work } if($str =~ m/\G(.*?)\s+/gcs) { # $1 is the word # the match is non-greedy so that it will stop at the first white-space } pos($str) == length($str) and last; } This should match a stream of things like: not-quoted "quoted stuff" thingie stuff 'another quoted thingie' and find: non-quoted "quoted stuff" thingie stuff 'another quoted thingie' Hope this helps! -scott On 0, Robert Lindley wrote: > > This is a multi-part message in MIME format. > --------------020401030200020407060505 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Here is a puzzle. > > I am constructing an assembler for a circa 1979 computer that is on the > Apache. > > Tried to use Text::ParseWords module. It almost worked. I expect it to > parse out a > quoted token only if the quote immediately follows a word delimiter. I > need it to work > that way (and the regex looks like it should) but it grabs the whole > word at the front > and back of the quoted token. > > What is really bad is that if there is an unmatched single or double > quote anywhere > on the line it throws the entire line away by returning an empty array > of words. > > I have extracted the part of Text::ParseWords that I am using and put it > in a error > demo program that is as small as is needed to show the error. > > Question: > > Does anybody know how to modify the main regex to: > 1. only tokenize a quoted string when that string starts with a single > or double quote > 2. return all the tokens (including the quote in place) when any > unmatched quotes are present. > > To run, copy both enclosed files somewhere and run with this command: > > ./parse-error-demo.pl test.src > > I made one change to parse_line -- deleted reference to > $PERL_SINGLE_QUOTE -- > that should not effect this problem. > > Does anyone know of another perl module to parse input lines into tokens > treating > quoted strings as single units by ignoring enclosed delimiters? > > Thanks for any help. > > Bob Lindley > > --------------020401030200020407060505 > Content-Type: text/plain; > name="parse-error-demo.pl" > Content-Transfer-Encoding: 7bit > Content-Disposition: inline; > filename="parse-error-demo.pl" > > #!/usr/bin/perl > # > use strict 'vars'; > use warnings; > # use Text::ParseWords; > my($file, $input, $inline, @words1) > ; > $file = shift; > open IN, $file or die "Can't open $file:\n $!\n"; > # read all lines in current input file. > while($inline = ) { > $inline =~ s/\s+$//; # trim trailing white space > $inline =~ s/^\s+//; # trim leading white space > print "|$inline|\n"; > if($inline eq "") { next; } # Skip blank lines > @words1 = &parse_line('\s+' , 'delimiters', $inline); > print join "|", @words1, "\n--------\n"; > # Each item in @words holds: > # empty string '' (e.g. word starts in col 1.) > # word with only delimiters present > # delimited word > # > } > close IN; > exit; > > sub parse_line { > # We will be testing undef strings > no warnings; > use re 'taint'; # if it's tainted, leave it as such > > my($delimiter, $keep, $line) = @_; > my($quote, $quoted, $unquoted, $delim, $word, @pieces); > while (length($line)) { > ($quote, $quoted, undef, $unquoted, $delim, undef) = > $line =~ m/^(["']) # a $quote > ((?:\\.|(?!\1)[^\\])*) # and $quoted text > \1 # followed by the same quote > ([\000-\377]*) # and the rest > | # --OR-- > ^((?:\\.|[^\\"'])*?) # an $unquoted text > (\Z(?!\n)|(?-x:$delimiter)|(?!^)(?=["'])) > # plus EOL, delimiter, or quote > ([\000-\377]*) # the rest > /x; # extended layout > return() unless( $quote || length($unquoted) || length($delim)); > $line = $+; > if ($keep) { > $quoted = "$quote$quoted$quote"; > } else { > $unquoted =~ s/\\(.)/$1/g; > if (defined $quote) { > $quoted =~ s/\\(.)/$1/g if ($quote eq '"'); > $quoted =~ s/\\([\\'])/$1/g if ($quote eq "'"); > } > } > $word .= defined $quote ? $quoted : $unquoted; > if (length($delim)) { > push(@pieces, $word); > push(@pieces, $delim) if ($keep eq 'delimiters'); > undef $word; > } > if (!length($line)) { > push(@pieces, $word); > } > } > return(@pieces); > } > > > > __END__ > > --------------020401030200020407060505 > Content-Type: text/plain; > name="test.src" > Content-Transfer-Encoding: 7bit > Content-Disposition: inline; > filename="test.src" > > An ordinary line parses just fine 'this has a space in it.' > Mismatched quotes throw away the whole line "mismatched quotes.' > Dave O'Neil worked with George O'Malley on this project. > My name is David O'Neil > ^ENABLES THE "SSS" MSG'S TO THE DTC, {57-000 > ^ NOTE THE '' ABOVE MEANS TO USE ONE ' CHARACTER {57-002 > > --------------020401030200020407060505-- > From bob at brogmoid.com Mon Jan 19 21:14:39 2004 From: bob at brogmoid.com (Robert Lindley) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Mystery perl module failure Message-ID: <400C9D1F.1020803@brogmoid.com> Thanks for the fast reply. I looked at the v 5.8 perlre on perldoc.dom and did not see the hack you mentioned before I asked for help Looked again and found it in the v 5.6 perldoc. That looks a lot simpler... I think that I can tweek it to my task. Bob Lindley From TomA at fh.org Tue Jan 20 10:33:40 2004 From: TomA at fh.org (Tom Achtenberg) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Meeting next month Message-ID: <4A8DFDA6B395D411A11B00508BEE23FE013639F1@mail.int.fh.org> I'd be interested in the 101 meeting especially since there is more than 2 days notice this time. Location for me that is best would be central phoenix or North. Tempe is too far South for me to go at night. I'd prefer a non bar non smoking atmosphere too. -----Original Message----- From: johnb [mailto:johngnub@cox.net] Sent: Saturday, January 17, 2004 8:45 AM To: phoenix-pm-list@happyfunball.pm.org Subject: Re: Phoenix.pm: Meeting next month 101! It never hurts to cover the ground work! On Friday, January 16, 2004, at 02:19 PM, doug@phoenixinternet.com wrote: > I'm flip-flopping between topics nobody wants to hear. :) How many > are interested in having the Perl 101 topic next month? I tried this > a little while back, and I know there is some interest out there, but > it didn't work out. If there is enough interest, I'm shooting for Feb > 5th. Otherwise, I'll go back to the drawing board. > > -- > > Doug Miles > From m at pdxlug.org Tue Jan 20 10:50:08 2004 From: m at pdxlug.org (Matt Alexander) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Meeting next month In-Reply-To: <4A8DFDA6B395D411A11B00508BEE23FE013639F1@mail.int.fh.org> References: <4A8DFDA6B395D411A11B00508BEE23FE013639F1@mail.int.fh.org> Message-ID: <20040120084928.Y16235@kraken.magnetinternet.com> I'd like a 101 as well. It's always good to review the basics and maybe plug a few holes in my understanding as well. :) On Tue, 20 Jan 2004, Tom Achtenberg wrote: > I'd be interested in the 101 meeting especially since there is more than 2 days notice this time. Location for me that is best would be central phoenix or North. Tempe is too far South for me to go at night. I'd prefer a non bar non smoking atmosphere too. > > -----Original Message----- > From: johnb [mailto:johngnub@cox.net] > Sent: Saturday, January 17, 2004 8:45 AM > To: phoenix-pm-list@happyfunball.pm.org > Subject: Re: Phoenix.pm: Meeting next month > > > 101! > It never hurts to cover the ground work! > > On Friday, January 16, 2004, at 02:19 PM, doug@phoenixinternet.com > wrote: > > > I'm flip-flopping between topics nobody wants to hear. :) How many > > are interested in having the Perl 101 topic next month? I tried this > > a little while back, and I know there is some interest out there, but > > it didn't work out. If there is enough interest, I'm shooting for Feb > > 5th. Otherwise, I'll go back to the drawing board. > > > > -- > > > > Doug Miles > > > From friedman at highwire.stanford.edu Thu Jan 22 20:28:43 2004 From: friedman at highwire.stanford.edu (Michael Friedman) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: How to display the inheritance tree? Message-ID: Folks, So, here I am in the debugger with a method that isn't getting found when I know for sure it's in the ISA tree *someplace*. I found the problem using ->isa() and ->can(), but it just raised the larger issue: Is there a way to display the entire contents of the inheritance tree, given a starting class? I'm guessing it gets checked on-the-fly, so you'd have to walk all the @ISAs yourself, but is there a better way? Does perl preprocess this sort of thing and store it somewhere it can be seen? As I said, I fixed my immediate problem, but now I'm really curious about this. Any thoughts? Thanks, -- Mike --------------------------------------------------------------------- Michael Friedman HighWire Press, Stanford Southwest Phone: 480-456-0880 Tempe, Arizona FAX: 270-721-8034 --------------------------------------------------------------------- From bob at brogmoid.com Thu Jan 22 21:43:10 2004 From: bob at brogmoid.com (Robert Lindley) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Mystery perl module failure In-Reply-To: <20040119070634.GK19546@illogics.org> References: <20040119070634.GK19546@illogics.org> Message-ID: <4010984E.6000508@brogmoid.com> Scott Thanks! That method allowed me to solve my problem. Had to modify the code a bit. It had two problems. 1. If a line (like the last line of a file) did not have a \n or space at the end it went into an infinite loop. Easy to fix. Just made sure the all lines had \n at the end. 2. Quoted string of the form ' ',,'x' etc. got in troulble. Just made the quoted capture non-greedy. Ran 50,000+ lines of assembly code through it an no problems found. Thanks again - - really saved the day! If anybody is interested, I will post what I ended up with. Bob Lindley Scott Walters wrote: >Text::Balanced. > >Okey, it took me three hours to type that. Sorry if this reply is short. >Post a status later... > >That will get things quoted by an arbitrary character of set of matching >characters. If you know when you're expecting something quoted and when >you're expecting something, you should be able to mix those. > >Parse::RecDescent is much more powerful, and the power carries a price. >There is some learning involved. > >I usually just hack up a quick parsing using the \G trick from perldoc >perlre. \G in a regex matches where the last match left off, so you >can match... > > while(1) { > if($str =~ m/\G(['"])(.*)\1\s+/gcs) { > # $1 will contain the qouting character > # $2 contains what was between them > # \s+ eats up whitespace > # the /gc are needed for \G to work > } > if($str =~ m/\G(.*?)\s+/gcs) { > # $1 is the word > # the match is non-greedy so that it will stop at the first white-space > } > pos($str) == length($str) and last; > } > >This should match a stream of things like: > >not-quoted "quoted stuff" thingie stuff >'another quoted thingie' > >and find: > >non-quoted >"quoted stuff" >thingie >stuff >'another quoted thingie' > >Hope this helps! >-scott > >On 0, Robert Lindley wrote: > > >>This is a multi-part message in MIME format. >>--------------020401030200020407060505 >>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>Content-Transfer-Encoding: 7bit >> >>Here is a puzzle. >> >>I am constructing an assembler for a circa 1979 computer that is on the >>Apache. >> >>Tried to use Text::ParseWords module. It almost worked. I expect it to >>parse out a >>quoted token only if the quote immediately follows a word delimiter. I >>need it to work >>that way (and the regex looks like it should) but it grabs the whole >>word at the front >>and back of the quoted token. >> >>What is really bad is that if there is an unmatched single or double >>quote anywhere >>on the line it throws the entire line away by returning an empty array >>of words. >> >>I have extracted the part of Text::ParseWords that I am using and put it >>in a error >>demo program that is as small as is needed to show the error. >> >>Question: >> >> Does anybody know how to modify the main regex to: >> 1. only tokenize a quoted string when that string starts with a single >>or double quote >> 2. return all the tokens (including the quote in place) when any >>unmatched quotes are present. >> >>To run, copy both enclosed files somewhere and run with this command: >> >>./parse-error-demo.pl test.src >> >>I made one change to parse_line -- deleted reference to >>$PERL_SINGLE_QUOTE -- >>that should not effect this problem. >> >>Does anyone know of another perl module to parse input lines into tokens >>treating >>quoted strings as single units by ignoring enclosed delimiters? >> >>Thanks for any help. >> >>Bob Lindley >> >>--------------020401030200020407060505 >>Content-Type: text/plain; >> name="parse-error-demo.pl" >>Content-Transfer-Encoding: 7bit >>Content-Disposition: inline; >> filename="parse-error-demo.pl" >> >>#!/usr/bin/perl >># >>use strict 'vars'; >>use warnings; >># use Text::ParseWords; >>my($file, $input, $inline, @words1) >>; >> $file = shift; >> open IN, $file or die "Can't open $file:\n $!\n"; >> # read all lines in current input file. >> while($inline = ) { >> $inline =~ s/\s+$//; # trim trailing white space >> $inline =~ s/^\s+//; # trim leading white space >> print "|$inline|\n"; >> if($inline eq "") { next; } # Skip blank lines >> @words1 = &parse_line('\s+' , 'delimiters', $inline); >> print join "|", @words1, "\n--------\n"; >> # Each item in @words holds: >> # empty string '' (e.g. word starts in col 1.) >> # word with only delimiters present >> # delimited word >> # >> } >> close IN; >> exit; >> >>sub parse_line { >> # We will be testing undef strings >> no warnings; >> use re 'taint'; # if it's tainted, leave it as such >> >> my($delimiter, $keep, $line) = @_; >> my($quote, $quoted, $unquoted, $delim, $word, @pieces); >> while (length($line)) { >> ($quote, $quoted, undef, $unquoted, $delim, undef) = >> $line =~ m/^(["']) # a $quote >> ((?:\\.|(?!\1)[^\\])*) # and $quoted text >> \1 # followed by the same quote >> ([\000-\377]*) # and the rest >> | # --OR-- >> ^((?:\\.|[^\\"'])*?) # an $unquoted text >> (\Z(?!\n)|(?-x:$delimiter)|(?!^)(?=["'])) >> # plus EOL, delimiter, or quote >> ([\000-\377]*) # the rest >> /x; # extended layout >> return() unless( $quote || length($unquoted) || length($delim)); >> $line = $+; >> if ($keep) { >> $quoted = "$quote$quoted$quote"; >> } else { >> $unquoted =~ s/\\(.)/$1/g; >> if (defined $quote) { >> $quoted =~ s/\\(.)/$1/g if ($quote eq '"'); >> $quoted =~ s/\\([\\'])/$1/g if ($quote eq "'"); >> } >> } >> $word .= defined $quote ? $quoted : $unquoted; >> if (length($delim)) { >> push(@pieces, $word); >> push(@pieces, $delim) if ($keep eq 'delimiters'); >> undef $word; >> } >> if (!length($line)) { >> push(@pieces, $word); >> } >> } >> return(@pieces); >>} >> >> >> >>__END__ >> >>--------------020401030200020407060505 >>Content-Type: text/plain; >> name="test.src" >>Content-Transfer-Encoding: 7bit >>Content-Disposition: inline; >> filename="test.src" >> >>An ordinary line parses just fine 'this has a space in it.' >>Mismatched quotes throw away the whole line "mismatched quotes.' >>Dave O'Neil worked with George O'Malley on this project. >>My name is David O'Neil >> ^ENABLES THE "SSS" MSG'S TO THE DTC, {57-000 >>^ NOTE THE '' ABOVE MEANS TO USE ONE ' CHARACTER {57-002 >> >>--------------020401030200020407060505-- >> >> >> > > > > From scott at illogics.org Fri Jan 23 13:41:29 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: How to display the inheritance tree? Message-ID: <20040123194129.GT10011@illogics.org> # GraphViz::ISA - graph inheritance trees # Devel::Symdump - same, but in ASCII >From http://perldesignpatterns.com/?AboutInheritance =) One of my current tasks is to chart CPAN the same way that Java API reference documents chart inheritance between the Java standard objects. -scott On 0, Michael Friedman wrote: > > Folks, > > So, here I am in the debugger with a method that isn't getting found > when I know for sure it's in the ISA tree *someplace*. I found the > problem using ->isa() and ->can(), but it just raised the larger issue: > > Is there a way to display the entire contents of the inheritance tree, > given a starting class? > > I'm guessing it gets checked on-the-fly, so you'd have to walk all the > @ISAs yourself, but is there a better way? Does perl preprocess this > sort of thing and store it somewhere it can be seen? > > As I said, I fixed my immediate problem, but now I'm really curious > about this. > Any thoughts? > > Thanks, > -- Mike > --------------------------------------------------------------------- > Michael Friedman HighWire Press, Stanford Southwest > Phone: 480-456-0880 Tempe, Arizona > FAX: 270-721-8034 > --------------------------------------------------------------------- > From scott at illogics.org Fri Jan 23 18:33:47 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: Mystery perl module failure Message-ID: <20040124003347.GX10011@illogics.org> Hi Robert, I'm glad! This idiom is very powerful. I wrote a module to parse HTML forms and repopulate them from data in a hash using that idiom, but someone beat me to the punch and got theirs on CPAN before I got around to posting mine. Thiers is probably better anyway. Re: the locking up when there is no newline at the end of a file, if the tokens are matched in patterns chained together with if/elsif/elsif, it is easy to do an error condition. If nothing else matches and it gets to the final elsif in the chain, that test to see if there is any character there at all. If so, throw a syntax error, otherwise, you're done. TinyWiki does exactly that. I wouldn't mind seeing your assembler as a presentation, but you'd better be ready to tell me all about the processor you're assembling code for ;) -scott On 0, Robert Lindley wrote: > > Scott > > Thanks! > > That method allowed me to solve my problem. Had to modify the code a > bit. It had two problems. > > 1. If a line (like the last line of a file) did not have a \n or space at > the end it went into an infinite loop. Easy to fix. Just made sure the all > lines had \n at the end. > > 2. Quoted string of the form ' ',,'x' etc. got in troulble. Just made the > quoted capture non-greedy. > > Ran 50,000+ lines of assembly code through it an no problems found. > > Thanks again - - really saved the day! > > If anybody is interested, I will post what I ended up with. > > Bob Lindley > > Scott Walters wrote: > > >Text::Balanced. > > > >Okey, it took me three hours to type that. Sorry if this reply is short. > >Post a status later... > > > >That will get things quoted by an arbitrary character of set of matching > >characters. If you know when you're expecting something quoted and when > >you're expecting something, you should be able to mix those. > > > >Parse::RecDescent is much more powerful, and the power carries a price. > >There is some learning involved. > > > >I usually just hack up a quick parsing using the \G trick from perldoc > >perlre. \G in a regex matches where the last match left off, so you > >can match... > > > > while(1) { > > if($str =~ m/\G(['"])(.*)\1\s+/gcs) { > > # $1 will contain the qouting character > > # $2 contains what was between them > > # \s+ eats up whitespace > > # the /gc are needed for \G to work > > } > > if($str =~ m/\G(.*?)\s+/gcs) { > > # $1 is the word > > # the match is non-greedy so that it will stop at the first white-space > > } > > pos($str) == length($str) and last; > > } > > > >This should match a stream of things like: > > > >not-quoted "quoted stuff" thingie stuff > >'another quoted thingie' > > > >and find: > > > >non-quoted > >"quoted stuff" > >thingie > >stuff > >'another quoted thingie' > > > >Hope this helps! > >-scott > > > >On 0, Robert Lindley wrote: > > > > > >>This is a multi-part message in MIME format. > >>--------------020401030200020407060505 > >>Content-Type: text/plain; charset=ISO-8859-1; format=flowed > >>Content-Transfer-Encoding: 7bit > >> > >>Here is a puzzle. > >> > >>I am constructing an assembler for a circa 1979 computer that is on the > >>Apache. > >> > >>Tried to use Text::ParseWords module. It almost worked. I expect it to > >>parse out a > >>quoted token only if the quote immediately follows a word delimiter. I > >>need it to work > >>that way (and the regex looks like it should) but it grabs the whole > >>word at the front > >>and back of the quoted token. > >> > >>What is really bad is that if there is an unmatched single or double > >>quote anywhere > >>on the line it throws the entire line away by returning an empty array > >>of words. > >> > >>I have extracted the part of Text::ParseWords that I am using and put it > >>in a error > >>demo program that is as small as is needed to show the error. > >> > >>Question: > >> > >> Does anybody know how to modify the main regex to: > >> 1. only tokenize a quoted string when that string starts with a single > >>or double quote > >> 2. return all the tokens (including the quote in place) when any > >>unmatched quotes are present. > >> > >>To run, copy both enclosed files somewhere and run with this command: > >> > >>./parse-error-demo.pl test.src > >> > >>I made one change to parse_line -- deleted reference to > >>$PERL_SINGLE_QUOTE -- > >>that should not effect this problem. > >> > >>Does anyone know of another perl module to parse input lines into tokens > >>treating > >>quoted strings as single units by ignoring enclosed delimiters? > >> > >>Thanks for any help. > >> > >>Bob Lindley > >> > >>--------------020401030200020407060505 > >>Content-Type: text/plain; > >> name="parse-error-demo.pl" > >>Content-Transfer-Encoding: 7bit > >>Content-Disposition: inline; > >> filename="parse-error-demo.pl" > >> > >>#!/usr/bin/perl > >># > >>use strict 'vars'; > >>use warnings; > >># use Text::ParseWords; > >>my($file, $input, $inline, @words1) > >>; > >> $file = shift; > >> open IN, $file or die "Can't open $file:\n $!\n"; > >> # read all lines in current input file. > >> while($inline = ) { > >> $inline =~ s/\s+$//; # trim trailing white space > >> $inline =~ s/^\s+//; # trim leading white space > >> print "|$inline|\n"; > >> if($inline eq "") { next; } # Skip blank lines > >> @words1 = &parse_line('\s+' , 'delimiters', $inline); > >> print join "|", @words1, "\n--------\n"; > >> # Each item in @words holds: > >> # empty string '' (e.g. word starts in col 1.) > >> # word with only delimiters present > >> # delimited word > >> # > >> } > >> close IN; > >> exit; > >> > >>sub parse_line { > >> # We will be testing undef strings > >> no warnings; > >> use re 'taint'; # if it's tainted, leave it as such > >> > >> my($delimiter, $keep, $line) = @_; > >> my($quote, $quoted, $unquoted, $delim, $word, @pieces); > >> while (length($line)) { > >> ($quote, $quoted, undef, $unquoted, $delim, undef) = > >> $line =~ m/^(["']) # a $quote > >> ((?:\\.|(?!\1)[^\\])*) # and $quoted text > >> \1 # followed by the same quote > >> ([\000-\377]*) # and the rest > >> | # --OR-- > >> ^((?:\\.|[^\\"'])*?) # an $unquoted text > >> (\Z(?!\n)|(?-x:$delimiter)|(?!^)(?=["'])) > >> # plus EOL, delimiter, or quote > >> ([\000-\377]*) # the rest > >> /x; # extended layout > >> return() unless( $quote || length($unquoted) || length($delim)); > >> $line = $+; > >> if ($keep) { > >> $quoted = "$quote$quoted$quote"; > >> } else { > >> $unquoted =~ s/\\(.)/$1/g; > >> if (defined $quote) { > >> $quoted =~ s/\\(.)/$1/g if ($quote eq '"'); > >> $quoted =~ s/\\([\\'])/$1/g if ($quote eq "'"); > >> } > >> } > >> $word .= defined $quote ? $quoted : $unquoted; > >> if (length($delim)) { > >> push(@pieces, $word); > >> push(@pieces, $delim) if ($keep eq 'delimiters'); > >> undef $word; > >> } > >> if (!length($line)) { > >> push(@pieces, $word); > >> } > >> } > >> return(@pieces); > >>} > >> > >> > >> > >>__END__ > >> > >>--------------020401030200020407060505 > >>Content-Type: text/plain; > >> name="test.src" > >>Content-Transfer-Encoding: 7bit > >>Content-Disposition: inline; > >> filename="test.src" > >> > >>An ordinary line parses just fine 'this has a space in it.' > >>Mismatched quotes throw away the whole line "mismatched quotes.' > >>Dave O'Neil worked with George O'Malley on this project. > >>My name is David O'Neil > >> ^ENABLES THE "SSS" MSG'S TO THE DTC, {57-000 > >>^ NOTE THE '' ABOVE MEANS TO USE ONE ' CHARACTER {57-002 > >> > >>--------------020401030200020407060505-- > >> > >> > >> > > > > > > > > > > From scott at illogics.org Sat Jan 31 22:55:10 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:13 2004 Subject: Phoenix.pm: davem@fdisolutions.com: Re: Whither 5.6.3? Message-ID: <20040201045510.GQ10011@illogics.org> my $x if 0; This form created a lexical variable that never re-initializes. It keeps its value across subroutine calls, like a C 'static'. For example: perl -e 'sub foo { my $x if 0; print $x, "\n"; $x = shift; } foo(10); foo(20); foo(40);' Looks like they're getting ready to nuke the "feature". -scott ----- Forwarded message from Dave Mitchell ----- ID: <20040201015900.GD20819@fdisolutions.com> List: contact perl5-porters-help@perl.org; run by ezmlm Status: No, hits=-4.9 required=8.0 tests=BAYES_00 autolearn=ham version=2.63 post: SMTPD: qpsmtpd/0.26, http://develooper.com/code/qpsmtpd/ Disposition: inline Type: text/plain; charset=us-ascii Spam-Index: -9.5 Filter-Rule: None, default is delivery References: <71B318898201D311845C0008C75DAD1C0A44CA54@defra1ex2> Archive: help: Agent: Mutt/1.4.1i Received: from onion.perl.org (onion.develooper.com [63.251.223.166]) (qmail 11033 invoked by uid 1005); 1 Feb 2004 02:26:16 -0000 (qmail 10904 invoked by uid 76); 1 Feb 2004 02:26:11 -0000 Cc: 'Yitzchak Scott-Thoennes' , perl5-porters@perl.org Subject: Re: Whither 5.6.3? unsubscribe: Spam-Is-Higher-Than: 5 Date: Sun, 1 Feb 2004 01:59:00 +0000 Version: 1.0 SpamAssassin 2.63 (2004-01-11) on x1.develooper.com Precedence: bulk To: "mailing list perl5-porters@perl.org perl5-porters@perl.org Orton, Yves" , "Orton, Yves" , 'Yitzchak Scott-Thoennes' , "perl5-porters@perl.org" <71B318898201D311845C0008C75DAD1C0A44CA54@defra1ex2> From: Dave Mitchell Disclaimer: This disclaimer may not be read without permission On Thu, Jan 29, 2004 at 05:10:32PM -0000, Orton, Yves wrote: [discussion of C ] > Oh, dont get me wrong. Make it a syntax error, or a warning or whatever. I > only commented becuase I think the meme is wider spread than one might think > and that it may affect more code than one might think. > > But I know that personally Ive been bitten by it and would have loved a > warning. The patch below attempts to give such a warning. I'll apply it in a couple of days if no one objects. $ ./perl -we 'my $x if $a' Use of my in conditional deprecated at -e line 1. If detects and/or/if/unless as simple statements, eg the following all give the a warning: my $x if $a; $a && (my $x = 1); my ($x,@y) = (1,2,3) unless $a; $a || (my ($x,@y) = (1,2,3)); but the following doesn't warn: if ($a && (my $foo = ...)) { print $foo } This patch threw up quite a lot of problems in the test suite, which is an indication that there's a *lot* of code out there about to get noisy. Here is a list of the major ones, along with sample snippets of code Use of my in conditional deprecated at ../lib/IO/Handle.pm line 497. Use of my in conditional deprecated at ../lib/IO/Handle.pm line 504. Use of my in conditional deprecated at ../lib/IO/Handle.pm line 511. Use of my in conditional deprecated at ../lib/IO/Handle.pm line 518. Use of my in conditional deprecated at ../lib/IO/Handle.pm line 525. Use of my in conditional deprecated at ../lib/IO/Handle.pm line 532. Use of my in conditional deprecated at ../lib/IO/Handle.pm line 607. my $tell = tell qualify($_[0], caller) if ref($_[0]); Use of my in conditional deprecated at ../lib/B/Deparse.pm line 1089. my $nseq = $self->find_scope_st($root->sibling) if ${$root->sibling}; Use of my in conditional deprecated at ../lib/IO/Pipe.pm line 125 my $pid = $me->_doit(1, $fh, @_) if(@_); Use of my in conditional deprecated at ../lib/ExtUtils/Liblist/Kid.pm line 230. Use of my in conditional deprecated at ../lib/ExtUtils/Liblist/Kid.pm line 231. Use of my in conditional deprecated at ../lib/ExtUtils/Liblist/Kid.pm line 232. my $VC = 1 if $cc =~ /^cl/i; my $BC = 1 if $cc =~ /^bcc/i; my $GC = 1 if $cc =~ /^gcc/i; Use of my in conditional deprecated at ../lib/ExtUtils/MM_NW5.pm line 35. Use of my in conditional deprecated at ../lib/ExtUtils/MM_NW5.pm line 36. Use of my in conditional deprecated at ../lib/ExtUtils/MM_NW5.pm line 37. my $BORLAND = 1 if $Config{'cc'} =~ /^bcc/i; my $GCC = 1 if $Config{'cc'} =~ /^gcc/i; my $DMAKE = 1 if $Config{'make'} =~ /^dmake/i; Use of my in conditional deprecated at ../lib/ExtUtils/MM_Win95.pm line 10. Use of my in conditional deprecated at ../lib/ExtUtils/MM_Win95.pm line 11. my $DMAKE = 1 if $Config{'make'} =~ /^dmake/i; my $NMAKE = 1 if $Config{'make'} =~ /^nmake/i; Use of my in conditional deprecated at ../utils/h2xs line 671. my %const_xsub = map { $_,1 } split(/,+/, $opt_s) if $opt_s; Use of my in conditional deprecated at ../lib/Net/NNTP.pm line 24. Use of my in conditional deprecated at ../lib/Net/SMTP.pm line 27. Use of my in conditional deprecated at ../lib/Net/POP3.pm line 24. my $host = shift if @_ % 2; Use of my in conditional deprecated at ../lib/Pod/Parser.pm line 1158. my ($in_fh, $out_fh) = (gensym, gensym) if ($] < 5.6); Use of my in conditional deprecated at ../lib/Test/Harness.pm line 466 my @dir_files = _globdir $Files_In_Dir if defined $Files_In_Dir; > also a warning would be nice for > > my $foo=$_ for (1..10); > > which doesnt do anything like what it looks like it should do. I'll worry about that one later! Dave. -- Nothing ventured, nothing lost. --- opcode.pl- Sat Jan 31 23:08:40 2004 +++ opcode.pl Sun Feb 1 00:40:46 2004 @@ -684,8 +684,8 @@ reset symbol reset ck_fun is% S? lineseq line sequence ck_null @ -nextstate next statement ck_null s; -dbstate debug next statement ck_null s; +nextstate next statement ck_state s; +dbstate debug next statement ck_state s; unstack iteration finalizer ck_null s0 enter block entry ck_null 0 leave block exit ck_null @ --- op.c- Sat Jan 31 22:57:27 2004 +++ op.c Sun Feb 1 01:36:30 2004 @@ -3305,7 +3305,7 @@ } } - return prepend_elem(OP_LINESEQ, (OP*)cop, o); + return prepend_elem(OP_LINESEQ, (OP*)cop, CHECKOP(cop->op_type, o)); } @@ -5938,6 +5938,43 @@ } OP * +Perl_ck_state(pTHX_ OP *o) +{ + /* **NB** o is actually the sibling of the state op */ + + /* warn on C , C<$a && my $x=1;> style statements */ + OP *kid; + if (!o || o->op_type != OP_NULL || !(o->op_flags & OPf_KIDS)) + return o; + kid = cUNOPo->op_first; + if (!(kid->op_type == OP_AND || kid->op_type == OP_OR)) + return o; + kid = kUNOP->op_first->op_sibling; + if (kid->op_type == OP_SASSIGN) + kid = kBINOP->op_first->op_sibling; + else if (kid->op_type == OP_AASSIGN) + kid = kBINOP->op_first->op_sibling; + + if (kid->op_type == OP_LIST + || (kid->op_type == OP_NULL && kid->op_targ == OP_LIST)) + { + kid = kUNOP->op_first; + if (kid->op_type == OP_PUSHMARK) + kid = kid->op_sibling; + } + if ((kid->op_type == OP_PADSV || kid->op_type == OP_PADAV + || kid->op_type == OP_PADHV) + && (kid->op_private & OPpLVAL_INTRO) + && (ckWARN(WARN_DEPRECATED))) + { + Perl_warner(aTHX_ packWARN(WARN_DEPRECATED), + "Use of my in conditional deprecated"); + } + return o; +} + + +OP * Perl_ck_subr(pTHX_ OP *o) { OP *prev = ((cUNOPo->op_first->op_sibling) --- t/lib/warnings/op- Sat Jan 31 23:27:57 2004 +++ t/lib/warnings/op Sun Feb 1 01:53:18 2004 @@ -1050,3 +1050,60 @@ Useless localization of substr at - line 48. Useless localization of match position at - line 49. Useless localization of vec at - line 50. +######## +# op.c +use warnings 'deprecated'; +our $a; +my $x1 if $a; +my @x2 if $a; +my %x3 if $a; +my ($x4) if $a; +my ($x5,@x6, %x7) if $a; +my @x8 if ($a+$a); +my $x9 = 1+$a if $a; +my ($x10,@x11) = ($a,$a+$a) if $a; +my ($x12) = 1 if $a; +my $y1 unless $a; +my @y2 unless $a; +my %y3 unless $a; +my ($y4) unless $a; +my ($y5,@y6, %y7) unless $a; +my @y8 unless ($a+$a); +$a && my $z1; +$a && my (%z2); +$a || my @z3; +$a || my (%z4); +$a || my (%z4,$z5); +$a && (my $z6 = 1); +$a && (my ($z7,@z8) = (1,2,3)); + +# these shouldn't warn +our $x if $a; +our $x unless $a; +if ($a) { my $w1 } +if (my $w2) { $a=1 } +if ($a && (my $w3 = 1)) {$a = 2} + +EXPECT +Use of my in conditional deprecated at - line 4. +Use of my in conditional deprecated at - line 5. +Use of my in conditional deprecated at - line 6. +Use of my in conditional deprecated at - line 7. +Use of my in conditional deprecated at - line 8. +Use of my in conditional deprecated at - line 9. +Use of my in conditional deprecated at - line 10. +Use of my in conditional deprecated at - line 11. +Use of my in conditional deprecated at - line 12. +Use of my in conditional deprecated at - line 13. +Use of my in conditional deprecated at - line 14. +Use of my in conditional deprecated at - line 15. +Use of my in conditional deprecated at - line 16. +Use of my in conditional deprecated at - line 17. +Use of my in conditional deprecated at - line 18. +Use of my in conditional deprecated at - line 19. +Use of my in conditional deprecated at - line 20. +Use of my in conditional deprecated at - line 21. +Use of my in conditional deprecated at - line 22. +Use of my in conditional deprecated at - line 23. +Use of my in conditional deprecated at - line 24. +Use of my in conditional deprecated at - line 25. --- pod/perldiag.pod- Sat Jan 31 23:47:54 2004 +++ pod/perldiag.pod Sun Feb 1 01:30:07 2004 @@ -4282,6 +4282,24 @@ it already went past any symlink you are presumably trying to look for. The operation returned C. Use a filename instead. +=item Use of my in conditional deprecated + +(D deprecated) You used a C declaration within a conditional +expression of some sort, such as C or C. +Perl's run-time behaviour in such constructs is currently undefined, but +typically causes the variable not be be cleared at the end of scope and +to retain its old value the next time the scope is entered. Some people +have been making use of this "feature" to implement a type of static +variable. We intend to change this behaviour in a future release, so +don't rely on it. + +To work around this warning, move the declaration outside the expression, +eg + + my $x; + $x = 1 if foo; + + =item Use of "package" with no arguments is deprecated (D deprecated) You used the C keyword without specifying a package ----- End forwarded message -----