From tim at consultix-inc.com Thu Apr 1 11:34:09 2004 From: tim at consultix-inc.com (Tim Maher) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: Call for "Internet Annoyances" Message-ID: <20040401173409.GC11807@jumpy.consultix-inc.com> This time around, we have yet another book in the wings--this one focusing on Internet annoyances. Some of the annoying areas: Email (and spam), connecting to the Net (via dialup, DSL, cable, configuration and all that), wireless annoyances (from WiFi hassles to hotspots to fiddling with WEP), web sites (namely creating, hosting, and maintaining your own web site), browsing and browsers (Internet Explorer, Netscape, and others), AOL, instant messaging, using search sites, security annoyances, and of course, shopping and auctions. Got Internet gripes/annoyances/kvetches? Send 'em our way by having your members email me (marsee@oreilly.com) with "Internet Annoyance" in the subject line and we'll put our author on the job. As thanks for sharing, we'll make sure to get copies of "Internet Annoyances" sent to your group shortly after publication. --Marsee *** An example: Pictureless Pages Predicament THE ANNOYANCE: There are some great pictures available on the Web, but certain pictures don't appear on web pages I visit. Instead I see a red X or a funny little icon where the picture is supposed to be. THE FIX: Several circumstances can keep pictures from appearing: * There's a logjam at the web server or somewhere along the miles of wires between the web server and your browser. Try refreshing the page (press F5 or click the Refresh button on the toolbar). But you probably already tried that. * Something's wrong with the web server. The picture might not be on the server, or the programmer who created the web page might have put in the wrong path to the picture. * Internet Explorer may be configured so that it doesn't show pictures, a common setup for those with slow dialup connections who don't want to waste time downloading pictures. (If this option is set, you can selectively display pictures by right-clicking the X or the icon and choosing Show Picture.) To undo this setting in Internet Explorer, choose Tools-->Internet Options. Click the Advanced tab, and in the Multimedia section, check the Show Pictures box to make your pictures appear. * An invalid value in the Windows Registry is preventing pictures from appearing. It's an easy fix, even for those who are squeamish about poking around in the Registry. (Before you mess around with the Registry, back it up as per the instructions in the sidebar on page 47.) Select Start-->Run, type in regedit, and hit Enter. In Registry Editor, navigate to \HKEY_CLASSES_ROOT\.gif. In the right pane, click the Content Type item; its value should be image/gif. Then check \HKEY_CLASSES_ ROOT\.jpg; Content Type should be set to image/jpg or image/jpeg. For more information about this fix, see Microsoft Knowledge Base article 307239. -- *--------------------------------------------------------------------------* | Tim Maher, CEO (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Classes: Perl Prog. plus Perl Modules, 4/5-4/8 ; Template Toolkit: TBA | | Watch for my upcoming book: "Minimal Perl for Shell Users & Programmers" | *--------------------------------------------------------------------------* From vikas_verma at lycos.com Thu Apr 1 13:26:47 2004 From: vikas_verma at lycos.com (vikas verma) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: (No Subject) Message-ID: Hi, can somebody tell me what's the command/pattern to find leading blank space in a file. Thanks ____________________________________________________________ Find what you are looking for with the Lycos Yellow Pages http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10 From tim at consultix-inc.com Thu Apr 1 13:40:34 2004 From: tim at consultix-inc.com (Tim Maher) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: (No Subject) In-Reply-To: References: Message-ID: <20040401194034.GA13164@jumpy.consultix-inc.com> On Thu, Apr 01, 2004 at 11:26:47AM -0800, vikas verma wrote: > Hi, can somebody tell me what's the command/pattern to find leading blank space in a file. > Thanks > If you mean "find and print lines that have leading whitespace characters": perl -wln -e '/^\s/ and print;' filename(s) *--------------------------------------------------------------------------* | Tim Maher, CEO (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Classes: Perl Prog. plus Perl Modules, 4/5-4/8 ; Template Toolkit: TBA | | Watch for my upcoming book: "Minimal Perl for Shell Users & Programmers" | *--------------------------------------------------------------------------* From bri at ifokr.org Mon Apr 5 12:34:42 2004 From: bri at ifokr.org (Brian Hatch) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: Favourite persistant variable module Message-ID: <20040405173442.GU26117@ifokr.org> What do people use for their favourite persisistant variable storage module? I'd like to have multiple independent processes able to access and modify it simultaneously without conflict. Recomendations? -- Brian Hatch "It will be fun. Assuming you are not Systems and vaporised, dissected, or otherwise Security Engineer killed in an assortment of supremely http://www.ifokr.org/bri/ horrible and painful ways. *Exciting*, isn't it?" Every message PGP signed -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://mail.pm.org/pipermail/spug-list/attachments/20040405/8359e113/attachment.bin From cmeyer at helvella.org Mon Apr 5 13:08:34 2004 From: cmeyer at helvella.org (Colin Meyer) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: Favourite persistant variable module In-Reply-To: <20040405173442.GU26117@ifokr.org> References: <20040405173442.GU26117@ifokr.org> Message-ID: <20040405180834.GD25820@funpox.helvella.org> On Mon, Apr 05, 2004 at 10:34:42AM -0700, Brian Hatch wrote: > > > What do people use for their favourite persisistant > variable storage module? I'd like to have multiple > independent processes able to access and modify it > simultaneously without conflict. > > Recomendations? There are many things to consider: - what is the nature of the data being persisted? - how is it accessed: - what is the read/write ratio? - how complex are the queries? But for most things either MLDBM + lockfiles (very simple and thus delightful to use) or DBI (for all the flexibility and complications of relational databases). -Colin. From tim at consultix-inc.com Mon Apr 5 14:04:01 2004 From: tim at consultix-inc.com (Tim Maher) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: Non OO Graphing Modules? Message-ID: <20040405190401.GA28524@jumpy.consultix-inc.com> For the benefit of my beginning Perl students this week, who won't be learning OO perl anytime soon, I've been asked to recommend a simple 2D graphing module. Searching CPAN, I found PGPLOT, which is non-OO (at least on the program-interface side), but it (yuck!) needs a *Fortran compiler* to install. Anybody have other recommendations? I'm willing to write a non-OO wrapper around a module if I have to, but I don't want to reinvent existing wheels. -Tim -- *--------------------------------------------------------------------------* | Tim Maher, CEO (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Classes: Perl Prog. plus Perl Modules, 4/5-4/8 ; Template Toolkit: TBA | | Watch for my upcoming book: "Minimal Perl for Shell Users & Programmers" | *--------------------------------------------------------------------------* From pdarley at kinesis-cem.com Mon Apr 5 14:23:52 2004 From: pdarley at kinesis-cem.com (Peter Darley) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: Non OO Graphing Modules? In-Reply-To: <20040405190401.GA28524@jumpy.consultix-inc.com> Message-ID: Tim, I've had great luck with GD::Graph. It's OO, but is simple enough that a wrapper would be easy to write. Thanks, Peter Darley -----Original Message----- From: spug-list-bounces@mail.pm.org [mailto:spug-list-bounces@mail.pm.org]On Behalf Of Tim Maher Sent: Monday, April 05, 2004 12:04 PM To: spug-list@pm.org Subject: SPUG: Non OO Graphing Modules? For the benefit of my beginning Perl students this week, who won't be learning OO perl anytime soon, I've been asked to recommend a simple 2D graphing module. Searching CPAN, I found PGPLOT, which is non-OO (at least on the program-interface side), but it (yuck!) needs a *Fortran compiler* to install. Anybody have other recommendations? I'm willing to write a non-OO wrapper around a module if I have to, but I don't want to reinvent existing wheels. -Tim -- *--------------------------------------------------------------------------* | Tim Maher, CEO (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Classes: Perl Prog. plus Perl Modules, 4/5-4/8 ; Template Toolkit: TBA | | Watch for my upcoming book: "Minimal Perl for Shell Users & Programmers" | *--------------------------------------------------------------------------* _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: spug-list@mail.pm.org http://spugwiki.perlocity.org ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list MEETINGS: 3rd Tuesdays, Location Unknown WEB PAGE: http://www.seattleperl.org From MichaelRWolf at att.net Mon Apr 5 18:22:31 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: Perl Debugger Pocket Reference Message-ID: The "Featured Book" at perl.oreilly.com is "Perl Debugger Pocket Reference", Richard Foley. $9.95 http://www.oreilly.com/catalog/perldebugpr/ For those on a budget, I can provide copies of the following for $0.08, (on a sliding scale for the under-employed). Enjoy, Michael ================================================================ List/search source lines: Control script execution: l [ln|sub] List source code T Stack trace - or . List previous/current line s [expr] Single step [in expr] v [line] View around line n [expr] Next, steps over subs f filename View source in file Repeat last n or s /pattern/ ?patt? Search forw/backw r Return from subroutine M Show module versions c [ln|sub] Continue until position Debugger controls: L List break/watch/actions o [...] Set debugger options t [expr] Toggle trace [trace expr] <[<]|{[{]|>[>] [cmd] Do pre/post-prompt b [ln|event|sub] [cnd] Set breakpoint ! [N|pat] Redo a previous command B ln|* Delete a/all breakpoints H [-num] Display last num commands a [ln] cmd Do cmd before line = [a val] Define/list an alias A ln|* Delete a/all actions h [db_cmd] Get help on command w expr Add a watch expression h h Complete help page W expr|* Delete a/all watch exprs |[|]db_cmd Send output to pager ![!] syscmd Run cmd in a subprocess q or ^D Quit R Attempt a restart Data Examination: expr Execute perl code, also see: s,n,t expr x|m expr Evals expr in list context, dumps the result or lists methods. p expr Print expression (uses script's current package). S [[!]pat] List subroutine names [not] matching pattern V [Pk [Vars]] List Variables in Package. Vars can be ~pattern or !pattern. X [Vars] Same as "V current_package [Vars]". y [n [Vars]] List lexicals in higher scope . Vars same as V. For more help, type h cmd_letter, or run man perldebug for all docs. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net From brian at coolnamehere.com Mon Apr 5 18:47:25 2004 From: brian at coolnamehere.com (Brian Wisti) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: Perl Debugger Pocket Reference In-Reply-To: References: Message-ID: <1081208845.4071f00d2bf31@coolnamehere.com> Pretty nice. Might even be worth the eight cents. Still, I like the formatting better in the book :-) Kind Regards, Brian Wisti http://coolnamehere.com/ Quoting "Michael R. Wolf" : > > The "Featured Book" at perl.oreilly.com is > > "Perl Debugger Pocket Reference", Richard Foley. $9.95 > > http://www.oreilly.com/catalog/perldebugpr/ > > > For those on a budget, I can provide copies of the following for > $0.08, (on a sliding scale for the under-employed). > > Enjoy, > Michael > > ================================================================ > > > List/search source lines: Control script execution: > l [ln|sub] List source code T Stack trace > - or . List previous/current line s [expr] Single step [in expr] > v [line] View around line n [expr] Next, steps over subs > f filename View source in file Repeat last n or s > /pattern/ ?patt? Search forw/backw r Return from subroutine > M Show module versions c [ln|sub] Continue until > position > Debugger controls: L List > break/watch/actions > o [...] Set debugger options t [expr] Toggle trace [trace > expr] > <[<]|{[{]|>[>] [cmd] Do pre/post-prompt b [ln|event|sub] [cnd] Set > breakpoint > ! [N|pat] Redo a previous command B ln|* Delete a/all > breakpoints > H [-num] Display last num commands a [ln] cmd Do cmd before line > = [a val] Define/list an alias A ln|* Delete a/all actions > h [db_cmd] Get help on command w expr Add a watch expression > h h Complete help page W expr|* Delete a/all watch > exprs > |[|]db_cmd Send output to pager ![!] syscmd Run cmd in a > subprocess > q or ^D Quit R Attempt a restart > Data Examination: expr Execute perl code, also see: s,n,t expr > x|m expr Evals expr in list context, dumps the result or lists > methods. > p expr Print expression (uses script's current package). > S [[!]pat] List subroutine names [not] matching pattern > V [Pk [Vars]] List Variables in Package. Vars can be ~pattern or > !pattern. > X [Vars] Same as "V current_package [Vars]". > y [n [Vars]] List lexicals in higher scope . Vars same as V. > For more help, type h cmd_letter, or run man perldebug for all docs. > > > -- > Michael R. Wolf > All mammals learn by playing! > MichaelRWolf@att.net > > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list@mail.pm.org http://spugwiki.perlocity.org > ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, Location Unknown > WEB PAGE: http://www.seattleperl.org > From MichaelRWolf at att.net Mon Apr 5 18:52:12 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: Non OO Graphing Modules? In-Reply-To: (Peter Darley's message of "Mon, 5 Apr 2004 12:23:52 -0700") References: Message-ID: "Peter Darley" writes: > Tim, > I've had great luck with GD::Graph. It's OO, but is simple enough that a > wrapper would be easy to write. Wouldn't that be an unwrapper? :-) -- Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net From david.dyck at fluke.com Mon Apr 5 18:55:48 2004 From: david.dyck at fluke.com (David Dyck) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: Non OO Graphing Modules? In-Reply-To: <20040405190401.GA28524@jumpy.consultix-inc.com> References: <20040405190401.GA28524@jumpy.consultix-inc.com> Message-ID: On Mon, 5 Apr 2004 at 12:04 -0700, Tim Maher wrote: > I've been asked to recommend a simple 2D graphing module. Did you look at Term::Gnuplot ? From andrew at sweger.net Mon Apr 5 19:10:47 2004 From: andrew at sweger.net (Andrew Sweger) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: Perl Debugger Pocket Reference In-Reply-To: Message-ID: This text is also included as the output for the help (h) command in the debugger in later versions of perl. You can print it out on your home inkjet printer, but that'll probably cost you about $0.20 in ink, eh? On Mon, 5 Apr 2004, Michael R. Wolf wrote: > > List/search source lines: Control script execution: > l [ln|sub] List source code T Stack trace > - or . List previous/current line s [expr] Single step [in expr] > v [line] View around line n [expr] Next, steps over subs > f filename View source in file Repeat last n or s > /pattern/ ?patt? Search forw/backw r Return from subroutine > M Show module versions c [ln|sub] Continue until position > Debugger controls: L List break/watch/actions > o [...] Set debugger options t [expr] Toggle trace [trace expr] > <[<]|{[{]|>[>] [cmd] Do pre/post-prompt b [ln|event|sub] [cnd] Set breakpoint > ! [N|pat] Redo a previous command B ln|* Delete a/all breakpoints > H [-num] Display last num commands a [ln] cmd Do cmd before line > = [a val] Define/list an alias A ln|* Delete a/all actions > h [db_cmd] Get help on command w expr Add a watch expression > h h Complete help page W expr|* Delete a/all watch exprs > |[|]db_cmd Send output to pager ![!] syscmd Run cmd in a subprocess > q or ^D Quit R Attempt a restart > Data Examination: expr Execute perl code, also see: s,n,t expr > x|m expr Evals expr in list context, dumps the result or lists methods. > p expr Print expression (uses script's current package). > S [[!]pat] List subroutine names [not] matching pattern > V [Pk [Vars]] List Variables in Package. Vars can be ~pattern or !pattern. > X [Vars] Same as "V current_package [Vars]". > y [n [Vars]] List lexicals in higher scope . Vars same as V. > For more help, type h cmd_letter, or run man perldebug for all docs. -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. From tim at consultix-inc.com Mon Apr 5 20:01:19 2004 From: tim at consultix-inc.com (Tim Maher) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: Non OO Graphing Modules? In-Reply-To: References: <20040405190401.GA28524@jumpy.consultix-inc.com> Message-ID: <20040406010119.GA30840@jumpy.consultix-inc.com> On Mon, Apr 05, 2004 at 04:55:48PM -0700, David Dyck wrote: > > On Mon, 5 Apr 2004 at 12:04 -0700, Tim Maher wrote: > > > I've been asked to recommend a simple 2D graphing module. > > Did you look at Term::Gnuplot ? Nope; but I'll check it out! Thanks. -- *--------------------------------------------------------------------------* | Tim Maher, CEO (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Classes: Perl Prog. plus Perl Modules, 4/5-4/8 ; Template Toolkit: TBA | | Watch for my upcoming book: "Minimal Perl for Shell Users & Programmers" | *--------------------------------------------------------------------------* From m3047 at inwa.net Tue Apr 6 00:25:00 2004 From: m3047 at inwa.net (Fred Morris) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: Non OO Graphing Modules? Message-ID: use tk; # You get free postscript: what could be better? At 12:04 PM 4/5/04, Tim Maher wrote: >For the benefit of my beginning Perl students this week, who >won't be learning OO perl anytime soon, I've been asked to >recommend a simple 2D graphing module. Searching CPAN, I found >PGPLOT, which is non-OO (at least on the program-interface side), >but it (yuck!) needs a *Fortran compiler* to install. > >Anybody have other recommendations? > >I'm willing to write a non-OO wrapper around a module if I > >have to, but I don't want to reinvent existing wheels. > > >-Tim From m3047 at inwa.net Tue Apr 6 00:30:00 2004 From: m3047 at inwa.net (Fred Morris) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: Non OO Graphing Modules? Message-ID: I wrote: >use tk; use Tk; # d'oh! -- Fred Morris m3047@inwa.net From tim at consultix-inc.com Tue Apr 6 08:57:46 2004 From: tim at consultix-inc.com (Tim Maher) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: Non OO Graphing Modules? In-Reply-To: <20040405190401.GA28524@jumpy.consultix-inc.com> References: <20040405190401.GA28524@jumpy.consultix-inc.com> Message-ID: <20040406135746.GA19721@jumpy.consultix-inc.com> On Mon, Apr 05, 2004 at 12:04:01PM -0700, Tim Maher wrote: > For the benefit of my beginning Perl students this week, who > won't be learning OO perl anytime soon, I've been asked to > recommend a simple 2D graphing module. Searching CPAN, I found > PGPLOT, which is non-OO (at least on the program-interface side), > but it (yuck!) needs a *Fortran compiler* to install. > > Anybody have other recommendations? > > I'm willing to write a non-OO wrapper around a module if I > have to, but I don't want to reinvent existing wheels. > > > -Tim I'm looking seriously at PGPLOT now, which seems the best fit for the students; I'll be trying to install it soon, and get it working. If anybody knows of any "gotchas", or has simple examples of plotting programs to share, I'd appreciate them. I'm using the Graphics Programming with Perl book as a guide, which seems pretty good. *--------------------------------------------------------------------------* | Tim Maher, CEO (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Classes: Perl Prog. plus Perl Modules, 4/5-4/8 ; Template Toolkit: TBA | | Watch for my upcoming book: "Minimal Perl for Shell Users & Programmers" | *--------------------------------------------------------------------------* From MichaelRWolf at att.net Tue Apr 6 10:58:15 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: Non OO Graphing Modules? In-Reply-To: <20040406135746.GA19721@jumpy.consultix-inc.com> (Tim Maher's message of "Tue, 6 Apr 2004 06:57:46 -0700") References: <20040405190401.GA28524@jumpy.consultix-inc.com> <20040406135746.GA19721@jumpy.consultix-inc.com> Message-ID: Tim Maher writes: [...] > or has simple examples of plotting programs to share, I'd appreciate > them. MJD had a quiz of the week that simulated ice formation (Expert Quiz #7, posted 2002-12-03). The solutions got creative by integrating a graphic simulation. Here's his write-up. It points to some interesting solutions. http://perl.plover.com/qotw/misc/e007/postmortem They're some great simulations, worth the time to look at (even if you're not Tim, trying to solve this particular problem), illustrating a point that's been coming up a lot for me -- emergent behavior. There are a few *simple* rules for how vapor, vacuum, and solid interact in a closed system. These simple rules give rise to a seemingly more complex pattern that could not have been predicted from the rules. See my previous posting on "Emergence" by Steven Johnson -- it applies to brains, cities, ants, open source software developers.... It's amazing to me -- think locally + act locally => global implications or simple + simple => complex -- Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net From iee2 at site42.com Tue Apr 6 12:03:13 2004 From: iee2 at site42.com (Ingmar Ellenberger) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: Ordered Hash Tie Class Message-ID: <1081270992.2278.3.camel@localhost.localdomain> Anyone have a suggestion where I can get a good class for an ordered hash tie? I wrote one myself, but I'm looking for something more. (Link to my version: http://cvs.sourceforge.net/viewcvs.py/puma/puma/Puma/Util/OrderedHash.pm - Revision 1.4 will be there as soon as Sourceforge syncs things up) I need it to be able to handle multiple values for a given key and have handlers to deal with them. What I'm REALLY trying to do is create tools to manipulate Java property files while while maintaining comments and whitespace. I have the tools mostly completed, but I'm not completely satisfied with the APIs I've designed (designed on the fly) and I was hoping that there may be something out there I could use as a reference. Any thoughts? Thanks. - Ingmar From tallpeak at hotmail.com Tue Apr 6 12:27:07 2004 From: tallpeak at hotmail.com (Aaron W. West) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: Non OO Graphing Modules? References: <20040405190401.GA28524@jumpy.consultix-inc.com> <20040406135746.GA19721@jumpy.consultix-inc.com> Message-ID: > PGPLOT, which is non-OO (at least on the program-interface side), > but it (yuck!) needs a *Fortran compiler* to install. A full install of Cygwin includes g77. www.cygwin.com Also takes around 350MB to download and uses 1.5GB disk space creating about 95,000 files... Maybe I should have de-selected some packages. When I went to select packages, the cygwin setup kept losing my selections if the mirror I selected was not available or something, so I gave up making my selections and just said All -> Install. Also, when I've done selective installations, I often found I'd forgotten something I might want. Oh well, hard drives are big and cheap these days... I saw benchmarks showing Cygwin Perl to be 20% faster than Activestate... if you build using a lot of GNU tools, the Cygwin environment may be preferable. Mixing cygwin and win32 apps can work, but can sometimes be problematic. Mostly I have problems with paths. Many Ocaml libraries have bad makefiles that don't like my OCaml install path with spaces (c:\program files\objective caml\bin), for example. (Guess it's time I switch back to Perl...) From cwilkes-spug at ladro.com Tue Apr 6 12:34:48 2004 From: cwilkes-spug at ladro.com (Chris Wilkes) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: Ordered Hash Tie Class In-Reply-To: <1081270992.2278.3.camel@localhost.localdomain> References: <1081270992.2278.3.camel@localhost.localdomain> Message-ID: <20040406173448.GE59467@www.ladro.com> On Tue, Apr 06, 2004 at 10:03:13AM -0700, Ingmar Ellenberger wrote: > > I need it to be able to handle multiple values for a given key and have > handlers to deal with them. > > What I'm REALLY trying to do is create tools to manipulate Java property > files while while maintaining comments and whitespace. Can you have multiple values for a single key in java property files? Most of mine look like this: # this is a comment # remote directory remotedir=/home/qubert/files # username for scp username=blah as for whitespace, I haven't seen that in use either, but I would imagine its done like this: message="I'm in the Dilbert Zone" correct? I take it eventually you want to get to something like this: $prop = My::JavaProperty->new("clothingreport.properties"); @keys = $prop->getKeys(); $columns = $prop->get("columns"); $columns++; $prop->set("columns", $columns); $prop->save(); it might be handy to have a method ->getComment() to get the comment lines above a certain key. Course then you would have to stipulate that one seperates keys with whitespaces. What I would do is slurp everything into an array (as property files are never that long) and then when someone requests a key, just go through the array looking for it, keeping track of its position in the array. Then when they change it, just change that position's value. And I could of saved myself a lot of time by looking on CPAN first, as there's a Config::Properties module out there: http://search.cpan.org/~salva/Config-Properties-0.56/Properties.pm so I would see if that suits your needs. You might want to also look into including a way of checking this into CVS so that you can easily (hah!) revert back to an old setting. Chris From iee2 at site42.com Tue Apr 6 13:48:35 2004 From: iee2 at site42.com (Ingmar Ellenberger) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: Ordered Hash Tie Class In-Reply-To: <20040406173448.GE59467@www.ladro.com> References: <1081270992.2278.3.camel@localhost.localdomain> <20040406173448.GE59467@www.ladro.com> Message-ID: <1081277314.2278.30.camel@localhost.localdomain> On Tue, 2004-04-06 at 10:34, Chris Wilkes wrote: > On Tue, Apr 06, 2004 at 10:03:13AM -0700, Ingmar Ellenberger wrote: > > I need it to be able to handle multiple values for a given key and have > > handlers to deal with them. > > > > What I'm REALLY trying to do is create tools to manipulate Java property > > files while while maintaining comments and whitespace. > > Can you have multiple values for a single key in java property files? Sort of, but not really. I'm no Java expert, but I believe it works this way. Java treats these properties as constants, so it takes the first instance of a property and ignores all others. That makes the order you load properties files rather important. I find the whole thing a little backward - must have been designed be committee. I was planning to parse out all comments into a single '_comment' key in the hash 'cause I really don't care about the (contents of the) comments. I just want to make sure that as I add values and merge files, the comments would also go with it so that the Java developers wouldn't get all confused. > Most of mine look like this: > # this is a comment > # remote directory > remotedir=/home/qubert/files > > # username for scp > username=blah > > as for whitespace, I haven't seen that in use either, ... When saying whitespace, I meant blank lines in addition to comments. I would presume that whitespace in properties would be preserved. > I take it eventually you want to get to something like this: > $prop = My::JavaProperty->new("clothingreport.properties"); > @keys = $prop->getKeys(); > $columns = $prop->get("columns"); > $columns++; > $prop->set("columns", $columns); > $prop->save(); That's pretty much it. Also wanted to be able to merge multiple property files as well. > What I would do is slurp everything into an array (as property files are > never that long) and then when someone requests a key, just go through > the array looking for it, keeping track of its position in the array. > Then when they change it, just change that position's value. That was my original thought, but I was aiming to be a little more fancy. > And I could of saved myself a lot of time by looking on CPAN first, as > there's a Config::Properties module out there: > http://search.cpan.org/~salva/Config-Properties-0.56/Properties.pm > so I would see if that suits your needs. Took a quick look at it, and from reading the code, it seems to ignore all comments (i.e. doesn't preserve them). I could be missing something though. The code isn't as clearly written as it could be. From pdarley at kinesis-cem.com Wed Apr 7 13:26:43 2004 From: pdarley at kinesis-cem.com (Peter Darley) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: 0 == undef Message-ID: Folks, I'm wondering if there's any way to get 0 to not equal undef. When I do: my ($Test1, $Test2) = 0, undef; if ($Test1 == $Test2) {print "Crap!\n"} else {print "OK\n"} I find out that 0==undef. I'm also wondering what the thinking here is? Thanks, Peter Darley From AEH at akc.org Wed Apr 7 13:38:58 2004 From: AEH at akc.org (Adrian Hands) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: 0 == undef Message-ID: if ("$Test1" eq "$Test2") {print "Crap!\n"} >>> "Peter Darley" 04/07/04 02:26PM >>> Folks, I'm wondering if there's any way to get 0 to not equal undef. When I do: my ($Test1, $Test2) = 0, undef; if ($Test1 == $Test2) {print "Crap!\n"} else {print "OK\n"} I find out that 0==undef. I'm also wondering what the thinking here is? Thanks, Peter Darley _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: spug-list@mail.pm.org http://spugwiki.perlocity.org ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list MEETINGS: 3rd Tuesdays, Location Unknown WEB PAGE: http://www.seattleperl.org From pdarley at kinesis-cem.com Wed Apr 7 13:43:53 2004 From: pdarley at kinesis-cem.com (Peter Darley) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: 0 == undef In-Reply-To: Message-ID: Adrian, This doesn't pass the following test tho: my $Test1 = 5; my $Test2 = "5.0"; if ("$Test1" eq "$Test2") {print "OK\n"} else {print "Crap!\n"} Thanks, Peter Darley -----Original Message----- From: Adrian Hands [mailto:AEH@akc.org] Sent: Wednesday, April 07, 2004 11:39 AM To: pdarley@kinesis-cem.com; spug-list@mail.pm.org Subject: Re: SPUG: 0 == undef if ("$Test1" eq "$Test2") {print "Crap!\n"} >>> "Peter Darley" 04/07/04 02:26PM >>> Folks, I'm wondering if there's any way to get 0 to not equal undef. When I do: my ($Test1, $Test2) = 0, undef; if ($Test1 == $Test2) {print "Crap!\n"} else {print "OK\n"} I find out that 0==undef. I'm also wondering what the thinking here is? Thanks, Peter Darley _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: spug-list@mail.pm.org http://spugwiki.perlocity.org ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list MEETINGS: 3rd Tuesdays, Location Unknown WEB PAGE: http://www.seattleperl.org From tim at consultix-inc.com Wed Apr 7 13:43:42 2004 From: tim at consultix-inc.com (Tim Maher) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: 0 == undef In-Reply-To: References: Message-ID: <20040407184342.GA5370@jumpy.consultix-inc.com> On Wed, Apr 07, 2004 at 11:26:43AM -0700, Peter Darley wrote: > Folks, > I'm wondering if there's any way to get 0 to not equal undef. When I do: > > my ($Test1, $Test2) = 0, undef; > if ($Test1 == $Test2) {print "Crap!\n"} > else {print "OK\n"} > > I find out that 0==undef. > > I'm also wondering what the thinking here is? > Thanks, > Peter Darley When you use an undefined value in a numeric comparison, Perl fudges in a 0 value for you (and gives you a warning, if -w is enabled). If you want to differentiate between undef values and those with zero values, you should use the "defined" function. my ($Test1, $Test2) = 0, undef; if ( ! defined $Test1 or ! defined $Test2 ) { print "Sorry, can't compare numbers, at least one is undefined\n"; ) } elsif ($Test1 == $Test2) {print "Equal!\n"} ============================================================== | Tim Maher, Ph.D. tim(AT)teachmeperl.com | | SPUG Leader Emeritus spug(AT)teachmeperl.com | | Seattle Perl Users Group http://www.seattleperl.com | | SPUG Wiki Site http://spugwiki.perlocity.org | | Perl Certification Site http://perlcert.perlocity.org | ============================================================== From jack at gehennom.net Wed Apr 7 13:54:29 2004 From: jack at gehennom.net (Jack Foy) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: 0 == undef In-Reply-To: <20040407184342.GA5370@jumpy.consultix-inc.com> References: <20040407184342.GA5370@jumpy.consultix-inc.com> Message-ID: <20040407185428.GA20467@demogorgon> Tim Maher wrote: > When you use an undefined value in a numeric comparison, > Perl fudges in a 0 value for you (and gives you a warning, > if -w is enabled). Didn't Conway give a SPUG talk about a package he wrote to 'fix' this? I seem to remember a Tenacious::Undef package, though Google isn't turning up much detail. -- Jack Foy From pdarley at kinesis-cem.com Wed Apr 7 14:00:51 2004 From: pdarley at kinesis-cem.com (Peter Darley) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: 0 == undef In-Reply-To: <20040407184342.GA5370@jumpy.consultix-inc.com> Message-ID: Tim, Further examination shows that any non-numeric value==0, so I guess I'll cook up an IsNumber() function and do if (IsNumber($Test1) && IsNumber($Test2) && $Test1==$Test2). Or perhaps I'll make a function like Equal($Test1, $Test2). None of this will help with readability tho. :) Any idea why this is set up like this? Thanks, Peter Darley -----Original Message----- From: Tim Maher [mailto:tim@consultix-inc.com] Sent: Wednesday, April 07, 2004 11:44 AM To: Peter Darley Cc: SPUG Subject: Re: SPUG: 0 == undef On Wed, Apr 07, 2004 at 11:26:43AM -0700, Peter Darley wrote: > Folks, > I'm wondering if there's any way to get 0 to not equal undef. When I do: > > my ($Test1, $Test2) = 0, undef; > if ($Test1 == $Test2) {print "Crap!\n"} > else {print "OK\n"} > > I find out that 0==undef. > > I'm also wondering what the thinking here is? > Thanks, > Peter Darley When you use an undefined value in a numeric comparison, Perl fudges in a 0 value for you (and gives you a warning, if -w is enabled). If you want to differentiate between undef values and those with zero values, you should use the "defined" function. my ($Test1, $Test2) = 0, undef; if ( ! defined $Test1 or ! defined $Test2 ) { print "Sorry, can't compare numbers, at least one is undefined\n"; ) } elsif ($Test1 == $Test2) {print "Equal!\n"} ============================================================== | Tim Maher, Ph.D. tim(AT)teachmeperl.com | | SPUG Leader Emeritus spug(AT)teachmeperl.com | | Seattle Perl Users Group http://www.seattleperl.com | | SPUG Wiki Site http://spugwiki.perlocity.org | | Perl Certification Site http://perlcert.perlocity.org | ============================================================== From tim at consultix-inc.com Wed Apr 7 14:27:08 2004 From: tim at consultix-inc.com (Tim Maher) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: 0 == undef In-Reply-To: References: <20040407184342.GA5370@jumpy.consultix-inc.com> Message-ID: <20040407192708.GA5655@jumpy.consultix-inc.com> On Wed, Apr 07, 2004 at 12:00:51PM -0700, Peter Darley wrote: > Tim, > Further examination shows that any non-numeric value==0, That's true, which is another very good reason to have -w enabled, to you'll be notified when 0s are substituted for the non-numeric value. 8-} > I guess I'll cook up an IsNumber() function and do if > (IsNumber($Test1) && IsNumber($Test2) && $Test1==$Test2). Or > perhaps I'll make a function like Equal($Test1, $Test2). None > of this will help with readability tho. :) > Any idea why this is set up like this? Larry has been known to say "AWK has to be better at something!" (Doesn't really apply here, but I love that quote !) Maybe the latest Regexp::Common (which I don't have handy) has a regex to match numbers, otherwise, it's pretty easy to roll your own (but don't forget leading - signs, and embedded decimal places). > Thanks, > Peter Darley From krahnj at acm.org Wed Apr 7 14:42:50 2004 From: krahnj at acm.org (John W. Krahn) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: 0 == undef In-Reply-To: References: Message-ID: <04040712425000.08046@d207-6-243-251> On Wednesday 07 April 2004 11:26, Peter Darley wrote: > > I'm wondering if there's any way to get 0 to not equal undef. When > I do: > > my ($Test1, $Test2) = 0, undef; That statement is the same as: my ($Test1, $Test2) = 0; undef; The comma operator (in list context) discards everything after the first argument. $Test2 is undef because my() sets its arguments to undef. You need parentheses to create a list: my ($Test1, $Test2) = ( 0, undef ); > if ($Test1 == $Test2) {print "Crap!\n"} > else {print "OK\n"} if ( defined $Test1 and defined $Test2 and $Test1 != $Test2 ) { print "OK\n" } else { print "Crap!\n" } John -- use Perl; program fulfillment From david.dyck at fluke.com Wed Apr 7 14:45:42 2004 From: david.dyck at fluke.com (David Dyck) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: 0 == undef In-Reply-To: <20040407192708.GA5655@jumpy.consultix-inc.com> References: <20040407184342.GA5370@jumpy.consultix-inc.com> <20040407192708.GA5655@jumpy.consultix-inc.com> Message-ID: On Wed, 7 Apr 2004 at 12:27 -0700, Tim Maher wrote: > Maybe the latest Regexp::Common (which I don't have handy) > has a regex to match numbers, otherwise, it's pretty easy > to roll your own (but don't forget leading - signs, and > embedded decimal places). The online perl FAQ give advice on testing for numbers, try: perldoc -q determine number which will provide advice for testing for number Yes Regexp::Common has a lot of support for matching numbers see perldoc Regexp::Common::number which provides regexes for numbers (integers and reals). You are warned Do not use this module directly, but load it via Regexp::Common. It even parses Roman numerals! From tallpeak at hotmail.com Wed Apr 7 14:39:07 2004 From: tallpeak at hotmail.com (Aaron W. West) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: Re: 0 == undef References: Message-ID: Good point, I'd think... It's rather the opposite of null propogation in SQL, where a comparison with null always fails. [MSSQL] select case when 0=null then '0=null' else '0<>null' end, case when 1=null then '1=null' else '1<>null' end, case when null=null then 'null=null' else 'null<>null' end ------- ------- ---------- 0<>null 1<>null null<>null (1 row(s) affected) Not that undef and null mean exactly the same thing... So you have to use defined tests if undef's are expected... cygwin bash & windows cmd.exe-compatible command-line... (can't use double-quotes within double quotes in cmd.exe, in my experience) perl -e "print map {qq($_\t=\t[) . (eval $_) . qq(]\n) } qw(0==undef undef==undef undef==qq() undef==1)" 0==undef = [1] undef==undef = [1] undef==qq() = [1] undef==1 = [] ---------- Quoting in CMD.EXE is very very weird. This command runs, but prints only a, nothing else: perl -e "print ""a""";print 1;"" a Note the necessity of a triple-quote to end the string. Without that I get Can't find string terminator... Also, there's no such thing as line-continuation (backslash in bash) Oh well, cmd.exe sucks, we all know it... ----- Original Message ----- From: "Peter Darley" To: "SPUG" Sent: Wednesday, April 07, 2004 11:26 AM Subject: SPUG: 0 == undef Folks, I'm wondering if there's any way to get 0 to not equal undef. When I do: my ($Test1, $Test2) = 0, undef; if ($Test1 == $Test2) {print "Crap!\n"} else {print "OK\n"} I find out that 0==undef. I'm also wondering what the thinking here is? Thanks, Peter Darley _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: spug-list@mail.pm.org http://spugwiki.perlocity.org ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list MEETINGS: 3rd Tuesdays, Location Unknown WEB PAGE: http://www.seattleperl.org From MichaelRWolf at att.net Wed Apr 7 15:29:38 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:37:18 2004 Subject: unbalance (LHS)=RHS [wasRe: SPUG: 0 == undef] In-Reply-To: (Peter Darley's message of "Wed, 7 Apr 2004 11:26:43 -0700") References: Message-ID: "Peter Darley" writes: > Folks, > I'm wondering if there's any way to get 0 to not equal undef. When I do: > > my ($Test1, $Test2) = 0, undef; This is doing what you want, but not for the reasons you expect. You've got array context on the LHS and scalar context on the RHS. You probably wanted my ($Test1, $Test2) = (0, undef); As written, you're not explicitly assigning anything to $Test2. It's easier to see if I write it using numbers instead of 0 and undef; my ($Test1, $Test2) = 17, 99; print "$Test1\n"; # Outputs "17\n" print "$Test2\n"; # Outputs "\n" Using parens, it looks like this (my ($Test1, $Test2) = (17)), 99; What you wrote was like -- it's a list on both sides: ($Test1, $Test2) = (17); Which is like: $Test2 = 17; # the [0]'s go RHS to LHS $Test2 = undef; # there's not a RHS[1] As proven by perl -MO=Deparse - syntax OK my($Test1, $Test2) = 17, '???'; print "$Test1\n"; print "$Test2\n"; The 99 is just the RHS of the (sparsely used) binary comma operator, which evaluates the left side, then evaluates the right side, and yeilds a the RHS. Therefore, the expression evaluates to 99, which isn't used. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net From krahnj at acm.org Wed Apr 7 16:18:21 2004 From: krahnj at acm.org (John W. Krahn) Date: Mon Aug 2 21:37:18 2004 Subject: unbalance (LHS)=RHS [wasRe: SPUG: 0 == undef] In-Reply-To: References: Message-ID: <04040714182101.08046@d207-6-243-251> On Wednesday 07 April 2004 13:29, Michael R. Wolf wrote: > > As proven by perl -MO=Deparse > - syntax OK > my($Test1, $Test2) = 17, '???'; > print "$Test1\n"; > print "$Test2\n"; > > The 99 is just the RHS of the (sparsely used) binary comma operator, > which evaluates the left side, then evaluates the right side, and > yeilds a the RHS. > > Therefore, the expression evaluates to 99, which isn't used. You will notice that in the B::Deparse output that 99 does not appear. In scalar context it would return 99, not in list context. John -- use Perl; program fulfillment From MichaelRWolf at att.net Wed Apr 7 17:44:11 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: 0 == undef In-Reply-To: (Peter Darley's message of "Wed, 7 Apr 2004 12:00:51 -0700") References: Message-ID: "Peter Darley" writes: > Further examination shows that any non-numeric value==0, so I > guess I'll cook up an IsNumber() function See my precious posting. It's not the number-ness that's your issue here, it's the non assignment-ness of your code. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net From MichaelRWolf at att.net Wed Apr 7 17:44:23 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: 0 == undef In-Reply-To: (Peter Darley's message of "Wed, 7 Apr 2004 12:00:51 -0700") References: Message-ID: "Peter Darley" writes: > Further examination shows that any non-numeric value==0, so I > guess I'll cook up an IsNumber() function See my previous posting. It's not the number-ness that's your issue here, it's the non assignment-ness of your code. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net From bri at ifokr.org Wed Apr 7 18:45:43 2004 From: bri at ifokr.org (Brian Hatch) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: ulimit Message-ID: <20040407234543.GZ23165@ifokr.org> How can you set a process limit (unix) inside perl? IE what's the perl analogy to 'ulimit -c 0' in *sh? I could have the perl script have a shell wrapper to set it first, but that's just messy. -- Brian Hatch "Packet-Filtering Barbie." Systems and - Failed attempt by Mattel Security Engineer to get into the computer http://www.ifokr.org/bri/ security world, before buying CyberPatrol. Every message PGP signed -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://mail.pm.org/pipermail/spug-list/attachments/20040407/2945f08c/attachment.bin From andrew at sweger.net Wed Apr 7 19:20:21 2004 From: andrew at sweger.net (Andrew Sweger) Date: Mon Aug 2 21:37:18 2004 Subject: SPUG: ulimit In-Reply-To: <20040407234543.GZ23165@ifokr.org> Message-ID: On Wed, 7 Apr 2004, Brian Hatch wrote: > How can you set a process limit (unix) inside perl? IE what's the perl > analogy to 'ulimit -c 0' in *sh? I could have the perl script have a > shell wrapper to set it first, but that's just messy. Found in /usr/share/perl/5.8/pod/perlfaq8.pod How do I set CPU limits? Use the BSD::Resource module from CPAN. > -- Pedant Service Alert! The double-hyphen typically found in plain text emails immediately preceding the signature block should be followed by a space character so that MUA's that recognize this can chop off the signature block in replies. -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. From bri at ifokr.org Wed Apr 7 23:14:23 2004 From: bri at ifokr.org (Brian Hatch) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: ulimit In-Reply-To: References: <20040407234543.GZ23165@ifokr.org> Message-ID: <20040408041423.GA23165@ifokr.org> > Found in /usr/share/perl/5.8/pod/perlfaq8.pod > How do I set CPU limits? > > Use the BSD::Resource module from CPAN. Excellent. use BSD::Resource; setrlimit(RLIMIT_CORE,0,0); and all's well. -- Brian Hatch Linux. The OS for Systems and those with an IQ Security Engineer greater than 98. http://www.ifokr.org/bri/ Every message PGP signed -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://mail.pm.org/pipermail/spug-list/attachments/20040407/29bced46/attachment.bin From bri at ifokr.org Wed Apr 7 23:28:38 2004 From: bri at ifokr.org (Brian Hatch) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: ulimit In-Reply-To: References: <20040407234543.GZ23165@ifokr.org> Message-ID: <20040408042838.GB23165@ifokr.org> > > -- > > Pedant Service Alert! > > The double-hyphen typically found in plain text emails immediately > preceding the signature block should be followed by a space character so > that MUA's that recognize this can chop off the signature block in > replies. Ahh! Yes, yes, bad macro. I have a habit of using machines/terminals/etc that like to put spaces at the end of lines, which will get converted into =20's when quoted printable, so my mailer vim wrapper automatically strips them. Unfortunately, it strips them from my sig too. Fixed. Most mailers (mutt at least) do recognize ^--$ to be a sig delimiter too - which do you use that don't like it? -- Brian Hatch It's not like esophogal- Systems and retrofluxing, it is? Security Engineer http://www.ifokr.org/bri/ Every message PGP signed -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://mail.pm.org/pipermail/spug-list/attachments/20040407/bdce5024/attachment.bin From andrew at sweger.net Thu Apr 8 00:38:06 2004 From: andrew at sweger.net (Andrew Sweger) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: ulimit In-Reply-To: <20040408042838.GB23165@ifokr.org> Message-ID: On Wed, 7 Apr 2004, Brian Hatch wrote: > Most mailers (mutt at least) do recognize ^--$ to be a sig > delimiter too - which do you use that don't like it? Touche! You know damn well what mailer I'm using (if you peeked at the headers): the same one I've been using for 12 years. :P I am so ashamed of myself. I was well on my way to moving to mutt, but fell back into old habits when I got busy again. I really need to put some more time into it. Then I can abandon those pesky arrow keys for good. -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. From tim at consultix-inc.com Thu Apr 8 14:01:52 2004 From: tim at consultix-inc.com (Tim Maher) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Ftp-free CPAN::shell usage? Message-ID: <20040408190152.GA14809@jumpy.consultix-inc.com> A student in today's class is wondering if it's possible to use CPAN or CPANPLUS from behind firewalls that don't allow FTP traffic. I know that curl and lynx can be used to download the indices, but I don't know if any non-FTP protocols like these are usable for downloading the actual modules. What's the story? TIA, -Tim *--------------------------------------------------------------------------* | Tim Maher, CEO (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Classes: Perl Prog. plus Perl Modules, 4/5-4/8 ; Template Toolkit: TBA | | Watch for my upcoming book: "Minimal Perl for Shell Users & Programmers" | *--------------------------------------------------------------------------* From andrew at sweger.net Thu Apr 8 17:06:46 2004 From: andrew at sweger.net (Andrew Sweger) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Ftp-free CPAN::shell usage? In-Reply-To: <20040408190152.GA14809@jumpy.consultix-inc.com> Message-ID: On Thu, 8 Apr 2004, Tim Maher wrote: > A student in today's class is wondering if it's possible to use CPAN or CPANPLUS > from behind firewalls that don't allow FTP traffic. I know that curl and lynx can > be used to download the indices, but I don't know if any non-FTP protocols like > these are usable for downloading the actual modules. What's the story? Make sure the selected mirrors listed in the CPAN config are http sites. I've noticed that the CPAN shell typically uses LWP (for me anyway) to retrieve files. When I changed the mirror list to inlclude only http listed mirrors instead of ftp ones, that seemed to do the trick. -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. From ced at carios2.ca.boeing.com Thu Apr 8 17:48:51 2004 From: ced at carios2.ca.boeing.com (ced@carios2.ca.boeing.com) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Ftp-free CPAN::shell usage? Message-ID: <200404082248.PAA12391@carios2.ca.boeing.com> >A student in today's class is wondering if it's possible to use > CPAN or CPANPLUS from behind firewalls that don't allow FTP traffic. > I know that curl and lynx can be used to download the indices, but I > don't know if any non-FTP protocols like these are usable for downloading > the actual modules. What's the story? Long ago through sheer trial and pain, I discovered CPAN seems to have an affinity for FTP. So never whisper the "F" word. Somewhere in CPAN's configure dialogue. I accepted defaults until I got to the proxy questions: ftp_proxy? # I input: http://proxy.somewhere.com:xxxxx http_proxy? # same URL: http://proxy.somewhere.com:xxxxx The trick was avoiding FTP url's everywhere to force HTTP. Hope this helps, -- Charles DeRykus From Perl at Doorways.org Thu Apr 8 16:29:49 2004 From: Perl at Doorways.org (Marc M. Adkins) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: HTML Entity UNICODE Blues In-Reply-To: <200404082248.PAA12391@carios2.ca.boeing.com> References: <200404082248.PAA12391@carios2.ca.boeing.com> Message-ID: <200404081729.49407.Perl@Doorways.org> Executing the following on Windows using ActiveState 5.8.3 (build 809): use HTML::Entities; $txt = "—"; print "1) $txt\n"; decode_entities($txt); print "2) $txt\n"; encode_entities($txt); print "3) $txt\n"; The final text isn't equal to the starting text. In fact, it looks something like this: 1) — 2) ? 3) — And whaddyaknow, it looks like that on my Linux box too, running 5.8.0. It appears to be some sort of UNICODE translation issue, and I'm allergic to UNICODE (heh, heh) so I have no clue what to do to fix it. This came up using HTML::TreeBuilder to parse some HTML containing an — sequence. There seems to be no simple way to tell TreeBuilder I don't _want_ it to decode my entities. Which I _don't_ since I'm just moving stuff around structurally. I just want the text to pass through unmunged. So my current solution is: $txt =~ s|&|{[AMP]}|gs; # do the TreeBuilder stuff and store result in $fixed $fixed =~ s|\{\[AMP\]\}|&|gs; Which bypasses the whole de/encoding issue. Ugly. Wouldn't mind wise words suggesting a better solution. During my attempted debugging I noticed that versions of libraries delivered with ActiveState are not the most recent on CPAN. By several versions in some cases. Sigh. mma From thasone at yahoo.com Fri Apr 9 01:49:11 2004 From: thasone at yahoo.com (gest) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: perl cgi applications for science articles Message-ID: <20040409064911.50624.qmail@web21002.mail.yahoo.com> Anybody know of perl cgi applications for managing science articles that are in pdf format? I have several pdf files. Each file is a science article from a journal. Some of the features I'm looking for are: - Users to search articles by keywords, volume, date, author, article title, or journal title. - Abstracts created from each article. - Conversion of pdf to text, html, or other, if possible. Or does anybody have better ideas on how to implement this. Thank you for any help. __________________________________ Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway http://promotions.yahoo.com/design_giveaway/ From ext-spug at jope.net Fri Apr 9 01:50:01 2004 From: ext-spug at jope.net (El JoPe Magnifico) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Re: HTML entity Unicode blues Message-ID: I read the question -- from Mr. Adkins? -- about ten minutes ago and summarily deleted it... only to stumble across the answer moments later while installing HTML::Parser, during which the following was displayed: Perl-5.8 provide core support for Unicode strings. You can compile HTML::Entities so that Unicode entities like € and € are decoded into a string containing "\x{20AC}". If you select no to the question below such entities will be left alone and only entities in the Latin-1 range is decoded. Sounds like you just need to reinstall with different options. -jp From tim at consultix-inc.com Fri Apr 9 11:23:59 2004 From: tim at consultix-inc.com (Tim Maher) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: OSCON discounts; more O'Reilly stuff Message-ID: <20040409162359.GA21907@jumpy.consultix-inc.com> 1. The O'Reilly Open Source Convention (OSCON) is returning to Portland, Oregon. Once again we're offering a special discount to the locals-- User Group members in Oregon and Washington. With this "locals only" discount, your members get 25% off of OSCON registration. Anyone who registers by June 18 gets a double discount--25% off of the Early Bird price. After the Early Bird Date, your members receive 25% off the regular conference pricing. Use code os04pug when you register online: To register, go to: http://conferences.oreillynet.com/cs/os2004/create/ord_os04 O'Reilly Open Source Convention Portland Marriott Downtown 1401 SW Naito Parkway July 26-30, 2004 http://conferences.oreilly.com/oscon/ 2. We're looking for GNOME hacks for our upcoming book, "Linux Desktop Hacks." We already have half of the book filled with KDE hacks, but no GNOME hacks! Do you know of any GNOME Hackers who could help us out? Please forward this email along. If you have a hack to share, please send 'em our way by having your members email me (marsee@oreilly.com) with "GNOME hacks" in the subject line. Don't let KDE hacks take over this book! -- *--------------------------------------------------------------------------* | Tim Maher, CEO (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Classes: Perl Prog. plus Perl Modules, 4/5-4/8 ; Template Toolkit: TBA | | Watch for my upcoming book: "Minimal Perl for Shell Users & Programmers" | *--------------------------------------------------------------------------* From ingy at ttul.org Fri Apr 9 12:00:32 2004 From: ingy at ttul.org (Brian Ingerson) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: The Ingy Returneth Message-ID: <20040409170032.GA11754@ttul.org> Hey Spuggers, Looks like I'm returning to the land of SPUG. I'll be calling Seattle home on April 15th if all goes as planned. So I was thinking that we should all celebrate by, hmmm, how about a SPUG meeting!! You provide the place, Ingy provides the talk. I'd like to talk about a couple new modules of mine: - IO::All - Spork Keep me posted, and I'll see y'all soon! Love, Ingy From MichaelRWolf at att.net Fri Apr 9 15:27:37 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Upcoming SPUG programs Message-ID: SPUGsters, I'm collecting some of my ideas (and notes of others' ideas) to organize upcoming SPUG programs. SPUG could use your creative input and energetic help. If you'd like to influence or direct the future of SPUG, please join me at an Open Sauce Lunch on Monday (http://spugwiki.perlocity.org/index.cgi?MondayApril12Ballard) where we can brainstorm, collect ideas, and distribute some of the fun of creating interesting programs for the future of SPUG -- all while we eat some Indian Food. Thanks, Michael Wolf P.S. I'm primarily focused on the monthly meetings, but am starting to consider other events that would serve the SPUG community (coding sessions, study sessions, testing sessions, design reviews, joint ventures, mini-conferences, virtual companies...). At this point in the brainstorming process, there are no dumb ideas. Let's get 'em out in the open and see how they can grow. P.P.S. If your schedule doesn't allow you to meet on Monday, contact me with your ideas so that you can join in on the bigger planning discussions that will continue beyond Monday's brainstorming kick-off. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net From MichaelRWolf at att.net Mon Apr 12 13:27:08 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Re: Upcoming SPUG programs In-Reply-To: (Michael R. Wolf's message of "Fri, 09 Apr 2004 13:27:37 -0700") References: Message-ID: Michael R. Wolf writes: > SPUGsters, > > I'm collecting some of my ideas (and notes of others' ideas) to > organize upcoming SPUG programs. SPUG could use your creative input > and energetic help. > > If you'd like to influence or direct the future of SPUG, please join > me at an Open Sauce Lunch on Monday > (http://spugwiki.perlocity.org/index.cgi?MondayApril12Ballard) where The lunch is cancelled. The collection of ideas continues. Let me know what you're interested in. I'll be the collector of ideas. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net From wnorth at state.mt.us Tue Apr 13 14:50:26 2004 From: wnorth at state.mt.us (North, Walter) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Getting / Putting data to a MS Excell Spreadsheet Message-ID: Hi all, I know I've seen this somewhere, perhaps some kind soul can point me in the right direction. I would like to create/update and get data from a spreadsheet, in particular MS Excel. The data resides in a mysql database and in particular I would like to create a spreadsheet from it. And allow users, in particular management, to update the database via the spreadsheet as I don't really have time to set up a spreadsheet looking web interface at this time. I really don't want to have to learn VBS or whatever and would prefer to use perl or php. I can do the db stuff but getting the data in and out of the spreadsheet via script has left me scratching my head. thanks much in advance ----------------------------------------------------- Walter North 406-444-2914 Operating Systems Programmer wnorth (at) state (dot) mt (dot) us I haven't been ignoring you; I've been prioritizing you. -- Scott Adams ----------------------------------------------------- From m3047 at inwa.net Tue Apr 13 15:02:30 2004 From: m3047 at inwa.net (Fred Morris) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Getting / Putting data to a MS Excell Spreadsheet Message-ID: At 1:50 PM 4/13/04, North, Walter wrote: >Hi all, > I know I've seen this somewhere, perhaps some kind soul > can point me in the right direction. > >I would like to create/update and get data from a spreadsheet, >in particular MS Excel. The data resides in a mysql database >and in particular I would like to create a spreadsheet from >it. And allow users, in particular management, to update the >database via the spreadsheet [...]. > >I really don't want to have to learn VBS or whatever and would >prefer to use perl or php. Use neither if you can find an ODBC driver which will let you publish your database as a data source. You should be able to read the data, in any case. Updating it is a larger problem which depends on the quality of the ODBC driver and your database skills. -- Fred Morris fredm3047@inwa.net (I-ACK) From mathin at mathin.com Tue Apr 13 15:05:31 2004 From: mathin at mathin.com (Dan Ebert) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Getting / Putting data to a MS Excell Spreadsheet In-Reply-To: References: Message-ID: <1081886729.8985.2.camel@algernon.lan.enic.cc> I use the Spreadsheet::WriteExcel CPAN module to create Excel sheets. Its perldoc recommends Spreadsheet::ParseExcel for reading them, but I haven't used it myself. Dan. On Tue, 2004-04-13 at 12:50, North, Walter wrote: > Hi all, > I know I've seen this somewhere, perhaps some kind soul > can point me in the right direction. > > I would like to create/update and get data from a spreadsheet, > in particular MS Excel. The data resides in a mysql database > and in particular I would like to create a spreadsheet from > it. And allow users, in particular management, to update the > database via the spreadsheet as I don't really have time to > set up a spreadsheet looking web interface at this time. > > I really don't want to have to learn VBS or whatever and would > prefer to use perl or php. I can do the db stuff but getting the > data in and out of the spreadsheet via script has left me scratching > my head. > > thanks much in advance > > ----------------------------------------------------- > Walter North 406-444-2914 > Operating Systems Programmer > wnorth (at) state (dot) mt (dot) us > > I haven't been ignoring you; I've been prioritizing you. > -- Scott Adams > ----------------------------------------------------- > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list@mail.pm.org http://spugwiki.perlocity.org > ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, Location Unknown > WEB PAGE: http://www.seattleperl.org From pdarley at kinesis-cem.com Tue Apr 13 15:24:01 2004 From: pdarley at kinesis-cem.com (Peter Darley) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Getting / Putting data to a MS Excell Spreadsheet In-Reply-To: <1081886729.8985.2.camel@algernon.lan.enic.cc> Message-ID: Folks, I strongly second this. Spreadsheet::WriteExcel is super easy to use, supports a lot of different formatting and is fast. I've attached a sample file created using it. Thanks, Peter Darley -----Original Message----- From: spug-list-bounces@mail.pm.org [mailto:spug-list-bounces@mail.pm.org]On Behalf Of Dan Ebert Sent: Tuesday, April 13, 2004 1:06 PM To: North, Walter Cc: Spug (E-mail) Subject: Re: SPUG: Getting / Putting data to a MS Excell Spreadsheet I use the Spreadsheet::WriteExcel CPAN module to create Excel sheets. Its perldoc recommends Spreadsheet::ParseExcel for reading them, but I haven't used it myself. Dan. On Tue, 2004-04-13 at 12:50, North, Walter wrote: > Hi all, > I know I've seen this somewhere, perhaps some kind soul > can point me in the right direction. > > I would like to create/update and get data from a spreadsheet, > in particular MS Excel. The data resides in a mysql database > and in particular I would like to create a spreadsheet from > it. And allow users, in particular management, to update the > database via the spreadsheet as I don't really have time to > set up a spreadsheet looking web interface at this time. > > I really don't want to have to learn VBS or whatever and would > prefer to use perl or php. I can do the db stuff but getting the > data in and out of the spreadsheet via script has left me scratching > my head. > > thanks much in advance > > ----------------------------------------------------- > Walter North 406-444-2914 > Operating Systems Programmer > wnorth (at) state (dot) mt (dot) us > > I haven't been ignoring you; I've been prioritizing you. > -- Scott Adams > ----------------------------------------------------- > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list@mail.pm.org http://spugwiki.perlocity.org > ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, Location Unknown > WEB PAGE: http://www.seattleperl.org _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: spug-list@mail.pm.org http://spugwiki.perlocity.org ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list MEETINGS: 3rd Tuesdays, Location Unknown WEB PAGE: http://www.seattleperl.org -------------- next part -------------- A non-text attachment was scrubbed... Name: List-M-8022-P-1328.xls Type: application/vnd.ms-excel Size: 56320 bytes Desc: not available Url : http://mail.pm.org/pipermail/spug-list/attachments/20040413/be78cfea/List-M-8022-P-1328.xls From jsl at blarg.net Tue Apr 13 15:29:31 2004 From: jsl at blarg.net (Jim Ludwig) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Getting / Putting data to a MS Excell Spreadsheet In-Reply-To: <1081886729.8985.2.camel@algernon.lan.enic.cc> (message from Dan Ebert on Tue, 13 Apr 2004 13:05:31 -0700) Message-ID: I've used both Spreadsheet::ParseExcel and Spreadsheet::WriteExcel. They both have worked great for my needs. The WriteExcel module is excellent. The parsed spreadsheets were created in a Windows environment and parsed in a Linux environment. The generated spreadsheets were created in a Linux environment and used in a Windows environment. I'd be happy to talk about my experiences with either or both on- or off-list. jim Dan Ebert wrote: >> Subject: Re: SPUG: Getting / Putting data to a MS Excell Spreadsheet >> From: Dan Ebert >> To: "North, Walter" >> Date: Tue, 13 Apr 2004 13:05:31 -0700 >> Cc: "Spug (E-mail)" >> >> I use the Spreadsheet::WriteExcel CPAN module >> to create Excel sheets. Its perldoc recommends >> Spreadsheet::ParseExcel for reading them, but I >> haven't used it myself. >> >> Dan. >> >> On Tue, 2004-04-13 at 12:50, North, Walter wrote: >> > Hi all, >> > I know I've seen this somewhere, perhaps >> > some kind soul can point me in the right >> > direction. >> > >> > I would like to create/update and get data >> > from a spreadsheet, in particular MS Excel. >> > The data resides in a mysql database and in >> > particular I would like to create a >> > spreadsheet from it. And allow users, in >> > particular management, to update the database >> > via the spreadsheet as I don't really have >> > time to set up a spreadsheet looking web >> > interface at this time. >> > >> > I really don't want to have to learn VBS or >> > whatever and would prefer to use perl or php. >> > I can do the db stuff but getting the data in >> > and out of the spreadsheet via script has >> > left me scratching my head. >> > >> > thanks much in advance From aaron at activox.com Tue Apr 13 16:10:18 2004 From: aaron at activox.com (aaron salo) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Getting / Putting data to a MS Excell Spreadsheet In-Reply-To: References: Message-ID: <407C573A.3080609@activox.com> North, Walter wrote: I would like to create/update and get data from a spreadsheet, >in particular MS Excel. The data resides in a mysql database >and in particular I would like to create a spreadsheet from >it. And allow users, in particular management, to update the >database via the spreadsheet as I don't really have time to >set up a spreadsheet looking web interface at this time. > > Hi Walter, Although Spreadsheet::WriteExcel and variants are useful, they are probably overkill for what you want to do here. For giving data to users in a form that opens in MSExcel I usually just throw an application/vnd.ms-excel HTTP header and stream the data to the user as a TSV file, it works great, it opens in Excel natively for your Uncle Bill users. This very quickly and effectively solves your "get a spreadsheet" problem. The rub here is your wish list item about having the users update the data by editing those spreadsheets. Say Janet, Ken, and Robin all download the same version of data at 8am. Each of them makes changes on their local copy. Then you're thinking (you coach them how to) upload the changed "spreadsheets" to the web server using HTTP file upload, and you write a parser to update the mySQL database. Now you have a problem coalescing those changes. Each of those three uploads updates the db, which means that subsequent uploads will overwrite previously committed changes, resulting in data loss. You will have unhappy campers. The phone will ring, your app is broken, I changed New Hampshire Widgets to 234 this morning and it's back to 197 this afternoon. You can count on it. It will happen. If you have multiple users with update privs on the same data set, you really do have to build a web interface to natively update the mySQL database or you're going to wish you had. You can still put a link to easily get a dump of the data in Excel using the previously mentioned technique so your users can get a copy in Excel and pivot table themselves silly (save you a lot of time writing reports), but as far as insert, update, and delete you need to have these people hitting the db in realtime. Just my .02. Best of luck, Aaron From coleman_dave at hotmail.com Tue Apr 13 17:02:14 2004 From: coleman_dave at hotmail.com (Dave Coleman) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Re: Getting / Putting data to a MS Excell Spreadsheet Message-ID: An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20040413/a131a416/attachment.htm From wnorth at state.mt.us Thu Apr 15 10:10:28 2004 From: wnorth at state.mt.us (North, Walter) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: SUMMARY: Getting / Putting Data to a MS Excel Spreadsheet Message-ID: Thanks to all who replied. Fred Morris who suggested using ODBC Dan Ebert who suggests Spreadsheet::WriteExcel and Spreadsheet::ParseExcel from CPAN Peter Darley who suggests the same Jim Ludwig ditto, and who generously offered to talk to me if I needed help Bradley Young, ODBC, and I'm not knocking VBS, I just don't want to have to learn another scripting language if I don't have to. Aaron Salo who suggests using a application/vnd.ms-excel HTTP header to publish the spreadsheet via the web. Aaron also brings up a point that had been lurking in the back of my brain, the chance of users clobbering each other if they can update the DB via spreadsheet. All in all I think I will scrap the idea of users updating via spreadsheet and write a update interface after all. I will still need to publish the DB in a spreadsheet, at least some of the data anyway. So, I will look into ODBC and Spreadsheet::WriteExcel and the http header looks like something that would be useful as well. If I missed anybody, I appologize, sometimes my delete finger works all by itself while the brain is not paying attention. Thanks again for the assistance! ----------------------------------------------------- Walter North 406-444-2914 Operating Systems Programmer wnorth (at) state (dot) mt (dot) us I haven't been ignoring you; I've been prioritizing you. -- Scott Adams ----------------------------------------------------- From kmeyer at blarg.net Fri Apr 16 16:55:44 2004 From: kmeyer at blarg.net (Ken Meyer) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: LAST CALL for Linuxfest NW 2004! INDIVIDUAL LIST DISTRIBUTION Message-ID: I see that just about every mail list intercepts messages sent to some nominal number of addresses. Since I am not sure how attentive all list moderators are, and time is short, and I am on my way north, I am resending this to individual lists. Sorry for the replication. It includes the separate addendum. -------------------------- For those who may have just ended a Rip Van Winkle gig, the FABULOUS, if not absolutely MAHVELUS, Linuxfest 2004 will be going on from 9:30 AM to 5:00 PM tomorrow, Saturday, April 17th, 2004, at Bellingham Technical College in -- surprise -- beautiful Bellingham, with a potential post-event party sponsored by the industrial-strength hosting operation Fibercloud. See: http://www.linuxnorthwest.org Check out the post-event party sign-up on the site (scroll down the home page for the link). Note that there may be a head-count limit in effect. I should mention the potential loot: Fibercloud is giving away some super (and expensive) co-lo service; see the after-event sign-up site for info. The Pogo People will be giving away an Athlon-64 computer! I understand it will be via their own "fish-bowl" at their exhibitor's table. The fest typically has a great raffle of their own, with many really drooly items contributed. This is the main source of Fest income to cover their expenses, such as the very professional posters, security services, etc. Contribute and ye shall be rewarded. Check it out. -------------------------- If you want to print yourself a schedule to handicap, be sure to set your printer driver to LANDSCAPE: http://lfnw.blug.org/fest2004/schedule.dxp The most frustrating thing about the Fest is that you need 3 clones to attend all of the simultaneous sessions that interest you in that six-ring circus; and it may be worse this year, since the specter of Fire Marshall displeasure is causing room capacity to be limited and enforced by volunteer nose-counters (leaving yours at home is unlikely to get you a free pass). Note that the TOTAL capacity of all 6 presentation rooms on the schedule is 326, whereas last year, the estimates of attendance ranged from 700 to over 1000. Hmmm! While you are at the site, join the mail list for post-mortem and early 2005 planning action: http://www.linuxnorthwest.org/general-info.php?id=mailinglist Be a part of the community. I've met a great group of new folks face-to-face just distributing posters, and all of this is not accomplished by magic! As for getting there, the sign-up for the Pogo Linux bus is still at: http://www.pogolinux.com/info/lfnw2004_signup.html Official cut-off for sign-up was on Tuesday, but I have been assured that they will welcome walk-ons up to the capacity of the two busses they have chartered (~94 seats). The Pogo People seemed to think that room would be available, particularly considering the substantial number of "no-shows" at last year's event -- but caveat emptor, this is not guaranteed at this late date. Get there early to fill you face with donuts; ain't Pogo nice to us? The busses should be parked in the southeast parking lot at North Seattle Community College (if not, cruise around the periphery of the campus). Because our GSLUG meetings are held on the campus and we pay for the room, we have been granted the privilege of parking there without charge. For a map and directions to North, see: http://www.northseattle.edu/maps/?tab=home The nearest entrance to the busses should be at the South end of the campus, on N. 92nd Street, at the intersection with Corliss Ave (N-S street), just west of the overpass over I-5. http://www.northseattle.edu/maps/directions.htm Now, if you are planning (or forced) to drive to the North, the drive can be done in 1:20, if you hustle, and if there is no Tulip Festival log-jam. 1:40 will create less stomach acid and rear-view mirror-checking neck strain. I strongly urge you to copy the map to the Fest site from the web: http://www.linuxnorthwest.com/map.php as BTC, at 3028 Lindbergh Ave., is buried in a residential area that consists of a number of un-grid-like streets. You will avoid a lot of grief by having paper in hand. Finally, a contributor to the Seattle Java Users' Group has given directions to circumvent Tulip fever potentially clogging I-5 (pray for rain?). Use at your own risk: ---------------- I won't be at the event tomorrow, but I do live in Mount Vernon and thought I'd suggest a route around the tulip traffic for those of you heading to Bellingham from Seattle. >From I-5 North take the Anderson Rd. exit #225. Turn Right at the end of the off-ramp. Turn Left on the next road. You'll now be traveling north parallel to I-5. Right on Blackburn Rd. You'll be going up a steep hill. Follow Blackburn Rd. out of town. You'll come to a corner where your choices are to go straight or to the right. Go to the right, uphill around the curve. This is now Little Mountain Road. Stay on this road for about 5 miles as it winds out through the hills. Left at the first stop sign you come to. You'll be going down a steep hill and this is still Little Mountain Road. At the bottom of the hill you'll take a left at the stop sign. The next road you come to is Highway 9. Take a left (north) on Highway 9. A couple miles up the road you'll come to an intersection with Big Rock Grocery on your right. You'll want to take a left here (turning off Highway 9 since it goes to the right). This will take you back into Mount Vernon, headed west, on College Way. When you get to Riverside Dr. you'll want turn right and go north across the Skagit River into Burlington. Continue all the way through Burlington, going past the signs for I-5 and HWY 20. You'll see another onramp for I-5 and this should put you north of the tulip traffic. Alternately, if you know the area, you could take a right at Big Rock Grocery and follow HWY 9 all the way up to Sedro-Woolley and then take Cook Rd to the west to I-5. Sounds more complicated than it is, but this should save you some time. --------------------- Hope to see and meet many of you there. I'll have a video camera on my shoulder at least part of the time. To those of you unable to make it to this fine event, apologies for the long mail message. Also, to those of you enthusiasts who got 4 or more copies of this message, sorry again. Ken Meyer KD7ZME kmeyer@blarg.net From kmeyer at blarg.net Fri Apr 16 16:21:56 2004 From: kmeyer at blarg.net (Ken Meyer) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: LAST CALL for Linuxfest NW 2004! Message-ID: For those who may have just ended a Rip Van Winkle gig, the FABULOUS, if not absolutely MAHVELUS, Linuxfest 2004 will be going on from 9:30 AM to 5:00 PM tomorrow, Saturday, April 17th, 2004, at Bellingham Technical College in -- surprise -- beautiful Bellingham, with a potential post-event party sponsored by the industrial-strength hosting operation Fibercloud. See: http://www.linuxnorthwest.org Check out the post-event party sign-up on the site (scroll down the home page for the link). Note that there may be a head-count limit in effect. If you want to print yourself a schedule to handicap, be sure to set your printer driver to LANDSCAPE: http://lfnw.blug.org/fest2004/schedule.dxp The most frustrating thing about the Fest is that you need 3 clones to attend all of the simultaneous sessions that interest you in that six-ring circus; and it may be worse this year, since the specter of Fire Marshall displeasure is causing room capacity to be limited and enforced by volunteer nose-counters (leaving yours at home is unlikely to get you a free pass). Note that the TOTAL capacity of all 6 presentation rooms on the schedule is 326, whereas last year, the estimates of attendance ranged from 700 to over 1000. Hmmm! While you are at the site, join the mail list for post-mortem and early 2005 planning action: http://www.linuxnorthwest.org/general-info.php?id=mailinglist Be a part of the community. I've met a great group of new folks face-to-face just distributing posters, and all of this is not accomplished by magic! As for getting there, the sign-up for the Pogo Linux bus is still at: http://www.pogolinux.com/info/lfnw2004_signup.html Official cut-off for sign-up was on Tuesday, but I have been assured that they will welcome walk-ons up to the capacity of the two busses they have chartered (~94 seats). The Pogo People seemed to think that room would be available, particularly considering the substantial number of "no-shows" at last year's event -- but caveat emptor, this is not guaranteed at this late date. Get there early to fill you face with donuts; ain't Pogo nice to us? The busses should be parked in the southeast parking lot at North Seattle Community College (if not, cruise around the periphery of the campus). Because our GSLUG meetings are held on the campus and we pay for the room, we have been granted the privilege of parking there without charge. For a map and directions to North, see: http://www.northseattle.edu/maps/?tab=home The nearest entrance to the busses should be at the South end of the campus, on N. 92nd Street, at the intersection with Corliss Ave (N-S street), just west of the overpass over I-5. http://www.northseattle.edu/maps/directions.htm Now, if you are planning (or forced) to drive to the North, the drive can be done in 1:20, if you hustle, and if there is no Tulip Festival log-jam. 1:40 will create less stomach acid and rear-view mirror-checking neck strain. I strongly urge you to copy the map to the Fest site from the web: http://www.linuxnorthwest.com/map.php as BTC, at 3028 Lindbergh Ave., is buried in a residential area that consists of a number of un-grid-like streets. You will avoid a lot of grief by having paper in hand. Finally, a contributor to the Seattle Java Users' Group has given directions to circumvent Tulip fever potentially clogging I-5 (pray for rain?). Use at your own risk: ---------------- I won't be at the event tomorrow, but I do live in Mount Vernon and thought I'd suggest a route around the tulip traffic for those of you heading to Bellingham from Seattle. >From I-5 North take the Anderson Rd. exit #225. Turn Right at the end of the off-ramp. Turn Left on the next road. You'll now be traveling north parallel to I-5. Right on Blackburn Rd. You'll be going up a steep hill. Follow Blackburn Rd. out of town. You'll come to a corner where your choices are to go straight or to the right. Go to the right, uphill around the curve. This is now Little Mountain Road. Stay on this road for about 5 miles as it winds out through the hills. Left at the first stop sign you come to. You'll be going down a steep hill and this is still Little Mountain Road. At the bottom of the hill you'll take a left at the stop sign. The next road you come to is Highway 9. Take a left (north) on Highway 9. A couple miles up the road you'll come to an intersection with Big Rock Grocery on your right. You'll want to take a left here (turning off Highway 9 since it goes to the right). This will take you back into Mount Vernon, headed west, on College Way. When you get to Riverside Dr. you'll want turn right and go north across the Skagit River into Burlington. Continue all the way through Burlington, going past the signs for I-5 and HWY 20. You'll see another onramp for I-5 and this should put you north of the tulip traffic. Alternately, if you know the area, you could take a right at Big Rock Grocery and follow HWY 9 all the way up to Sedro-Woolley and then take Cook Rd to the west to I-5. Sounds more complicated than it is, but this should save you some time. --------------------- Hope to see and meet many of you there. I'll have a video camera on my shoulder at least part of the time. To those of you unable to make it to this fine event, apologies for the long mail message. Also, to those of you enthusiasts who got 4 or more copies of this message, sorry again. Ken Meyer KD7ZME kmeyer@blarg.net From kmeyer at blarg.net Fri Apr 16 16:33:04 2004 From: kmeyer at blarg.net (Ken Meyer) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: ADDENDUM: LAST CALL for Linuxfest NW 2004! Message-ID: Sorry, should have mentioned the potential loot: The fest typically has a great raffle, with many really drooly items contributed. This is the main source of Fest income to cover their expenses, such as the very professional posters, security services, etc. Contribute and ye shall be rewarded. Fibercloud is giving away some super (and expensive) co-lo service; see the after-event sign-up site for info. The Pogo People will be giving away an Athlon-64 computer! I understand it will be via their own "fish-bowl" at their exhibitor's table. Check it out. Ken Meyer From jack at gehennom.net Mon Apr 19 23:04:57 2004 From: jack at gehennom.net (Jack Foy) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Attaching a string to STDOUT Message-ID: <20040420040457.GA17364@demogorgon> I'd like to override STDOUT so that 'print' and friends append to a string, rather than writing to a physical file. How may I do this? Any help is appreciated. (Background: I have a large and complex gawk script (a Cobol data type translator -- not my code, thank goodness). I need to integrate its functionality into my Perl environment, preferably without having to understand the gawk code in depth. I've run it through a2p, and now I'm trying to encapsulate the resulting Perl into a module. Simpler solutions are rendered impractical by our weird platform.) -- Jack Foy From bri at ifokr.org Mon Apr 19 23:13:11 2004 From: bri at ifokr.org (Brian Hatch) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Attaching a string to STDOUT In-Reply-To: <20040420040457.GA17364@demogorgon> References: <20040420040457.GA17364@demogorgon> Message-ID: <20040420041311.GC23165@ifokr.org> > I'd like to override STDOUT so that 'print' and friends append to a > string, rather than writing to a physical file. How may I do this? Any > help is appreciated. > > (Background: I have a large and complex gawk script (a Cobol data type > translator -- not my code, thank goodness). I need to integrate its > functionality into my Perl environment, preferably without having to > understand the gawk code in depth. I've run it through a2p, and now I'm > trying to encapsulate the resulting Perl into a module. Simpler > solutions are rendered impractical by our weird platform.) Hmmn - wonder if you can override the print function. Or perhaps fork with something similar to if ( open STDOUT, "-|" ) { do lots of printing } else { while ( ) { $a .= $_ } do something with $a } Or perhaps a pipe inside the program itself (though you'll need to clean out print periodically, lest it fill up and you block indefinitely.) -- Brian Hatch Scientists have finally Systems and isolated the gene that Security Engineer makes scientists want http://www.ifokr.org/bri/ to isolate genes. Every message PGP signed -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://mail.pm.org/pipermail/spug-list/attachments/20040419/9d0e15c4/attachment.bin From david.dyck at fluke.com Mon Apr 19 23:36:10 2004 From: david.dyck at fluke.com (David Dyck) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Attaching a string to STDOUT In-Reply-To: <20040420040457.GA17364@demogorgon> References: <20040420040457.GA17364@demogorgon> Message-ID: On Tue, 20 Apr 2004 at 00:04 -0400, Jack Foy wrote: > I'd like to override STDOUT so that 'print' and friends append to a > string, rather than writing to a physical file. How may I do this? Any > help is appreciated. IO::String is a module that will most likely do what you want, but it includes a note Note that perl-5.8 and better has built-in support for "in memory" files, which are set up by passing a reference instead of a filename to the open() call. The reason for using this module is that it makes the code backwards compatible with older versions of Perl. I tried it in perl 5.9.2 and get: $ perl -we 'open F,">",\$f; select F; print "hello"; print ", world"; print STDOUT "<$f>\n"' for more info perldoc -f IO::String; From MichaelRWolf at att.net Tue Apr 20 00:25:08 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: April SPUG meeting Message-ID: SPUG is alive. Long live SPUG. SPUG is reborn!!! -- There is a promised venue starting next month. (Details later) -- There are beginnings of a program schedule. (Details later) All that's in the future. As for the present, let's have an April meeting. Here's my suggestion for this month's meeting -- a chance to get acquainted, talk shop, talk business, shoot the breeze, find out where we are as a community, what we're up to, where we want to go, and who wants to pitch in. (Pheeww, that's a lot. Dig in where you're comfortable.) When: April 20 (the third Tuesday) Where: Blue Star Cafe & Pub (Wallingford/Green Lake) 4512 Stone Way (NE corner of Stone Way and 45th St) http://www.3dhospitality.com/bluestar/ When: 6:30 - 8:30 (or beyond) Agenda: - come when you can, leave when you have to - meet/greet - talk tech - food, beer on your own $$ - tip well As a lurker on other Perl Monger groups, I notice that many use this kind of format as their sole monthly formal meeting. It has many advantages: - less pressure on *one* speaker - don't have to listen to just one speaker - peer-to-peer networking (the old fashioned people-oriented kind) - full-duplex (geek-speak for a two-way conversation) - interactive (everyone participates) Much of our time together as the SPUG community has been spent like strangers at in a movie theater, due in large part to the layout of our previous venue*. As a way to shake it up a bit, let's sit across a table from each another, within ear shot, over a dinner, a beer, or a coffee and take stock of where we are individually and as a community. I think it would be great if the following kinds of info just naturally fell out of the conversations: - topics for future meetings - adjunct activities beyond monthly meetings - leads for future speakers - leads to undiscovered pockets of future SPUGsters If they do, please take notes for future reference, but I'm not really attached to it. The meeting is really about an informal get-together to talk shop (for some definitions of "shop", especially if they relate to Perl and Open Source). We'll see what pops up, then take that step. Please RSVP (http://spugwiki.perlocity.org/index.cgi?April2004Meeting) so that we can get the right size table. Looking forward to seeing you at the meeting, Michael Wolf * Observation only, not a dig -- It was a great venue while it lasted. Thanks, Dora. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net From ingy at ttul.org Tue Apr 20 11:05:24 2004 From: ingy at ttul.org (Brian Ingerson) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: April SPUG meeting In-Reply-To: References: Message-ID: <20040420160524.GA12219@ttul.org> I guess this means I *won't* be presenting tonight?!? On 19/04/04 22:25 -0700, Michael R. Wolf wrote: > > SPUG is alive. Long live SPUG. > > SPUG is reborn!!! > > -- There is a promised venue starting next month. (Details later) > > -- There are beginnings of a program schedule. (Details later) > > All that's in the future. > > As for the present, let's have an April meeting. > > Here's my suggestion for this month's meeting -- a chance to get > acquainted, talk shop, talk business, shoot the breeze, find out where > we are as a community, what we're up to, where we want to go, and who > wants to pitch in. (Pheeww, that's a lot. Dig in where you're > comfortable.) > > When: April 20 (the third Tuesday) > Where: Blue Star Cafe & Pub (Wallingford/Green Lake) > 4512 Stone Way (NE corner of Stone Way and 45th St) > http://www.3dhospitality.com/bluestar/ > When: 6:30 - 8:30 (or beyond) > Agenda: > - come when you can, leave when you have to > - meet/greet > - talk tech > - food, beer on your own $$ > - tip well > > As a lurker on other Perl Monger groups, I notice that many use this > kind of format as their sole monthly formal meeting. It has many > advantages: > - less pressure on *one* speaker > - don't have to listen to just one speaker > - peer-to-peer networking (the old fashioned people-oriented kind) > - full-duplex (geek-speak for a two-way conversation) > - interactive (everyone participates) > > Much of our time together as the SPUG community has been spent like > strangers at in a movie theater, due in large part to the layout of > our previous venue*. As a way to shake it up a bit, let's sit across a > table from each another, within ear shot, over a dinner, a beer, or a > coffee and take stock of where we are individually and as a community. > > I think it would be great if the following kinds of info just > naturally fell out of the conversations: > > - topics for future meetings > - adjunct activities beyond monthly meetings > - leads for future speakers > - leads to undiscovered pockets of future SPUGsters > > If they do, please take notes for future reference, but I'm not really > attached to it. The meeting is really about an informal get-together > to talk shop (for some definitions of "shop", especially if they > relate to Perl and Open Source). We'll see what pops up, then take > that step. > > Please RSVP (http://spugwiki.perlocity.org/index.cgi?April2004Meeting) > so that we can get the right size table. > > Looking forward to seeing you at the meeting, > Michael Wolf > > > * Observation only, not a dig -- It was a great venue while it lasted. > Thanks, Dora. > > -- > Michael R. Wolf > All mammals learn by playing! > MichaelRWolf@att.net > > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list@mail.pm.org http://spugwiki.perlocity.org > ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, Location Unknown > WEB PAGE: http://www.seattleperl.org From brian at coolnamehere.com Tue Apr 20 11:45:16 2004 From: brian at coolnamehere.com (Brian Wisti) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: April SPUG meeting In-Reply-To: <20040420160524.GA12219@ttul.org> References: <20040420160524.GA12219@ttul.org> Message-ID: <20040420164516.GA6304@www.coolnamehere.com> That's okay, pay the mean old SPUG people no mind. Seattle.rb loves you, and you can present any time ;-) 'twas merely a fanciful jest. I think that the people of SPUG are lovely folk, and neither mean nor old. Kind Regards, Brian Wisti http://coolnamehere.com On Tue, Apr 20, 2004 at 09:05:24AM -0700, Brian Ingerson wrote: > I guess this means I *won't* be presenting tonight?!? > > > On 19/04/04 22:25 -0700, Michael R. Wolf wrote: > > > > SPUG is alive. Long live SPUG. > > > > SPUG is reborn!!! > > From MichaelRWolf at att.net Tue Apr 20 15:04:24 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: April SPUG meeting In-Reply-To: <20040420164516.GA6304@www.coolnamehere.com> (Brian Wisti's message of "Tue, 20 Apr 2004 09:45:16 -0700") References: <20040420160524.GA12219@ttul.org> <20040420164516.GA6304@www.coolnamehere.com> Message-ID: Brian Wisti writes: > That's okay, pay the mean old SPUG people no mind. Seattle.rb loves you, and > you can present any time ;-) Seattle.rb? A Ruby group? I think I've heard Ingy, the language agnostic, mention it. As a language agnostic (*and* Perl Evangelist) myself I'd be interested in some more information. I think it would be a benefit to both groups to have more cross-pollenization, or at least some cross-promotion (but not by cross, mean people). :-) Would this be a good thing to add to the SPUG Wiki (http://spugwiki.perlocity.org/), under "Other Geekly Stuff"? Thanks, Michael "!~/mean|old/ (for some definitions of 'mean' and 'old'" Wolf -- Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net From MichaelRWolf at att.net Tue Apr 20 15:06:53 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: April SPUG meeting In-Reply-To: (Michael R. Wolf's message of "Tue, 20 Apr 2004 09:53:43 -0700") References: <20040420160524.GA12219@ttul.org> Message-ID: Oops. Forgot to CC to the list. Michael R. Wolf writes: > Brian Ingerson writes: > >> I guess this means I *won't* be presenting tonight?!? > > Sorry, we didn't get a good venue for a computer-projected > presentation. Obviously, Spork would be better with a computer > projector. > > Could I put you down for May 18 for IO::All with a Spork attachment? > > Thanks and welcome to Seattle, > Michael > > -- > Michael R. Wolf > All mammals learn by playing! > MichaelRWolf@att.net -- Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net From tallpeak at hotmail.com Tue Apr 20 19:29:44 2004 From: tallpeak at hotmail.com (Aaron W. West) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: ADATE Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 5493 bytes Desc: not available Url : http://mail.pm.org/pipermail/spug-list/attachments/20040420/e559775c/attachment.gif From MichaelRWolf at att.net Wed Apr 21 17:08:55 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Apocalypse 12 released Message-ID: It addresses OO in Perl6. 20 pages Enjoy. http://www.perl.com/pub/a/2004/04/16/a12.html -- Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net From MichaelRWolf at att.net Wed Apr 21 17:12:50 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Attaching a string to STDOUT In-Reply-To: <20040420040457.GA17364@demogorgon> (Jack Foy's message of "Tue, 20 Apr 2004 00:04:57 -0400") References: <20040420040457.GA17364@demogorgon> Message-ID: Jack Foy writes: > I'd like to override STDOUT so that 'print' and friends append to a > string, rather than writing to a physical file. How may I do this? Any > help is appreciated. Does IO::All do this? -- Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net From kellan at protest.net Wed Apr 21 17:26:55 2004 From: kellan at protest.net (kellan@protest.net) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Apocalypse 12 released In-Reply-To: References: Message-ID: Anyone made it through and want to summarize? Its been a busy week, and I've been daunted by the length. -k On Wed, 21 Apr 2004, Michael R. Wolf wrote: > > It addresses OO in Perl6. > 20 pages > Enjoy. > > http://www.perl.com/pub/a/2004/04/16/a12.html > > -- > Michael R. Wolf > All mammals learn by playing! > MichaelRWolf@att.net > > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list@mail.pm.org http://spugwiki.perlocity.org > ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, Location Unknown > WEB PAGE: http://www.seattleperl.org > From MichaelRWolf at att.net Wed Apr 21 17:34:25 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Re: April SPUG meeting In-Reply-To: (Michael R. Wolf's message of "Mon, 19 Apr 2004 22:25:08 -0700") References: Message-ID: Michael R. Wolf writes: > SPUG is alive. Long live SPUG. Thanks to the folks who showed up last night on short notice. (Next month's meeting will be announced much earlier.) It was a good mix of business, programming, beer, fish/chips, politics, computer languages, current projects, and Perl. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net From jack at gehennom.net Wed Apr 21 17:38:01 2004 From: jack at gehennom.net (Jack Foy) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Attaching a string to STDOUT In-Reply-To: References: <20040420040457.GA17364@demogorgon> Message-ID: <20040421223801.GA26587@demogorgon> Michael R. Wolf wrote: > Does IO::All do this? Thanks to all who replied. The technique I actually needed is described on page 384 of Programming Perl, 3rd Ed.: 'tie' a collector class to STDOUT do the black-box operation read the result from the collector un-'tie' STDOUT The collector only needs to re-define a handful of the filehandle operations; we only used PRINT and READLINE. Note that doing things this way breaks use of the Perl debugger for your black-box operation. -- Jack Foy From david.dyck at fluke.com Wed Apr 21 18:13:33 2004 From: david.dyck at fluke.com (David Dyck) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Attaching a string to STDOUT In-Reply-To: References: <20040420040457.GA17364@demogorgon> Message-ID: On Wed, 21 Apr 2004 at 15:12 -0700, Michael R. Wolf ...: > Jack Foy writes: > > > I'd like to override STDOUT so that 'print' and friends append to a > > string, rather than writing to a physical file. How may I do this? Any > > help is appreciated. > > Does IO::All do this? Looks like it uses IO::String that we mentioned earlier, as The IO::All object is a proxy for IO::File, IO::Dir, IO::Socket, IO::String, Tie::File and File::ReadBackwards. You can use most of the methods found in these classes and in IO::Handle (which they all inherit from). IO::All is easily subclassable. You can override any methods and also add new methods of your own. I didn't have the Spiffy module installed, so I had to learn about that also. I think the IO::All example that does the same thing as the earlier perl-5.8 builtin string example is a bit longer, e.g: perl -we 'use IO::All qw(-tie); my $s=io(q($)); select $s; print "hello"; print ", world"; print STDOUT "<",${$s->string_ref},">\n";' but at least the prints to the strings are about the same. # perl5.8 builtin string files perl -we 'open F,">",\$f; select F; print "hello"; print ", world"; print STDOUT "<$f>\n"' David From MichaelRWolf at att.net Wed Apr 21 19:48:16 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Apocalypse 12 released In-Reply-To: (kellan@protest.net's message of "Wed, 21 Apr 2004 18:26:55 -0400 (EDT)") References: Message-ID: kellan@protest.net writes: > Anyone made it through and want to summarize? Its been a busy week, and > I've been daunted by the length. Summary -- that sounds like an Exegesis, not a posting. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net From MichaelRWolf at att.net Wed Apr 21 20:13:30 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Apocalypse 12 released In-Reply-To: (Michael R. Wolf's message of "Wed, 21 Apr 2004 17:48:16 -0700") References: Message-ID: "Michael R. Wolf" writes: > kellan@protest.net writes: > >> Anyone made it through and want to summarize? Its been a busy week, and >> I've been daunted by the length. > > Summary -- that sounds like an Exegesis, not a posting. I take that back.... It's a book, and Damian's already written it. But that was Perl5 ... it'll obviously take another book for Perl6. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net From Perl at Doorways.org Wed Apr 21 13:16:08 2004 From: Perl at Doorways.org (Marc M. Adkins) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Regex question In-Reply-To: <20040420040457.GA17364@demogorgon> References: <20040420040457.GA17364@demogorgon> Message-ID: <200404211416.08875.Perl@Doorways.org> Let's say I'm parsing HTML using regular expressions and I want to find: ... where the text within the tag body does _not_ contain the word 'Alpo'. I've seen the following as a solution: $text =~ m|(?:(?!Alpo).)*|; This seems really compute-intensive. Is there a better way? mma (test program attached) -------------- next part -------------- A non-text attachment was scrubbed... Name: dogfood.pl Type: text/x-perl Size: 882 bytes Desc: not available Url : http://mail.pm.org/pipermail/spug-list/attachments/20040421/5d0810ba/dogfood.bin From cwilkes-spug at ladro.com Wed Apr 21 20:31:44 2004 From: cwilkes-spug at ladro.com (Chris Wilkes) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Regex question In-Reply-To: <200404211416.08875.Perl@Doorways.org> References: <20040420040457.GA17364@demogorgon> <200404211416.08875.Perl@Doorways.org> Message-ID: <20040422013144.GA13987@www.ladro.com> On Wed, Apr 21, 2004 at 02:16:08PM -0400, Marc M. Adkins wrote: > Let's say I'm parsing HTML using regular expressions and I want to find: > > ... > > where the text within the tag body does _not_ contain the word 'Alpo'. > > I've seen the following as a solution: > > $text =~ m|(?:(?!Alpo).)*|; > > This seems really compute-intensive. Is there a better way? I would check out HTML::Parser to do this job for you. In particular HTML::LinkExtor pulls out links from HTML documents, just modify the code to pull our your . Then you can loop through all the matches and pull out the non-Alpos with a simple regexp. You're going to run into a lot of unforseen problems by trying to roll your own regexp. For example, this is valid: but you're not going to get it as you're looking for "" to finish it off. Or what if the $text is more than one line? And shirely there's no malformed HTML out there either .... the list goes on and on. Chris From sthoenna at efn.org Wed Apr 21 20:38:59 2004 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Apocalypse 12 released In-Reply-To: References: Message-ID: <20040422013859.GA216@efn.org> On Wed, Apr 21, 2004 at 06:26:55PM -0400, kellan@protest.net wrote: > Anyone made it through and want to summarize? Its been a busy week, and > I've been daunted by the length. Not a summary, but there are some questions, objections, and answers (by Larry and Damian) at http://perlmonks.org/index.pl?node_id=345777 (One could also delve into the no doubt hearty discussions on perl6-language@perl.org or look at next weeks perl6 summary on perl6-announce@perl.org.) From MichaelRWolf at att.net Thu Apr 22 09:17:19 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: double-dot stylin' Message-ID: As a way to illustrate how the double-dot operator (in a scalar context) operates as a flip-flop, I put this code together. It's a classic example of parsing an email message -- the header is the first line through a blank line; the body is the rest. while (<>) { if (1 .. /^\s*$/) { push @header, $_; } else { push @body, $_; } Then I started playing golf, taking away unnecessary code, and refactoring. Unfortunately this minimal version didn't work push 1 .. /^\s*$/ ? @header : @body, $_ while (<>); So I repeated the 'push' and '$_' (ugh... repeated code -- what would Fowler say?) and came up with this. 1 .. /^\s*$/ ? push @header, $_ : push @body, $_ while (<>); But even with 8 years of Perl under my belt, it's too dense and cryptic for me to look at. This at least exposes the "?" in a way that hints at the ternary operator, but it's not so obvious that the 'while' is a modifier, and subordinate to the ternary, instead of an empty loop. 1 .. /^\s*$/ ? push @header, $_ : push @body, $_ while (<>); I'm sure Tim will suggest getting rid of the 'while' at the end, but that takes up another whole line and two printable characters.... while (<>) { 1 .. /^\s*$/ ? push @header, $_ : push @body, $_ } Better formatting ideas? -- Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net From MichaelRWolf at att.net Thu Apr 22 09:31:46 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: flip..flops In-Reply-To: (Michael R. Wolf's message of "Thu, 22 Apr 2004 07:26:14 -0700") References: <5.1.0.14.2.20040107110910.00bcc128@mail.traininghott.com> Message-ID: FYI.. Here's the guts of the message I sent to my colleague regarding double-dots (range and flip-flop), in the hopes that it shines a light into a dark, oft-overlooked, powerful corner of Perl. Enjoy, Michael [...] > I thought of you recently too. I saw something in Ellie Quigley's > Perl book that amazed me about Perl: > > open(DB, "emp.names") || die "Can't open emp.names: $!"; > while () { > print if /Norma/ .. eof(); > } > > It's the use of the range operator in that way. It blew my mind. Actually, dot-dot is overloaded, and in this case is not the range operator, it's the flip-flop operator. In an array context, it's a range operator. @toddler = (1..3); @teenager = (13..19); But in a scalar context, it's a flip-flop binary operator. The operator evaluates as false until the LHS being true triggers it to flip to a true state, which it stays in until the RHS being true triggers it to flip back to false. There's a 2-dot version and a 3-dot version, the difference being whether both sides can get evaluated for the same line and trigger on/off for the same line or whether they must do it on separate lines. Her example shows printing lines from a file starting at lines that contain norma Norma until the end of file. Another classic example is parsing an email message. The header is the first line through a blank line; the body is the rest. while (<>) { if (1 .. /^\s*$/) { push @header, $_; } else { push @body, $_; } Or, more perlishly (probably *too* perlishly): 1 .. /^\s*$/ ? push @header, $_ : push @body, $_ while (<>); Is this a better style...? 1 .. /^\s*$/ ? push @header, $_ : push @body, $_ while (<>); Or this....?? while (<>) { 1 .. /^\s*$/ ? push @header, $_ : push @body, $_ } The last 3 all compile and run the same. Perl... I really appreciate its flexability and expressiveness. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net From sthoenna at efn.org Thu Apr 22 10:47:07 2004 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: double-dot stylin' In-Reply-To: References: Message-ID: <20040422154707.GC3920@efn.org> On Thu, Apr 22, 2004 at 07:17:19AM -0700, "Michael R. Wolf" wrote: > Unfortunately this minimal version didn't work > > push 1 .. /^\s*$/ ? @header : @body, $_ while (<>); I think this has come up here before. The way to get this to work is: push @{ 1 .. /^$/ ? \@header : \@body }, $_ while (<>); The "push expr ? @array1 : @array2" form *does* work when expr is a constant or expression over only constants, but this is a bug and should not be relied upon. When you teach people about .. it is a good idea to mention the implicit comparison with $. From MichaelRWolf at att.net Thu Apr 22 14:18:58 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: double-dot stylin' In-Reply-To: <20040422154707.GC3920@efn.org> (Yitzchak Scott-Thoennes's message of "Thu, 22 Apr 2004 08:47:07 -0700") References: <20040422154707.GC3920@efn.org> Message-ID: Yitzchak Scott-Thoennes writes: [...] > When you teach people about .. it is a good idea to mention the > implicit comparison with $. Oh yeah! It was such DWIMery on the 'what' that I forgot about the 'how'. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net From andrew at sweger.net Thu Apr 22 18:37:53 2004 From: andrew at sweger.net (Andrew Sweger) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Using last in non-loop blocks Message-ID: According to perldoc -f last (perl 5.8.3): Note that a block by itself is semantically identical to a loop that executes once. Thus "last" can be used to effect an early exit out of such a block. This led me to think that I could safely use 'last' in any block structure, including an if block. E.g., if ($reasonably_true) { #blah blah last unless $denominator > 0; #blah blah } I got slapped in the terminal with, Can't "last" outside a loop block at /my/dumb/script.pl line 162. Just thought that was interesting. I thought it should work (according to the docs anyway). -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. From asim at pair.com Thu Apr 22 18:50:28 2004 From: asim at pair.com (Asim Jalis) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Using last in non-loop blocks In-Reply-To: References: Message-ID: <20040422235028.GA43628@wokkil.pair.com> On Thu, Apr 22, 2004 at 04:37:53PM -0700, Andrew Sweger wrote: > According to perldoc -f last (perl 5.8.3): > > Note that a block by itself is semantically identical to a > loop that executes once. Thus "last" can be used to effect > an early exit out of such a block. > > This led me to think that I could safely use 'last' in any > block structure, including an if block. E.g., > > if ($reasonably_true) { > #blah blah > last unless $denominator > 0; > #blah blah > } > > I got slapped in the terminal with, > > Can't "last" outside a loop block at /my/dumb/script.pl line 162. > > Just thought that was interesting. I thought it should work > (according to the docs anyway). Perhaps when the documentation says "a block by itself" it means a block that is part of a construct such as "if". So this throws an error as you observe: /usr/home/asim> perl -e 'if(1){ print "1\n"; last; print "2\n"; } ' 1 Can't "last" outside a loop block at -e line 1. But the following works just fine, and breaks out of the block before printing "2", without an error. /usr/home/asim> perl -e '{ print "1\n"; last; print "2\n"; } ' 1 Asim From ced at carios2.ca.boeing.com Thu Apr 22 18:46:05 2004 From: ced at carios2.ca.boeing.com (ced@carios2.ca.boeing.com) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Using last in non-loop blocks Message-ID: <200404222346.QAA27894@carios2.ca.boeing.com> > According to perldoc -f last (perl 5.8.3): > > Note that a block by itself is semantically identical to a loop that > executes once. Thus "last" can be used to effect an early exit out of > such a block. > >This led me to think that I could safely use 'last' in any block >structure, including an if block. E.g., > > if ($reasonably_true) { > #blah blah > last unless $denominator > 0; > #blah blah > } > >I got slapped in the terminal with, > > Can't "last" outside a loop block at /my/dumb/script.pl line 162. > >Just thought that was interesting. I thought it should work (according to >the docs anyway). diagnostics provides an explanation: Can't "last" outside a loop block at ./test1.pl line 6 (#1) (F) A "last" statement was executed to break out of the current block, except that there's this itty bitty problem called there isn't a current block. Note that an "if" or "else" block doesn't count as a "loopish" block, as doesn't a block given to sort(), map() or grep(). You can usually double the curlies to get the same effect though, because the inner curlies will be considered a block that loops once. See perlfunc/last. But that means something like this will work: if ($reasonably_true) {{ #blah blah last unless $denominator > 0; #blah blah }} print "I managed to last out...\n"; -- Charles DeRykus From sthoenna at efn.org Thu Apr 22 18:59:43 2004 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Using last in non-loop blocks In-Reply-To: References: Message-ID: <20040422235943.GA424@efn.org> On Thu, Apr 22, 2004 at 04:37:53PM -0700, Andrew Sweger wrote: > According to perldoc -f last (perl 5.8.3): > > Note that a block by itself is semantically identical to a loop that > executes once. Thus "last" can be used to effect an early exit out of > such a block. > > This led me to think that I could safely use 'last' in any block > structure, including an if block. E.g., > > if ($reasonably_true) { > #blah blah > last unless $denominator > 0; > #blah blah > } > > I got slapped in the terminal with, > > Can't "last" outside a loop block at /my/dumb/script.pl line 162. > > Just thought that was interesting. I thought it should work (according to > the docs anyway). That's not a block by itself, that's part of the if statement. Try: if (...) {{ ... }} From jack at gehennom.net Thu Apr 22 19:02:50 2004 From: jack at gehennom.net (Jack Foy) Date: Mon Aug 2 21:37:19 2004 Subject: SPUG: Using last in non-loop blocks In-Reply-To: References: Message-ID: <20040423000250.GA25594@demogorgon> Andrew Sweger wrote: > This led me to think that I could safely use 'last' in any block > structure, including an if block. E.g., 'if' (and 'unless') blocks are the exception to that rule -- unlike all other blocks, they are not one-time loops. (See page 123 of PP3.) That's because you often want to do something like this, and have it do the notionally right thing: for (@lines) { if ($disaster) { clean_up(); last; } normal_processing(); } If you really want to use last inside an if, use a double block: if ($condition1) {{ stuff(); last if $condition2; more_stuff(); }} -- Jack Foy From asim at pair.com Thu Apr 22 19:05:17 2004 From: asim at pair.com (Asim Jalis) Date: Mon Aug 2 21:37:20 2004 Subject: SPUG: Using last in non-loop blocks In-Reply-To: <20040422235028.GA43628@wokkil.pair.com> References: <20040422235028.GA43628@wokkil.pair.com> Message-ID: <20040423000517.GA49287@wokkil.pair.com> I meant "a block that is *NOT* part of a construct". I keep forgetting to type "not" periodically. This is of course much more dangerous in programs than in e-mail messages. -- Asim On Thu, Apr 22, 2004 at 07:50:28PM -0400, Asim Jalis wrote: > Perhaps when the documentation says "a block by itself" it means > a block that is part of a construct such as "if". > > So this throws an error as you observe: > > /usr/home/asim> perl -e 'if(1){ print "1\n"; last; print "2\n"; } > ' > 1 > Can't "last" outside a loop block at -e line 1. > > But the following works just fine, and breaks out of the block > before printing "2", without an error. > > /usr/home/asim> perl -e '{ print "1\n"; last; print "2\n"; } > ' > 1 > > > Asim > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list@mail.pm.org http://spugwiki.perlocity.org > ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, Location Unknown > WEB PAGE: http://www.seattleperl.org From sthoenna at efn.org Thu Apr 22 19:07:13 2004 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Mon Aug 2 21:37:20 2004 Subject: SPUG: Perl release announcements Message-ID: <20040423000713.GB424@efn.org> For a while now, the ancient tradition of heralding a new perl release with a quote from Tolkien has been abandoned in favor of all kinds of other things. I made a list of recent ones, if anyone is interested: http://perlmonks.org/index.pl?node_id=347451 From sthoenna at efn.org Thu Apr 22 19:51:46 2004 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Mon Aug 2 21:37:20 2004 Subject: SPUG: Using last in non-loop blocks In-Reply-To: <20040423000250.GA25594@demogorgon> References: <20040423000250.GA25594@demogorgon> Message-ID: <20040423005146.GA624@efn.org> On Thu, Apr 22, 2004 at 08:02:50PM -0400, Jack Foy wrote: > Andrew Sweger wrote: > 'if' (and 'unless') blocks are the exception to that rule -- unlike all > other blocks, they are not one-time loops. (See page 123 of PP3.) For(each)?, while, and bare blocks are more the exception; any other block won't use next/last/redo: sort, do, grep, map, sub, eval, &-prototype blocks, and continue (in a sense, anyway) all have blocks that don't associate with next/last/redo (though many of them will warn if you leave that way, control still passes to the end of a "real" block (with another warning if there wasn't a "real" block). The behavior of eval is somewhat inconsistent this: $ perl -we'eval { print "1"; last; print "2" }; print "3"' Exiting eval via last at -e line 1. 13 $ perl -we'{eval { print "1"; last; print "2" }; print "3"}' Exiting eval via last at -e line 1. 1 $ perl -we'{eval { print "1"; last; print "2" }; print "3"} print "4"' Exiting eval via last at -e line 1. 14 Why 13 in one case and 14 in the other? And where's the "Can't "last" outside a loop block" warning? From sthoenna at efn.org Thu Apr 22 19:57:05 2004 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Mon Aug 2 21:37:20 2004 Subject: SPUG: Using last in non-loop blocks In-Reply-To: <200404222346.QAA27894@carios2.ca.boeing.com> References: <200404222346.QAA27894@carios2.ca.boeing.com> Message-ID: <20040423005705.GA3616@efn.org> On Thu, Apr 22, 2004 at 04:46:05PM -0700, ced@carios2.ca.boeing.com wrote: > > According to perldoc -f last (perl 5.8.3): > > > > Note that a block by itself is semantically identical to a loop that > > executes once. Thus "last" can be used to effect an early exit out of > > such a block. > > > >This led me to think that I could safely use 'last' in any block > >structure, including an if block. E.g., > > > > if ($reasonably_true) { > > #blah blah > > last unless $denominator > 0; > > #blah blah > > } > > > >I got slapped in the terminal with, > > > > Can't "last" outside a loop block at /my/dumb/script.pl line 162. > > > >Just thought that was interesting. I thought it should work (according to > >the docs anyway). > > diagnostics provides an explanation: > > Can't "last" outside a loop block at ./test1.pl line 6 (#1) > (F) A "last" statement was executed to break out of the current block, > except that there's this itty bitty problem called there isn't a current > block. Note that an "if" or "else" block doesn't count as a "loopish" > block, as doesn't a block given to sort(), map() or grep(). You can > usually double the curlies to get the same effect though, because the > inner curlies will be considered a block that loops once. See > perlfunc/last. > > > But that means something like this will work: > > if ($reasonably_true) {{ > #blah blah > last unless $denominator > 0; > #blah blah > }} > print "I managed to last out...\n"; It's worth noting that there is no way of doubling the braces for a do { } while or do { } until block that will work sanely both for last and next/redo. From andrew at sweger.net Thu Apr 22 20:34:44 2004 From: andrew at sweger.net (Andrew Sweger) Date: Mon Aug 2 21:37:20 2004 Subject: SPUG: Using last in non-loop blocks In-Reply-To: <20040423000250.GA25594@demogorgon> Message-ID: On Thu, 22 Apr 2004, Jack Foy wrote: > 'if' (and 'unless') blocks are the exception to that rule -- unlike all > other blocks, they are not one-time loops. (See page 123 of PP3.) > That's because you often want to do something like this, and have it do > the notionally right thing: > > for (@lines) { > if ($disaster) { > clean_up(); > last; > } > normal_processing(); > } Ooo. Nicely illustrated. I think I will keep my next/last/redo's to a minimum or at least so they're painfully clear what they're doing. Thanks. -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. From ext-spug at jope.net Thu Apr 22 22:01:47 2004 From: ext-spug at jope.net (El JoPe Magnifico) Date: Mon Aug 2 21:37:20 2004 Subject: SPUG: Using last in non-loop blocks In-Reply-To: <200404222346.QAA27894@carios2.ca.boeing.com> References: <200404222346.QAA27894@carios2.ca.boeing.com> Message-ID: Related question: Will this limitation still apply in Perl6? The foreword to Apocalypse 4 says the following: [...] control flow must be able to leak out of blocks in a controlled fashion. Obviously, falling off the end of a block is the most "normal" way, but we need to exit blocks in other "abnormal" ways as well. Perl 5 has several different ways of exiting a block: return, next, last, redo, and die, for instance. The problem is that these various keywords are hard-wired to transfer control outward to a particular built-in construct, such as a subroutine definition, a loop, or an eval. That works against our unifying concept that every block is a closure. In Perl 6, all these abnormal means of block exit are unified under the concept of exceptions. A return is a funny kind of exception that is trapped by a sub block. A next is an exception that is trapped by a loop block. And later in the same doc, in the RFC 199 discussion: The interesting policy question as we go on will be whether a given construct responds to a given exception or not. Some exceptions will have to be restricted in their use. For instance, we should probably say that only explicit sub declarations may respond to a return. I saw no hints as to a decision on whether "last" would be allowed inside a non-loop block, though the general mood in decisions so far seems to be toward permissiveness unless there is a convincing reason to the contrary. And I can't think of one in this case. -jp On Thu, 22 Apr 2004 ced@carios2.ca.boeing.com wrote: > diagnostics provides an explanation: > > Can't "last" outside a loop block at ./test1.pl line 6 (#1) > (F) A "last" statement was executed to break out of the current block, > except that there's this itty bitty problem called there isn't a current > block. Note that an "if" or "else" block doesn't count as a "loopish" > block, as doesn't a block given to sort(), map() or grep(). From tallpeak at hotmail.com Fri Apr 23 18:28:39 2004 From: tallpeak at hotmail.com (Aaron W. West) Date: Mon Aug 2 21:37:20 2004 Subject: SPUG: Tmojo | Net::FTPServer | FreeTDS | ramblings about type safety Message-ID: Some interesting recent finds. I'd like to hear if anyone's tried tmojo. http://lab-01.com/tmojo/ What is Tmojo? Tmojo is a flexible Perl-based dynamic content generation engine. It enables Web Application Developers to quickly build rich, dynamic web-sites in a completely object-oriented environment. .. --- http://www.annexia.org/ .. Monolith is a revolutionary web application architecture, which changes the way applications are delivered over the web. And it's written entirely in C, so it can serve hundreds of thousands of hits a day from an old 486. Net::FTPServer is a powerful, configurable, extensible and secure FTP server, with millions of users worldwide. .. FYI: I found this page because of my interest in Ocaml ( www.ocaml.com ), a fast,l efficient functional language which Doug Bagley's language comparison page drew me to ( http://www.bagley.org/ ). His comparison also shows that Perl is faster than Java for some things (although not matrix multiplication; heavy math is a strong point of C, C++, Fortran, OCaml, for example). -- But I've yet to get OpenPAM to build under Cygwin (so I can install Authen::PAM, a dependency of Net::FTPServer). I know, I should just run Linux... --- FreeTDS: http://www.linuxjournal.com/article.php?sid=5732 But I didn't find there to be any performance boost to using TDS to retrieve records, so I'll probably stick with ODBC (DBI -> DBD::ODBC). -------- (Just ignore the rest of this message, as I babble about type-safety...) This is better than what I wrote below: http://c2.com/cgi/wiki?StaticTypeSafety Maybe static type-safety isn't that important... it's implemented "cleanly" in type-inferring languages (ML-family, Haskell, maybe Dylan, perhaps Clean), and shouldn't get in the way too often in them, although there are things you can't do like create generic containers (a list can't have both ints and strings in it, for example. Lisp and Perl (arrays) allow that, SML/OCAML don't.) --- My own observations on language features, with regards to type-safety: Assembler: the least type-safe of all Forth: Not type safe: you can push a couple of integers and pop them back as a float. C: Not type safe Pascal: Type safe, by putting chains on the programmer and tying him to his seat Ada: Like Pascal? C++: potentially quite type-safe, especially if using templates/STL (properly), but all type information has to be specified, and there's the potential of dangerous downcasts in an inheritance hierarchy. Perl: not really type-safe, but stores some type information with each variable and tries to take care of many of the nasty details for you. But be careful to understand the behavior so that you know what will happen, otherwise you may get type-related errors at runtime. ML: SML / OCAML: Very type-safe, using type inference. ( www.ocaml.com ) Clean: also type-safe ( www.clean.org ) Prolog and other logic languages: ??? I think types are rather restricted in these languages. Haskell: type-safe Dylan: supports static or dynamic typing Java: type-safe, but annoying SQL: very type-safe: all conversions have to be specified explicitly. But very few types are supported and types can't generally be created (Postgresql being a possible exception, as well as the upcoming MS SQL Server: Yukon) -- Excel: Well, not a language, but... Ugh. How many times have you had strings turn into numbers when parsing a tab-delimited file? I think it should default to "Text". From MichaelRWolf at att.net Tue Apr 27 19:36:56 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:37:20 2004 Subject: SPUG: serial I/O from Perl (W32 & Red Hat) Message-ID: I'm connecting two systems together for the purpose of testing. It's been a long time since I twiddled bits across a serial port. Last time I did so it was in assembly and C. I'd like to do much better this time -- Perl. Other than the following useless answer in FAQ8, any pointers to info write a serial port on W32 read a serial port on W32 write a serial port on Unix (Red Hat 7.2) read a serial port on Unix (Red Hat 7.2) On the Unix box. $from_w32 = unix_read(); $to_w32 = unix_read($byte); And on the W32 box, same thing... $from_unix = w32_read(); $to_unix = w32_read($byte); I've seen a reference to Win32::SerialPort and Win32API::CommPort. Which of this the best one to start studying? What's the naming convention for a serial port (/dev/someting?) in Red Hat? Could it really be that serial port I/O is so thinly documented? To paraphrase RTFM, I've read the fine manuals and found them lacking. Perhaps it's me, and there's better documentation that I haven't found. Thanks, Michael Wolf ================================================================ How do I read and write the serial port? This depends on which operating system your program is running on. In the case of Unix, the serial ports will be accessible through files in /dev; on other systems, device names will doubtless differ. Several problem areas common to all device interaction are the following: lockfiles Your system may use lockfiles to control multiple access. Make sure you follow the correct protocol. Unpredictable behavior can result from multiple processes reading from one device. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net From david.dyck at fluke.com Tue Apr 27 23:16:42 2004 From: david.dyck at fluke.com (David Dyck) Date: Mon Aug 2 21:37:20 2004 Subject: SPUG: serial I/O from Perl (W32 & Red Hat) In-Reply-To: References: Message-ID: On Tue, 27 Apr 2004 at 17:36 -0700, Michael R. Wolf ...: > I'm connecting two systems together for the purpose of testing. > > It's been a long time since I twiddled bits across a serial port. Last > time I did so it was in assembly and C. I'd like to do much better > this time -- Perl. Here's a start that allows us to run code on Unix and Windows, although we've found Unix more reliable. use vars qw($OS_win); BEGIN { $OS_win = ($^O eq "MSWin32") ? 1 : 0; if ($OS_win) { eval "use Win32::SerialPort 0.11 qw(:ALL)"; die "$@\n" if ($@); } else { eval "use Device::SerialPort qw(:ALL)"; die "$@\n" if ($@); } } Then when you want to allocate a port $name = '/dev/' . $name if not $OS_win; $port = $OS_win ? Win32::SerialPort->new($name) : Device::SerialPort->new($name), 1; After that, the access through $port is very much the same. From douglas at slugstone.net Wed Apr 28 03:37:07 2004 From: douglas at slugstone.net (Douglas Kirkland) Date: Mon Aug 2 21:37:20 2004 Subject: SPUG: serial I/O from Perl (W32 & Red Hat) In-Reply-To: References: Message-ID: <200404280137.19502.douglas@slugstone.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tuesday 27 April 2004 17:36, Michael R. Wolf wrote: > I'm connecting two systems together for the purpose of testing. > > It's been a long time since I twiddled bits across a serial port. Last > time I did so it was in assembly and C. I'd like to do much better > this time -- Perl. > > > What's the naming convention for a serial port (/dev/someting?) in Red > Hat? > Try: /dev/ttyS0 for com1 /dev/ttyS1 for com2 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFAj206SpWn8R0Z08URAt/vAJ9zQ0xMNZQCGyzKqfxBW7y9v7Pc7QCeKaaX jmJUX5GpEKQvulK3HCTQ6vs= =1gcL -----END PGP SIGNATURE----- From MichaelRWolf at att.net Wed Apr 28 13:17:54 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:37:20 2004 Subject: SPUG: Using last in non-loop blocks In-Reply-To: <20040423005705.GA3616@efn.org> (Yitzchak Scott-Thoennes's message of "Thu, 22 Apr 2004 17:57:05 -0700") References: <200404222346.QAA27894@carios2.ca.boeing.com> <20040423005705.GA3616@efn.org> Message-ID: Yitzchak Scott-Thoennes writes: [...] >> But that means something like this will work: >> >> if ($reasonably_true) {{ >> #blah blah >> last unless $denominator > 0; >> #blah blah >> }} >> print "I managed to last out...\n"; It took me a while to get around to this thread, so I read it all at once. Luckily I did. It took seeing double curlies a few times before I realized it's non-standard enough (at least to my eyes) that I'd hilight it some other way. I know that most of these other solutions are obvious to most of us, but I'd like to hilight the goto solution. Not that I like it. But that's the point. The 'goto' solution appeals as little to me as the 'last unless' solution. IMHO, of course, but this discussion seemed to be bordering the gap between 'technically feasable' and 'stylistic preference'. It's a balance act. # 1. Label the "extra" block, and name it in the 'last'. if ($reasonably_true) { DIVISION: { #blah blah last DIVISION unless $denominator > 0; #blah blah } } # 2. Refactor the following code into a block. if ($reasonably_true) { #blah blah unless $denominator > 0 { #blah blah } } # 3. Use an exception if ($reasonably_true) { eval { #blah blah die unless $denominator > 0; #blah blah }; handle_divide_by_negative if ($@); } # 4. Break down and do a GOTO. if ($reasonably_true) { #blah blah goto SAFE if $denominator > 0; #blah blah SAFE: # handle divide by negative } > It's worth noting that there is no way of doubling the braces for a > do { } while or do { } until block that will work sanely both for last > and next/redo. Would you consider labels to be an a sane solution? -- Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net From MichaelRWolf at att.net Fri Apr 30 13:45:26 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:37:20 2004 Subject: SPUG: Off-topic (need RedHat 7.2 LILO/GRUB help) Message-ID: Warning -- off topic. Hit delete now if you can't spare the diversion. Thanks for the indulgence, Michael ================================================================ I know it's off-topic for a Perl list, but you're my favorite techies, and I know someone out here in SPUGland has a clue. I'm trying to get a computer set up to test a custom PCI board. The drivers for the board require the 2.4.22 kernel. That requires a standard install, then two updates/upgrades/up-somethings. I got RH 7.2 to jump right off the CD's. The customer sent me a CD with some other stuff on it, so that I could upgrade to the 2.4.20 kernel then the 2.4.22 kernel then add some avtec-specific drivers. I expect that this will look familiar to someone who's used LILO or GRUB before. My local contact prefers LILO (but is currently in Japan). The customer has used GRUB (and is in Maryland). I'll go with what works because I just need an OS so I can write a Perl test harness to exercise the board. Here's what was on the customer's CD: -r--r--r-- 1 michael root 226105 Apr 23 10:51 avtec_2.4.22.tar.gz -r--r--r-- 1 michael root 10625740 Apr 23 11:06 boot.tar.gz -r--r--r-- 1 michael root 832426 Apr 23 11:00 dev-3.3-4.i386.rpm -r--r--r-- 1 michael root 176773 Apr 23 11:00 iptables-1.2.8-8.72.3.i386.rpm -r--r--r-- 1 michael root 126202 Apr 23 11:00 iptables-ipv6-1.2.8-8.72.3.i386.rpm -r--r--r-- 1 michael root 12671436 Apr 26 04:40 kernel-2.4.20-20.7.i386.rpm -r--r--r-- 1 michael root 6362328 Apr 26 04:41 kernel-BOOT-2.4.20-20.7.i386.rpm -r--r--r-- 1 michael root 1790757 Apr 26 04:41 kernel-doc-2.4.20-20.7.i386.rpm -r--r--r-- 1 michael root 1153405 Apr 23 11:01 kernel-headers-2.4.9-34.i386.rpm -r--r--r-- 1 michael root 38692562 Apr 26 04:41 kernel-source-2.4.20-20.7.i386.rpm -r--r--r-- 1 michael root 41042746 Apr 23 10:48 linux-2.4.22-6.ll.rh73.tar.gz -r--r--r-- 1 michael root 208818 Apr 23 11:00 modutils-2.4.18-3.7x.i386.rpm -r--r--r-- 1 michael root 47516 Apr 23 11:00 modutils-devel-2.4.18-3.7x.i386.rpm The clues as to how to load multiple kernels are probably in the boot.tar.gz file, whose contents are below: drwxr-xr-x root/root 0 boot/ drwxr-xr-x root/root 0 boot/grub/ -rw-r--r-- root/root 1262 boot/grub/grub.conf -rw-r--r-- root/root 54044 boot/grub/splash.xpm.gz srwxrwxrwx root/root 0 boot/grub/menu.lst --> ./grub.conf -rw-r--r-- root/root 82 boot/grub/device.map -rw-r--r-- root/root 512 boot/grub/stage1 -rw-r--r-- root/root 120000 boot/grub/stage2 -rw-r--r-- root/root 10848 boot/grub/e2fs_stage1_5 -rw-r--r-- root/root 9744 boot/grub/fat_stage1_5 -rw-r--r-- root/root 8864 boot/grub/ffs_stage1_5 -rw-r--r-- root/root 9248 boot/grub/minix_stage1_5 -rw-r--r-- root/root 12512 boot/grub/reiserfs_stage1_5 -rw-r--r-- root/root 8512 boot/grub/vstafs_stage1_5 srwxrwxrwx root/root 0 boot/vmlinuz --> vmlinuz-2.4.20-20.7 -rw-r--r-- root/root 5824 boot/boot.b -rw-r--r-- root/root 612 boot/chain.b -rw-r--r-- root/root 23108 boot/message -rw-r--r-- root/root 640 boot/os2_d.b srwxrwxrwx root/root 0 boot/kernel.h --> kernel.h-2.4.9 -rw-r--r-- root/root 1095761 boot/vmlinuz-2.4.22-6.ll.rh73 srwxrwxrwx root/root 0 boot/System.map --> System.map-2.4.20-20.7 -rw-r--r-- root/root 116130 boot/initrd-2.4.22-6.ll.rh73 -rw-r--r-- root/root 1192132 boot/vmlinuz-2.4.22-6.ll.rh73_av srwxrwxrwx root/root 0 boot/module-info --> module-info-2.4.20-20.7 -rw-r--r-- root/root 850361 boot/bzImage -rw-r--r-- root/root 850361 boot/vmlinuz-2.4.7-10_avtec -rw-r--r-- root/root 811923 boot/vmlinuz-2.4.7-10_avtec.sav -rw-r--r-- root/root 327990 boot/initrd-2.4.7-10custom.img -rw-r--r-- root/root 431819 boot/System.map.old -rw-r--r-- root/root 850455 boot/vmlinuz-2.4.7-10_avtec_5 -rw-r--r-- root/root 431819 boot/System.map-2.4.7-10custom -rw-r--r-- root/root 802068 boot/vmlinuz-2.4.7-10.bu -rw-r--r-- root/root 850332 boot/vmlinuz-2.4.7-10_avtec_3 -rw-r--r-- root/root 511785 boot/System.map-2.4.20-20.7 -rw-r--r-- root/root 405 boot/kernel.h-2.4.9 -rw-r--r-- root/root 15438 boot/module-info-2.4.20-20.7 -rw-r--r-- root/root 44882 boot/config-2.4.20-20.7 -rw-r--r-- root/root 116130 boot/initrd-2.4.20-20.7.img -rw-r--r-- root/root 3005123 boot/vmlinux-2.4.20-20.7 -rw-r--r-- root/root 1079416 boot/vmlinuz-2.4.20-20.7 Gunshy and looking for a clue. It's a separate system, so I can ready && fire && aim until sucess; # Here's the Perl.... :-) But I'd rather ready && aim && fire; Please call (206)782-8377 if you've got time to share a clue. Many thanks, Michael Wolf -- Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net