From ericj at cubesearch.com Fri Oct 1 02:17:35 2004 From: ericj at cubesearch.com (Eric Johanson) Date: Fri Oct 1 02:17:39 2004 Subject: SPUG: 24-bit signed int unpacking? Message-ID: Hey perl-gurus, I'm trying to use unpack to convert binary 24-bit ints into native perl ints. For example (in hex): I'd like to convert: "\x24\x00\x00" => 66 "\xf9\xff\xff" => -7 I COULD just tack on 0x00 or 0xFF based on the last byte values, but this seems really ghetto. Is there a slicker method for conversion? print unpack('i*', "\xf9\xff\xff"); # Darn, doesn't work... TIA, -Ericj From charles.e.derykus at boeing.com Fri Oct 1 10:25:02 2004 From: charles.e.derykus at boeing.com (DeRykus, Charles E) Date: Fri Oct 1 10:25:13 2004 Subject: SPUG: interesting while() behavior and hosting recs Message-ID: <5DF8FDE8DFE8744388602480FDCC0E310346FE8B@xch-nw-23.nw.nos.boeing.com> Yes, you're right, there's no "list in scalar context" but I always had trouble with just the "semantic denial". The point to me is more what Perl does with something that looks like a "list in scalar context" and there's no general rule about what will happen. No termination, no warning, etc. It's parsed and the fact that its appearance is of a "list in scalar context" provides a way to identify the beast and its effects. Also the faq you've cited, simply documents the fact that it can act like the comma operator: As a side note, there's no such thing as a list in scalar context. When you say $scalar = (2, 5, 7, 9); you're using the comma operator in scalar context so it uses the scalar comma operator.There was no list at all! This causes the last value to be returned: 9., But, as we've seen Joel's post, the effects of a "list in scalar context" in a different may altogether different and unexpected... ie, while () ... gets parsed as for (;;). Cheers, -- Charles DeRykus -----Original Message----- From: John W. Krahn [mailto:krahnj@telus.net] Sent: Thursday, September 30, 2004 10:00 PM To: SPUG Subject: Re: SPUG: interesting while() behavior and hosting recs DeRykus, Charles E wrote: > An array (AV) can meaningfully be evaluated in scalar context so I'd > expect @empty to fail. However, () is a list in scalar context As Randal has pointed out many times and as the FAQ clearly states: perldoc -q "What is the difference between a list and an array" [snip] As a side note, there's no such thing as a list in scalar context. > which doesn't behave in a predictable manner. That is because it doesn't exist. In the expression: while () { ... } there is NO list. As a side note, and has been recently discused on comp.lang.perl.misc, parentheses do not create a list. http://groups.google.com/groups?threadm=UjE6d.138341%24D%25.46143%40attbi_s51 John -- use Perl; program fulfillment _____________________________________________________________ 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 Fri Oct 1 12:46:36 2004 From: tim at consultix-inc.com (Tim Maher) Date: Fri Oct 1 12:46:46 2004 Subject: SPUG: interesting while() behavior and hosting recs In-Reply-To: <5DF8FDE8DFE8744388602480FDCC0E310346FE8B@xch-nw-23.nw.nos.boeing.com> References: <5DF8FDE8DFE8744388602480FDCC0E310346FE8B@xch-nw-23.nw.nos.boeing.com> Message-ID: <20041001174636.GA11923@jumpy.consultix-inc.com> On Fri, Oct 01, 2004 at 08:25:02AM -0700, DeRykus, Charles E wrote: > > But, as we've seen Joel's post, the effects of a "list in > scalar context" in a different may altogether different and > unexpected... ie, while () ... gets parsed as for (;;). > Charles DeRykus I've been skimming this thread, but having trouble with a fundamental element of the discussion. Specifically, what qualifies while () { statement; } as having /anything/ to do with the conceptually understandable (albeit technically non-existent) "list in scalar context"? Or, for that matter, the parens in while's close relative: if () { statement; } AFAIK, those parens after the keywords are *required elements of syntax* that have nothing to do with the kind of "list formation" effect that people associate with expressions like: @stuff=(1,2,3); and @stuff=(); # empty list It seems to me that earlier posts are equating the parens in "while ()..." to those in my empty list example above, which conflicts with my interpretation that they are merely syntactic elements after "while". If they're /not/ syntactic, why can't we write code like this? while $foo { statement; } while @foo { statement; } or if 1 { statement; } (And that code doesn't compile; I checked!) I'll readily admit that I, like many JAPHs, have some of my own ways of thinking about Perl that make it easier for me to use, and to teach, and that usually serve me quite well -- despite their technically being over-simplifications of Perl's (twisted) reality. 8-} As a case in point, I offer the widespread notion that parens function as "list constructors" in expressions like "@array=(1,2)" and "print (1,2)", which is tremendously useful, despite being less than a perfectly accurate representation of how those expressions are actually parsed and evaluated, IIRC. (What's the real story? Is it that the comma operator in list context returns all the expressions, so the parens are just there for reasons of precedence in the case of an assignment?) Surely, even in Perl, there are some elements of basic syntax that can be trusted to have concrete meanings -- like while's parens; aren't there? 8-} *--------------------------------------------------------------------------* | Tim Maher, CEO (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for Shell Users & Programmers" | | Classes! 10/4: UNIX Fundamentals 11/30: Perl 12/6: Shell & Utilities | *--------------------------------------------------------------------------* From tim at consultix-inc.com Fri Oct 1 12:53:53 2004 From: tim at consultix-inc.com (Tim Maher) Date: Fri Oct 1 12:54:08 2004 Subject: SPUG: SpamAssassin 3.0.0 is released In-Reply-To: <054222519C2ED411A68E00508B603AC70653451D@zetxch01.zetron.com> References: <054222519C2ED411A68E00508B603AC70653451D@zetxch01.zetron.com> Message-ID: <20041001175353.GA15374@jumpy.consultix-inc.com> On Wed, Sep 29, 2004 at 07:09:03PM -0700, Kurt Buff wrote: > Tim said... > > > FWIW, here are my early impressions of the new version of > > SpamAssassin, > > v 3.0. > > > > 2) Suddenly, my formerly adequate Pentium III @ 966 Mhz feels > > like a Pentium II at 150 Mhz. > -Tim > A question comes to mind - what's your MTA? I use Postfix, and deliberately > throttle it to only a few child processes at a time. > -Kurt I believed the spamd man-page when it told me that the default number of children for spamd was 5, but recently discovered that the line in my /etc/init.d/postfix that started spamd was actually requesting 20! (I guess something in the upgrade to 3.0 slipped that into the file when I wasn't looking.) So I've changed that command to only allow 2 simultaneous children (spamd -m 2), and my performance is *much* better now. So, nevermind! 8-} -Tim *--------------------------------------------------------------------------* | Tim Maher, CEO (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for Shell Users & Programmers" | | Classes! 10/4: UNIX Fundamentals 11/30: Perl 12/6: Shell & Utilities | *--------------------------------------------------------------------------* From charles.e.derykus at boeing.com Fri Oct 1 13:34:45 2004 From: charles.e.derykus at boeing.com (DeRykus, Charles E) Date: Fri Oct 1 13:34:57 2004 Subject: SPUG: interesting while() behavior and hosting recs Message-ID: <5DF8FDE8DFE8744388602480FDCC0E310451BA92@xch-nw-23.nw.nos.boeing.com> On Fri, Oct 01, 2004 at 08:25:02AM -0700, DeRykus, Charles E wrote: > > But, as we've seen Joel's post, the effects of a "list in scalar > context" in a different may altogether different and unexpected... ie, > while () ... gets parsed as for (;;). Charles DeRykus That sentence parses like a "mind in void context"... > Specifically, what qualifies > while () { statement; } > as having /anything/ to do with the conceptually understandable (albeit technically non-> > existent) "list in scalar context"? > Or, for that matter, the parens in while's close relative: > if () { statement; } > AFAIK, those parens after the keywords are *required elements of > syntax* that have nothing to do with the kind of "list formation" effect that people > associate with expressions like: > @stuff=(1,2,3); > and @stuff=(); # empty list > It seems to me that earlier posts are equating the parens in "while ()..." to those in my > empty list example above, which conflicts with my interpretation that they are merely > syntactic elements after "while". You're right. I was was over-generalizing... those parens are syntactic requirements and shouldn't have been tossed into the "list in scalar context" discussion. Maybe my "list in scalar context" just to provide a semantic handle for for parens that don't parse or work the way you think they do is a bad idea. But as you can see, parens are a tricky issue. John cites a whole thread that I presume discusses some of these subtleties. For instance, if the original expression were changed to: while (()) {... # instead of while () There would be no problem and would work exactly the same as @empty = (); while ( @empty) {... Yet, the inner paren's might be mistaken for a list. I'm not totally sure what's happening. And to repeat another subtlety I mentioned earlier, look what Perl does here: $ perl -MO=Deparse -e '$c=1;while ( ("a","b","c") ) { print "hello,world";last if ++$c>3;}' $c = 1; while ('???', '???', 'c') { print 'hello,world'; last if ++$c > 3; } -e syntax OK The ("a","b","c") might easily convince someone they had a "list in scalar context" even though it's not. But Perl treats this altogether differently than $scalar = ("a","b","c") where the list would resolve with a comma operator. Deep magic. Cheers, -- Charles DeRykus P.S. This is one of the really difficult areas. I think that's why the doc's gloss over much of the fine print. > I'll readily admit that I, like many JAPHs, have some of my own ways of thinking > about Perl that make it easier for me to use, and to teach, and that usually serve me > quite well -- despite their technically being over-simplifications of Perl's (twisted) > reality. 8-} > As a case in point, I offer the widespread notion that parens function as "list > constructors" in expressions like "@array=(1,2)" and "print (1,2)", which is > tremendously useful, despite being less than a perfectly accurate representation > of how those expressions are actually parsed and evaluated, IIRC. (What's the real > story? Is it that the comma operator in list context returns all the expressions, > so the parens are just there for reasons of precedence in the case of an assignment?) > Surely, even in Perl, there are some elements of basic syntax that can be trusted > to have concrete meanings -- like while's parens; aren't there? 8-} From joel at largest.org Fri Oct 1 14:04:12 2004 From: joel at largest.org (Joel Grow) Date: Fri Oct 1 14:04:14 2004 Subject: SPUG: interesting while() behavior and hosting recs In-Reply-To: <20041001174636.GA11923@jumpy.consultix-inc.com> References: <5DF8FDE8DFE8744388602480FDCC0E310346FE8B@xch-nw-23.nw.nos.boeing.com> <20041001174636.GA11923@jumpy.consultix-inc.com> Message-ID: On Fri, 1 Oct 2004, Tim Maher wrote: > On Fri, Oct 01, 2004 at 08:25:02AM -0700, DeRykus, Charles E wrote: > > > > But, as we've seen Joel's post, the effects of a "list in > > scalar context" in a different may altogether different and > > unexpected... ie, while () ... gets parsed as for (;;). > > Charles DeRykus > > I've been skimming this thread, but having trouble with a fundamental > element of the discussion. > > Specifically, what qualifies > > while () { statement; } > > as having /anything/ to do with the conceptually understandable (albeit > technically non-existent) "list in scalar context"? Good point, it has nothing to do with "list in a scalar context". while() of course just checks the conditional in parens for truth, and the parens are syntax, not a list. The reason I brought empty list into the discussion is that I was burned once a year or two ago with an empty list issue, where it didn't behave as I expected. I think it was with a regex match, but unfortunately I can't remember exactly what the situation was. :-) I wanted to point it out just as a debugging thing I tried. John pointed out: That is working for the same reason that for ( ;; ) { ... } works in Perl as well as in C where Perl inherited it from. I guess that's a good enough explanation, but it still seems to me like while () { } should intuitively evaluate to false. I'll get over it. Or at least memorize it. Btw, if you really want to use while() without the parens, you could do: do { print "hello world\n"; } while $x++ < 3; # not to my tastes, but tmtowtdi... Joel > Or, for that matter, the parens in while's close relative: > > if () { statement; } > > AFAIK, those parens after the keywords are *required elements of > syntax* that have nothing to do with the kind of "list formation" > effect that people associate with expressions like: > @stuff=(1,2,3); > and > @stuff=(); # empty list > > It seems to me that earlier posts are equating the parens in > "while ()..." to those in my empty list example above, which > conflicts with my interpretation that they are merely > syntactic elements after "while". > > If they're /not/ syntactic, why can't we write code like this? > while $foo { statement; } > while @foo { statement; } > or > if 1 { statement; } > > (And that code doesn't compile; I checked!) > > I'll readily admit that I, like many JAPHs, have some of my own > ways of thinking about Perl that make it easier for me to use, and > to teach, and that usually serve me quite well -- despite their > technically being over-simplifications of Perl's (twisted) > reality. 8-} > > As a case in point, I offer the widespread notion that parens > function as "list constructors" in expressions like > "@array=(1,2)" and "print (1,2)", which is tremendously useful, > despite being less than a perfectly accurate representation of > how those expressions are actually parsed and evaluated, IIRC. > (What's the real story? Is it that the comma operator in list > context returns all the expressions, so the parens are just there > for reasons of precedence in the case of an assignment?) > > Surely, even in Perl, there are some elements of basic syntax > that can be trusted to have concrete meanings -- like while's > parens; aren't there? 8-} > > *--------------------------------------------------------------------------* > | Tim Maher, CEO (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | > | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | > *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* > | Watch for my upcoming book: "Minimal Perl for Shell Users & Programmers" | > | Classes! 10/4: UNIX Fundamentals 11/30: Perl 12/6: Shell & Utilities | > *--------------------------------------------------------------------------* > _____________________________________________________________ > 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 KBuff at zetron.com Fri Oct 1 14:17:45 2004 From: KBuff at zetron.com (Kurt Buff) Date: Fri Oct 1 14:17:59 2004 Subject: SPUG: SpamAssassin 3.0.0 is released Message-ID: <054222519C2ED411A68E00508B603AC70653453C@zetxch01.zetron.com> Tim said... > On Wed, Sep 29, 2004 at 07:09:03PM -0700, Kurt Buff wrote: > > Tim said... > > > > > FWIW, here are my early impressions of the new version of > > > SpamAssassin, > > > v 3.0. > > > > > > 2) Suddenly, my formerly adequate Pentium III @ 966 Mhz feels > > > like a Pentium II at 150 Mhz. > > -Tim > > A question comes to mind - what's your MTA? I use Postfix, > and deliberately > > throttle it to only a few child processes at a time. > > -Kurt > > I believed the spamd man-page when it told me that the default > number of children for spamd was 5, but recently discovered that > the line in my /etc/init.d/postfix that started spamd was > actually requesting 20! (I guess something in the upgrade to 3.0 > slipped that into the file when I wasn't looking.) So I've > changed that command to only allow 2 simultaneous children > (spamd -m 2), > and my performance is *much* better now. > > So, nevermind! 8-} Well, that, um, interesting. I'll have to keep that in mind when I set up my new box. Kurt From charles.e.derykus at boeing.com Fri Oct 1 14:54:06 2004 From: charles.e.derykus at boeing.com (DeRykus, Charles E) Date: Fri Oct 1 14:54:15 2004 Subject: SPUG: interesting while() behavior and hosting recs Message-ID: <5DF8FDE8DFE8744388602480FDCC0E310346FE8E@xch-nw-23.nw.nos.boeing.com> >... > Specifically, what qualifies > > while () { statement; } > > as having /anything/ to do with the conceptually understandable > (albeit technically non-existent) "list in scalar context"? >> Good point, it has nothing to do with "list in a scalar context". >> while() of course just checks the conditional in parens for truth, >> and the parens are syntax, not a list. The reason I >> brought empty >> list into the discussion is that I was burned once a year or two ago with an empty list issue, where it didn't behave as I expected. I think it was with a regex match, but unfortunately I can't remember exactly what the >>situation was. I'm sure everyone now realizes there's "no list in scalar context". I mentioned it for the reasons I stated. Originally, you had contrasted the "empty list" (as you mention) with an actual array @empty and then I went errantly down the "list in scalar contest" path. The array though works because there's an actual AV struct which is resolved to the array length to satisfy the conditional. What might be construed as a list after 'while' isn't and all kinds of weirdness can ensue. > I guess that's a good enough explanation, but it still seems to me like > while () {} > should intuitively evaluate to false. I'll get over it. Or at least memorize it. I'd agree. The fact that doubling the paren's, ie, while ( () ) { .... works as expected makes this really confusing to me. -- Charles From tim at consultix-inc.com Fri Oct 1 15:22:32 2004 From: tim at consultix-inc.com (Tim Maher) Date: Fri Oct 1 15:22:39 2004 Subject: SPUG: interesting while() behavior and hosting recs In-Reply-To: <5DF8FDE8DFE8744388602480FDCC0E310451BA92@xch-nw-23.nw.nos.boeing.com> References: <5DF8FDE8DFE8744388602480FDCC0E310451BA92@xch-nw-23.nw.nos.boeing.com> Message-ID: <20041001202232.GA24649@jumpy.consultix-inc.com> On Fri, Oct 01, 2004 at 11:34:45AM -0700, DeRykus, Charles E wrote: > > And to repeat another subtlety I mentioned earlier, look what Perl does here: > > $ perl -MO=Deparse -e '$c=1;while ( ("a","b","c") ) { > print "hello,world";last if ++$c>3;}' > > $c = 1; > while ('???', '???', 'c') { As indicated on a man-page somewhere, those ??? marks indicate that the actual values provided at those locations are irrelevant, because "c" will be the result of this application of the comma operator. > print 'hello,world'; > last if ++$c > 3; > } > -e syntax OK > > The ("a","b","c") might easily convince someone they had a "list in scalar context" > even though it's not. But Perl treats this altogether differently than > $scalar = ("a","b","c") where the list would resolve with a comma operator. How does it treat it differently? I think it's the same, as indicated by no iterations of this variation on your example: $ perl -MO=Deparse -e '$c=1;while ( ("a","b",0) ) { And this deparsing of the assignment to a scalar: perl -MO=Deparse -e '$scalar = ("a","b","c") ' -e syntax OK $scalar = ('???', '???', 'c'); Look familiar? 8-} > Deep magic. > Charles DeRykus > I'm used to "deep magic" in Perl, but I don't detect its presence here. Did I miss your point, or are we miscommunicating? -- *--------------------------------------------------------------------------* | Tim Maher, CEO (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for Shell Users & Programmers" | | Classes! 10/4: UNIX Fundamentals 11/30: Perl 12/6: Shell & Utilities | *--------------------------------------------------------------------------* From charles.e.derykus at boeing.com Fri Oct 1 15:39:01 2004 From: charles.e.derykus at boeing.com (DeRykus, Charles E) Date: Fri Oct 1 15:39:07 2004 Subject: SPUG: interesting while() behavior and hosting recs Message-ID: <5DF8FDE8DFE8744388602480FDCC0E310346FE90@xch-nw-23.nw.nos.boeing.com> On Fri, Oct 01, 2004 at 11:34:45AM -0700, DeRykus, Charles E wrote: > > And to repeat another subtlety I mentioned earlier, look what Perl > does here: > > $ perl -MO=Deparse -e '$c=1;while ( ("a","b","c") ) { > print "hello,world";last if ++$c>3;}' > > $c = 1; > while ('???', '???', 'c') { >> As indicated on a man-page somewhere, >> those ??? marks indicate that the actual values provided at >> those locations are irrelevant, because "c" will be the result of this application of the comma operator. Gawd, you're good if you found that somewhere in the man pages somewhere. > > The ("a","b","c") might easily convince someone they had a "list in > scalar context" even though it's not. But Perl treats this altogether > differently than $scalar = ("a","b","c") where the list would resolve > with a comma operator. >> How does it treat it differently? I think it's the same, > $ perl -MO=Deparse -e '$c=1;while ( ("a","b",0) ) { > And this deparsing of the assignment to a scalar: > perl -MO=Deparse -e '$scalar = ("a","b","c") ' > -e syntax OK > $scalar = ('???', '???', 'c'); >I'm used to "deep magic" in Perl, but I don't detect its presence here. Did I miss your point, or are we miscommunicating? Alright shallow magic then :). Hey, if it's all so logical, why does 'while ( () )' work like 'while (@empty)' while 'while ()' doesn't.... :) Cheers, -- Charles DeRykus *--------------------------------------------------------------------------* | Tim Maher, CEO (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com | http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for Shell Users & Programmers" | | Classes! 10/4: UNIX Fundamentals 11/30: Perl 12/6: Shell & Utilities | *--------------------------------------------------------------------------* From tim at consultix-inc.com Fri Oct 1 15:40:15 2004 From: tim at consultix-inc.com (Tim Maher) Date: Fri Oct 1 15:40:34 2004 Subject: SPUG: SpamAssassin 3.0.0 is released In-Reply-To: <054222519C2ED411A68E00508B603AC70653453C@zetxch01.zetron.com> References: <054222519C2ED411A68E00508B603AC70653453C@zetxch01.zetron.com> Message-ID: <20041001204015.GA26680@jumpy.consultix-inc.com> On Fri, Oct 01, 2004 at 12:17:45PM -0700, Kurt Buff wrote: > > > > I believed the spamd man-page when it told me that the default > > number of children for spamd was 5, but recently discovered that > > the line in my /etc/init.d/postfix that started spamd was > > actually requesting 20! (I guess something in the upgrade to 3.0 > > slipped that into the file when I wasn't looking.) So I've > > changed that command to only allow 2 simultaneous children > > (spamd -m 2), > > and my performance is *much* better now. An alternative possibility is that I (unknowingly) previously ran 20 children without trouble, but after upgrading to the new version, that number proved way too high for my (1 ghz) machine to handle. -- *--------------------------------------------------------------------------* | Tim Maher, CEO (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for Shell Users & Programmers" | | Classes! 10/4: UNIX Fundamentals 11/30: Perl 12/6: Shell & Utilities | *--------------------------------------------------------------------------* From tim at consultix-inc.com Fri Oct 1 15:45:39 2004 From: tim at consultix-inc.com (Tim Maher) Date: Fri Oct 1 15:45:52 2004 Subject: SPUG: interesting while() behavior and hosting recs In-Reply-To: <5DF8FDE8DFE8744388602480FDCC0E310346FE90@xch-nw-23.nw.nos.boeing.com> References: <5DF8FDE8DFE8744388602480FDCC0E310346FE90@xch-nw-23.nw.nos.boeing.com> Message-ID: <20041001204539.GA27184@jumpy.consultix-inc.com> On Fri, Oct 01, 2004 at 01:39:01PM -0700, DeRykus, Charles E wrote: > > >> As indicated on a man-page somewhere, > >> those ??? marks indicate that the actual values provided at > >> those locations are irrelevant, because "c" will be the result of this application of the comma operator. > > Gawd, you're good if you found that somewhere in the man pages somewhere. > It's at the end of the following snippet from the Deparse man page; Enjoy! 8-} i686-linux-threUseruContribi686-linux-thread-multi::B::Deparse(3) NAME B::Deparse - Perl compiler backend to produce perl code SYNOPSIS perl -MO=Deparse[,-d][,-fFILE][,-p][,-q][,-l] [,-sLETTERS][,-xLEVEL] prog.pl DESCRIPTION . . . -p Print extra parentheses. Without this option, B::Deparse includes parentheses in its output only when they are needed, based on the structure of your program. With -p, it uses parentheses (almost) when? ever they would be legal. This can be useful if you are used to LISP, or if you want to see how perl parses your input. If you say if ($var & 0x7f == 65) {print "Gimme an A!"} print ($which ? $a : $b), "\n"; $name = $ENV{USER} or "Bob"; "B::Deparse,-p" will print if (($var & 0)) { print('Gimme an A!') }; (print(($which ? $a : $b)), '???'); (($name = $ENV{'USER'}) or '???') which probably isn't what you intended (the '???' is a sign that perl optimized away a constant value). From dark_ros at hotmail.com Fri Oct 1 19:09:02 2004 From: dark_ros at hotmail.com (Jess Ross) Date: Fri Oct 1 19:10:05 2004 Subject: SPUG: Helpme!!! net:snmp Message-ID: use Net::SNMP; # pass read/write:private my $ip_AP = '10.49.158.10'; my $sysContact = '1.3.6.1.2.1.1.4.0'; my $type = OCTET_STRING; my $value = 'Jesus Ros'; my ($session, $error) = Net::SNMP->session( -hostname => shift || $ip_AP, -community => shift || 'private'); if (!defined($session)) { printf("Error session: %s \n", $error); exit 1; } my $result = $session->set_request( -varbindlist => [$sysContact, $type, '$value']); if (!defined($result)) { printf("ERROR: %s.\n", $session->error()); $session->close(); exit 1; } $session->close; exit 0; ----------------------------------- It errors out saying: ERROR: Received noSuchName(2) error-status at error-index 0. ---------------------------------------- I execute this scrip in host wireless towards a Access Point. I'm use the community and pasword correct. Why it marks east error to me?. _________________________________________________________________ Platica con tus amigos en linea con T1msn Messenger http://messenger.t1msn.com.mx/ From chris at zorinco.com Fri Oct 1 19:44:48 2004 From: chris at zorinco.com (Chris Nielsen) Date: Fri Oct 1 19:44:52 2004 Subject: SPUG: SPF adoption Message-ID: ... follow up on the fine presentation at the last meeting.... I found a aice article on BBC about SPF... http://news.bbc.co.uk/2/hi/technology/3706828.stm Curious though, all this talk of 'the big guys' and 'fighting spam' in the news lately, and yet many of the big boys I've looked seem to not publish SPF records? Unless I'm missing something of course :-) Nothing comes back from 'host -t txt' on these... hotmail.com, comcast.net, yahoo.com, att.net Does anyone know why not (if it's true)? Surely it's not a big deal for them to make the DNS changes? Cheers, C -- Christopher Nielsen chris@ZORINco.com http://ZORINco.com ______________________________________________________________ Electronic Products - Consulting - Hosting C O N T R O L Y O U R W O R L D From andrew at sweger.net Sat Oct 2 01:19:16 2004 From: andrew at sweger.net (Andrew Sweger) Date: Sat Oct 2 01:19:18 2004 Subject: SPUG: Helpme!!! net:snmp In-Reply-To: Message-ID: On Fri, 1 Oct 2004, Jess Ross wrote: > use Net::SNMP; > [...snip...] > my $result = $session->set_request( -varbindlist => [$sysContact, $type, > '$value']); ^^^^^^^^ I'm not familiar with the symptom you're seeing, but the variable $value wrapped in single quotes looks ripe for trouble. You're adding a literal string containing the text '$value', not the value stored in the variable $value, to that anonymous array. -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. From sthoenna at efn.org Sun Oct 3 05:23:36 2004 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Sun Oct 3 05:23:41 2004 Subject: SPUG: interesting while() behavior and hosting recs In-Reply-To: <20041001174636.GA11923@jumpy.consultix-inc.com> References: <5DF8FDE8DFE8744388602480FDCC0E310346FE8B@xch-nw-23.nw.nos.boeing.com> <20041001174636.GA11923@jumpy.consultix-inc.com> Message-ID: <20041003102336.GA9152@efn.org> On Fri, Oct 01, 2004 at 10:46:36AM -0700, Tim Maher wrote: > > As a case in point, I offer the widespread notion that parens > function as "list constructors" in expressions like > "@array=(1,2)" and "print (1,2)", which is tremendously useful, > despite being less than a perfectly accurate representation of > how those expressions are actually parsed and evaluated, IIRC. > (What's the real story? Is it that the comma operator in list > context returns all the expressions, so the parens are just there > for reasons of precedence in the case of an assignment?) They are just there for reasons of precedence. Parens really really really truly don't function as list constructors. > Surely, even in Perl, there are some elements of basic syntax > that can be trusted to have concrete meanings -- like while's > parens; aren't there? 8-} While's parens are just part of the syntax; they don't function as parens; as perly.y says: loop : label WHILE '(' remember mtexpr ')' mblock cont Same thing with the parentheses around a function's parameters. From sthoenna at efn.org Sun Oct 3 05:34:20 2004 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Sun Oct 3 05:34:24 2004 Subject: SPUG: interesting while() behavior and hosting recs In-Reply-To: <5DF8FDE8DFE8744388602480FDCC0E310346FE90@xch-nw-23.nw.nos.boeing.com> References: <5DF8FDE8DFE8744388602480FDCC0E310346FE90@xch-nw-23.nw.nos.boeing.com> Message-ID: <20041003103420.GB9152@efn.org> On Fri, Oct 01, 2004 at 01:39:01PM -0700, "DeRykus, Charles E" wrote: > >> As indicated on a man-page somewhere, > >> those ??? marks indicate that the actual values provided at > >> those locations are irrelevant, because "c" will be the result of this application of the comma operator. > > Gawd, you're good if you found that somewhere in the man pages somewhere. $ man B::Deparse|fgrep -C3 '???' if (($var & 0)) { print('Gimme an A!') }; (print(($which ? $a : $b)), '???'); (($name = $ENV{'USER'}) or '???') which probably isn't what you intended (the '???' is a sign that perl optimized away a constant value). -P Disable prototype checking. With this option, all function calls -- values include 0, 1, 42, '', 'foo', and 'Useless use of con- stant omitted' (which may need to be -sv"'Useless use of con- stant omitted'." or something similar depending on your shell). The default is '???'. If you're using B::Deparse on a module or other file that's require'd, you shouldn't use a value that evaluates to false, since the customary true con- stant at the end of a module will be in void context when the -- produced is already ordinary Perl which shouldn't be filtered again. o Optimised away statements are rendered as '???'. This includes statements that have a compile-time side-effect, such as the obscure Note that the '???' is a default and can be overridden: $ perl -MO=Deparse,-sv'"what do you get if you multiply 6 by 9".' -e42 "what do you get if you multiply 6 by 9"; -e syntax OK From krahnj at telus.net Sun Oct 3 05:58:00 2004 From: krahnj at telus.net (John W. Krahn) Date: Sun Oct 3 05:58:21 2004 Subject: SPUG: interesting while() behavior and hosting recs In-Reply-To: References: <5DF8FDE8DFE8744388602480FDCC0E310346FE8B@xch-nw-23.nw.nos.boeing.com> <20041001174636.GA11923@jumpy.consultix-inc.com> Message-ID: <415FDB38.1010809@telus.net> Joel Grow wrote: > > John pointed out: > > That is working for the same reason that > > for ( ;; ) { ... } > > works in Perl as well as in C where Perl inherited it from. > > I guess that's a good enough explanation, but it still seems to me like > > while () { > } > > should intuitively evaluate to false. I'll get over it. Or at least > memorize it. > > Btw, if you really want to use while() without the parens, you could do: > > do { > print "hello world\n"; > } while $x++ < 3; > > # not to my tastes, but tmtowtdi... You could but it has two differences from "while (EXPR) {CODE BLOCK}". The first is that the code block executes first before the expr is evaluated (just like in C) and second is that using do {} means that the keywords 'next', 'last' and 'redo' won't work without adding another pair of braces to create a loop. If you have a single statement like your example then you could just use 'print "hello world\n" while $x++ < 3;' John -- use Perl; program fulfillment From krahnj at telus.net Sun Oct 3 06:09:32 2004 From: krahnj at telus.net (John W. Krahn) Date: Sun Oct 3 06:09:52 2004 Subject: SPUG: interesting while() behavior and hosting recs In-Reply-To: <20041003102336.GA9152@efn.org> References: <5DF8FDE8DFE8744388602480FDCC0E310346FE8B@xch-nw-23.nw.nos.boeing.com> <20041001174636.GA11923@jumpy.consultix-inc.com> <20041003102336.GA9152@efn.org> Message-ID: <415FDDEC.2030501@telus.net> Yitzchak Scott-Thoennes wrote: > On Fri, Oct 01, 2004 at 10:46:36AM -0700, Tim Maher wrote: > >>As a case in point, I offer the widespread notion that parens >>function as "list constructors" in expressions like >>"@array=(1,2)" and "print (1,2)", which is tremendously useful, >>despite being less than a perfectly accurate representation of >>how those expressions are actually parsed and evaluated, IIRC. >>(What's the real story? Is it that the comma operator in list >>context returns all the expressions, so the parens are just there >>for reasons of precedence in the case of an assignment?) > > They are just there for reasons of precedence. Parens really really > really truly don't function as list constructors. So in the expressions: while ( () ) { print "this won't print\n" } $count = () = $string =~ /\d+/g; You are saying that there is no list? John -- use Perl; program fulfillment From sthoenna at efn.org Sun Oct 3 07:16:53 2004 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Sun Oct 3 07:16:58 2004 Subject: SPUG: interesting while() behavior and hosting recs In-Reply-To: <415FDDEC.2030501@telus.net> References: <5DF8FDE8DFE8744388602480FDCC0E310346FE8B@xch-nw-23.nw.nos.boeing.com> <20041001174636.GA11923@jumpy.consultix-inc.com> <20041003102336.GA9152@efn.org> <415FDDEC.2030501@telus.net> Message-ID: <20041003121653.GE9152@efn.org> On Sun, Oct 03, 2004 at 04:09:32AM -0700, "John W. Krahn" wrote: > Yitzchak Scott-Thoennes wrote: > > >They are just there for reasons of precedence. Parens really really > >really truly don't function as list constructors. > > So in the expressions: > > while ( () ) { print "this won't print\n" } > > $count = () = $string =~ /\d+/g; > > You are saying that there is no list? :) For every rule, there's an exception; () is the exception here. But it doesn't work by way of some grammatical rule that what's inside () is a list; empty parens are handled in perl's grammar as a special case. I guess you could look at it as the parentheses being required to delimit the empty list for which there is no other syntactic provision. From krahnj at telus.net Sun Oct 3 08:30:44 2004 From: krahnj at telus.net (John W. Krahn) Date: Sun Oct 3 08:31:05 2004 Subject: SPUG: interesting while() behavior and hosting recs In-Reply-To: <20041003121653.GE9152@efn.org> References: <5DF8FDE8DFE8744388602480FDCC0E310346FE8B@xch-nw-23.nw.nos.boeing.com> <20041001174636.GA11923@jumpy.consultix-inc.com> <20041003102336.GA9152@efn.org> <415FDDEC.2030501@telus.net> <20041003121653.GE9152@efn.org> Message-ID: <415FFF04.1090609@telus.net> Yitzchak Scott-Thoennes wrote: > On Sun, Oct 03, 2004 at 04:09:32AM -0700, "John W. Krahn" wrote: > >>Yitzchak Scott-Thoennes wrote: >> >>>They are just there for reasons of precedence. Parens really really >>>really truly don't function as list constructors. >> >>So in the expressions: >> >>while ( () ) { print "this won't print\n" } >> >>$count = () = $string =~ /\d+/g; >> >>You are saying that there is no list? > > :) For every rule, there's an exception; () is the exception here. > > But it doesn't work by way of some grammatical rule that what's inside > () is a list; empty parens are handled in perl's grammar as a special > case. I guess you could look at it as the parentheses being required > to delimit the empty list for which there is no other syntactic > provision. I concur. :-) Yet I could argue that, in the second example, if the parentheses did delimit an empty list then $count would always contain 0. ;-} John -- use Perl; program fulfillment From umar at drizzle.com Mon Oct 4 13:58:14 2004 From: umar at drizzle.com (Umar Cheema) Date: Mon Oct 4 13:58:17 2004 Subject: SPUG: web host In-Reply-To: <200401222039.i0MKdOsq014921@catmanor.com> Message-ID: A couple of weeks ago someone mentioned the name of a good web hosting service on the list. I seemed to have misplaced that email. I am looking for a unix based web hosting service provider that will give me the basic stuff such as ssh, ftp, cgis, pine, etc and a decent amount of disk space. Any recommendations will be appreciated. Thanks, Umar From asimjalis at gmail.com Mon Oct 4 16:15:35 2004 From: asimjalis at gmail.com (Asim Jalis) Date: Mon Oct 4 16:15:53 2004 Subject: SPUG: web host In-Reply-To: References: <200401222039.i0MKdOsq014921@catmanor.com> Message-ID: <88d9159a04100414152cfac03@mail.gmail.com> Hi Umar, I have been using pair.com for the last 3 years and have had a good experience with them. Asim On Mon, 4 Oct 2004 11:58:14 -0700 (PDT), Umar Cheema wrote: > A couple of weeks ago someone mentioned the name of a good web hosting > service on the list. I seemed to have misplaced that email. I am looking > for a unix based web hosting service provider that will give me the basic > stuff such as ssh, ftp, cgis, pine, etc and a decent amount of disk space. > > Any recommendations will be appreciated. > > Thanks, > Umar > > _____________________________________________________________ > 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 > -- http://asimjalis.blogspot.com From aaron at activox.com Mon Oct 4 16:20:35 2004 From: aaron at activox.com (aaron salo) Date: Mon Oct 4 16:21:26 2004 Subject: SPUG: ! In-Reply-To: <88d9159a04100414152cfac03@mail.gmail.com> References: <200401222039.i0MKdOsq014921@catmanor.com> <88d9159a04100414152cfac03@mail.gmail.com> Message-ID: <4161BEA3.1060906@activox.com> Two votes for pair.com. I have been with them since 1996. Very very reliable. ~a Asim Jalis wrote: >Hi Umar, > >I have been using pair.com for the last 3 years and have had a good >experience with them. > >Asim > > >On Mon, 4 Oct 2004 11:58:14 -0700 (PDT), Umar Cheema wrote: > > >>A couple of weeks ago someone mentioned the name of a good web hosting >>service on the list. I seemed to have misplaced that email. I am looking >>for a unix based web hosting service provider that will give me the basic >>stuff such as ssh, ftp, cgis, pine, etc and a decent amount of disk space. >> >>Any recommendations will be appreciated. >> >>Thanks, >>Umar >> >>_____________________________________________________________ >>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 kenslinux at shaw.ca Mon Oct 4 16:35:33 2004 From: kenslinux at shaw.ca (Ken Clarke) Date: Mon Oct 4 16:35:39 2004 Subject: SPUG: Re: web host References: Message-ID: <002f01c4aa5a$147b4ce0$37476d18@kens> Check out http://positivefusion.com Their tech support is second to none. Very knowledgeable and responsive to even highly technical requests. Want a perl module installed? Submit a support ticket and grab a cup of coffee - done. I asked about certain mod_perl functionality once and they recompiled Apache for me :) >> Ken Clarke >> Contract Web Programmer / E-commerce Technologist ----- Original Message ----- From: "Umar Cheema" To: Sent: Monday, October 04, 2004 11:58 AM Subject: SPUG: web host >A couple of weeks ago someone mentioned the name of a good web hosting > service on the list. I seemed to have misplaced that email. I am looking > for a unix based web hosting service provider that will give me the basic > stuff such as ssh, ftp, cgis, pine, etc and a decent amount of disk space. > > Any recommendations will be appreciated. > > Thanks, > Umar > > _____________________________________________________________ > 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 james at banshee.com Mon Oct 4 19:01:06 2004 From: james at banshee.com (James Moore) Date: Mon Oct 4 19:01:09 2004 Subject: SPUG: web host In-Reply-To: Message-ID: <200410050001.i95016a02146@server2.chocolatelust.com> I liked rackspace.com, but they're on the expensive side. If what you need, though, is your own server all to yourself, their price becomes very competitive. Everyone else I looked at who was willing to give you an entire server to yourself was significantly more expensive. My experience is a bit out of date though; it's probably been about a year since I had this set up. -- James From ivandh at comcast.net Mon Oct 4 20:44:33 2004 From: ivandh at comcast.net (Ivan Heffner) Date: Mon Oct 4 20:44:36 2004 Subject: SPUG: web host In-Reply-To: References: <200401222039.i0MKdOsq014921@catmanor.com> Message-ID: <6.1.0.6.0.20041004184038.034d3720@mail.comcast.net> I'm using RimuHosting. $20/mo for a 2GB Virtual Linux Machine. Essentially, they set up your account with one of several images, give you root and let you do with it as you choose. Prices go up with increased memory, storage, and bandwidth. Ivan At 10/4/2004 11:58 AM, Umar Cheema wrote: >A couple of weeks ago someone mentioned the name of a good web hosting >service on the list. I seemed to have misplaced that email. I am looking >for a unix based web hosting service provider that will give me the basic >stuff such as ssh, ftp, cgis, pine, etc and a decent amount of disk space. > >Any recommendations will be appreciated. > >Thanks, >Umar > >_____________________________________________________________ >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 moonbeam at catmanor.com Mon Oct 4 21:46:54 2004 From: moonbeam at catmanor.com (William Julien) Date: Mon Oct 4 21:46:55 2004 Subject: SPUG: web host Message-ID: <200410050246.i952ksTj019883@catmanor.com> How about drizzle? That's where I have my web space. William >From: Umar Cheema > >A couple of weeks ago someone mentioned the name of a good web hosting >service on the list. I seemed to have misplaced that email. I am looking >for a unix based web hosting service provider that will give me the basic >stuff such as ssh, ftp, cgis, pine, etc and a decent amount of disk space. > >Any recommendations will be appreciated. > >Thanks, >Umar > >_____________________________________________________________ >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 jsl at blarg.net Tue Oct 5 08:27:27 2004 From: jsl at blarg.net (Jim Ludwig) Date: Tue Oct 5 08:27:36 2004 Subject: SPUG: web host In-Reply-To: <200410050246.i952ksTj019883@catmanor.com> (message from William Julien on Mon, 4 Oct 2004 19:46:54 -0700) Message-ID: What about Speakeasy? http://speakeasy.net/hosting/web_host.php Cheers, jim >> Date: Mon, 4 Oct 2004 19:46:54 -0700 >> From: William Julien >> To: spug-list@mail.pm.org, umar@drizzle.com >> Subject: Re: SPUG: web host >> >> How about drizzle? >> >> That's where I have my web space. >> >> William >> >> >From: Umar Cheema >> > >> >A couple of weeks ago someone mentioned the >> >name of a good web hosting service on the >> >list. I seemed to have misplaced that email. I >> >am looking for a unix based web hosting >> >service provider that will give me the basic >> >stuff such as ssh, ftp, cgis, pine, etc and a >> >decent amount of disk space. >> > >> >Any recommendations will be appreciated. >> > >> >Thanks, >> >Umar From umar at drizzle.com Tue Oct 5 11:35:55 2004 From: umar at drizzle.com (Umar Cheema) Date: Tue Oct 5 11:36:13 2004 Subject: SPUG: web host In-Reply-To: Message-ID: Thanks for all the recommendations guys. Umar On Tue, 5 Oct 2004, Jim Ludwig wrote: > What about Speakeasy? > > http://speakeasy.net/hosting/web_host.php > > Cheers, > jim > > >> Date: Mon, 4 Oct 2004 19:46:54 -0700 > >> From: William Julien > >> To: spug-list@mail.pm.org, umar@drizzle.com > >> Subject: Re: SPUG: web host > >> > >> How about drizzle? > >> > >> That's where I have my web space. > >> > >> William > >> > >> >From: Umar Cheema > >> > > >> >A couple of weeks ago someone mentioned the > >> >name of a good web hosting service on the > >> >list. I seemed to have misplaced that email. I > >> >am looking for a unix based web hosting > >> >service provider that will give me the basic > >> >stuff such as ssh, ftp, cgis, pine, etc and a > >> >decent amount of disk space. > >> > > >> >Any recommendations will be appreciated. > >> > > >> >Thanks, > >> >Umar > _____________________________________________________________ > 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 james at banshee.com Tue Oct 5 12:12:45 2004 From: james at banshee.com (James Moore) Date: Tue Oct 5 12:13:01 2004 Subject: SPUG: web host In-Reply-To: Message-ID: <200410051712.i95HCga12301@server2.chocolatelust.com> I have friends in the May Area who rented an entire rack and share it out amongst themselves. Is anybody up here doing the same sort of thing? Seems like it makes sense if you don't care about tech support (or, more precisely, you plan to do all of the tech support yourself) and you want a lot of control over the systems. -- James From haircut at gmail.com Tue Oct 5 12:16:42 2004 From: haircut at gmail.com (Adam Monsen) Date: Tue Oct 5 12:17:04 2004 Subject: SPUG: where be the wiki? Message-ID: <9ebd651104100510162f17b73a@mail.gmail.com> Anyone know what happened to the wiki? -- Adam Monsen http://adammonsen.com/ From andrew at sweger.net Tue Oct 5 12:25:08 2004 From: andrew at sweger.net (Andrew Sweger) Date: Tue Oct 5 12:25:11 2004 Subject: SPUG: where be the wiki? In-Reply-To: <9ebd651104100510162f17b73a@mail.gmail.com> Message-ID: On Tue, 5 Oct 2004, Adam Monsen wrote: > Anyone know what happened to the wiki? Oops. My bad. I'll get that fixed soon(-ish). -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. From lmzaldivar at mac.com Tue Oct 5 15:37:56 2004 From: lmzaldivar at mac.com (Luis Medrano) Date: Tue Oct 5 15:37:58 2004 Subject: SPUG: lenght of string Message-ID: <13727387.1097008676110.JavaMail.lmzaldivar@mac.com> List, How can I found out what is the lenght of a string? Thanks, Luis From umar at drizzle.com Tue Oct 5 15:43:18 2004 From: umar at drizzle.com (Umar Cheema) Date: Tue Oct 5 15:43:38 2004 Subject: SPUG: lenght of string In-Reply-To: <13727387.1097008676110.JavaMail.lmzaldivar@mac.com> Message-ID: print length( $string ); On Tue, 5 Oct 2004, Luis Medrano wrote: > List, > > How can I found out what is the lenght of a string? > > Thanks, > Luis > > _____________________________________________________________ > 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 joneil at cobaltgroup.com Tue Oct 5 15:43:42 2004 From: joneil at cobaltgroup.com (O'neil, Jerome) Date: Tue Oct 5 15:43:51 2004 Subject: SPUG: lenght of string Message-ID: <25160AB2660F8B449892B0EB9C29C16501E6649C@ex-sea-is2.main.cobaltgroup.com> %length EXPR has always worked for me. perldoc -f length for wisdom. -J -----Original Message----- From: spug-list-bounces@mail.pm.org [mailto:spug-list-bounces@mail.pm.org]On Behalf Of Luis Medrano Sent: Tuesday, October 05, 2004 1:38 PM To: spug-list@mail.pm.org Subject: SPUG: lenght of string List, How can I found out what is the lenght of a string? Thanks, Luis _____________________________________________________________ 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 rkosai at u.washington.edu Tue Oct 5 15:45:31 2004 From: rkosai at u.washington.edu (Ryan T. Kosai) Date: Tue Oct 5 15:45:41 2004 Subject: SPUG: lenght of string In-Reply-To: <13727387.1097008676110.JavaMail.lmzaldivar@mac.com> References: <13727387.1097008676110.JavaMail.lmzaldivar@mac.com> Message-ID: <416307EB.5020406@u.washington.edu> Hi Luis, You'll want to usually check the perlfunc reference before you post questions like this to the mailing list. Keep in mind how many people this mailing list goes to. For your reference, there is a length function: my $str_length = length($string); Ryan From kenslinux at shaw.ca Tue Oct 5 16:31:01 2004 From: kenslinux at shaw.ca (Ken Clarke) Date: Tue Oct 5 16:31:08 2004 Subject: SPUG: lenght of string References: <25160AB2660F8B449892B0EB9C29C16501E6649C@ex-sea-is2.main.cobaltgroup.com> Message-ID: <002001c4ab22$9c873180$37476d18@kens> While we're on the subject of the length function... I've noticed that ActiveState Perl v 5.8.3 seems to ignore the use bytes pragma mentioned in the docs. This snippet reports the length as 3 bytes when in fact it's 4: "\x31\x0D\x0A\x33" my $string = "1\n2"; do { use bytes; print length($string); }; I had to add the following work around when setting the Content-Length HTTP header for file downloading: $size = length($download_file); if ($^O =~ /win/i) { my $cr_count = $$download_file =~ tr/\n//; $cr_count ||= 0; $size += $cr_count; } Comments? >> Ken Clarke >> Contract Web Programmer / E-commerce Technologist ----- Original Message ----- From: "O'neil, Jerome" To: Sent: Tuesday, October 05, 2004 1:43 PM Subject: RE: SPUG: lenght of string > %length EXPR has always worked for me. > > perldoc -f length for wisdom. > > -J From jlb at io.com Tue Oct 5 16:52:43 2004 From: jlb at io.com (jlb) Date: Tue Oct 5 16:52:51 2004 Subject: SPUG: web host In-Reply-To: <200410051712.i95HCga12301@server2.chocolatelust.com> Message-ID: When I was reaching cheap, local colo I came across cm2.com. They seemed to have a flexible enough plan for my needs. I never actually used them, though, so I can't personally vouch, but if anyone else ends up using them or has past experience with them I'd be interested in hearing about it. Jon On Tue, 5 Oct 2004, James Moore wrote: > I have friends in the May Area who rented an entire rack and share it out > amongst themselves. Is anybody up here doing the same sort of thing? Seems > like it makes sense if you don't care about tech support (or, more > precisely, you plan to do all of the tech support yourself) and you want a > lot of control over the systems. > > -- James > > > _____________________________________________________________ > 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 Tue Oct 5 17:07:59 2004 From: tim at consultix-inc.com (Tim Maher) Date: Tue Oct 5 17:08:04 2004 Subject: SPUG: lenght of string In-Reply-To: <25160AB2660F8B449892B0EB9C29C16501E6649C@ex-sea-is2.main.cobaltgroup.com> References: <25160AB2660F8B449892B0EB9C29C16501E6649C@ex-sea-is2.main.cobaltgroup.com> Message-ID: <20041005220759.GA20942@jumpy.consultix-inc.com> On Tue, Oct 05, 2004 at 01:43:42PM -0700, O'neil, Jerome wrote: > %length EXPR has always worked for me. No it hasn't! > -J *--------------------------------------------------------------------------* | Tim Maher, CEO (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for Shell Users & Programmers" | | Classes! 10/4: UNIX Fundamentals 11/30: Perl 12/6: Shell & Utilities | *--------------------------------------------------------------------------* From sthoenna at efn.org Tue Oct 5 17:12:58 2004 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Tue Oct 5 17:13:16 2004 Subject: SPUG: lenght of string In-Reply-To: <002001c4ab22$9c873180$37476d18@kens> References: <25160AB2660F8B449892B0EB9C29C16501E6649C@ex-sea-is2.main.cobaltgroup.com> <002001c4ab22$9c873180$37476d18@kens> Message-ID: <20041005221258.GA7040@efn.org> On Tue, Oct 05, 2004 at 02:31:01PM -0700, Ken Clarke wrote: > While we're on the subject of the length function... > > I've noticed that ActiveState Perl v 5.8.3 seems to ignore the use bytes > pragma mentioned in the docs. > > This snippet reports the length as 3 bytes when in fact it's 4: > "\x31\x0D\x0A\x33" > > my $string = "1\n2"; > do { > use bytes; > print length($string); > }; I think you are under a misapprehension. It really is just 3 bytes, but if you output it to a filehandle that does crlf conversion, you will get 4 bytes of output. Everything is designed so that a program only has to worry about a single line-end character; CR's get stripped off as you read things in and added as you write things out. If you are needing to count actual bytes of output, you may want to use a binmode filehandle and just manually use "\r\n" yourself (or "\015\012" if you have to worry about old Macs.) From joneil at cobaltgroup.com Tue Oct 5 17:22:20 2004 From: joneil at cobaltgroup.com (O'neil, Jerome) Date: Tue Oct 5 17:22:33 2004 Subject: SPUG: lenght of string Message-ID: <25160AB2660F8B449892B0EB9C29C16501E6649D@ex-sea-is2.main.cobaltgroup.com> Yes it has! -----Original Message----- From: Tim Maher [mailto:tim@consultix-inc.com] Sent: Tuesday, October 05, 2004 3:08 PM To: O'neil, Jerome Cc: spug-list@mail.pm.org Subject: Re: SPUG: lenght of string On Tue, Oct 05, 2004 at 01:43:42PM -0700, O'neil, Jerome wrote: > %length EXPR has always worked for me. No it hasn't! > -J *--------------------------------------------------------------------------* | Tim Maher, CEO (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for Shell Users & Programmers" | | Classes! 10/4: UNIX Fundamentals 11/30: Perl 12/6: Shell & Utilities | *--------------------------------------------------------------------------* From tim at consultix-inc.com Tue Oct 5 18:15:04 2004 From: tim at consultix-inc.com (Tim Maher) Date: Tue Oct 5 18:15:12 2004 Subject: SPUG: lenght of string In-Reply-To: <25160AB2660F8B449892B0EB9C29C16501E6649D@ex-sea-is2.main.cobaltgroup.com> References: <25160AB2660F8B449892B0EB9C29C16501E6649D@ex-sea-is2.main.cobaltgroup.com> Message-ID: <20041005231504.GA25360@jumpy.consultix-inc.com> On Tue, Oct 05, 2004 at 03:22:20PM -0700, O'neil, Jerome wrote: > Yes it has! Really? Please explain. What's %length EXPR, if not just a typo for length EXPR? *--------------------------------------------------------------------------* | Tim Maher, CEO (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for Shell Users & Programmers" | | Classes! 10/4: UNIX Fundamentals 11/30: Perl 12/6: Shell & Utilities | *--------------------------------------------------------------------------* From dha at panix.com Tue Oct 5 22:53:49 2004 From: dha at panix.com (David H. Adler) Date: Tue Oct 5 22:53:51 2004 Subject: SPUG: lenght of string In-Reply-To: <20041005231504.GA25360@jumpy.consultix-inc.com> References: <25160AB2660F8B449892B0EB9C29C16501E6649D@ex-sea-is2.main.cobaltgroup.com> <20041005231504.GA25360@jumpy.consultix-inc.com> Message-ID: <20041006035349.GA25218@panix.com> On Tue, Oct 05, 2004 at 04:15:04PM -0700, Tim Maher wrote: > On Tue, Oct 05, 2004 at 03:22:20PM -0700, O'neil, Jerome wrote: > > Yes it has! > > Really? Please explain. What's %length EXPR, if not just a typo > for length EXPR? I was assuming that the '%' was a prompt. On the other hand, people asking how to find the length of a string is a pet peeve of mine. *shrug* dha -- David H. Adler - - http://www.panix.com/~dha/ And, considering the prevalence of displaced psychiatric patients among the ranks of the homeless, the viewpoints are usually guaranteed to involve aliens or 7 foot tall magical cats. - Mark Rogaski From cjcollier at colliertech.org Wed Oct 6 01:51:43 2004 From: cjcollier at colliertech.org (C.J. Collier) Date: Wed Oct 6 01:52:07 2004 Subject: SPUG: lenght of string In-Reply-To: <13727387.1097008676110.JavaMail.lmzaldivar@mac.com> References: <13727387.1097008676110.JavaMail.lmzaldivar@mac.com> Message-ID: <2E9C48B8-1764-11D9-A938-000A95CA2B00@colliertech.org> Heya Luis, It seems like your question has been answered quite a few times. Woo :) I suggest that you monitor beginners@perl.org as well. It's a great way to get familiar with Perl the language. http://lists.perl.org/showlist.cgi?name=beginners Cheers, C.J. On Oct 5, 2004, at 1:37 PM, Luis Medrano wrote: > List, > > How can I found out what is the lenght of a string? > > Thanks, > Luis > > _____________________________________________________________ > 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 Oct 6 03:05:07 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Wed Oct 6 03:06:26 2004 Subject: SPUG: SDBM & CGI request for information and pointers Message-ID: <6.1.2.0.0.20041006010133.0764bf30@ipostoffice.worldnet.att.net> I got this question from a friend of mine, wondering where he could post such a question. I don't know the answers. Do you? Reply to the list or to me -- I'll get the answers back to him. On behalf of my friend -- thanks! Michael Wolf ============================ I've got two Perl questions maybe you can help with: 1 - Where can I learn more about the Perl "sdbm" database - the one that ties hashes to a file? I've discovered that it's easily corruptable by assigning a large (e.g., 1000-byte) value to a key. But I have no idea why, or what conditions create that limit. I've tried trying to find out what the limit is empirically, but it seems to depend on parameters I don't know about, because what works one time may not work the next. Is there real documentation for this? What I find on my system is very scant. (FYI: I'm required to "use POSIX" and "use SDBM_File" to use this feature.) Is there a Perl forum or discussion group that covers this (for people at my modest level of expertise)? 2. In order to get any kind of error return at all for the above problem I have to have this active: use CGI::Carp 'fatalsToBrowser'; #During testing only But I'm told this is a security problem (I don't know why). Is there any way to issue this "use", then rescind it when I'm past where the problem might be? Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net From m3047 at inwa.net Wed Oct 6 05:51:58 2004 From: m3047 at inwa.net (Fred Morris) Date: Wed Oct 6 06:01:33 2004 Subject: SPUG: lenght of string Message-ID: Not intentionally quoting out of context.. At 3:12 PM 10/5/04, Yitzchak Scott-Thoennes wrote: >On Tue, Oct 05, 2004 at 02:31:01PM -0700, Ken Clarke wrote: >>[...] >> This snippet reports the length as 3 bytes when in fact it's 4: >> "\x31\x0D\x0A\x33" >>[...] >> my $string = "1\n2"; >[...] >I think you are under a misapprehension. > >It really is just 3 bytes, but if you output it to a filehandle that >does crlf conversion, you will get 4 bytes of output. Everything is >designed so that a program only has to worry about a single line-end >character; CR's get stripped off as you read things in and added as >you write things out. No they aren't!? :-p Actually I suspect you are correct in this specific case, but in the tradition of the language typically used to specify RFCs I think "you will" (must) is overstating the case and is more likely "you may". Recall that the original poster was specifically referring to the context of computing the length for a Content-Length header. Here's the interesting thing: although it is widely ignored, all of the protocols which I recall which utilize a Content-Length header specify \r\n as the official line terminator (a fact which warms my impact printer, mechanical control code, dinosaur lizard heart). >If you are needing to count actual bytes of output, you may want to >use a binmode filehandle and just manually use "\r\n" yourself (or >"\015\012" if you have to worry about old Macs.) See above... As a further example 821/822 (not sure about son-of-821/822) has specific admonitions against bare LFs although in the grand tradition most MTAs have been willing to overlook this. If an MTA or other server isn't willing to overlook these sorts of things, then it obviously has two options: fix it or reject it. A strict reading of various RFCs would seem to indicate a general bias towards rejection rather than repair (but only in those cases where acceptance is not, well, acceptable), which may be overstating the case as well, perhaps better to say that if you "repair" you are no longer "forwarding". (Fixing the blame on ActiveState may be misplaced.) (Repairs which are broken is probably the rationale for the bias towards rejection.) Off topic: have you actually ever found a standard for "crlf conversion"? -- FWM From joneil at cobaltgroup.com Wed Oct 6 11:30:12 2004 From: joneil at cobaltgroup.com (O'neil, Jerome) Date: Wed Oct 6 11:30:22 2004 Subject: SPUG: lenght of string Message-ID: <25160AB2660F8B449892B0EB9C29C16501E664A4@ex-sea-is2.main.cobaltgroup.com> Jebuz, Tim, of all the people in the universe, I wouldn't have expected pedantry from you. perldoc -f length length EXPR length Returns the length in characters of the value of EXPR. If EXPR is omitted, returns length of $_. Note that this cannot be used on an entire array or hash to find out how many elements these have. For that, use "scalar @array" and "scalar keys %hash" respectively. Works for me, every time. -J -----Original Message----- From: Tim Maher [mailto:tim@consultix-inc.com] Sent: Tuesday, October 05, 2004 4:15 PM To: O'neil, Jerome Cc: 'tim@consultix-inc.com'; spug-list@mail.pm.org Subject: Re: SPUG: lenght of string On Tue, Oct 05, 2004 at 03:22:20PM -0700, O'neil, Jerome wrote: > Yes it has! Really? Please explain. What's %length EXPR, if not just a typo for length EXPR? *--------------------------------------------------------------------------* | Tim Maher, CEO (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for Shell Users & Programmers" | | Classes! 10/4: UNIX Fundamentals 11/30: Perl 12/6: Shell & Utilities | *--------------------------------------------------------------------------* From sthoenna at efn.org Wed Oct 6 11:44:12 2004 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Wed Oct 6 11:44:19 2004 Subject: SPUG: SDBM & CGI request for information and pointers In-Reply-To: <6.1.2.0.0.20041006010133.0764bf30@ipostoffice.worldnet.att.net> References: <6.1.2.0.0.20041006010133.0764bf30@ipostoffice.worldnet.att.net> Message-ID: <20041006164411.GA11992@efn.org> On Wed, Oct 06, 2004 at 01:05:07AM -0700, "Michael R. Wolf" wrote: > I got this question from a friend of mine, wondering where he could post > such a question. I don't know the answers. Do you? How about http://perlmonks.org/?node=Seekers%20of%20Perl%20Wisdom > 1 - Where can I learn more about the Perl "sdbm" database - the one > that ties hashes to a file? I've discovered that it's easily > corruptable by assigning a large (e.g., 1000-byte) value to a > key. But I have no idea why, or what conditions create that > limit. I've tried trying to find out what the limit is empirically, > but it seems to depend on parameters I don't know about, because > what works one time may not work the next. Is there real > documentation for this? What I find on my system is very > scant. (FYI: I'm required to "use POSIX" and "use SDBM_File" to use > this feature.) Is there a Perl forum or discussion group that covers > this (for people at my modest level of expertise)? perldoc SDBM_File says: There are a number of limits on the size of the data that you can store in the SDBM file. The most important is that the length of a key, plus the length of its associated value, may not exceed 1008 bytes. I believe it can be tweaked to have a different limit when you build it (at the expense of incompatibility with old data files). perldoc AnyDBM_File has a comparison of the different *DB*_File packages: odbm ndbm sdbm gdbm bsd-db ---- ---- ---- ---- ------ Linkage comes w/ perl yes yes yes yes yes Src comes w/ perl no no yes no no Comes w/ many unix os yes yes[0] no no no Builds ok on !unix ? ? yes yes ? Code Size ? ? small big big Database Size ? ? small big? ok[1] Speed ? ? slow ok fast FTPable no no yes yes yes Easy to build N/A N/A yes yes ok[2] Size limits 1k 4k 1k[3] none none > 2. In order to get any kind of error return at all for the above problem I > have > to have this active: > > use CGI::Carp 'fatalsToBrowser'; #During testing only > But I'm told this is a security problem (I don't know why). Is there > any way to issue this "use", then rescind it when I'm past where the > problem might be? Without that, the errors will go the the webserver's error logs. You should be able to see them there. Using fatalsToBrowser is just a convenience to use while developing. The security issue is that if something goes wrong and fatalsToBrowser shows an error to your users, the error message may give black hats enough info for an exploit of some kind. If you are only assigning to your hash in a few places, wrap the assignments in eval { } and detect errors afterward by testing $@ && $@=~/sdbm store/; From tim at consultix-inc.com Wed Oct 6 13:11:08 2004 From: tim at consultix-inc.com (Tim Maher) Date: Wed Oct 6 13:11:15 2004 Subject: SPUG: lenght of string In-Reply-To: <25160AB2660F8B449892B0EB9C29C16501E664A4@ex-sea-is2.main.cobaltgroup.com> References: <25160AB2660F8B449892B0EB9C29C16501E664A4@ex-sea-is2.main.cobaltgroup.com> Message-ID: <20041006181108.GA2498@jumpy.consultix-inc.com> On Wed, Oct 06, 2004 at 09:30:12AM -0700, O'neil, Jerome wrote: > Jebuz, Tim, of all the people in the universe, I wouldn't have expected > pedantry from you. > > perldoc -f length > length EXPR > length Returns the length in characters of the value of > Works for me, every time. > > -J My point was a technical one having to do with correct syntax (sorry if you thought I was being pedantic, but as a teacher, that's what I get paid for!) Specifically, the Perl technique for determining the length of a string is "length EXPR", not "%length EXPR" (which looks like a hash followed by a scalar). The post in question showed %length, which was incorrect. As a courtesy to those who are growing tired of this thread, I'll resist the temptation to question the spelling of the word "Jebuz", which appears at the start of your message 8-} -Tim *--------------------------------------------------------------------------* | Tim Maher, CEO (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for Shell Users & Programmers" | | Classes! 10/4: UNIX Fundamentals 11/30: Perl 12/6: Shell & Utilities | *--------------------------------------------------------------------------* From james at banshee.com Wed Oct 6 13:24:01 2004 From: james at banshee.com (James Moore) Date: Wed Oct 6 13:24:18 2004 Subject: SPUG: lenght of string In-Reply-To: <20041006181108.GA2498@jumpy.consultix-inc.com> Message-ID: <200410061824.i96IO0a28251@server2.chocolatelust.com> I'm with Tim on this one. In the world of software, beating a "pedantic" is frequently a life or death question, not a question of being irritating or not. The syntax as originally stated, including the percentage sign, is wrong. -- James From dha at panix.com Wed Oct 6 13:41:47 2004 From: dha at panix.com (David H. Adler) Date: Wed Oct 6 13:41:50 2004 Subject: SPUG: lenght of string In-Reply-To: <20041006181108.GA2498@jumpy.consultix-inc.com> References: <25160AB2660F8B449892B0EB9C29C16501E664A4@ex-sea-is2.main.cobaltgroup.com> <20041006181108.GA2498@jumpy.consultix-inc.com> Message-ID: <20041006184147.GB12536@panix.com> On Wed, Oct 06, 2004 at 11:11:08AM -0700, Tim Maher wrote: > > Specifically, the Perl technique for determining the length of a > string is "length EXPR", not "%length EXPR" (which looks like a hash > followed by a scalar). Ahem. s/scalar/bareword/ :-) dha, 'pedantics backwards-r us' -- David H. Adler - - http://www.panix.com/~dha/ "scanf() is evil." From joneil at cobaltgroup.com Wed Oct 6 13:43:17 2004 From: joneil at cobaltgroup.com (O'neil, Jerome) Date: Wed Oct 6 13:43:25 2004 Subject: SPUG: lenght of string Message-ID: <25160AB2660F8B449892B0EB9C29C16501E664B0@ex-sea-is2.main.cobaltgroup.com> There is no syntax here. We are not in the world of software, we are in the world of documentation. It was not an example, nor was it intended to be run. It was a reference to the documentation, which is where the OP should be directed. My original statement is correct. -Jerome -----Original Message----- From: James Moore [mailto:james@banshee.com] Sent: Wednesday, October 06, 2004 11:24 AM To: tim@consultix-inc.com; 'O'neil, Jerome' Cc: spug-list@mail.pm.org Subject: RE: SPUG: lenght of string I'm with Tim on this one. In the world of software, beating a "pedantic" is frequently a life or death question, not a question of being irritating or not. The syntax as originally stated, including the percentage sign, is wrong. -- James From cjcollier at colliertech.org Wed Oct 6 17:39:32 2004 From: cjcollier at colliertech.org (CJ Collier) Date: Wed Oct 6 17:40:07 2004 Subject: SPUG: lenght of string In-Reply-To: <20041006181108.GA2498@jumpy.consultix-inc.com> References: <25160AB2660F8B449892B0EB9C29C16501E664A4@ex-sea-is2.main.cobaltgroup.com> <20041006181108.GA2498@jumpy.consultix-inc.com> Message-ID: <1097102372.7788.47.camel@cjcoll.desktop.amazon.com> > As a courtesy to those who are growing tired of this thread, > I'll resist the temptation to question the spelling of the > word "Jebuz", which appears at the start of your message 8-} I'll stand up for Jerome on this one: http://en.wikipedia.org/wiki/Talk:Jebus > -Tim C.J. From lmzaldivar at mac.com Wed Oct 6 18:16:52 2004 From: lmzaldivar at mac.com (Luis Medrano) Date: Wed Oct 6 18:16:54 2004 Subject: SPUG: I can't get any content Message-ID: <8010436.1097104612655.JavaMail.lmzaldivar@mac.com> List, I have this script: #!/usr/bin/perl use LWP::Simple; @content=split /\n/,get("http://www.google.com/search?hl=en&q=perl"); print "@content \n" But I can not received any content from this url. any idea? Thanks, Luis From lmzaldivar at mac.com Wed Oct 6 22:20:47 2004 From: lmzaldivar at mac.com (Luis Medrano) Date: Wed Oct 6 22:20:50 2004 Subject: SPUG: I can't get any content In-Reply-To: References: Message-ID: <4378918.1097119247732.JavaMail.lmzaldivar@mac.com> list, I processing a log file but is showing this error afer have process 5522 lines. Any Idea? Quantifier follows nothing in regex; marked by <-- HERE in m/* <-- HERE .jpg / at phrases_db.pl line 37. Thanks, Luis From charles.e.derykus at boeing.com Thu Oct 7 09:25:40 2004 From: charles.e.derykus at boeing.com (DeRykus, Charles E) Date: Thu Oct 7 09:26:00 2004 Subject: SPUG: I can't get any content Message-ID: <5DF8FDE8DFE8744388602480FDCC0E310346FE96@xch-nw-23.nw.nos.boeing.com> > #!/usr/bin/perl > use LWP::Simple; > @content=split /\n/,get("http://www.google.com/search?hl=en&q=perl"); > print "@content \n" > But I can not received any content from this url. any idea? Looks like you're not welcome: -- Charles DeRykus perl -le 'use LWP::Debug qw(+);use LWP::Simple; getprint "http://www.google.com/search?hl=en&q=perl"' ... LWP::UserAgent::send_request: GET http://www.google.com/search?hl=en&q=perl LWP::UserAgent::_need_proxy: Proxied to <....censored....> LWP::Protocol::http::request: () LWP::Protocol::collect: read 878 bytes LWP::Protocol::collect: read 3036 bytes LWP::UserAgent::request: Simple response: Forbidden 403 Forbidden From haircut at gmail.com Thu Oct 7 10:13:46 2004 From: haircut at gmail.com (Adam Monsen) Date: Thu Oct 7 10:15:08 2004 Subject: SPUG: I can't get any content In-Reply-To: <5DF8FDE8DFE8744388602480FDCC0E310346FE96@xch-nw-23.nw.nos.boeing.com> References: <5DF8FDE8DFE8744388602480FDCC0E310346FE96@xch-nw-23.nw.nos.boeing.com> Message-ID: <9ebd651104100708133cc68024@mail.gmail.com> Luis, if you wish to use Google programmatically, read this: http://www.google.com/apis/ On Thu, 7 Oct 2004 07:25:40 -0700, DeRykus, Charles E wrote: > > > #!/usr/bin/perl > > use LWP::Simple; > > @content=split /\n/,get("http://www.google.com/search?hl=en&q=perl"); > > print "@content \n" > > > But I can not received any content from this url. any idea? > > Looks like you're not welcome: > > -- > Charles DeRykus > > perl -le 'use LWP::Debug qw(+);use LWP::Simple; getprint "http://www.google.com/search?hl=en&q=perl"' > > ... > LWP::UserAgent::send_request: GET http://www.google.com/search?hl=en&q=perl > LWP::UserAgent::_need_proxy: Proxied to <....censored....> > LWP::Protocol::http::request: () > LWP::Protocol::collect: read 878 bytes > LWP::Protocol::collect: read 3036 bytes > LWP::UserAgent::request: Simple response: Forbidden > 403 Forbidden > > > > _____________________________________________________________ > 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 > -- Adam Monsen http://adammonsen.com/ From lmzaldivar at mac.com Thu Oct 7 13:37:09 2004 From: lmzaldivar at mac.com (Luis Medrano) Date: Thu Oct 7 13:37:12 2004 Subject: SPUG: Help with this error Message-ID: <4373441.1097174229320.JavaMail.lmzaldivar@mac.com> List, I processing a log file. but I check a pather: if ($linea=~m/$temp/){ but for some reason after process 5221 lines of the log is showing this: Quantifier follows nothing in regex; marked by <-- HERE in m/* <-- HERE .jpg / at phrases_db.pl line 37 (this is line 37 if ($linea=~m/$temp/){) Any idea of what is going on? Thanks, Luis From lmzaldivar at mac.com Thu Oct 7 15:29:37 2004 From: lmzaldivar at mac.com (Luis Medrano) Date: Thu Oct 7 15:29:42 2004 Subject: SPUG: Help with this error In-Reply-To: <1097180102.2944.57.camel@cjcoll.desktop.amazon.com> References: <4373441.1097174229320.JavaMail.lmzaldivar@mac.com> <1097180102.2944.57.camel@cjcoll.desktop.amazon.com> Message-ID: <3929764.1097180977408.JavaMail.lmzaldivar@mac.com> list, This how it works $temp is the line of the file I'm processing and when they fines the line what contains this "*.jpg". it brakes. $temp=$file[5221]; ## this contains *.jpg if ($linea=~m/$temp/){ ## and here is where it brakes. any ideas? Luis On Thursday, October 07, 2004, at 01:15PM, CJ Collier wrote: >$temp is getting dynamically build, no? well, the part that comes >before the * is not getting set. How do you build $temp? $temp = >"$foo*$bar+$baz?" or some such? If it's something like this, $foo isn't >being set. If $foo is built as $foo = $x ? $y : "", and $x is not set, >$foo will be "", which will cause $temp to be set to "*$bar+$baz?", >which is not a valid regex. > >If you paste more code, we can give you more specific and less imaginary >help :) > >C.J. > > >On Thu, 2004-10-07 at 11:37 -0700, Luis Medrano wrote: >> List, >> >> I processing a log file. but I check a pather: >> >> if ($linea=~m/$temp/){ >> >> but for some reason after process 5221 lines of the log is showing this: >> Quantifier follows nothing in regex; marked by <-- HERE in m/* <-- HERE .jpg / at phrases_db.pl line >> 37 >> (this is line 37 if ($linea=~m/$temp/){) >> >> Any idea of what is going on? >> >> Thanks, >> Luis >> >> >> _____________________________________________________________ >> 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 mathin at mathin.com Thu Oct 7 15:40:30 2004 From: mathin at mathin.com (Dan Ebert) Date: Thu Oct 7 15:40:32 2004 Subject: SPUG: Modules screwing each other up. Message-ID: Here's an interesting problem ... I am attempting to use two modules in another module I am writing: SOAP::WSDL and SOAP::Parser. When I put the 'use' for the SOAP::WSDL module first I get this error when trying to call the parsestring method from the SOAP::Parser module: Can't call method "get_deserializer" on an undefined value at /usr/lib/perl5/site_perl/5.8.3/SOAP/Parser.pm line 326 When I 'use' the SOAP::Parser module first I get this when trying to call the new method from the SOAP::WSDL module: Can't locate object method "xmlschemaclass" via package "SOAP::Serializer" at /usr/lib/perl5/site_perl/5.8.3/SOAP/Lite.pm I've tried putting the 'use' inside the subroutines that need it, but that doesn't seem to help. Any ideas? Thanks, Dan. ---------------------------------------------------------- Immigration is the sincerest form of flattery. - Unknown ---------------------------------------------------------- From tim at consultix-inc.com Thu Oct 7 16:05:37 2004 From: tim at consultix-inc.com (Tim Maher) Date: Thu Oct 7 16:05:45 2004 Subject: SPUG: Help with this error In-Reply-To: <3929764.1097180977408.JavaMail.lmzaldivar@mac.com> References: <4373441.1097174229320.JavaMail.lmzaldivar@mac.com> <1097180102.2944.57.camel@cjcoll.desktop.amazon.com> <3929764.1097180977408.JavaMail.lmzaldivar@mac.com> Message-ID: <20041007210537.GA12000@jumpy.consultix-inc.com> On Thu, Oct 07, 2004 at 01:29:37PM -0700, Luis Medrano wrote: > list, > > This how it works > $temp is the line of the file I'm processing and when they > fines the line what contains this "*.jpg". it brakes. > > $temp=$file[5221]; ## this contains *.jpg > if ($linea=~m/$temp/){ ## and here is where it brakes. > Luis You need to "quote" the metacharacters that result from the expansion of $temp, so they are interpreted as literals when doing the match against $linea; \Q \E are for this: if ($linea=~m/\Q$temp\E/){ ## and here is where it brakes. But I don't understand what you're doing. How could "*.jpg" ever match a line number, which is what you say is in $linea? *--------------------------------------------------------------------------* | Tim Maher, CEO (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for Shell Users & Programmers" | | Classes! 10/4: UNIX Fundamentals 11/30: Perl 12/6: Shell & Utilities | *--------------------------------------------------------------------------* From hydo at mac.com Thu Oct 7 16:30:01 2004 From: hydo at mac.com (Clint Moore) Date: Thu Oct 7 16:30:12 2004 Subject: SPUG: Modules screwing each other up. In-Reply-To: References: Message-ID: <0BC109B6-18A8-11D9-A0DD-000A95B4870E@mac.com> On Oct 7, 2004, at 1:40 PM, Dan Ebert wrote: > > Here's an interesting problem ... > > Module Horkage > There's definitely something funky going on. preston:~ cmoore$ perl -d -e 1 Works fine... main::(-e:1): 1 DB<1> use SOAP::Parser; DB<2> $p = new SOAP::Parser; DB<3> use SOAP::WSDL; DB<4> $g = new SOAP::Parser; DB<5> $w = new SOAP::WSDL; DB<6> Horks.... main::(-e:1): 1 DB<1> use SOAP::WSDL; DB<2> use SOAP::Parser; DB<3> $w = new SOAP::WSDL; Can't locate object method "xmlschemaclass" via package "SOAP::Serializer" at /Library/Perl/5.8.1/SOAP/Lite.pm line 764. DB<4> $p = new SOAP::Parser; DB<5> Double Hork 2004 Alpha II Turbo Platinum Pro Edition main::(-e:1): 1 DB<1> use SOAP::Parser; DB<2> use SOAP::WSDL; DB<3> $p = new Soap::Parser; Can't locate object method "new" via package "Soap::Parser" (perhaps you forgot to load "Soap::Parser"?) at (eval 95)[/System/Library/Perl/5.8.1/perl5db.pl:618] line 2. DB<4> $w = new Soap::WSDL; Can't locate object method "new" via package "Soap::WSDL" (perhaps you forgot to load "Soap::WSDL"?) at (eval 96)[/System/Library/Perl/5.8.1/perl5db.pl:618] line 2. DB<5> So I guess until it's fixed... maybe... use SOAP::Parser, make one S::P object, and then use SOAP::WSDL? I'm not suggesting that it's a solution, but it would be interesting if it works. -cm From mathin at mathin.com Thu Oct 7 16:47:20 2004 From: mathin at mathin.com (Dan Ebert) Date: Thu Oct 7 16:47:24 2004 Subject: SPUG: Modules screwing each other up. In-Reply-To: <0BC109B6-18A8-11D9-A0DD-000A95B4870E@mac.com> Message-ID: I've found a work around for this particular module ... I only need to use one OR the other in any given call so I just make sure I don't create the SOAP::WSDL object unless I need it. (I was creating it when "new" was called to create my object and storing it as part of that object. Now I just create the WSDL object right before I use it.) Your idea about creating the SOAP::Parser object first is interesting, but the perldoc says that a new Parser should be created for everything you need to parse ... so I can't just create one in the begining and keep using it. Thanks for your testing though. I thought I might be going insane :) Dan. ---------------------------------------------------------- Immigration is the sincerest form of flattery. - Unknown ---------------------------------------------------------- On Thu, 7 Oct 2004, Clint Moore wrote: > > On Oct 7, 2004, at 1:40 PM, Dan Ebert wrote: > > > > Here's an interesting problem ... > > > > Module Horkage > > > > There's definitely something funky going on. > > preston:~ cmoore$ perl -d -e 1 > > > Works fine... > > main::(-e:1): 1 > DB<1> use SOAP::Parser; > DB<2> $p = new SOAP::Parser; > DB<3> use SOAP::WSDL; > DB<4> $g = new SOAP::Parser; > DB<5> $w = new SOAP::WSDL; > DB<6> > > > Horks.... > > main::(-e:1): 1 > DB<1> use SOAP::WSDL; > DB<2> use SOAP::Parser; > DB<3> $w = new SOAP::WSDL; > Can't locate object method "xmlschemaclass" via package > "SOAP::Serializer" at /Library/Perl/5.8.1/SOAP/Lite.pm line 764. > DB<4> $p = new SOAP::Parser; > DB<5> > > > Double Hork 2004 Alpha II Turbo Platinum Pro Edition > > main::(-e:1): 1 > DB<1> use SOAP::Parser; > DB<2> use SOAP::WSDL; > DB<3> $p = new Soap::Parser; > Can't locate object method "new" via package "Soap::Parser" (perhaps > you forgot to load "Soap::Parser"?) at (eval > 95)[/System/Library/Perl/5.8.1/perl5db.pl:618] line 2. > DB<4> $w = new Soap::WSDL; > Can't locate object method "new" via package "Soap::WSDL" (perhaps you > forgot to load "Soap::WSDL"?) at (eval > 96)[/System/Library/Perl/5.8.1/perl5db.pl:618] line 2. > DB<5> > > > So I guess until it's fixed... maybe... use SOAP::Parser, make one > S::P object, and then use SOAP::WSDL? I'm not suggesting that it's a > solution, but it would be interesting if it works. > > -cm > > _____________________________________________________________ > 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 jlb at io.com Thu Oct 7 17:15:21 2004 From: jlb at io.com (jlb) Date: Thu Oct 7 17:15:23 2004 Subject: SPUG: Modules screwing each other up. In-Reply-To: Message-ID: The only time recently I ran into an issue with modules screwing one another up had to do with XML::Twig importing UNIVERSAL::isa, which is apparently a bad thing for reasons I am not entirely clear on. Though, I would be interested in understanding the issue better if someone can explain. Confusingly, the UNIVERSAL code examples import isa, then strongly recommend against doing so. Jon From kmeyer at blarg.net Fri Oct 8 11:56:37 2004 From: kmeyer at blarg.net (Ken Meyer) Date: Fri Oct 8 11:54:58 2004 Subject: SPUG: October 9th GSLUG Meeting: Unix Apps for Doc Creation; Sound Record & Edit Using Audacity Message-ID: The October 2004 meeting of the Greater Seattle Linux Users Group (GSLUG) will be held this Saturday, October 9th, starting promptly at 10:00 AM on the North Seattle Community College campus. Please feel free to forward this announcement as appropriate. ************************************************************* We are confirmed to use room IB 3319. For directions, see the meetings page: http://www.gslug.org/meeting.html ************************************************************* The presentation topics will be: * 10:00am - Overview of Document Formats Available Under Unix, Including an Introduction to LyX for Easy Writing By Jeremy Reed This presentation will be an overview, with examples, of standard documentation formats available under Unix, including nroff (and the mandoc macro), DocBook, LaTeX, and others. Some document processing and conversion tools will also be described. Use of the LyX document editor for easy document creation will be introduced. LyX is a full-featured graphical front-end for LaTeX, and can be used to generate books, articles, reports, etc. The presentation will cover some of the standard uses of LyX, its common features, how to get started using it, and examples of the generation of ready-to-print documents. The audience will be encouraged to share their experiences and advice with document generation under Unix. Jeremy C. Reed's Bio: Jeremy is a journalist, Unix instructor and consultant (for Puget Sound Technology), and open source advocate. http://www.pugetsoundtechnology.com/ http://bsd.reedmedia.net/ --------------- * 11:15am - Audacity By Matt Brubeck Audacity is a free (GPL) audio recorder and multi-track sound editor. Audacity is built on the cross-platform wxWidgets framework, and is available for Linux, Mac OS, and Windows. It is designed for ease of use, and efficient editing of large files with unlimited undo. Presentation topics include: * Introduction to Audacity, with demonstrations of recording, mixing, and editing. * The developer's view: under the hood of Audacity. * Experiences with cross-platform development. * Legal hurdles, including licensing, MP3 patent issues, and trademark issues. * Preview of recent developments in Audacity CVS. The Audacity web site: http://audacity.sourceforge.net/ Matt Brubeck's Bio: Matt Brubeck is one of the maintainers of the free (GPL) Audacity sound editor for Linux, Mac OS, and Windows. He also maintains the Debian package of Audacity, and is currently in the Debian "New Maintainer" process. http://advogato.org/person/mbrubeck/ ------------------------------------------------------------------------ -- The typical GSLUG meeting agenda is as follows: 10:00 AM First Presentation 11:00 AM Break 11:10 AM Raffle Quiz 11:15 AM Second Presentation 12:15 PM Break 12:30 PM Raffle prizes giveaway 12:35 PM GSLUG announcements and business, including discussion of potential future presentation topics Announcements from attendees Requests for assistance with trouble-shooting and installations desired during the ensuing Workshop session 1:00 PM-ish Formal meeting is adjourned; Workshop and social networking opportunities begin, including: * Installation and trouble-shooting assistance For recommendations on preparations to maximize the probability of a successful outcome, it is recommended that you consult the "What to Bring" topic, way down the page at: http://www.gslug.org/meeting.html * Potential break-out discussions about interest-group activities * Informal PGP key signing * Talking, chatting, blathering, etc, etc. 4:00 pm End of meeting ----------------------------------------------------------------------- GSLUG meetings are held regularly on the second Saturday of the month at 10 AM, currently at North Seattle Community College. Meeting announcements are posted to the gslug-announce mail list. To receive reminders for future GSLUG meetings and notice of other GSLUG activities, you are invited to join the list at: http://lists.gslug.org/mailman/listinfo/gslug-announce Directions, agenda, and presenters' bios will also be posted on the GSLUG website, on the home page and at: http://www.gslug.org/meeting.html You are invited to join the gslug-general discussion list at: http://lists.gslug.org/mailman/listinfo/gslug-general A message board alternative may be found at: http://msgboard.gslug.org/ And a new wiki site is at: http://wiki.gslug.org/ ------------------------------------------------------------------------ -- The GSLUG Crew From lmzaldivar at mac.com Mon Oct 11 12:10:28 2004 From: lmzaldivar at mac.com (Luis Medrano) Date: Mon Oct 11 12:10:32 2004 Subject: SPUG: re-size array Message-ID: <13933179.1097514628552.JavaMail.lmzaldivar@mac.com> List, I need your help. Any body know what is the best way to re-size array. For example: @array=(1,2,3,4,5,6,7,8,9,10); I need to remove 1,3,5,7,9 and I need to re-size @array to: @array=(2,4,6,8,10); the array I need to re-size or re-defined has 166771 elements. I really appreciate all your help. Thanks, Luis From keith.reed at philips.com Mon Oct 11 12:31:30 2004 From: keith.reed at philips.com (keith.reed@philips.com) Date: Mon Oct 11 12:32:44 2004 Subject: SPUG: re-size array Message-ID: splice() is the function you want to use. The details can be found in perlfunc. Keith Luis Medrano Sent by: spug-list-bounces@mail.pm.org 10/11/2004 10:10 AM To: spug-list@mail.pm.org cc: (bcc: Keith Reed/ATL-BTL/MS/PHILIPS) Subject: SPUG: re-size array Classification: List, I need your help. Any body know what is the best way to re-size array. For example: @array=(1,2,3,4,5,6,7,8,9,10); I need to remove 1,3,5,7,9 and I need to re-size @array to: @array=(2,4,6,8,10); the array I need to re-size or re-defined has 166771 elements. I really appreciate all your help. Thanks, Luis _____________________________________________________________ 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 -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20041011/37c7088c/attachment.htm From bri at ifokr.org Mon Oct 11 12:34:17 2004 From: bri at ifokr.org (Brian Hatch) Date: Mon Oct 11 12:34:19 2004 Subject: SPUG: re-size array In-Reply-To: <13933179.1097514628552.JavaMail.lmzaldivar@mac.com> References: <13933179.1097514628552.JavaMail.lmzaldivar@mac.com> Message-ID: <20041011173417.GD24705@ifokr.org> > I need your help. Any body know what is the best way to re-size array. For example: > > @array=(1,2,3,4,5,6,7,8,9,10); > > I need to remove 1,3,5,7,9 and I need to re-size @array to: > > @array=(2,4,6,8,10); > > the array I need to re-size or re-defined has 166771 elements. I really appreciate all your help. Are you splicing out based on the value, or just the position? For example this would work if you just want to remove every other element: @array=(1..10); @array = grep { %i++ % 2 } @array; Or if it's value based @array = (blahblahblah); @array = grep { doiwanttokeepit($_) } @array; sub doiwanttokeepit { my($value) = @_; if ( we want to keep this value ) { return 1; } return 0; } -- Brian Hatch # apt-get remove George.W.Bush Systems and 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/archives/spug-list/attachments/20041011/d6c78575/attachment.bin From cjcollier at colliertech.org Mon Oct 11 15:44:50 2004 From: cjcollier at colliertech.org (CJ Collier) Date: Mon Oct 11 15:45:35 2004 Subject: SPUG: re-size array In-Reply-To: <13933179.1097514628552.JavaMail.lmzaldivar@mac.com> References: <13933179.1097514628552.JavaMail.lmzaldivar@mac.com> Message-ID: <1097527490.15542.33.camel@cjcoll.desktop.amazon.com> %hash = @array; @even = keys %hash; @odd = values %hash; On Mon, 2004-10-11 at 10:10 -0700, Luis Medrano wrote: > List, > > I need your help. Any body know what is the best way to re-size array. For example: > > @array=(1,2,3,4,5,6,7,8,9,10); > > I need to remove 1,3,5,7,9 and I need to re-size @array to: > > @array=(2,4,6,8,10); > > the array I need to re-size or re-defined has 166771 elements. I really appreciate all your help. > > Thanks, > Luis > > > _____________________________________________________________ > 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 mathin at mathin.com Mon Oct 11 16:56:57 2004 From: mathin at mathin.com (Dan Ebert) Date: Mon Oct 11 16:57:07 2004 Subject: SPUG: Inheritance Message-ID: I am trying to create a series of modules which inherit from a base class. The base class looks like this: package CLE2::Interface; ############################################################################### use strict; ############################################################################### use vars qw(@ISA @EXPORT_OK $VERSION $err); require Exporter; $VERSION = '0.01'; @ISA = qw(Exporter); ############################################################################### zub allocate { my $invocant = shift; my $class = ref($invocant) || $invocant; # Object or class name my $interface = bless { @_ }, $class; return $interface; } ############################################################################### and is saved to a file: CLE2/Interface.pm I have another module, CLE2/ProvisionerIF.pm package CLE2::ProvisionerIF; ############################################################################### use strict; ############################################################################### use vars qw(@ISA @EXPORT_OK $VERSION $err); require Exporter; $VERSION = '0.01'; @ISA = ("CLE2::Interface"); # I'v also tried @ISA = ("Interface"); ############################################################################### zub new { my $pkg = shift; return $pkg->allocate(@_); } ############################################################################### I have a script which uses CLE2::ProvisionerIF: use CLE2::ProvisionerIF; my $provisioner = new CLE2::ProvisionerIF( %param_hash ); I'm getting an error, "Can't locate object method "allocate" via package "CLE2::ProvisionerIF" at CLE2/ProvisionerIF.pm line 20." (line 20 is the line with "return $pkg->allocate(@_)") I must be missing something simple, but I can't put my finger on it. Any help is appreciated. Thanks, Dan. ---------------------------------------------------------- Immigration is the sincerest form of flattery. - Unknown ---------------------------------------------------------- From michaelrwolf at att.net Mon Oct 11 16:58:51 2004 From: michaelrwolf at att.net (michaelrwolf@att.net) Date: Mon Oct 11 16:59:00 2004 Subject: SPUG: Re: re-size array Message-ID: <101120042158.22750.416B021B000418A5000058DE2160376316000401999D040A0E080C0703@att.net> Pedant alert -- I'm an isstructor, too. Don't get the words confused: splice and slice. splice -- a built-in function splice(ARRAY,OFFSET[,LENGTH[,LIST]]) slice -- a concept. An indexing (or lookup) operation on an array (or hash) that returns a list. @array_slice = @array[index list goes here]; @hash_slice = @hash{key list goes here}; Brian's grep solution: For example this would work if you just want to remove every other element: @array=(1..10); @array = grep { %i++ % 2 } @array; Brian's solution used grep to pass every other array element. (Code review note: I'd add a "my $i=0" line before the grep line to be explicit about where $i starts.) The following alternative uses grep to generate the indices for an array slice. # As a one-liner. @new_array = @old_array[ grep { $_ % 2 } 0 .. @old_array - 1 ]; # As a two-liner. @indices = grep { $_ % 2 } 0 .. @old_array - 1; @new_array = @old_array[@indices]; TMOWTDI. There's probably a bit more of a memory issue for my solution. It has to hold the @indices array in memory, then the slice'd list in memory before it gets assigned. For big arrays, this may be an issue. You're probably on the cusp of where I'd benchmark it to see how it worked. Otherwise, I'd be tempted to write the one that's more likely to make sense to me in 2 weeks or 6 months when I come back to maintain the code. > _____________________________________________________________ > 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 -------------- An embedded message was scrubbed... From: Brian Hatch Subject: Re: SPUG: re-size array Date: Mon, 11 Oct 2004 17:34:56 +0000 Size: 1942 Url: http://mail.pm.org/archives/spug-list/attachments/20041011/6f3f809e/attachment.eml From michaelrwolf at att.net Mon Oct 11 17:03:10 2004 From: michaelrwolf at att.net (michaelrwolf@att.net) Date: Mon Oct 11 17:03:29 2004 Subject: SPUG: re-size array Message-ID: <101120042203.26347.416B031D0009A3E2000066EB2160376316000401999D040A0E080C0703@att.net> > %hash = @array; > > @even = keys %hash; > @odd = values %hash; Tricky! I like it. But beware. It only works if you don't care about the ordering of the @even or @odd arrays. If you merely need to consider them as sets (collections), this will work. Otherwise, the ordering has been lost by creating a hash out of it. It'll probably take a not-so-insignificant amount of time/CPU to build that hash. From umar at drizzle.com Mon Oct 11 17:16:02 2004 From: umar at drizzle.com (Umar Cheema) Date: Mon Oct 11 17:16:10 2004 Subject: SPUG: Inheritance In-Reply-To: Message-ID: In your package CLE2::ProvisionerIF, you seem to be missing this line: use CLE2::Interface; On Mon, 11 Oct 2004, Dan Ebert wrote: > > I am trying to create a series of modules which inherit from a base class. > The base class looks like this: > > package CLE2::Interface; > ############################################################################### > use strict; > ############################################################################### > use vars qw(@ISA @EXPORT_OK $VERSION $err); > require Exporter; > $VERSION = '0.01'; > @ISA = qw(Exporter); > ############################################################################### > zub allocate { > my $invocant = shift; > my $class = ref($invocant) || $invocant; # Object or class name > my $interface = bless { @_ }, $class; > return $interface; > } > ############################################################################### > > and is saved to a file: CLE2/Interface.pm > > I have another module, CLE2/ProvisionerIF.pm > > package CLE2::ProvisionerIF; > ############################################################################### > use strict; > ############################################################################### > use vars qw(@ISA @EXPORT_OK $VERSION $err); > require Exporter; > $VERSION = '0.01'; > @ISA = ("CLE2::Interface"); # I'v also tried @ISA = ("Interface"); > ############################################################################### > zub new { > my $pkg = shift; > return $pkg->allocate(@_); > } > ############################################################################### > > I have a script which uses CLE2::ProvisionerIF: > > use CLE2::ProvisionerIF; > > my $provisioner = new CLE2::ProvisionerIF( %param_hash ); > > I'm getting an error, "Can't locate object method "allocate" via package > "CLE2::ProvisionerIF" at CLE2/ProvisionerIF.pm line 20." (line 20 is the > line with "return $pkg->allocate(@_)") > > I must be missing something simple, but I can't put my finger on it. > > Any help is appreciated. > > Thanks, > > Dan. > ---------------------------------------------------------- > Immigration is the sincerest form of flattery. > - Unknown > ---------------------------------------------------------- > > > _____________________________________________________________ > 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 me at donshanks.com Mon Oct 11 17:23:51 2004 From: me at donshanks.com (Don Shanks) Date: Mon Oct 11 17:44:00 2004 Subject: SPUG: Inheritance In-Reply-To: References: Message-ID: <1919.216.254.31.221.1097533431.squirrel@webmail.ctupc.org> You could just use base('CLE2::Interface'); and forget about the use CLE2* line and the @ISA push altogether. --Don > In your package CLE2::ProvisionerIF, you seem to be missing this line: > > use CLE2::Interface; > > > > > > On Mon, 11 Oct 2004, Dan Ebert wrote: > >> >> I am trying to create a series of modules which inherit from a base >> class. >> The base class looks like this: >> >> package CLE2::Interface; >> ############################################################################### >> use strict; >> ############################################################################### >> use vars qw(@ISA @EXPORT_OK $VERSION $err); >> require Exporter; >> $VERSION = '0.01'; >> @ISA = qw(Exporter); >> ############################################################################### >> zub allocate { >> my $invocant = shift; >> my $class = ref($invocant) || $invocant; # Object or class name >> my $interface = bless { @_ }, $class; >> return $interface; >> } >> ############################################################################### >> >> and is saved to a file: CLE2/Interface.pm >> >> I have another module, CLE2/ProvisionerIF.pm >> >> package CLE2::ProvisionerIF; >> ############################################################################### >> use strict; >> ############################################################################### >> use vars qw(@ISA @EXPORT_OK $VERSION $err); >> require Exporter; >> $VERSION = '0.01'; >> @ISA = ("CLE2::Interface"); # I'v also tried @ISA = ("Interface"); >> ############################################################################### >> zub new { >> my $pkg = shift; >> return $pkg->allocate(@_); >> } >> ############################################################################### >> >> I have a script which uses CLE2::ProvisionerIF: >> >> use CLE2::ProvisionerIF; >> >> my $provisioner = new CLE2::ProvisionerIF( %param_hash ); >> >> I'm getting an error, "Can't locate object method "allocate" via package >> "CLE2::ProvisionerIF" at CLE2/ProvisionerIF.pm line 20." (line 20 is >> the >> line with "return $pkg->allocate(@_)") >> >> I must be missing something simple, but I can't put my finger on it. >> >> Any help is appreciated. >> >> Thanks, >> >> Dan. >> ---------------------------------------------------------- >> Immigration is the sincerest form of flattery. >> - Unknown >> ---------------------------------------------------------- >> >> >> _____________________________________________________________ >> 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 > From cmeyer at helvella.org Mon Oct 11 17:44:51 2004 From: cmeyer at helvella.org (Colin Meyer) Date: Mon Oct 11 17:44:55 2004 Subject: SPUG: re-size array In-Reply-To: <101120042203.26347.416B031D0009A3E2000066EB2160376316000401999D040A0E080C0703@att.net> References: <101120042203.26347.416B031D0009A3E2000066EB2160376316000401999D040A0E080C0703@att.net> Message-ID: <20041011224451.GB3010@funpox.helvella.org> On Mon, Oct 11, 2004 at 10:03:10PM +0000, Michael R. Wolf wrote: > > > > > %hash = @array; > > > > @even = keys %hash; > > @odd = values %hash; > > Tricky! I like it. > > But beware. It only works if you don't care about the ordering of the > @even or @odd arrays. If you merely need to consider them as sets > (collections), this will work. Otherwise, the ordering has been lost > by creating a hash out of it. Also worth noting is that you will get a bogus undef in the @odd array, if there were an odd number of elements in @array. > > It'll probably take a not-so-insignificant amount of time/CPU to build > that hash. I wouldn't think so. Perl hashes are pretty speedy to use. But just to be sure, here's a test of hashes vs iterating through the list: Rate iter hash iter 11962/s -- -14% hash 13831/s 16% -- Hashes 14% faster than iterating (at least by my cheap test). -Colin. #!/usr/bin/perl use Benchmark ':all'; my @a = 1..100; cmpthese( 100_000, { iter => \&oddeven_iterate, hash => \&oddeven_hash } ); sub oddeven_hash { my ( $o, $e, %h ); %h = @a; $o = [ keys %h ]; $e = [ values %h ]; return $e, $o; } sub oddeven_iterate { my ( $o, $e ); push @{ $_ % 2 ? $o : $e }, $a[$_] for 0..$#a; return $e, $o; } From charles.e.derykus at boeing.com Mon Oct 11 18:35:34 2004 From: charles.e.derykus at boeing.com (DeRykus, Charles E) Date: Mon Oct 11 18:35:39 2004 Subject: SPUG: re-size array Message-ID: <5DF8FDE8DFE8744388602480FDCC0E310451BAAE@xch-nw-23.nw.nos.boeing.com> You can juke the "odd no. of elements in hash assigment" warning and maintain hash insert ordering too: tie my %hash, 'Tie::IxHash' or die; %hash = @array % 2 ? (@array,undef) : @array; my @odd = keys %hash; my @even= values %hash; $#even-- unless defined $even[-1]; (Assuming @array won't produce key duplicates that'd vanish when hashified) -----Original Message----- From: Colin Meyer [mailto:cmeyer@helvella.org] Sent: Monday, October 11, 2004 3:45 PM To: michaelrwolf@att.net Cc: SPUG; Luis Medrano Subject: Re: SPUG: re-size array On Mon, Oct 11, 2004 at 10:03:10PM +0000, Michael R. Wolf wrote: > > > > > %hash = @array; > > > > @even = keys %hash; > > @odd = values %hash; > > Tricky! I like it. > > But beware. It only works if you don't care about the ordering of the > @even or @odd arrays. If you merely need to consider them as sets > (collections), this will work. Otherwise, the ordering has been lost > by creating a hash out of it. Also worth noting is that you will get a bogus undef in the @odd array, if there were an odd number of elements in @array. > > It'll probably take a not-so-insignificant amount of time/CPU to build > that hash. I wouldn't think so. Perl hashes are pretty speedy to use. But just to be sure, here's a test of hashes vs iterating through the list: Rate iter hash iter 11962/s -- -14% hash 13831/s 16% -- Hashes 14% faster than iterating (at least by my cheap test). -Colin. #!/usr/bin/perl use Benchmark ':all'; my @a = 1..100; cmpthese( 100_000, { iter => \&oddeven_iterate, hash => \&oddeven_hash } ); sub oddeven_hash { my ( $o, $e, %h ); %h = @a; $o = [ keys %h ]; $e = [ values %h ]; return $e, $o; } sub oddeven_iterate { my ( $o, $e ); push @{ $_ % 2 ? $o : $e }, $a[$_] for 0..$#a; return $e, $o; } _____________________________________________________________ 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 jlb at io.com Mon Oct 11 20:05:52 2004 From: jlb at io.com (jlb) Date: Mon Oct 11 20:05:59 2004 Subject: SPUG: Inheritance In-Reply-To: Message-ID: On Mon, 11 Oct 2004, Dan Ebert wrote: > zub allocate { ... > zub new { What's zub? Jon From mathin at mathin.com Mon Oct 11 20:29:44 2004 From: mathin at mathin.com (Dan Ebert) Date: Mon Oct 11 20:29:48 2004 Subject: SPUG: Inheritance In-Reply-To: References: Message-ID: <1097544583.1184.0.camel@localhost.localdomain> it used to be (don't know if it still is) that if you put s-u-b in the body of the email, the email listserve would choke on it. On Mon, 2004-10-11 at 18:05, jlb wrote: > On Mon, 11 Oct 2004, Dan Ebert wrote: > > zub allocate { > ... > > zub new { > > What's zub? > > Jon From michaelrwolf at att.net Tue Oct 12 01:57:35 2004 From: michaelrwolf at att.net (michaelrwolf@att.net) Date: Tue Oct 12 01:57:38 2004 Subject: SPUG: re-size array Message-ID: <101220040657.11138.416B805E000958FD00002B822161243646000401999D040A0E080C0703@att.net> > You can juke the "odd no. of elements in hash assigment" warning > and maintain hash insert ordering too: > tie my %hash, 'Tie::IxHash' or die; > %hash = @array % 2 ? (@array,undef) : @array; > my @odd = keys %hash; my @even= values %hash; > $#even-- unless defined $even[-1]; For two reasons, I prefer not to use the $#array syntax. 0 - It's hard to remember (for me and my future readers) 1 - It's ugly. Well, at least there are prettier alternatives -- pop, push, splice -- that deal with the array *directly* instead of *indirectly* through that syntactic form. 2 - It's going away in Perl6 For those reasons, I'd rewrite the final line as pop @even unless defined $even[-1]; Cool solution. > > > You can juke the "odd no. of elements in hash assigment" warning > and maintain hash insert ordering too: > > tie my %hash, 'Tie::IxHash' or die; > %hash = @array % 2 ? (@array,undef) : @array; > my @odd = keys %hash; my @even= values %hash; > $#even-- unless defined $even[-1]; > > (Assuming @array won't produce key duplicates > that'd vanish when hashified) > > > -----Original Message----- > From: Colin Meyer [mailto:cmeyer@helvella.org] > Sent: Monday, October 11, 2004 3:45 PM > To: michaelrwolf@att.net > Cc: SPUG; Luis Medrano > Subject: Re: SPUG: re-size array > > > On Mon, Oct 11, 2004 at 10:03:10PM +0000, Michael R. Wolf wrote: > > > > > > > > > %hash = @array; > > > > > > @even = keys %hash; > > > @odd = values %hash; > > > > Tricky! I like it. > > > > But beware. It only works if you don't care about the ordering of the > > @even or @odd arrays. If you merely need to consider them as sets > > (collections), this will work. Otherwise, the ordering has been lost > > by creating a hash out of it. > > Also worth noting is that you will get a bogus undef in the @odd array, if there > were an odd number of elements in @array. > > > > > It'll probably take a not-so-insignificant amount of time/CPU to build > > that hash. > > I wouldn't think so. Perl hashes are pretty speedy to use. But just to be sure, > here's a test of hashes vs iterating through the list: > > Rate iter hash > iter 11962/s -- -14% > hash 13831/s 16% -- > > Hashes 14% faster than iterating (at least by my cheap test). > > -Colin. > > #!/usr/bin/perl > > use Benchmark ':all'; > > my @a = 1..100; > > cmpthese( 100_000, { iter => \&oddeven_iterate, hash => \&oddeven_hash } ); > > sub oddeven_hash { > my ( $o, $e, %h ); > %h = @a; > $o = [ keys %h ]; > $e = [ values %h ]; > return $e, $o; > } > > sub oddeven_iterate { > my ( $o, $e ); > push @{ $_ % 2 ? $o : $e }, $a[$_] for 0..$#a; > return $e, $o; > } > _____________________________________________________________ > 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 From krahnj at telus.net Tue Oct 12 08:30:57 2004 From: krahnj at telus.net (John W. Krahn) Date: Tue Oct 12 08:31:17 2004 Subject: SPUG: Re: re-size array In-Reply-To: <101120042158.22750.416B021B000418A5000058DE2160376316000401999D040A0E080C0703@att.net> References: <101120042158.22750.416B021B000418A5000058DE2160376316000401999D040A0E080C0703@att.net> Message-ID: <416BDC91.9030304@telus.net> michaelrwolf@att.net wrote: > Pedant alert -- I'm an isstructor, too. > > Don't get the words confused: splice and slice. > > splice -- a built-in function > splice(ARRAY,OFFSET[,LENGTH[,LIST]]) > > > slice -- a concept. An indexing (or lookup) operation > on an array (or hash) that returns a list. (or list) > @array_slice = @array[index list goes here]; > @hash_slice = @hash{key list goes here}; @list_slice = ( LIST )[index list goes here]; John -- use Perl; program fulfillment From mathin at mathin.com Tue Oct 12 10:10:16 2004 From: mathin at mathin.com (Dan Ebert) Date: Tue Oct 12 10:10:36 2004 Subject: SPUG: Inheritance In-Reply-To: Message-ID: I thought that if you were inheriting you didn't have to 'use' the base class. I tried just putting 'use CLE2::Interface' in the provisionerIF module and that didn't work. The only way I could get it to work is to put all the methods in @EXPORT_OK in the CLE2::Interface and use CLE2::Interface qw(all the methods) in the CLE2::Provisioner. I didn't think this was supposed to be necessary if the CLE2::Interface was in the @ISA array. It isn't described like this in the Camel book or in O'Reilly's 'Advanced Perl Programming' So, I got it to work, but I don't think I'm doing it the 'right' way. Dan. ---------------------------------------------------------- Immigration is the sincerest form of flattery. - Unknown ---------------------------------------------------------- On Mon, 11 Oct 2004, Umar Cheema wrote: > In your package CLE2::ProvisionerIF, you seem to be missing this line: > > use CLE2::Interface; > > > > > > On Mon, 11 Oct 2004, Dan Ebert wrote: > > > > > I am trying to create a series of modules which inherit from a base class. > > The base class looks like this: > > > > package CLE2::Interface; > > ############################################################################### > > use strict; > > ############################################################################### > > use vars qw(@ISA @EXPORT_OK $VERSION $err); > > require Exporter; > > $VERSION = '0.01'; > > @ISA = qw(Exporter); > > ############################################################################### > > zub allocate { > > my $invocant = shift; > > my $class = ref($invocant) || $invocant; # Object or class name > > my $interface = bless { @_ }, $class; > > return $interface; > > } > > ############################################################################### > > > > and is saved to a file: CLE2/Interface.pm > > > > I have another module, CLE2/ProvisionerIF.pm > > > > package CLE2::ProvisionerIF; > > ############################################################################### > > use strict; > > ############################################################################### > > use vars qw(@ISA @EXPORT_OK $VERSION $err); > > require Exporter; > > $VERSION = '0.01'; > > @ISA = ("CLE2::Interface"); # I'v also tried @ISA = ("Interface"); > > ############################################################################### > > zub new { > > my $pkg = shift; > > return $pkg->allocate(@_); > > } > > ############################################################################### > > > > I have a script which uses CLE2::ProvisionerIF: > > > > use CLE2::ProvisionerIF; > > > > my $provisioner = new CLE2::ProvisionerIF( %param_hash ); > > > > I'm getting an error, "Can't locate object method "allocate" via package > > "CLE2::ProvisionerIF" at CLE2/ProvisionerIF.pm line 20." (line 20 is the > > line with "return $pkg->allocate(@_)") > > > > I must be missing something simple, but I can't put my finger on it. > > > > Any help is appreciated. > > > > Thanks, > > > > Dan. > > ---------------------------------------------------------- > > Immigration is the sincerest form of flattery. > > - Unknown > > ---------------------------------------------------------- > > > > > > _____________________________________________________________ > > 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 > From maherb at brimworks.com Tue Oct 12 11:22:53 2004 From: maherb at brimworks.com (Brian Maher) Date: Tue Oct 12 11:23:08 2004 Subject: SPUG: Inheritance In-Reply-To: References: Message-ID: I just used your code, added the 'use CLE2::Interface' to the CLE2::ProvisionerIF module and it seems to work now. Be sure to end all your .pm modules with 1; (all perl modules must return true if they successfully load). I think any problems that are requiring the @EXPORT_OK are all together different problems. Be sure all your method calls are being called with either the package name or an object blessed to that package. Simply putting a line like this in your code won't work: super_class_method(); Also be sure that all methods take a $self object as the first parameter (that is expected to be either a blessed reference or a package name. Cheers, -Brian On Oct 12, 2004, at 8:10 AM, Dan Ebert wrote: > > I thought that if you were inheriting you didn't have to 'use' the base > class. > > I tried just putting 'use CLE2::Interface' in the provisionerIF module > and > that didn't work. The only way I could get it to work is to put all > the > methods in @EXPORT_OK in the CLE2::Interface and use CLE2::Interface > qw(all the methods) in the CLE2::Provisioner. I didn't think this was > supposed to be necessary if the CLE2::Interface was in the @ISA array. > It > isn't described like this in the Camel book or in O'Reilly's 'Advanced > Perl Programming' > > So, I got it to work, but I don't think I'm doing it the 'right' way. > > Dan. > ---------------------------------------------------------- > Immigration is the sincerest form of flattery. > - Unknown > ---------------------------------------------------------- > > > On Mon, 11 Oct 2004, Umar Cheema wrote: > >> In your package CLE2::ProvisionerIF, you seem to be missing this line: >> >> use CLE2::Interface; >> >> >> >> >> >> On Mon, 11 Oct 2004, Dan Ebert wrote: >> >>> >>> I am trying to create a series of modules which inherit from a base >>> class. >>> The base class looks like this: >>> >>> package CLE2::Interface; >>> ##################################################################### >>> ########## >>> use strict; >>> ##################################################################### >>> ########## >>> use vars qw(@ISA @EXPORT_OK $VERSION $err); >>> require Exporter; >>> $VERSION = '0.01'; >>> @ISA = qw(Exporter); >>> ##################################################################### >>> ########## >>> zub allocate { >>> my $invocant = shift; >>> my $class = ref($invocant) || $invocant; # Object or class >>> name >>> my $interface = bless { @_ }, $class; >>> return $interface; >>> } >>> ##################################################################### >>> ########## >>> >>> and is saved to a file: CLE2/Interface.pm >>> >>> I have another module, CLE2/ProvisionerIF.pm >>> >>> package CLE2::ProvisionerIF; >>> ##################################################################### >>> ########## >>> use strict; >>> ##################################################################### >>> ########## >>> use vars qw(@ISA @EXPORT_OK $VERSION $err); >>> require Exporter; >>> $VERSION = '0.01'; >>> @ISA = ("CLE2::Interface"); # I'v also tried @ISA = ("Interface"); >>> ##################################################################### >>> ########## >>> zub new { >>> my $pkg = shift; >>> return $pkg->allocate(@_); >>> } >>> ##################################################################### >>> ########## >>> >>> I have a script which uses CLE2::ProvisionerIF: >>> >>> use CLE2::ProvisionerIF; >>> >>> my $provisioner = new CLE2::ProvisionerIF( %param_hash ); >>> >>> I'm getting an error, "Can't locate object method "allocate" via >>> package >>> "CLE2::ProvisionerIF" at CLE2/ProvisionerIF.pm line 20." (line 20 >>> is the >>> line with "return $pkg->allocate(@_)") >>> >>> I must be missing something simple, but I can't put my finger on it. >>> >>> Any help is appreciated. >>> >>> Thanks, >>> >>> Dan. >>> ---------------------------------------------------------- >>> Immigration is the sincerest form of flattery. >>> - Unknown >>> ---------------------------------------------------------- >>> >>> >>> _____________________________________________________________ >>> 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 >> > > _____________________________________________________________ > 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 > > -- Brian Maher >> Glory to God << From mathin at mathin.com Tue Oct 12 11:27:43 2004 From: mathin at mathin.com (Dan Ebert) Date: Tue Oct 12 11:27:55 2004 Subject: SPUG: Inheritance In-Reply-To: Message-ID: I must have been smoking crack. I could have sworn adding the 'use CLE2::Interface' didn't work yesterday. It is working today. Dan. ---------------------------------------------------------- Immigration is the sincerest form of flattery. - Unknown ---------------------------------------------------------- On Tue, 12 Oct 2004, Brian Maher wrote: > I just used your code, added the 'use CLE2::Interface' to the > CLE2::ProvisionerIF module and it seems to work now. Be sure to end > all your .pm modules with 1; (all perl modules must return true if they > successfully load). I think any problems that are requiring the > @EXPORT_OK are all together different problems. Be sure all your > method calls are being called with either the package name or an object > blessed to that package. Simply putting a line like this in your code > won't work: > > super_class_method(); > > Also be sure that all methods take a $self object as the first > parameter (that is expected to be either a blessed reference or a > package name. > > Cheers, > -Brian > > On Oct 12, 2004, at 8:10 AM, Dan Ebert wrote: > > > > > I thought that if you were inheriting you didn't have to 'use' the base > > class. > > > > I tried just putting 'use CLE2::Interface' in the provisionerIF module > > and > > that didn't work. The only way I could get it to work is to put all > > the > > methods in @EXPORT_OK in the CLE2::Interface and use CLE2::Interface > > qw(all the methods) in the CLE2::Provisioner. I didn't think this was > > supposed to be necessary if the CLE2::Interface was in the @ISA array. > > It > > isn't described like this in the Camel book or in O'Reilly's 'Advanced > > Perl Programming' > > > > So, I got it to work, but I don't think I'm doing it the 'right' way. > > > > Dan. > > ---------------------------------------------------------- > > Immigration is the sincerest form of flattery. > > - Unknown > > ---------------------------------------------------------- > > > > > > On Mon, 11 Oct 2004, Umar Cheema wrote: > > > >> In your package CLE2::ProvisionerIF, you seem to be missing this line: > >> > >> use CLE2::Interface; > >> > >> > >> > >> > >> > >> On Mon, 11 Oct 2004, Dan Ebert wrote: > >> > >>> > >>> I am trying to create a series of modules which inherit from a base > >>> class. > >>> The base class looks like this: > >>> > >>> package CLE2::Interface; > >>> ##################################################################### > >>> ########## > >>> use strict; > >>> ##################################################################### > >>> ########## > >>> use vars qw(@ISA @EXPORT_OK $VERSION $err); > >>> require Exporter; > >>> $VERSION = '0.01'; > >>> @ISA = qw(Exporter); > >>> ##################################################################### > >>> ########## > >>> zub allocate { > >>> my $invocant = shift; > >>> my $class = ref($invocant) || $invocant; # Object or class > >>> name > >>> my $interface = bless { @_ }, $class; > >>> return $interface; > >>> } > >>> ##################################################################### > >>> ########## > >>> > >>> and is saved to a file: CLE2/Interface.pm > >>> > >>> I have another module, CLE2/ProvisionerIF.pm > >>> > >>> package CLE2::ProvisionerIF; > >>> ##################################################################### > >>> ########## > >>> use strict; > >>> ##################################################################### > >>> ########## > >>> use vars qw(@ISA @EXPORT_OK $VERSION $err); > >>> require Exporter; > >>> $VERSION = '0.01'; > >>> @ISA = ("CLE2::Interface"); # I'v also tried @ISA = ("Interface"); > >>> ##################################################################### > >>> ########## > >>> zub new { > >>> my $pkg = shift; > >>> return $pkg->allocate(@_); > >>> } > >>> ##################################################################### > >>> ########## > >>> > >>> I have a script which uses CLE2::ProvisionerIF: > >>> > >>> use CLE2::ProvisionerIF; > >>> > >>> my $provisioner = new CLE2::ProvisionerIF( %param_hash ); > >>> > >>> I'm getting an error, "Can't locate object method "allocate" via > >>> package > >>> "CLE2::ProvisionerIF" at CLE2/ProvisionerIF.pm line 20." (line 20 > >>> is the > >>> line with "return $pkg->allocate(@_)") > >>> > >>> I must be missing something simple, but I can't put my finger on it. > >>> > >>> Any help is appreciated. > >>> > >>> Thanks, > >>> > >>> Dan. > >>> ---------------------------------------------------------- > >>> Immigration is the sincerest form of flattery. > >>> - Unknown > >>> ---------------------------------------------------------- > >>> > >>> > >>> _____________________________________________________________ > >>> 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 > >> > > > > _____________________________________________________________ > > 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 > > > > > -- > Brian Maher >> Glory to God << > From andrew at sweger.net Fri Oct 15 01:11:44 2004 From: andrew at sweger.net (Andrew Sweger) Date: Fri Oct 15 01:11:54 2004 Subject: SPUG: Meeting Announcement -- Hello Perl & DBD::mysql - 19 October 2004 Message-ID: October Seattle Perl Users Group (SPUG) Meeting =============================================== Title: Hello, Perl Speaker: C.J. Collier and Title: How DBD::mysql Enhancements Can Benefit the Perl Developer Speaker: Patrick Galbraith Meeting Date: Tuesday, October 19, 2004 Meeting Time: 7:00 - 9:00 p.m. (networking 6:30 - 7:00) Location: Amazon.com Pac-Med Building Cost: Admission is free and open to the general public Info: http://seattleperl.com/ =========================================== It's a month of excellence for SPUG once again. Many, many thanks to C.J. Collier for engineering and fine tuning what should make for a excellent SPUG meeting this month. C.J. had an excellent speaker all lined up for us which fell apart at the last minute (through no one's fault) and he went and found someone no less excellent: Patrick Galbraith of MySQL. I mentioned to C.J. that it would be great if we could also get a talk in aimed at folks wanting to get into the Perl game without drowning in obscure details and religious wars. The next thing I knew, C.J. was volunteering to provide an introduction to this most excellent programming language. And to top it all off, C.J. has also arranged for us to meet in the most excellent A/V meeting room at Amazon.com's Pac Med building. See the presentation details below. I am not providing directions to the meeting location in this email. It was more important to get the announcement out (since I'm already late in doing so). Someone will post this information separately. If you want to exchange PGP/GnuPG signatures, please contact me directly with your public key (now!) and I'll bring fingerprint checklists for participants. Contact me if you want to know more. What's with seattleperl.org and seattleperl.net? The registrar failed to complete a renewal (they happily took my money however) and the entries got pulled from the TLD's. It's being fixed along with many other things that are broken thanks to me. Excellent. (Okay, that should be the last time I use that word today.) Here's what's in store for you at our next meeting: Hello, Perl =========== About C.J. Collier: ------------------- Owner and operator of Collier Technologies. He is currently working with Amazon's Enterprise Commerce Services to build the next generation of E-commerce infrastructure. C.J. has been using Perl since 1998 for tasks including daily system administration, building test automation infrastructure and desktop application programming. About the Presentation ---------------------- C.J. will guide beginners through their first iterations of Hello World, exploring Perl syntax, scalars, lists and basic list operators. Please bring a laptop if you want to participate in this portion of the meeting. Sitting next to an experienced Perl guru will likely help as well. ================================================================ How DBD::mysql Enhancements Can Benefit the Perl Developer ========================================================== About Patrick Galbraith: ------------------------ Patrick Galbraith is a Senior Systems Engineer with MySQL AB. He has been enjoying Perl and open source software since 1994 and has been lucky enough to pay his bills doing so! - Launched East Side Journal's website (now Kingcountyjournal) in 1996 - Worked for the Cobalt Group from 1997-1999 - Worked for OSDN on Slashcode/slashdot.org from 1999 to 2002 (now OSTG) - Other stints - Classmates.com, TMobile - currently Senior Software/Engineer at MySQL AB where he works on DBD::mysql, build tools, and most recently the MySQL Federated Storage Handler About the Presentations ----------------------- MySQL, until version 4.1, didn't have server-side prepare statements in the C API (which DBD::mysql uses). With the current version of DBD::mysql, prepare statements with placeholders are emulated by simple string replacement, and results in having none of the benefits of using 'prepare' with placeholders, so many perl developers haven't really utilized the benefit of using placeholders in SQL such as with: my $val1 = 1; my $val2 = 'Test value'; my $sth = $dbh->prepare("INSERT INTO testtable VALUES (?, ?)"); $dbh->execute($val1, $val2); Now that MySQL version 4.1 and later versions are available, it is possible to perform server side prepare statements in the C API, which results in much better performance. DBD::mysql will soon (if not now) have this functionality, which will give Perl developers the ability to use server side prepare statements, which in turn will give them better performance. Patrick will show the Perl developer briefly how this was accomplished in the driver code. Also, he will show them how to write applications that take advantage of this new functionality, such as how they can prepare a single SQL insert statement and simply pass the values they wish for their application to insert by simply calling 'execute' as in the previous example. He will detail how their application can benefit from this, and how it will result in fewer database calls, using a mod_perl database-driven web application as an example. He will also discuss future ideas for DBD::mysql, such as named placeholders and cursors. ================================================================ Okay, what did I forget this time? From andrew at sweger.net Mon Oct 18 15:34:18 2004 From: andrew at sweger.net (Andrew Sweger) Date: Mon Oct 18 15:34:28 2004 Subject: SPUG: Meeting REMINDER -- Hello Perl & DBD::mysql - 19 October 2004 (fwd) Message-ID: Tomorrow night at Amazon.com's Pac-Med building. Would anyone care to write some sensible directions to the building and post to the list. I'll get it on the website if someone would do that please. Thanks! October Seattle Perl Users Group (SPUG) Meeting =============================================== Title: Hello, Perl Speaker: C.J. Collier and Title: How DBD::mysql Enhancements Can Benefit the Perl Developer Speaker: Patrick Galbraith Meeting Date: Tuesday, October 19, 2004 Meeting Time: 7:00 - 9:00 p.m. (networking 6:30 - 7:00) Location: Amazon.com Pac-Med Building Cost: Admission is free and open to the general public Info: http://seattleperl.com/ =========================================== It's a month of excellence for SPUG once again. Many, many thanks to C.J. Collier for engineering and fine tuning what should make for a excellent SPUG meeting this month. C.J. had an excellent speaker all lined up for us which fell apart at the last minute (through no one's fault) and he went and found someone no less excellent: Patrick Galbraith of MySQL. I mentioned to C.J. that it would be great if we could also get a talk in aimed at folks wanting to get into the Perl game without drowning in obscure details and religious wars. The next thing I knew, C.J. was volunteering to provide an introduction to this most excellent programming language. And to top it all off, C.J. has also arranged for us to meet in the most excellent A/V meeting room at Amazon.com's Pac Med building. See the presentation details below. I am not providing directions to the meeting location in this email. It was more important to get the announcement out (since I'm already late in doing so). Someone will post this information separately. If you want to exchange PGP/GnuPG signatures, please contact me directly with your public key (now!) and I'll bring fingerprint checklists for participants. Contact me if you want to know more. What's with seattleperl.org and seattleperl.net? The registrar failed to complete a renewal (they happily took my money however) and the entries got pulled from the TLD's. It's being fixed along with many other things that are broken thanks to me. Excellent. (Okay, that should be the last time I use that word today.) Here's what's in store for you at our next meeting: Hello, Perl =========== About C.J. Collier: ------------------- Owner and operator of Collier Technologies. He is currently working with Amazon's Enterprise Commerce Services to build the next generation of E-commerce infrastructure. C.J. has been using Perl since 1998 for tasks including daily system administration, building test automation infrastructure and desktop application programming. About the Presentation ---------------------- C.J. will guide beginners through their first iterations of Hello World, exploring Perl syntax, scalars, lists and basic list operators. Please bring a laptop if you want to participate in this portion of the meeting. Sitting next to an experienced Perl guru will likely help as well. ================================================================ How DBD::mysql Enhancements Can Benefit the Perl Developer ========================================================== About Patrick Galbraith: ------------------------ Patrick Galbraith is a Senior Systems Engineer with MySQL AB. He has been enjoying Perl and open source software since 1994 and has been lucky enough to pay his bills doing so! - Launched East Side Journal's website (now Kingcountyjournal) in 1996 - Worked for the Cobalt Group from 1997-1999 - Worked for OSDN on Slashcode/slashdot.org from 1999 to 2002 (now OSTG) - Other stints - Classmates.com, TMobile - currently Senior Software/Engineer at MySQL AB where he works on DBD::mysql, build tools, and most recently the MySQL Federated Storage Handler About the Presentations ----------------------- MySQL, until version 4.1, didn't have server-side prepare statements in the C API (which DBD::mysql uses). With the current version of DBD::mysql, prepare statements with placeholders are emulated by simple string replacement, and results in having none of the benefits of using 'prepare' with placeholders, so many perl developers haven't really utilized the benefit of using placeholders in SQL such as with: my $val1 = 1; my $val2 = 'Test value'; my $sth = $dbh->prepare("INSERT INTO testtable VALUES (?, ?)"); $dbh->execute($val1, $val2); Now that MySQL version 4.1 and later versions are available, it is possible to perform server side prepare statements in the C API, which results in much better performance. DBD::mysql will soon (if not now) have this functionality, which will give Perl developers the ability to use server side prepare statements, which in turn will give them better performance. Patrick will show the Perl developer briefly how this was accomplished in the driver code. Also, he will show them how to write applications that take advantage of this new functionality, such as how they can prepare a single SQL insert statement and simply pass the values they wish for their application to insert by simply calling 'execute' as in the previous example. He will detail how their application can benefit from this, and how it will result in fewer database calls, using a mod_perl database-driven web application as an example. He will also discuss future ideas for DBD::mysql, such as named placeholders and cursors. ================================================================ Okay, what did I forget this time? _____________________________________________________________ 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 cjcollier at colliertech.org Mon Oct 18 19:29:33 2004 From: cjcollier at colliertech.org (CJ Collier) Date: Mon Oct 18 19:29:42 2004 Subject: SPUG: Meet at amazon.com Pac-Med office? In-Reply-To: References: Message-ID: <1098145773.1658.49.camel@cjcoll.desktop.amazon.com> Here are some directions from a few weeks ago. A basic sanity test tells me that they are likely correct. C.J. On Thu, 2004-09-23 at 13:05 -0700, Aaron W. West wrote: > I'm sorry, but the right is on 8th Ave S, not 10th. > > You can take 10th on the way back to the highway, but it's a one-way. > (You'll see 10th straight across from the end of the ramp when you get off > the exit, but can't go up it.) > > Other routes I've taken include Denny St, L Boren, R 12th (but a long slow > drive on Boren in traffic) > > ----- Original Message ----- > From: "Aaron W. West" > To: > Sent: Thursday, September 23, 2004 11:52 AM > Subject: Re: SPUG: Meet at amazon.com Pac-Med office? > > > The best route I found by car: > > >From north: > > I5-S, take the Dearborn exit. > > At the end of the ramp, turn left to head west on Dearborn (under the bridge > then down the hill). > > Take the first right after the bridge, onto 10th ave S. > > Go about three blocks to take the first non-dead-end right (King Street). > > Take a right onto 12th. Follow up the hill, across the bridge, and take a > right at the light (onto Charles Street), then park on the street and walk > to the entrance. > > As for taking the bus, unless you are on either the #60 or #36 routes, > you'll need to transfer, so I usually found it a bit inconvenient to do and > opted to drive. But use http://transit.metrokc.gov or > http://tripplanner.metrokc.gov > > ----- Original Message ----- > From: "Rizvi, Ali" > To: "Andrew Sweger" ; "Seattle Perl Users Group" > > Sent: Thursday, September 23, 2004 10:03 AM > Subject: RE: SPUG: Meet at amazon.com Pac-Med office? > > > I think it would be awesome to have the meeting at Amazon. I am an amazonian > and ofcourse, I am biased by my laziness to travel far but as far as I know > Laziness is one of the virtues of a perl hacker. :-) > > I am looking forward to attend the first meeting at PacMed soon. > > Thanks for all the effort on the organizers part to make it happen. > > Ali > > -----Original Message----- > From: spug-list-bounces@mail.pm.org [mailto:spug-list-bounces@mail.pm.org] > On Behalf Of Andrew Sweger > Sent: Wednesday, September 22, 2004 8:58 AM > To: Seattle Perl Users Group > Subject: SPUG: Meet at amazon.com Pac-Med office? > > C.J. Collier, a longtime SPUG member and recent new hire at amazon.com, has > done all the footwork to provide SPUG the opportunity to hold our monthly > meetings in the A/V room at the amazon.com Pac-Med office (near the I-5 & > I-90 interchange). The arrangement would be similar to the years we met at > Safeco tower in the U-district (visitor sign-in, escort to meeting room). > C.J. is offering to sponsor our group in meeting there and will be our > representative (ambassador?) to the company (like Dora Choi was for Safeco). > > So, what do folks think about this? > > Some information I already know folks will need include: access from > freeway, parking availability nearby, size of room, projector, Internet > access, nearby food/drink establishments for pre- and post-meeting activity. > C.J. will try to provide some of that when he has a chance. I'll work on > gathering some of this information next week when I'm back in town. What > else do folks need to know (as if the location wasn't enough)? > > Discuss. > > (We're tentatively lining things up to meet there for our 19 October > meeting. We are still welcome to meet at Geospiza for the foreseeable > future.) > > -- > Andrew B. Sweger -- The great thing about multitasking is that several > things can go wrong at once. > > _____________________________________________________________ > 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 > _____________________________________________________________ > 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 > From jay at scherrer.com Mon Oct 18 20:59:02 2004 From: jay at scherrer.com (Jay Scherrer) Date: Mon Oct 18 20:59:08 2004 Subject: SPUG: Meeting REMINDER -- Hello Perl & DBD::mysql - 19 October 2004 (fwd) In-Reply-To: References: Message-ID: <200410181859.02965.jay@scherrer.com> Is there anyway we could get an address? I've seen the directions: >From north: > I5-S, take the Dearborn exit. > At the end of the ramp, turn left to head west on Dearborn (under the bridge > then down the hill). > Take the first right after the bridge, onto 10th ave S. > Go about three blocks to take the first non-dead-end right (King Street). > Take a right onto 12th. Follow up the hill, across the bridge, and take a right at the light (onto Charles Street), then park on the street and walk to the entrance. But some I feel more comfortable with a physical address to fall back on. Jay Scherrer Scherrer Company From sthoenna at efn.org Mon Oct 18 21:02:35 2004 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Mon Oct 18 21:02:43 2004 Subject: SPUG: Meeting Announcement -- Hello Perl & DBD::mysql - 19 October 2004 In-Reply-To: References: Message-ID: <20041019020235.GA2144@efn.org> On Thu, Oct 14, 2004 at 11:11:44PM -0700, Andrew Sweger wrote: > Hello, Perl > =========== > Sitting next to an experienced Perl guru will likely help as well. So you can listen to them mutter caveats and exceptions to what C.J. says and know about all the fiddly details being glossed over? :) From jay at scherrer.com Mon Oct 18 21:25:53 2004 From: jay at scherrer.com (Jay Scherrer) Date: Mon Oct 18 21:25:59 2004 Subject: SPUG: Meet at amazon.com Pac-Med office? In-Reply-To: <1098145773.1658.49.camel@cjcoll.desktop.amazon.com> References: <1098145773.1658.49.camel@cjcoll.desktop.amazon.com> Message-ID: <200410181925.54000.jay@scherrer.com> Is this the correct address? Amazon.com Building 1143 14th Avenue South Seattle, WA 98144 Just making sure. Jay Scherrer Scherrer Company From andrew at sweger.net Mon Oct 18 21:41:41 2004 From: andrew at sweger.net (Andrew Sweger) Date: Mon Oct 18 21:41:44 2004 Subject: SPUG: Meet at amazon.com Pac-Med office? In-Reply-To: <200410181925.54000.jay@scherrer.com> Message-ID: On Mon, 18 Oct 2004, Jay Scherrer wrote: > Is this the correct address? > > Amazon.com Building > 1143 14th Avenue South > Seattle, WA 98144 It is. The other side of the building (property/campus/whatever) would be: 1200 12th Ave S #1200 Seattle WA 98144 -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. From bill at celestial.com Mon Oct 18 22:28:33 2004 From: bill at celestial.com (Bill Campbell) Date: Mon Oct 18 22:28:37 2004 Subject: SPUG: Meeting REMINDER -- Hello Perl & DBD::mysql - 19 October 2004 (fwd) In-Reply-To: <200410181859.02965.jay@scherrer.com> References: <200410181859.02965.jay@scherrer.com> Message-ID: <20041019032833.GA28402@alexis.mi.celestial.com> On Mon, Oct 18, 2004, Jay Scherrer wrote: >Is there anyway we could get an address? It's the big building on top of the hill. You can't miss it. >I've seen the directions: >>From north: >> I5-S, take the Dearborn exit. >> At the end of the ramp, turn left to head west on Dearborn (under >the bridge >> then down the hill). >> Take the first right after the bridge, onto 10th ave S. >> Go about three blocks to take the first non-dead-end right (King >Street). >> Take a right onto 12th. Follow up the hill, across the bridge, and >take a right at the light (onto Charles Street), then park on the >street and walk to the entrance. >But some I feel more comfortable with a physical address to fall back >on. > >Jay Scherrer >Scherrer Company >_____________________________________________________________ >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 > -- Bill -- INTERNET: bill@Celestial.COM Bill Campbell; Celestial Software LLC UUCP: camco!bill PO Box 820; 6641 E. Mercer Way FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676 URL: http://www.celestial.com/ ``Whenever you find yourself on the side of the majority it is time to pause and reflect.'' -- Mark Twain From andrew at sweger.net Tue Oct 19 03:27:54 2004 From: andrew at sweger.net (Andrew Sweger) Date: Tue Oct 19 03:28:03 2004 Subject: SPUG: Directions to Amazon.com Pac-Med building In-Reply-To: <1098145773.1658.49.camel@cjcoll.desktop.amazon.com> Message-ID: Okay, here is a revised (though not necessarily better) version of Aaron's directions with some possible corrections and further details: I-5 (from North or South) ========================= On I-5, take the S Dearborn St exit and turn West on Dearborn (I-5 Southbound: turn right; I-5 Northbound: turn left) and proceed approximately two blocks. Turn right on 8th Ave S and proceed North for three blocks. Turn right on S King St and proceed East for approximately five blocks. Turn right on 12th Ave S and proceed South for approximately five blocks. Along this way, you will cross over the Rizal bridge. At this point, notice that you have been going in a circle. Skip to Pac-Med Building below. I-90 (from East) ================ On I-90, take the Rainier Ave S (hwy 900) exit Northbound and proceed approximately six blocks. Turn left on S King St and proceed West for approximately two blocks. Turn left on 12th Ave S and proceed South for approximately five blocks. Along this way, you will cross over the Rizal bridge. Pac-Med Building ================ Turn right at Charles St (the light after the bridge). The Amazon.com Pac-Med building is visible ahead and on the left as you make the turn and proceed South on Charles (Charles borders the West side of the building). Park. Walk to the South entrance of the tower. There is a convenient path that goes around the building in case you accidently end up at the North entrance. Enter building and go to the reception/security desk to the right. Sign in and wait to be escorted to the meeting room (just like when we met at Safeco in the U-district, more or less). Hopefully I didn't introduce any critical errors this time. Putting it up on the http://seattleperl.org/ page shortly... -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. From andrew at sweger.net Wed Oct 20 17:41:10 2004 From: andrew at sweger.net (Andrew Sweger) Date: Wed Oct 20 17:41:19 2004 Subject: SPUG: The SPUG Report, 19 October 2004 Message-ID: Last night's meeting was the first to be held at the Amazon.com Pac-Med building near Rizal Park at the North end of Beacon Hill. About 16 people turned out with approximately a third of them there specifically to get an introduction to Perl by C.J. Collier. Following C.J. was Patrick Galbraith of MySQL AB who showed how the Perl-MySQL DBI interface (DBD::mysql) is advancing and taking advantage of advances in the MySQL database server and its client protocol. The biggest development in the works that has me excited will be support for embedded MySQL via DBI. I'd like to extend thanks on behalf of SPUG to Patrick for giving his time to share with us (in fact, I did just that). I'd like to encourage all SPUGgers to take some time to lavish some well deserved gratitude upon C.J. Collier. Not only did he give a Perl introduction, but he's the man behind getting SPUG the privilege of meeting in such a fine location. He also sought out and arranged for Patrick to present at the meeting. And to top it off, he even got permission for us to use the Amazon network to access the Internet. Oh, and he's responsible for designing and printing some snazzy fliers advertising the meeting to the Amazonian crowd. And convincing next month's speaker into giving up some of his precious personal time. Our meetings at Amazon are currently probationary to make sure it's a good fit. Based on the meeting last night, I'd say we're doing very well so far (again, many thanks to C.J.). Our next meeting will be at the same location. Presently, Jonathan Swartz is scheduled to speak on his creation, Mason, a powerful Perl-based web site development and delivery engine. We're going to try asking folks to RSVP for the November meeting. I'm looking for suggestions or experience on how to conduct that efficiently (evite, meetup, etc.). The RSVPs will help the facility's security personal prepare the appropriate number of badges required and speed the check-in process. I don't think RSVPs will be required, but will certainly help make things more efficient. According to security personnel, free guest parking is available after hours on the building lots. It should not be necessary to park on the street. I took a quick attendance survey, partly to see how the location effected turnout. I don't really see anything significant in the numbers. The number of Amazon employees at the meeting was seven. The following are the number of people who attended SPUG meetings at these past locations in attendance last night: Geospiza (Interbay) 6 Safeco (U-District) 4 N2H2 (Downtown) 3 FHCRC (S. Lk Union) 2 E-SPUG (Bellevue) 2 Ballard? Community Center 1 Of the following top reasons to attend last night's meeting, the following number of people raised their hand: Topics 1 Speakers 4 Location 6 (Note the similarity in the number of people citing location as the number one reason and the number of Amazonian's in attendance.) I would like to hear feedback on why *you* weren't there (if there was a chance that you would have attended in any event). Were there problems with the directions? No wheels? Other problems? Thanks. The November meeting will Tuesday, 16 November 2004 at 7:00 p.m. PST at the Amazon.com Pac-Med building featuring Jonathan Swartz speaking on Mason. More details to follow. -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. From andrew at sweger.net Wed Oct 20 18:00:38 2004 From: andrew at sweger.net (Andrew Sweger) Date: Wed Oct 20 18:00:47 2004 Subject: SPUG: Meeting Announcement -- Mason - 16 November 2004 Message-ID: November Seattle Perl Users Group (SPUG) Meeting ================================================ Title: Mason Speaker: Jonathan Swartz Meeting Date: Tuesday, November 16, 2004 Meeting Time: 7:00 - 9:00 p.m. (networking 6:30 - 7:00) Location: Amazon.com Pac-Med Building Cost: Admission is free and open to the general public Info: http://seattleperl.org/ =========================================== I'm going to try to stay on the ball this time and get the announcement out now for the November meeting. More details should become available with time. If you want to exchange PGP/GnuPG signatures, please contact me directly with your public key (now!) and I'll bring fingerprint checklists for participants. Contact me if you want to know more. Here's what's in store for you at our next meeting: Hello, Perl =========== About Jonathan Swartz --------------------- He created Mason and works at Amazon.com. We'd love to know more about him. About the Presentation ---------------------- Jonathan will give a presentation on Mason, a powerful Perl-based web site development and delivery engine. With Mason you can embed Perl code in your HTML and construct pages from shared, reusable components. The specific material to be covered will be forthcoming. ================================================================ DIRECTIONS ========== These directions are relatively usable. I (or someone) will try to refine these over time with experience. I-5 (from North or South) ========================= On I-5, take the S Dearborn St exit and turn West on Dearborn (I-5 Southbound: turn right; I-5 Northbound: turn left) and proceed approximately one or two blocks. Turn right on 8th Ave S (the first light) and proceed North for three blocks. Turn right on S King St and proceed East for approximately five blocks. You will pass under I-5. Turn right on 12th Ave S and proceed South for approximately five blocks. Along this way, you will cross over the Dr. Jose P. Rizal bridge and you should see the Pac-Med tower directly ahead. At this point, notice that you have been going in a circle. Skip to Pac-Med Building below. I-90 (from East) ================ On I-90, take the Rainier Ave S (hwy 900) exit Northbound and proceed approximately six blocks. Turn left on S King St and proceed West for approximately two blocks. Turn left on 12th Ave S and proceed South for approximately five blocks. Along this way, you will cross over the Dr. Jose P. Rizal bridge and you should see the Pac-Med tower directly ahead. Pac-Med Building ================ Turn right at Charles St (the light after the bridge). The Amazon.com Pac-Med building is visible ahead and on the left as you make the turn and proceed South on Charles (Charles borders the West side of the building). The North parking lot entrance will be the second drive way on the left (the first has a Do Not Enter sign). The parking lot is on the left just past the parking attendant booth. The "carpool only" spaces should be okay to park in after 6:30. Walk to the South entrance of the tower. There is stair next to the parking garage structure that leads to a convenient path that goes around the building to the main entrance on the South side of the building. Enter building and go to the security desk. Sign in and wait to be escorted to the meeting room (just like when we met at Safeco in the U-district, more or less). From jay at scherrer.com Wed Oct 20 18:57:23 2004 From: jay at scherrer.com (Jay Scherrer) Date: Wed Oct 20 18:57:31 2004 Subject: SPUG: Thanks Message-ID: <200410201657.23530.jay@scherrer.com> C. J. Collier, I just wanted to send another $gratitude = "Thank you"; Jay Scherrer From umar at drizzle.com Wed Oct 20 19:03:42 2004 From: umar at drizzle.com (Umar Cheema) Date: Wed Oct 20 19:03:50 2004 Subject: SPUG: Thanks In-Reply-To: <200410201657.23530.jay@scherrer.com> Message-ID: If I were you I'd make my message a bit more personal. my $gratitude = "Thank you"; On Wed, 20 Oct 2004, Jay Scherrer wrote: > C. J. Collier, > > I just wanted to send another > > $gratitude = "Thank you"; > > Jay Scherrer > _____________________________________________________________ > 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: Amazon.com Pac-Med > WEB PAGE: http://seattleperl.org/ > From andrew at sweger.net Wed Oct 20 20:42:00 2004 From: andrew at sweger.net (Andrew Sweger) Date: Wed Oct 20 20:42:07 2004 Subject: SPUG: Thanks In-Reply-To: Message-ID: Now that's class. Speaking of class, our $cj_collier = new Person; $cj_collier->ThankYou (from => "SPUGdom"); Next? On Wed, 20 Oct 2004, Umar Cheema wrote: > If I were you I'd make my message a bit more personal. > > my $gratitude = "Thank you"; > > > On Wed, 20 Oct 2004, Jay Scherrer wrote: > > > C. J. Collier, > > > > I just wanted to send another > > > > $gratitude = "Thank you"; -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. From tim at consultix-inc.com Thu Oct 21 11:38:27 2004 From: tim at consultix-inc.com (Tim Maher) Date: Thu Oct 21 11:38:36 2004 Subject: SPUG: Inheritance In-Reply-To: <1097544583.1184.0.camel@localhost.localdomain> References: <1097544583.1184.0.camel@localhost.localdomain> Message-ID: <20041021163827.GA9186@jumpy.consultix-inc.com> On Mon, Oct 11, 2004 at 06:29:44PM -0700, Dan Ebert wrote: > > > zub allocate { > > ... > > > zub new { > > What's zub? > > > > Jon > it used to be (don't know if it still is) that if you put s-u-b in the > body of the email, the email listserve would choke on it. > > We got rid of that problem when we moved from MajorDomo to MailMan, a few years ago. So use "sub" all you want, with impunity! -- *--------------------------------------------------------------------------* | Tim Maher, CEO (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for Shell Users & Programmers" | | Classes! 11/30: Perl Programming and Modules 12/6: Shell & Utilities | *--------------------------------------------------------------------------* From cjcollier at colliertech.org Thu Oct 21 12:17:47 2004 From: cjcollier at colliertech.org (CJ Collier) Date: Thu Oct 21 12:18:45 2004 Subject: SPUG: The SPUG Report, 19 October 2004 In-Reply-To: References: Message-ID: <1098379067.2719.24.camel@cjcoll.desktop.amazon.com> > I'd like to encourage all SPUGgers to take some time to lavish some well > deserved gratitude upon C.J. Collier. Thank you Andrew, but I can't take all of the credit for myself. I wouldn't have been able to do it without the help of Tim O'Reilly from O'Reilly Media, Colin Bryar, the Technical Assistant Director at Amazon, John Schoettler, the senior manager of Global Property Management at Amazon, Bruce Blank, the Media Services Project Manager for the PacMed AV room, David Carswell, who provided escorts to attendees, Kelly Lobello, who set up the AV room for us, Kuyper Hoffman, the security engineer who okayed us for using the external Internet connections, and all of the attendees, without whom we wouldn't have a reason to throw this shindig. I look forward to seeing many of you at the next meeting. I spoke with Jon this morning, and it sounds like he's going to have an interesting presentation that should appeal to beginning Mason users, as well as experienced folks. Cheers, C.J. From andrew at sweger.net Mon Oct 25 10:56:18 2004 From: andrew at sweger.net (Andrew Sweger) Date: Mon Oct 25 10:56:32 2004 Subject: SPUG: SPUG website stuff Message-ID: Hopefully the SPUG website URL's are working as expected. The wiki is now located at http://wiki.seattleperl.org/ The old URL (http://spugwiki.perlocity.org/) should redirect to the new one. C.J. asked Ask to configure another handy URL for the main website, http://seattle.pm.org/ -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. From andrew at sweger.net Tue Oct 26 13:12:12 2004 From: andrew at sweger.net (Andrew Sweger) Date: Tue Oct 26 13:12:21 2004 Subject: SPUG: JOB: Systems Engineer Message-ID: TEKsystems is an IT & Communications staffing company: TEKsystems is looking for 3 Systems Engineers to implement an application to help manage a provisioning service to monitor, change, fine tune, and maintain new system database. Enterprise systems management is a must in addition the ability to design, troubleshoot, and communicate on systems including tools such as BMC, Tivoli Monitoring, NetlQ, Maestro, Veritas Net backup, UNIX variants, and Windows. Scripting skills in Perl and PHP is a MUST. Must also have MYSQL. Required skills: Unix - HPUX, Solaris, Linux- Design, administration, troubleshooting and maintenance Perl, MySQL, PHP Experience with one or more of the following: BMC, Tivoli Monitoring, NetlQ, Maestro, Veritas Net backup, UNIX variants, and Windows Contract: 3+ months, W2 Location: Bothell, WA (telecommuting is *not* an option) Industry: telecommunication Pay: DOE To Apply, please email your resume to: tpritche@teksystems.com About TEK Systems: Join TEKsystems, one of the leading IT consulting and services providers in the United States. As a result of our rapid growth and merger with our sister company, Maxim Group, we are constantly searching for talented technical professionals with all levels of information technology and communications skills. From the personal delivery of your weekly checks, to our dedication at finding you the next project, we take care of our people. TEKsystems knows that every professional has different needs, so we'll work together to determine a suitable benefits package. We offer our team members a health plan, 401k, provisions for vacation and holiday pay, and technical and professional training. EOE From cos at indeterminate.net Wed Oct 27 15:20:50 2004 From: cos at indeterminate.net (John Costello) Date: Wed Oct 27 15:21:02 2004 Subject: SPUG: Behavior of &&'ed functions Message-ID: I have some code which boils down to the example shown below. I expected to see four lines of output, with $column incremented twice. Instead, the first print statement in each block does not output. Instead, the second and third lines are performed and apparently the first print outputs the boolean evaluation of &&'ed statements. Why does Perl (5.8.0) behave this way? Enlightenment appreciated. John #!/localdepot/perl-5.80/bin/perl -w # test6.pl use strict; my ($column); $column = 0; print "column is: $column\n" && ++$column && print "now column is: $column\n"; print "and column is: $column\n" && $column++ && print "and now column is: $column\n"; > ./test6.pl now column is: 1 1and now column is: 2 1 ----- John Costello - cos at indeterminate dot net "If you are afraid of butter, use cream."--Julia Child From tleffler at u.washington.edu Wed Oct 27 15:41:28 2004 From: tleffler at u.washington.edu (Trevor Leffler) Date: Wed Oct 27 15:41:44 2004 Subject: SPUG: Behavior of &&'ed functions In-Reply-To: References: Message-ID: <418007F8.3030403@u.washington.edu> Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3202 bytes Desc: S/MIME Cryptographic Signature Url : http://mail.pm.org/archives/spug-list/attachments/20041027/4bf4e3e5/smime.bin From krahnj at telus.net Wed Oct 27 16:07:11 2004 From: krahnj at telus.net (John W. Krahn) Date: Wed Oct 27 16:07:18 2004 Subject: SPUG: Behavior of &&'ed functions In-Reply-To: References: Message-ID: <41800DFF.70005@telus.net> John Costello wrote: > I have some code which boils down to the example shown below. I expected > to see four lines of output, with $column incremented twice. Instead, the > first print statement in each block does not output. Instead, the second > and third lines are performed and apparently the first print outputs the > boolean evaluation of &&'ed statements. Why does Perl (5.8.0) behave this > way? > > Enlightenment appreciated. > > > #!/localdepot/perl-5.80/bin/perl -w > # test6.pl > use strict; > > my ($column); > > $column = 0; > > print "column is: $column\n" > && ++$column > && print "now column is: $column\n"; > > print "and column is: $column\n" > && $column++ > && print "and now column is: $column\n"; > > >>./test6.pl > > now column is: 1 > 1and now column is: 2 > 1 To see what is happening use the B::Deparse module. $ perl -MO=Deparse,-p -e'print "column is: $column\n" && ++$column && print "now column is: $column\n";' print((("column is: $column\n" && (++$column)) && print("now column is: $column\n"))); -e syntax OK John -- use Perl; program fulfillment From cos at indeterminate.net Wed Oct 27 17:20:17 2004 From: cos at indeterminate.net (John Costello) Date: Wed Oct 27 17:22:19 2004 Subject: SPUG: Behavior of &&'ed functions In-Reply-To: <41800DFF.70005@telus.net> Message-ID: Thank you, Trevor, for the excellent explanation and you, JohnK, for the mention of B::Deparse, which is useful for me to know. John ----- John Costello - cos at indeterminate dot net "If you are afraid of butter, use cream."--Julia Child From james at banshee.com Wed Oct 27 18:31:42 2004 From: james at banshee.com (James Moore) Date: Wed Oct 27 18:31:57 2004 Subject: SPUG: Behavior of &&'ed functions In-Reply-To: Message-ID: <200410272331.i9RNVV219502@server2.chocolatelust.com> Not a solution to your problem, but personally I wouldn't really consider this to be a happy use of the ++ operator. If there's more than one instance of the variable in question on a line, I'd almost always rather not use a ++; do the increment on the next line. - James From david.dyck at fluke.com Wed Oct 27 18:48:33 2004 From: david.dyck at fluke.com (David Dyck) Date: Wed Oct 27 18:48:41 2004 Subject: SPUG: Behavior of &&'ed functions (B::Deparse and perltidy) In-Reply-To: References: Message-ID: On Wed, 27 Oct 2004 at 13:20 -0700, John Costello wrote: > Why does Perl (5.8.0) behave this way? Don't you just had it when you start composing email and forget to send it till it's too late :-) I see you were already given a response, but I want to follow up with a plug for 2 perl tools that can help you understand what "perl is thinking" I took your code perl6.pl and used Deparse to explain how perl parses the code perl -MO=Deparse,-p test6.pl > test6p.pl See perldoc B::Deparse for an explanation... When you use the -p option, the output also includes parentheses even when they are not required by precedence, which can make it easy to see if perl is parsing your expressions the way you intended. Then I asked perltidy to pretty print the coutput # see http://perltidy.sourceforge.net perltidy test6p.pl cat test6p.pl.tdy use strict 'refs'; my ($column); ( $column = 0 ); print( ( ( "column is: $column\n" && ( ++$column ) ) && print("now column is: $column\n") ) ); print( ( ( "and column is: $column\n" && ( $column++ ) ) && print("and now column is: $column\n") ) ); From cos at indeterminate.net Fri Oct 29 12:55:10 2004 From: cos at indeterminate.net (John Costello) Date: Fri Oct 29 12:55:30 2004 Subject: SPUG: Behavior of &&'ed functions In-Reply-To: <200410272331.i9RNVV219502@server2.chocolatelust.com> Message-ID: On Wed, 27 Oct 2004, James Moore wrote: > Not a solution to your problem, but personally I wouldn't really consider > this to be a happy use of the ++ operator. If there's more than one > instance of the variable in question on a line, I'd almost always rather not > use a ++; do the increment on the next line. I do not disagree. It is an ugly code snippet. > - James John ----- John Costello - cos at indeterminate dot net "If you are afraid of butter, use cream."--Julia Child