From MichaelRWolf at att.net Mon Jan 1 22:59:37 2007 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon, 1 Jan 2007 22:59:37 -0800 Subject: SPUG: Perl Programming class - 1/8-10 in Kent Message-ID: <000001c72e3b$96033810$0500a8c0@mlaptop> [[Disclaimer: The following community service announcement may sound like a commercial plug. It's both. The SPUG and Perl community should know my commitment to the community. One of the ways I support the community (and myself) is to teach Perl classes. Please read this public enrollment class announcement, or skip it as appropriate for your interest.]] In a rare local appearance, I will be leading a "Perl Programming" class next week in Kent. It's a basic 3-day intro class, with hands-on lab, that I've been teaching across the US and in Canada for a vendor who I've worked with for 8 or so years. About every 12-18 months, it gets offered in Seattle. Next week is such an occasion. If you'd like to learn the basics or fill in some holes in your own home-grown knowledge, this could be a great opportunity for you. It's a small class that got put together on short notice, so there will be plenty of one-on-one time, and opportunities to pursue "off-syllabus" interests. Seats are still available. Operators are standing by... :-) No, you don't need to order by midnight tonight... :-) But don't delay, either. Sorry for the short notice. I just found out about it on Friday. Email me or call me on 206-782-8377 if you'd like more enrollment information. Prices: 3-day Perl Programming: 1495 5-day Perl Programming + CGI/DBI: $2395 Hope to see you there. Thanks, Michael Wolf P.S. The 3-day class is followed by a 2-day add-on that covers references, CGI, and DBI. P.P.S. Enrollment's not limited to locals. We get folks from as far away as the East Coast of US or Canada. For example, I recently had a student who worked for a Bellevue company fly in from Georgia. We can get a good rate for the flight/hotel. Let you out of town friends/colleagues know. It may be a good reason for them to combine a business (or personal) trip with some training. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From jobs-noreply at seattleperl.org Sat Jan 6 15:25:18 2007 From: jobs-noreply at seattleperl.org (SPUG Jobs) Date: Sat, 6 Jan 2007 15:25:18 -0800 (PST) Subject: SPUG: JOB: Pioneer Square start-up, mobile content & applications Message-ID: Perl Developer I'm with StarTechnical and we are an I.T. Staffing and Consulting Company. My client is a 2 plus year start-up based in Pioneer Square that is in the mobile content and applications industry. They are expanding rapidly and they are currently in need of a Perl developer to work within their application team They are seeking a Perl Developer who understands that Perl is a very serious, high-level programming language used in large, complex, high-performance applications, and not just a "scripting tool." Part of their primary applications is written in PERL and this particular application goes out and "crawls" sites to obtain information about pricing, equipment and services offered. Requirements: * 5+ years programming in Perl. * HTML, DHTML, JavaScript, CGI and web development experience. * SQL experience. * C++ or C# (.NET) experience or knowledge is preferred. * Full project life cycle experience. * Strong written and verbal communication skills. * Highly motivated, able to work both in a team and solo. * Must be able to meet deadlines and work well under pressure. * Strong attention to detail. * Strong communication skills and a passion for doing great work. This position is a permanent full time position and medical, dental, vision, holiday and sick pay plus pre-IPO stock options and a generous performance bonus is offered along with a market base salary. The salary is based on the years of experience and the skills sets of the qualified candidate. This position does not allow for telecommuting at this time; however they do have some telecommuting developers. Qualified and interested candidates can submit their resume to: JCSmith at StarTechnical.com J.C. Smith Star Technical, Inc. Senior Technical Recuiter JCSmith at Startechnical.com 208-437-0250 Direct From Eric.D.Peterson at alltel.com Mon Jan 8 15:41:41 2007 From: Eric.D.Peterson at alltel.com (Eric.D.Peterson at alltel.com) Date: Mon, 8 Jan 2007 17:41:41 -0600 Subject: SPUG: DBI question: Lookup given a SID Message-ID: <8476CE21F2E6E543851495D6AB09F2A402385EF3@scarlitnt642.alltel.com> Given a database name (i.e., SID) is there a way to lookup the hostname and/or ip address? For example I know the following: db: dbname Host: xxx.alltel.com IP: nn.nn.nn.nn I'd like to do something like this in Perl. my ( $host, $IP ) = who ( $db ); In this subroutine I'd do the lookup to get the hostname and IP address. Do ya'll know of Perl module that will do that? Or am I just dreaming? I'd like this to work both on Win32 and Solaris Unix. I did some searching, but I must be looking in the wrong places as I can't seem to find much in this area. The issue is that my company no longer has explicit listings in the TNSNAMES.ORA file. So I just create a simple connection string (my $conn = "dbi:Oracle:$sid";). So essentially all I know is the name of the database. But in the case of some sort of failure or error, I'd like to print out more then just the SID name. I'd like to say this database on this machine had a problem with your query. Thanks for any help you can provide. Eric ****************************************************************************************** The information contained in this message, including attachments, may contain privileged or confidential information that is intended to be delivered only to the person identified above. If you are not the intended recipient, or the person responsible for delivering this message to the intended recipient, Alltel requests that you immediately notify the sender and asks that you do not read the message or its attachments, and that you delete them without copying or sending them to anyone else. From offby1 at blarg.net Tue Jan 9 12:19:21 2007 From: offby1 at blarg.net (Eric Hanchrow) Date: Tue, 09 Jan 2007 12:19:21 -0800 Subject: SPUG: DBI question: Lookup given a SID In-Reply-To: <8476CE21F2E6E543851495D6AB09F2A402385EF3@scarlitnt642.alltel.com> (Eric D. Peterson's message of "Mon\, 8 Jan 2007 17\:41\:41 -0600") References: <8476CE21F2E6E543851495D6AB09F2A402385EF3@scarlitnt642.alltel.com> Message-ID: <87vejgosvq.fsf@offby1.atm01.sea.blarg.net> >>>>> writes: Given a database name (i.e., SID) is there a way to lookup the hostname and/or ip address? For example I know the following: db: dbname Host: xxx.alltel.com IP: nn.nn.nn.nn I'd like to do something like this in Perl. my ( $host, $IP ) = who ( $db ); I must be failing to understand something basic. You first say you know the host and IP; then you ask how to get the host and IP. What am I missing? -- Keaton, Chaplin, Garbo - let them now make room for Gromit. A. O. Scott, in The New York Times From Eric.D.Peterson at alltel.com Tue Jan 9 13:28:55 2007 From: Eric.D.Peterson at alltel.com (Eric.D.Peterson at alltel.com) Date: Tue, 9 Jan 2007 15:28:55 -0600 Subject: SPUG: DBI question: Lookup given a SID Message-ID: <8476CE21F2E6E543851495D6AB09F2A401F3D11C@scarlitnt642.alltel.com> Got it. TNSPING will tell me. Now to do a regex or string manipulation and capture the hostname from the line returned. While it's not a "perlish" solution, TNSPING is available both on the PC and Unix boxes I work on. I'm using the switch for now as I'm not sure about all the return permutations. If it's just these two, then a simple if statement would be better. Once I have the hostname in a variable, I can use gethostbyname to get more information. #!perl # ========== ========== ========== ========== ========== ========== ========== $|++; # Disable buffering use warnings; use strict; use Switch; my $results = `tnsping dbname` or die "Unable to call tnsping\n"; my @array = split ( /\n/, $results ); # breakup the output by line foreach ( @array ) { my $line = $_; chomp $line; switch ( $line ) { # Expecting something like this when successful # # Attempting to contact (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=1 521)))(CONNECT_DATA=(SID=dbname))) case /HOST/ { print "$line\n"; } # TNS-03505: Failed to resolve name # or any other TNS error case /TNS-/ { print "$line\n"; } } } -----Original Message----- Sent: Monday, 08 January, 2007 16:19 To: Peterson, Eric D Subject: Re: SPUG: DBI question: Lookup given a SID gethostbyname what you're looking for? On 1/8/07, Eric.D.Peterson at alltel.com wrote: > > Given a database name (i.e., SID) is there a way to lookup the > hostname and/or ip address? For example I know the following: > > db: dbname > Host: xxx.alltel.com > IP: nn.nn.nn.nn > > I'd like to do something like this in Perl. > > my ( $host, $IP ) = who ( $db ); > > In this subroutine I'd do the lookup to get the hostname and IP > address. Do ya'll know of Perl module that will do that? Or am I > just dreaming? I'd like this to work both on Win32 and Solaris Unix. > > I did some searching, but I must be looking in the wrong places as I > can't seem to find much in this area. The issue is that my company no > longer has explicit listings in the TNSNAMES.ORA file. So I just > create a simple connection string (my $conn = "dbi:Oracle:$sid";). So > essentially all I know is the name of the database. But in the case > of some sort of failure or error, I'd like to print out more then just > the SID name. I'd like to say this database on this machine had a > problem with your query. > > Thanks for any help you can provide. > Eric > > > ********************************************************************** > ******************** The information contained in this message, > including attachments, may contain privileged or confidential > information that is intended to be delivered only to the person > identified above. If you are not the intended recipient, or the person > responsible for delivering this message to the intended recipient, > Alltel requests that you immediately notify the sender and asks that > you do not read the message or its attachments, and that you delete them without copying or sending them to anyone else. > > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays > WEB PAGE: http://seattleperl.org/ > ****************************************************************************************** The information contained in this message, including attachments, may contain privileged or confidential information that is intended to be delivered only to the person identified above. If you are not the intended recipient, or the person responsible for delivering this message to the intended recipient, Alltel requests that you immediately notify the sender and asks that you do not read the message or its attachments, and that you delete them without copying or sending them to anyone else. From jobs-noreply at seattleperl.org Wed Jan 10 10:04:43 2007 From: jobs-noreply at seattleperl.org (SPUG Jobs) Date: Wed, 10 Jan 2007 10:04:43 -0800 (PST) Subject: SPUG: JOB: web developers Message-ID: We have the following immediate requirement with our direct client in Seattle, WA. The job description is given below. If you are interested, please reply with a rate confirmation and your resume in word format. Job Title: Web Developers (multiple positions) Duration: 6 months Location: Seattle WA Web Developer Key notes from discussion with the Hiring Manager The client websites are built on the Java platform. Websites are built by extending the functionality provided by the Java. The Java platform acts as an interface between the Website and the platform. This platform is based on Apache and uses a combination of Perl and Java technology. Perl programs are slowly being moved to Java based programs. The SDEs will work on this layer. The client website is the presentation layer and interfaces with the Java platform through a Struts, JSF. The Web Devs will work on this layer and integrate with the Java platform for building the necessary functionality into the website. Web Devs need to develop website based on customer requirements and integrate with the Java platform. All UI development should be based on optimizing the performance of the website Other info: - Applications run on Linux OS and Oracle backend - Client uses Agile methodology. Candidates should have experience with Agile development or with other RAD methodology. Should be familiar and comfortable with scrum working - Candidates should preferably have experience with implementation of application or deployment of packages, especially with external customers. This background will give them experience in project planning, meeting deadlines, being date driven and also a 'get it done' attitude. Job Description Typical background is a graduate software engineer with up to 5 years of web development experience. Must show an interest in a broad range of technologies and interested in developing enterprise grade web sites. Candidates will be responsible for performing front-end development activities involving presentation, primarily in the various dialects of HTML (including XHTML and DHTML), Javascript, and CSS. Examples of sites being developed include Target.com, nbastore.com, Bombaycompany.com, and DVF.com. The candidate must have significant experience and expertise in all of the following: Javascript/DHTML; XHTML; CSS A templating environment such as Perl/Mason, JSF/Facelets, JSP, PHP, or ASP. Good software engineering practices, such as Object Oriented Design, proper variable use, good coding style, etc., as implemented in the languages they are experienced in (e.g. Javascript) Versioning concepts, and some sort of version control, such as CVS, SVN, Perforce, VSS, etc. Also should have significant experience and expertise in several, or all, of the following: Issues surrounding cross browser compatibility Image manipulation and formats, including color models, lossy/lossless compression, interlacing, palettes, and the usage of Photoshop, GIMP, or equivalent Web technologies in general, such as HTTP I18N, L10N, Unicode, and related areas XML/XSLT AJAX The ideal candidate will have additional experience or knowledge in one or more of the following areas: Flash/Actionscript Java: JSP and/or Applets Web Services/SOA: SOAP, XML-RPC, REST Perl: CGI, Mason, LWP, XML XPFE Any of WSH, Tcl/Tk, Python, Ruby, PHP, or unix shell scripting Experience with other "Internet Document Formats", such as PDF, and relevant toolsets, such as Acrobat Experience with relevant toolsets, such as Eclipse, Dreamweaver, etc. Successful candidates should have a four year degree in a field such as graphic arts or design. Thanks and Regards, Harpreet Singh. Recruiter, Akraya Inc. 216 Lundy Ave, #200 San Jose, CA Direct Line: 408 .512 .2361 Fax Number :408-907-6410 E FAX :408-904-6610 URl :www.akraya.com E-mail: Harpreet.Singh at akraya.com From cmeyer at helvella.org Fri Jan 12 15:46:59 2007 From: cmeyer at helvella.org (Colin Meyer) Date: Fri, 12 Jan 2007 15:46:59 -0800 Subject: SPUG: Meeting Announcement -- 16 January 2007 Message-ID: <20070112234659.GA19705@funpox.helvella.org> January 2007 Seattle Perl Users Group (SPUG) Meeting ==================================================== Topic: Hacking Session Meeting Date: Tuesday, 16 January 2007 Meeting Time: 6:30 - 8:30 p.m. Location: Whitepages.com offices, downtown Seattle Cost: Admission is free and open to the public Info: http://seattleperl.org/ ==================================================== Please join us Tuesday evening on the 16 January 2007 at the regular monthly meeting of the Seattle Perl Users Group. This month we'll have an informal get together, to discuss our current projects and have a hacking session. Thank you to our hosts at Whitepages.com for giving us a great place to hold our meetings and presentations, to the SPUG-Workers list for making speaker arrangements, to all the SPUG members that show up at meetings or participate on the list to make the group worthwhile in the first place, and all the JAPHs out there for just being. Meeting Location ================ Whitepages.com is located on the 16th floor of the Rainier Square Tower (1301 5th Avenue, Seattle) which is across from the 5th Avenue Theater. See the directions[1] for a quick primer on how to reach us from various locations across Puget Sound. There are plenty of locations to park in the area, including on the street. If you're looking for off-street parking, you can park in the Rainier Square garage which has an entrance on Union St. After 6PM, the building management restricts access to most floors. Our host is trying to take care of this, but if unsuccessful, they will station someone on the 1st floor near the elevator bank and 5th Avenue entrance to let people in. Worst case scenario, give our host a call on his cell phone[2] and he'll run down to let you in. Our hosts are providing a generous assortment of free sodas, fruit drinks, teas, and coffee, and also have some snacks. You definitely won't dehydrate here. We look forward to seeing you! [1] - http://www.whitepagesinc.com/locations [2] - 206 354 7789 From jerry.gay at gmail.com Fri Jan 12 16:36:27 2007 From: jerry.gay at gmail.com (jerry gay) Date: Fri, 12 Jan 2007 16:36:27 -0800 Subject: SPUG: Meeting Announcement -- 16 January 2007 In-Reply-To: <20070112234659.GA19705@funpox.helvella.org> References: <20070112234659.GA19705@funpox.helvella.org> Message-ID: <1d9a3f400701121636x719376fdy666df2cb57d72275@mail.gmail.com> On 1/12/07, Colin Meyer wrote: > January 2007 Seattle Perl Users Group (SPUG) Meeting > ==================================================== > > Topic: Hacking Session > > Meeting Date: Tuesday, 16 January 2007 > Meeting Time: 6:30 - 8:30 p.m. > Location: Whitepages.com offices, downtown Seattle > > Cost: Admission is free and open to the public > Info: http://seattleperl.org/ > > ==================================================== > > Please join us Tuesday evening on the 16 January 2007 at the regular > monthly meeting of the Seattle Perl Users Group. This month we'll have > an informal get together, to discuss our current projects and have a > hacking session. > happy new year, everyone! i really hope to be there this month, but we've scheduled the release of parrot 0.4.8 on tuesday. since chip (our pumpking) has been unavailable lately, i'm releasing parrot this time around. hopefully i'll have finished things up before the meeting. by the way, if you'd like to help squash some bugs, we're holding a bug day on saturday. here's a link for the interested: http://www.oreillynet.com/onlamp/blog/2007/01/monthly_parrot_bug_day_is_13_j.html there's a lot to do, even if it's just reading the docs and asking questions--although we'd appreciate patches if you have tuits :) hope to catch you online saturday, and at the meeting tuesday. ~jerry From offby1 at blarg.net Sat Jan 13 17:18:39 2007 From: offby1 at blarg.net (Eric Hanchrow) Date: Sat, 13 Jan 2007 17:18:39 -0800 Subject: SPUG: Meeting Announcement -- 16 January 2007 In-Reply-To: <20070112234659.GA19705@funpox.helvella.org> (Colin Meyer's message of "Fri\, 12 Jan 2007 15\:46\:59 -0800") References: <20070112234659.GA19705@funpox.helvella.org> Message-ID: <87k5zqjths.fsf@offby1.atm01.sea.blarg.net> Never been to a hacking session. Whaddya gonna hack? What should a would-be hacker bring? -- Keaton, Chaplin, Garbo - let them now make room for Gromit. A. O. Scott, in The New York Times From cmeyer at helvella.org Mon Jan 15 09:15:46 2007 From: cmeyer at helvella.org (Colin Meyer) Date: Mon, 15 Jan 2007 09:15:46 -0800 Subject: SPUG: Meeting Announcement -- 16 January 2007 In-Reply-To: <87k5zqjths.fsf@offby1.atm01.sea.blarg.net> References: <20070112234659.GA19705@funpox.helvella.org> <87k5zqjths.fsf@offby1.atm01.sea.blarg.net> Message-ID: <20070115171546.GB12162@funpox.helvella.org> Hi, On Sat, Jan 13, 2007 at 05:18:39PM -0800, Eric Hanchrow wrote: > Never been to a hacking session. Whaddya gonna hack? What should a > would-be hacker bring? Basically this is a very informal get-together. The intention is to provide a forum for local Perl hackers to meet with each other, and discuss projects or problems. This way SPUG can continue to meet monthly, even when a speaker hasn't been arranged for. There are lots of things that we can talk about. Several SPUGgers are interested in Perl6, Pugs and Parrot, so that is a likely topic of discussion. Other topics from recent sessions have been testing, code generation and packaging code for distribution. Bring yourself, your ideas and optionally a laptop. -Colin. From tim at consultix-inc.com Mon Jan 15 09:51:22 2007 From: tim at consultix-inc.com (Tim Maher) Date: Mon, 15 Jan 2007 09:51:22 -0800 Subject: SPUG: Meeting Announcement -- 16 January 2007 In-Reply-To: <20070115171546.GB12162@funpox.helvella.org> References: <20070112234659.GA19705@funpox.helvella.org> <87k5zqjths.fsf@offby1.atm01.sea.blarg.net> <20070115171546.GB12162@funpox.helvella.org> Message-ID: <20070115175122.GA4569@jumpy.consultix-inc.com> In other words, it's going to be more of a "chatting" session than a "hacking" (sounds so brutal!) session. That's much more civilized. 8-} +------------------------------------------------------------+ | Tim Maher (and Yeshe Sherpa) HOME: Seattle, WA USA | | MOTORHOME: Chinook Premier BOAT: A.B. Inflatable | | NAVIGATION AID: Sherpa wife EMAIL: Tim at TimMaher.org | +------------------------------------------------------------+ On Mon, Jan 15, 2007 at 09:15:46AM -0800, Colin Meyer wrote: > Hi, > > On Sat, Jan 13, 2007 at 05:18:39PM -0800, Eric Hanchrow wrote: > > Never been to a hacking session. Whaddya gonna hack? What should a > > would-be hacker bring? > > Basically this is a very informal get-together. The intention is to > provide a forum for local Perl hackers to meet with each other, and > discuss projects or problems. This way SPUG can continue to meet > monthly, even when a speaker hasn't been arranged for. > > There are lots of things that we can talk about. Several SPUGgers are > interested in Perl6, Pugs and Parrot, so that is a likely topic of > discussion. Other topics from recent sessions have been testing, code > generation and packaging code for distribution. > > Bring yourself, your ideas and optionally a laptop. > > -Colin. > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays > WEB PAGE: http://seattleperl.org/ From aloofcat at gmail.com Mon Jan 15 10:45:08 2007 From: aloofcat at gmail.com (Jeff Kidd) Date: Mon, 15 Jan 2007 10:45:08 -0800 Subject: SPUG: Meeting Announcement -- 16 January 2007 In-Reply-To: <20070115175122.GA4569@jumpy.consultix-inc.com> References: <20070112234659.GA19705@funpox.helvella.org> <87k5zqjths.fsf@offby1.atm01.sea.blarg.net> <20070115171546.GB12162@funpox.helvella.org> <20070115175122.GA4569@jumpy.consultix-inc.com> Message-ID: <9d83cbac0701151045n4b9eac1an243279189e1b8c4d@mail.gmail.com> Sounds interesting. I've been trying to get to one of these meetings for a while, but between weather and schedule conflicts haven't been able to. I hope to make it to the February one. I mainly use perl for bioinformatics/genome analysis applications. Are there other such users in SPUG? I'm sure that when I finally make it to a meeting I'll learn a lot of neat stuff, Jeff On 1/15/07, Tim Maher wrote: > In other words, it's going to be more of a "chatting" session > than a "hacking" (sounds so brutal!) session. > > That's much more civilized. 8-} > > +------------------------------------------------------------+ > | Tim Maher (and Yeshe Sherpa) HOME: Seattle, WA USA | > | MOTORHOME: Chinook Premier BOAT: A.B. Inflatable | > | NAVIGATION AID: Sherpa wife EMAIL: Tim at TimMaher.org | > +------------------------------------------------------------+ > > On Mon, Jan 15, 2007 at 09:15:46AM -0800, Colin Meyer wrote: > > Hi, > > > > On Sat, Jan 13, 2007 at 05:18:39PM -0800, Eric Hanchrow wrote: > > > Never been to a hacking session. Whaddya gonna hack? What should a > > > would-be hacker bring? > > > > Basically this is a very informal get-together. The intention is to > > provide a forum for local Perl hackers to meet with each other, and > > discuss projects or problems. This way SPUG can continue to meet > > monthly, even when a speaker hasn't been arranged for. > > > > There are lots of things that we can talk about. Several SPUGgers are > > interested in Perl6, Pugs and Parrot, so that is a likely topic of > > discussion. Other topics from recent sessions have been testing, code > > generation and packaging code for distribution. > > > > Bring yourself, your ideas and optionally a laptop. > > > > -Colin. > > _____________________________________________________________ > > Seattle Perl Users Group Mailing List > > POST TO: spug-list at pm.org > > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > > MEETINGS: 3rd Tuesdays > > WEB PAGE: http://seattleperl.org/ > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays > WEB PAGE: http://seattleperl.org/ > From cmeyer at helvella.org Mon Jan 15 11:00:25 2007 From: cmeyer at helvella.org (Colin Meyer) Date: Mon, 15 Jan 2007 11:00:25 -0800 Subject: SPUG: Meeting Announcement -- 16 January 2007 In-Reply-To: <9d83cbac0701151045n4b9eac1an243279189e1b8c4d@mail.gmail.com> References: <20070112234659.GA19705@funpox.helvella.org> <87k5zqjths.fsf@offby1.atm01.sea.blarg.net> <20070115171546.GB12162@funpox.helvella.org> <20070115175122.GA4569@jumpy.consultix-inc.com> <9d83cbac0701151045n4b9eac1an243279189e1b8c4d@mail.gmail.com> Message-ID: <20070115190025.GH12162@funpox.helvella.org> On Mon, Jan 15, 2007 at 10:45:08AM -0800, Jeff Kidd wrote: > Sounds interesting. I've been trying to get to one of these meetings > for a while, but between weather and schedule conflicts haven't been > able to. I hope to make it to the February one. I mainly use perl > for bioinformatics/genome analysis applications. Are there other such > users in SPUG? jeah, there is at least one regular SPUGger who is a bioinformatics person. Though I am not currently doing bioinformatics, my previous job involved bioinformatics, and it is still an interest of mine. And I know that there are several companies in the area that make use of Perl for bioinformatics processing, so this is a good topic for SPUG. > > I'm sure that when I finally make it to a meeting I'll learn a lot of > neat stuff, I hope that you make it soon! -Colin. From ghawk at eskimo.com Tue Jan 16 08:58:29 2007 From: ghawk at eskimo.com (Gary Hawkins) Date: Tue, 16 Jan 2007 08:58:29 -0800 Subject: SPUG: International characters from input form In-Reply-To: <20070115175122.GA4569@jumpy.consultix-inc.com> Message-ID: <00be01c7398f$8c817770$6600a8c0@GARYHA1> There's this webpage form where the user supplies some text, might be English, Swedish, Chinese, Portugese, Russian, Hebrew, Arabic ... To Perl, is it (or can it be made to be) clearcut which language the user is sending to my program, truly without question, or are there any opportunities for confusion or possible crossover in unicode-land. I do not want the user to have to tell me which language they are using, I want that to be determined programmatically, and hope to hear that someone has sorted all of that out already (Larry Wall and company or the folks at Apache) with no grey areas. On this: SERVER_SOFTWARE = Apache/1.3.34 (Unix) mod_layout/3.2 ... I tried printing back %ENV with normal English text and received this: HTTP_ACCEPT_LANGUAGE = en-us,ja;q=0.5 ... then tried inputing Japanese text instead and to my dismay saw the same thing: HTTP_ACCEPT_LANGUAGE = en-us,ja;q=0.5 I would have been real happy to see this instead: HTTP_ACCEPT_LANGUAGE = ja,en-us;q=0.5 Maybe there is a way I can tell from the following that they (I) used Japanese? I see it does appear to correctly reflect my 4 keyboard strokes for each field, but how am I to know it isn't Swahili? QUERY_STRING = Name1=%B6%C1%C4%C1&Name2=%BD%C1%BD%B2 Does "en-us,ja" indicate the two languages installed on the user's system? If so, that would make sense and provide a clue (I have both English and Japanese keyboard inputs set up). What is 'q'? Now, if they happen to have Thai and Vietnamese, how am I to know which one they are using? Maybe Thai is %AF thru %D7 and Vietnamese is %D8 thru %FF or some such thing? Thanks, Gary Hawkins From cmeyer at helvella.org Tue Jan 16 09:39:06 2007 From: cmeyer at helvella.org (Colin Meyer) Date: Tue, 16 Jan 2007 09:39:06 -0800 Subject: SPUG: Meeting Announcement -- 16 January 2007 In-Reply-To: <20070112234659.GA19705@funpox.helvella.org> References: <20070112234659.GA19705@funpox.helvella.org> Message-ID: <20070116173906.GA19921@funpox.helvella.org> Considering the weather, are folks still planning on attending the SPUG meeting tonight? Could I get a show of hands, please? Thanks, -Colin. On Fri, Jan 12, 2007 at 03:46:59PM -0800, Colin Meyer wrote: > January 2007 Seattle Perl Users Group (SPUG) Meeting > ==================================================== > > Topic: Hacking Session > > Meeting Date: Tuesday, 16 January 2007 > Meeting Time: 6:30 - 8:30 p.m. > Location: Whitepages.com offices, downtown Seattle > > Cost: Admission is free and open to the public > Info: http://seattleperl.org/ > > ==================================================== From Eric.D.Peterson at alltel.com Tue Jan 16 12:37:46 2007 From: Eric.D.Peterson at alltel.com (Eric.D.Peterson at alltel.com) Date: Tue, 16 Jan 2007 14:37:46 -0600 Subject: SPUG: spug-list Digest, Vol 43, Issue 8 Message-ID: <8476CE21F2E6E543851495D6AB09F2A402385F22@scarlitnt642.alltel.com> Greetings, I'm going to have to say not tonight. I like my car in one piece. Not as a decoration around some tree. On Fri, Jan 12, 2007 at 03:46:59PM -0800, Colin Meyer wrote: > January 2007 Seattle Perl Users Group (SPUG) Meeting > ==================================================== > > Topic: Hacking Session > > Meeting Date: Tuesday, 16 January 2007 > Meeting Time: 6:30 - 8:30 p.m. > Location: Whitepages.com offices, downtown Seattle > > Cost: Admission is free and open to the public > Info: http://seattleperl.org/ > > ==================================================== ****************************************************************************************** The information contained in this message, including attachments, may contain privileged or confidential information that is intended to be delivered only to the person identified above. If you are not the intended recipient, or the person responsible for delivering this message to the intended recipient, Alltel requests that you immediately notify the sender and asks that you do not read the message or its attachments, and that you delete them without copying or sending them to anyone else. From offby1 at blarg.net Tue Jan 16 12:52:49 2007 From: offby1 at blarg.net (Eric Hanchrow) Date: Tue, 16 Jan 2007 12:52:49 -0800 Subject: SPUG: Meeting Announcement -- 16 January 2007 In-Reply-To: <20070116173906.GA19921@funpox.helvella.org> (Colin Meyer's message of "Tue\, 16 Jan 2007 09\:39\:06 -0800") References: <20070116173906.GA19921@funpox.helvella.org> Message-ID: <878xg2g0da.fsf@offby1.atm01.sea.blarg.net> If the snow miraculously melts between now and then, sure. Otherwise ... no. -- Fat is beautiful. Fat is our friend. -- Armandino Batali, owner of Salumi From bill at celestial.com Tue Jan 16 14:30:53 2007 From: bill at celestial.com (Bill Campbell) Date: Tue, 16 Jan 2007 14:30:53 -0800 Subject: SPUG: Meeting Announcement -- 16 January 2007 In-Reply-To: <878xg2g0da.fsf@offby1.atm01.sea.blarg.net> References: <20070116173906.GA19921@funpox.helvella.org> <878xg2g0da.fsf@offby1.atm01.sea.blarg.net> Message-ID: <20070116223053.GA1212@ayn.mi.celestial.com> On Tue, Jan 16, 2007, Eric Hanchrow wrote: >If the snow miraculously melts between now and then, sure. Otherwise >... no. When I backed up in my driveway to leave this morning, my all wheel drive Subaru slid down the hill sideways until it found something solid enough to stop it. Bill -- INTERNET: bill at Celestial.COM Bill Campbell; Celestial Software, LLC URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676 If you think health care is expensive now, wait until you see what it coses when it's free -- P.J. O'Rourke From veritosproject at gmail.com Tue Jan 16 14:30:07 2007 From: veritosproject at gmail.com (veritosproject at gmail.com) Date: Tue, 16 Jan 2007 14:30:07 -0800 Subject: SPUG: Meeting Announcement -- 16 January 2007 In-Reply-To: <20070116223053.GA1212@ayn.mi.celestial.com> References: <20070116173906.GA19921@funpox.helvella.org> <878xg2g0da.fsf@offby1.atm01.sea.blarg.net> <20070116223053.GA1212@ayn.mi.celestial.com> Message-ID: <6dcbe5980701161430y5c0c59ebk85f10353dba1d597@mail.gmail.com> On 1/16/07, Bill Campbell wrote: > On Tue, Jan 16, 2007, Eric Hanchrow wrote: > >If the snow miraculously melts between now and then, sure. Otherwise > >... no. > > When I backed up in my driveway to leave this morning, my all > wheel drive Subaru slid down the hill sideways until it found > something solid enough to stop it. 1. You OK? 2. Your hard drive OK? 3. What'd you hit? From cmeyer at helvella.org Tue Jan 16 14:32:29 2007 From: cmeyer at helvella.org (Colin Meyer) Date: Tue, 16 Jan 2007 14:32:29 -0800 Subject: SPUG: Meeting Announcement -- 16 January 2007 In-Reply-To: <20070116223053.GA1212@ayn.mi.celestial.com> References: <20070116173906.GA19921@funpox.helvella.org> <878xg2g0da.fsf@offby1.atm01.sea.blarg.net> <20070116223053.GA1212@ayn.mi.celestial.com> Message-ID: <20070116223229.GD24123@funpox.helvella.org> Well, I've gotten one yes, two maybes and numerous nos. I guess that I'll stay around to see if some people show up. -Colin. On Tue, Jan 16, 2007 at 02:30:53PM -0800, Bill Campbell wrote: > On Tue, Jan 16, 2007, Eric Hanchrow wrote: > >If the snow miraculously melts between now and then, sure. Otherwise > >... no. > > When I backed up in my driveway to leave this morning, my all > wheel drive Subaru slid down the hill sideways until it found > something solid enough to stop it. > > Bill > -- > INTERNET: bill at Celestial.COM Bill Campbell; Celestial Software, LLC > URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way > FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676 > > If you think health care is expensive now, wait until you see what it coses > when it's free -- P.J. O'Rourke > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays > WEB PAGE: http://seattleperl.org/ From schuh at farmdale.com Tue Jan 16 14:34:34 2007 From: schuh at farmdale.com (Mike Schuh) Date: Tue, 16 Jan 2007 14:34:34 -0800 (PST) Subject: SPUG: Meeting Announcement -- 16 January 2007 In-Reply-To: <20070116223229.GD24123@funpox.helvella.org> References: <20070116173906.GA19921@funpox.helvella.org> <878xg2g0da.fsf@offby1.atm01.sea.blarg.net> <20070116223053.GA1212@ayn.mi.celestial.com> <20070116223229.GD24123@funpox.helvella.org> Message-ID: On Tue, 16 Jan 2007, Colin Meyer wrote: >Well, I've gotten one yes, two maybes and numerous nos. > >I guess that I'll stay around to see if some people show up. Hmm. I'm sure we have the collective smarts to assemble a virtual (on-line) meeting/hacking session... -- Mike Schuh - Seattle, Washington USA http://www.farmdale.com From bill at celestial.com Tue Jan 16 14:41:06 2007 From: bill at celestial.com (Bill Campbell) Date: Tue, 16 Jan 2007 14:41:06 -0800 Subject: SPUG: Meeting Announcement -- 16 January 2007 In-Reply-To: <6dcbe5980701161430y5c0c59ebk85f10353dba1d597@mail.gmail.com> References: <20070116173906.GA19921@funpox.helvella.org> <878xg2g0da.fsf@offby1.atm01.sea.blarg.net> <20070116223053.GA1212@ayn.mi.celestial.com> <6dcbe5980701161430y5c0c59ebk85f10353dba1d597@mail.gmail.com> Message-ID: <20070116224106.GA5394@ayn.mi.celestial.com> On Tue, Jan 16, 2007, veritosproject at gmail.com wrote: >On 1/16/07, Bill Campbell wrote: >> On Tue, Jan 16, 2007, Eric Hanchrow wrote: >> >If the snow miraculously melts between now and then, sure. Otherwise >> >... no. >> >> When I backed up in my driveway to leave this morning, my all >> wheel drive Subaru slid down the hill sideways until it found >> something solid enough to stop it. > >1. You OK? >2. Your hard drive OK? >3. What'd you hit? Yes, yes, and the telco and cable terminal boxes for our downhill neighbor (about 6 inch square green boxes). I managed to back up enough that the front end swung downhill, and with major effort I kept my foot off the brake so I could steer enough to get it headed downhill in the right direction letting engine braking (stick shift) do all the braking. Fortunately there was a non-icy spot at the bottom large enough for me to stop before I went across East Mercer Way, thence to the lake if I made it further without hitting something. The basic problem was a bit of new snow over the ice where the neighbor kids had been sliding, packing things down neatly in the driveway. Bill -- INTERNET: bill at Celestial.COM Bill Campbell; Celestial Software LLC URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676 ``Nobody wants to be called common people, especially common people.'' Will Rogers From kevin-spug at fink.com Tue Jan 16 16:23:21 2007 From: kevin-spug at fink.com (Kevin Fink) Date: Tue, 16 Jan 2007 16:23:21 -0800 Subject: SPUG: International characters from input form In-Reply-To: <00be01c7398f$8c817770$6600a8c0@GARYHA1> References: <00be01c7398f$8c817770$6600a8c0@GARYHA1> Message-ID: <45AD6C79.30006@fink.com> HTTP_ACCEPT_LANGUAGE is a request header, so it indicates what languages the browser would like to see from the server. The q parameter is a weighting so the server can decide which language to send in the case that it can produce several acceptable languages. I don't know the answer to the real question, though. There is an interesting paper at: http://www.mozilla.org/projects/intl/UniversalCharsetDetection.html that talks about it, though. Kevin Gary Hawkins wrote: > There's this webpage form where the user supplies some text, might be English, > Swedish, Chinese, Portugese, Russian, Hebrew, Arabic ... > > To Perl, is it (or can it be made to be) clearcut which language the user is > sending to my program, truly without question, or are there any opportunities > for confusion or possible crossover in unicode-land. > > I do not want the user to have to tell me which language they are using, I want > that to be determined programmatically, and hope to hear that someone has > sorted all of that out already (Larry Wall and company or the folks at Apache) > with no grey areas. > > On this: > > SERVER_SOFTWARE = Apache/1.3.34 (Unix) mod_layout/3.2 > > ... I tried printing back %ENV with normal English text and received this: > > HTTP_ACCEPT_LANGUAGE = en-us,ja;q=0.5 > > ... then tried inputing Japanese text instead and to my dismay saw the same > thing: > > HTTP_ACCEPT_LANGUAGE = en-us,ja;q=0.5 > > I would have been real happy to see this instead: > > HTTP_ACCEPT_LANGUAGE = ja,en-us;q=0.5 > > Maybe there is a way I can tell from the following that they (I) used Japanese? > I see it does appear to correctly reflect my 4 keyboard strokes for each field, > but how am I to know it isn't Swahili? > > QUERY_STRING = Name1=%B6%C1%C4%C1&Name2=%BD%C1%BD%B2 > > Does "en-us,ja" indicate the two languages installed on the user's system? If > so, that would make sense and provide a clue (I have both English and Japanese > keyboard inputs set up). What is 'q'? Now, if they happen to have Thai and > Vietnamese, how am I to know which one they are using? Maybe Thai is %AF thru > %D7 and Vietnamese is %D8 thru %FF or some such thing? > > Thanks, > > Gary Hawkins > > > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays > WEB PAGE: http://seattleperl.org/ From ppcook at gmail.com Tue Jan 16 20:40:40 2007 From: ppcook at gmail.com (Paul Cook) Date: Tue, 16 Jan 2007 20:40:40 -0800 Subject: SPUG: Meeting Announcement -- 16 January 2007 In-Reply-To: <20070116223229.GD24123@funpox.helvella.org> References: <20070116173906.GA19921@funpox.helvella.org> <878xg2g0da.fsf@offby1.atm01.sea.blarg.net> <20070116223053.GA1212@ayn.mi.celestial.com> <20070116223229.GD24123@funpox.helvella.org> Message-ID: I'm across the street at Doug Treder's Perl class at UW Ext, moved from Monday night due to the holiday yesterday. Otherwise I'd be there. Did anyone show up? On 1/16/07, Colin Meyer wrote: > > Well, I've gotten one yes, two maybes and numerous nos. > > I guess that I'll stay around to see if some people show up. > > -Colin. > > On Tue, Jan 16, 2007 at 02:30:53PM -0800, Bill Campbell wrote: > > On Tue, Jan 16, 2007, Eric Hanchrow wrote: > > >If the snow miraculously melts between now and then, sure. Otherwise > > >... no. > > > > When I backed up in my driveway to leave this morning, my all > > wheel drive Subaru slid down the hill sideways until it found > > something solid enough to stop it. > > > > Bill > > -- > > INTERNET: bill at Celestial.COM Bill Campbell; Celestial Software, LLC > > URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way > > FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) > 236-1676 > > > > If you think health care is expensive now, wait until you see what it > coses > > when it's free -- P.J. O'Rourke > > _____________________________________________________________ > > Seattle Perl Users Group Mailing List > > POST TO: spug-list at pm.org > > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > > MEETINGS: 3rd Tuesdays > > WEB PAGE: http://seattleperl.org/ > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays > WEB PAGE: http://seattleperl.org/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20070116/ddc3015b/attachment-0001.html From cmeyer at helvella.org Wed Jan 17 08:28:42 2007 From: cmeyer at helvella.org (Colin Meyer) Date: Wed, 17 Jan 2007 08:28:42 -0800 Subject: SPUG: Meeting Announcement -- 16 January 2007 In-Reply-To: References: <20070116173906.GA19921@funpox.helvella.org> <878xg2g0da.fsf@offby1.atm01.sea.blarg.net> <20070116223053.GA1212@ayn.mi.celestial.com> <20070116223229.GD24123@funpox.helvella.org> Message-ID: <20070117162842.GF24123@funpox.helvella.org> On Tue, Jan 16, 2007 at 08:40:40PM -0800, Paul Cook wrote: > I'm across the street at Doug Treder's Perl class at UW Ext, moved from > Monday night due to the holiday yesterday. Otherwise I'd be there. Did > anyone show up? There were three of us last night. We discussed numerous topics, including logic programming and the positive and negative effects of applying process to software creation, the Perl6 creation process and the necessity of people like Larry and Damian. Here's a head-asploder that Yitzchak dropped on us yesterday. I think that he called it Schr?dinger's variable: perl -MTest::More=no_plan -we'$nz = -0.; ok !$nz, "$nz false" for 1..2' -Colin. From twists at gmail.com Wed Jan 17 10:07:59 2007 From: twists at gmail.com (Joshua ben Jore) Date: Wed, 17 Jan 2007 10:07:59 -0800 Subject: SPUG: International characters from input form In-Reply-To: <00be01c7398f$8c817770$6600a8c0@GARYHA1> References: <20070115175122.GA4569@jumpy.consultix-inc.com> <00be01c7398f$8c817770$6600a8c0@GARYHA1> Message-ID: On 1/16/07, Gary Hawkins wrote: > There's this webpage form where the user supplies some text, might be English, > Swedish, Chinese, Portugese, Russian, Hebrew, Arabic ... > > To Perl, is it (or can it be made to be) clearcut which language the user is > sending to my program, truly without question, or are there any opportunities > for confusion or possible crossover in unicode-land. > > I do not want the user to have to tell me which language they are using, I want > that to be determined programmatically, and hope to hear that someone has > sorted all of that out already (Larry Wall and company or the folks at Apache) > with no grey areas. > > On this: > > SERVER_SOFTWARE = Apache/1.3.34 (Unix) mod_layout/3.2 > > ... I tried printing back %ENV with normal English text and received this: > > HTTP_ACCEPT_LANGUAGE = en-us,ja;q=0.5 > > ... then tried inputing Japanese text instead and to my dismay saw the same > thing: > > HTTP_ACCEPT_LANGUAGE = en-us,ja;q=0.5 > > I would have been real happy to see this instead: > > HTTP_ACCEPT_LANGUAGE = ja,en-us;q=0.5 > > Maybe there is a way I can tell from the following that they (I) used Japanese? > I see it does appear to correctly reflect my 4 keyboard strokes for each field, > but how am I to know it isn't Swahili? > > QUERY_STRING = Name1=%B6%C1%C4%C1&Name2=%BD%C1%BD%B2 Whatever it was you typed wasn't passed to as unicode code points. At least those could be interpreted unambiguously as unicode and treated that way. %u2819%u280a%u2815%u281e%u2801%u2807%u2811%u2827%u280a; which is just my typical perly handle written down in the unicode for braille and URI encoded. Since you really just sent some octets, perhaps you also sent a HTTP header which indicated the character set or encoding? Josh From MichaelRWolf at att.net Sun Jan 21 15:21:31 2007 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Sun, 21 Jan 2007 15:21:31 -0800 Subject: SPUG: last index array reference's referent Message-ID: <002b01c73db2$e6b393f0$0500a8c0@mlaptop> # If you have an array ref and don't care about the index, it's pretty # simple and elegant to loop over the referenced array... @season = qw(winter spring summer fall); $a_ref = \@season; foreach my $element ( @{$a_ref} ) { # Use $element here... print "$element\n"; } # But if you *do* care about the index, it's neither simple, nor # elegant... foreach my $i ( 0 .. @{$a_ref} - 1 ) { my $element = $a_ref->[$i]; # Use $i and $element here... print "$i $element\n"; } # Is there a more elegant way to get the equivalent of $#seasons if # all you have is a reference? Somehting that would do to references # what $# does to arrays.... foreach my $i (0 .. $#season) { my $element = $season[$i]; # Use $i and $element here... print "$i $element\n"; } -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From dtreder at gmail.com Sun Jan 21 15:26:54 2007 From: dtreder at gmail.com (Doug Treder) Date: Sun, 21 Jan 2007 15:26:54 -0800 Subject: SPUG: last index array reference's referent In-Reply-To: <002b01c73db2$e6b393f0$0500a8c0@mlaptop> References: <002b01c73db2$e6b393f0$0500a8c0@mlaptop> Message-ID: <13fc2edf0701211526n2359ce20ma6e29d27ac649916@mail.gmail.com> I've never thought of $#array as elegant at all, and the fact that my left fingers curl into a painful knot to type it as Larry's way of telling me so. Also note that indexing into an array is much slower than aliasing it in a foreach loop. So my favorite idiom for this is: my $i = 0; foreach my $item (@$array_ref) { print $i++ .' ' . $item . "\n"; } -Doug On 1/21/07, Michael R. Wolf wrote: > # If you have an array ref and don't care about the index, it's pretty > # simple and elegant to loop over the referenced array... > > @season = qw(winter spring summer fall); > $a_ref = \@season; > > foreach my $element ( @{$a_ref} ) { > # Use $element here... > print "$element\n"; > } > > > # But if you *do* care about the index, it's neither simple, nor > # elegant... > > foreach my $i ( 0 .. @{$a_ref} - 1 ) { > my $element = $a_ref->[$i]; > > # Use $i and $element here... > print "$i $element\n"; > } > > > # Is there a more elegant way to get the equivalent of $#seasons if > # all you have is a reference? Somehting that would do to references > # what $# does to arrays.... > > foreach my $i (0 .. $#season) { > my $element = $season[$i]; > > # Use $i and $element here... > print "$i $element\n"; > } > > -- > Michael R. Wolf > All mammals learn by playing! > MichaelRWolf at att.net > > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays > WEB PAGE: http://seattleperl.org/ > -- -Doug Treder http://www.trederfamily.org From veritosproject at gmail.com Sun Jan 21 15:43:47 2007 From: veritosproject at gmail.com (veritosproject at gmail.com) Date: Sun, 21 Jan 2007 15:43:47 -0800 Subject: SPUG: last index array reference's referent In-Reply-To: <13fc2edf0701211526n2359ce20ma6e29d27ac649916@mail.gmail.com> References: <002b01c73db2$e6b393f0$0500a8c0@mlaptop> <13fc2edf0701211526n2359ce20ma6e29d27ac649916@mail.gmail.com> Message-ID: <6dcbe5980701211543p6396aa82rac318d3c80333c2d@mail.gmail.com> I tend to use a for loop for stuff like this: On 1/21/07, Doug Treder wrote: > I've never thought of $#array as elegant at all, and the fact that my > left fingers curl into a painful knot to type it as Larry's way of > telling me so. Also note that indexing into an array is much slower > than aliasing it in a foreach loop. So my favorite idiom for this is: > > my $i = 0; > foreach my $item (@$array_ref) { > print $i++ .' ' . $item . "\n"; > } print $i . ' ' . $array_ref->[$i] . "\n" for (my $i = 0; $i <= $#{$array_ref}; ++$i); From jerry.gay at gmail.com Sun Jan 21 15:45:06 2007 From: jerry.gay at gmail.com (jerry gay) Date: Sun, 21 Jan 2007 15:45:06 -0800 Subject: SPUG: last index array reference's referent In-Reply-To: <002b01c73db2$e6b393f0$0500a8c0@mlaptop> References: <002b01c73db2$e6b393f0$0500a8c0@mlaptop> Message-ID: <1d9a3f400701211545m1e1ab726q4dd8528b85162766@mail.gmail.com> On 1/21/07, Michael R. Wolf wrote: > # Is there a more elegant way to get the equivalent of $#seasons if > # all you have is a reference? Somehting that would do to references > # what $# does to arrays.... > sure! use C<$#$seasons> perl -Mstrict -Mwarnings -e'my $a=[1,2,3]; print $#$a;' 2 ~jerry From sthoenna at efn.org Sun Jan 21 20:40:41 2007 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Sun, 21 Jan 2007 20:40:41 -0800 (PST) Subject: SPUG: last index array reference's referent Message-ID: <2106.67.40.28.188.1169440841.squirrel@67.40.28.188> On Sun, Jan 21, 2007 at 03:21:31PM -0800, Michael R. Wolf wrote: > # Is there a more elegant way to get the equivalent of $#seasons if > # all you have is a reference? Somehting that would do to references > # what $# does to arrays.... $#$aref or $#{ some_aref_expression }. For all your reference needs, see: http://perlmonks.org/?node=reference+quick+reference -- I'm looking for a job: http://perlmonks.org/?node=ysth#looking From sthoenna at efn.org Sun Jan 21 20:44:20 2007 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Sun, 21 Jan 2007 20:44:20 -0800 (PST) Subject: SPUG: last index array reference's referent In-Reply-To: <2106.67.40.28.188.1169440841.squirrel@67.40.28.188> References: <2106.67.40.28.188.1169440841.squirrel@67.40.28.188> Message-ID: <2120.67.40.28.188.1169441060.squirrel@67.40.28.188> I wrote: > For all your reference needs, see: > http://perlmonks.org/?node=reference+quick+reference Memo to self (again!): check links before hitting send. That should be: http://perlmonks.org/?node=References+quick+reference -- I'm looking for a job: http://perlmonks.org/?node=ysth#looking From veritosproject at gmail.com Mon Jan 22 11:03:00 2007 From: veritosproject at gmail.com (veritosproject at gmail.com) Date: Mon, 22 Jan 2007 11:03:00 -0800 Subject: SPUG: Precedence question Message-ID: <6dcbe5980701221103r16d2612by5e7c88f5d8797909@mail.gmail.com> does @$foo[3] parse as (@$foo)[3] or @{$foo[3]}? From sbaylis at whitepages.com Mon Jan 22 11:15:57 2007 From: sbaylis at whitepages.com (Steve Baylis) Date: Mon, 22 Jan 2007 11:15:57 -0800 Subject: SPUG: Precedence question Message-ID: <33B47F69A0CC444CA074864F04A3E1361E9945@mail.corp.w3data.com> @$foo[3] returns element 3 from the array reference stored in $foo. As always, before I open my mouth I like to verify what I'm saying so as to not lead people astray... --- my $foo = [ 'a' .. 'z' ]; my @foo = ( map { [ $_ ] } 0 .. 25 ); print @$foo[3], "\n"; exit; --- -Steve Steve Baylis Lead Architect WhitePages.com -----Original Message----- From: spug-list-bounces+sbaylis=whitepages.com at pm.org [mailto:spug-list-bounces+sbaylis=whitepages.com at pm.org] On Behalf Of veritosproject at gmail.com Sent: Monday, January 22, 2007 11:03 AM To: spug-list at pm.org Subject: SPUG: Precedence question does @$foo[3] parse as (@$foo)[3] or @{$foo[3]}? _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: spug-list at pm.org SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list MEETINGS: 3rd Tuesdays WEB PAGE: http://seattleperl.org/ The information contained in this message may be privileged, confidential, and protected from disclosure. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. From sthoenna at efn.org Mon Jan 22 11:17:14 2007 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Mon, 22 Jan 2007 11:17:14 -0800 (PST) Subject: SPUG: Precedence question In-Reply-To: <6dcbe5980701221103r16d2612by5e7c88f5d8797909@mail.gmail.com> References: <6dcbe5980701221103r16d2612by5e7c88f5d8797909@mail.gmail.com> Message-ID: <1540.67.40.28.188.1169493434.squirrel@67.40.28.188> > does @$foo[3] parse as (@$foo)[3] or @{$foo[3]}? The former. You can easily verify this yourself with: $ perl -we'use strict; my $foo; ()=@$foo[3]' $ perl -we'use strict; my @foo; ()=@$foo[3]' Global symbol "$foo" requires explicit package name at -e line 1. Execution of -e aborted due to compilation errors. -- I'm looking for a job: http://perlmonks.org/?node=ysth#looking From jarich at perltraining.com.au Mon Jan 22 15:50:35 2007 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Tue, 23 Jan 2007 10:50:35 +1100 Subject: SPUG: Precedence question In-Reply-To: <6dcbe5980701221103r16d2612by5e7c88f5d8797909@mail.gmail.com> References: <6dcbe5980701221103r16d2612by5e7c88f5d8797909@mail.gmail.com> Message-ID: <45B54DCB.5090201@perltraining.com.au> veritosproject at gmail.com wrote: > does @$foo[3] parse as (@$foo)[3] or @{$foo[3]}? I would argue, that regardless of the answer, you should probably explicitly show your intent by using one of options on the right so that your maintainer doesn't have to ask. J -- ("`-''-/").___..--''"`-._ | Jacinta Richardson | `6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia | (_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 | _..`--'_..-_/ /--'_.' ,' | contact at perltraining.com.au | (il),-'' (li),' ((!.-' | www.perltraining.com.au | From veritosproject at gmail.com Mon Jan 22 16:01:05 2007 From: veritosproject at gmail.com (veritosproject at gmail.com) Date: Mon, 22 Jan 2007 16:01:05 -0800 Subject: SPUG: Precedence question In-Reply-To: <45B54DCB.5090201@perltraining.com.au> References: <6dcbe5980701221103r16d2612by5e7c88f5d8797909@mail.gmail.com> <45B54DCB.5090201@perltraining.com.au> Message-ID: <6dcbe5980701221601q7ba074efj99f8cd4ee5399818@mail.gmail.com> On 1/22/07, Jacinta Richardson wrote: > veritosproject at gmail.com wrote: > > does @$foo[3] parse as (@$foo)[3] or @{$foo[3]}? > > I would argue, that regardless of the answer, you should probably explicitly > show your intent by using one of options on the right so that your maintainer > doesn't have to ask. Of course. I would probably use $foo->[3] in this case anyway, or just use an array in the first place. This was hypothetical. From MichaelRWolf at att.net Mon Jan 22 17:51:36 2007 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon, 22 Jan 2007 17:51:36 -0800 Subject: SPUG: last index array reference's referent In-Reply-To: <1d9a3f400701211545m1e1ab726q4dd8528b85162766@mail.gmail.com> References: <002b01c73db2$e6b393f0$0500a8c0@mlaptop> <1d9a3f400701211545m1e1ab726q4dd8528b85162766@mail.gmail.com> Message-ID: <001301c73e91$04e1dec0$0500a8c0@mlaptop> Thanks. I didn't believe that this was documented. I still don't. But perhaps this is as close as it gets. (Put on your Perl glasses, and read between the lines.) I can make myself believe that this is what it means, but I'd have been hard pressed to realize it up front. Thanks again! I guess I like it that Perl anticipated my needs here..??!!.. http://perldoc.perl.org/perlref.html#Using-References-reference%2c-use-deref erencing-dereference Using References That's it for creating references. By now you're probably dying to know how to use references to get back to your long-lost data. There are several basic methods. 1. Anywhere you'd put an identifier (or chain of identifiers) as part of a variable or subroutine name, you can replace the identifier with a simple scalar variable containing a reference of the correct type: $bar = $$scalarref; push(@$arrayref, $filename); $$arrayref[0] = "January"; $$hashref{"KEY"} = "VALUE"; &$coderef(1,2,3); print $globref "output\n [... See link for full details] -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net > -----Original Message----- > From: spug-list-bounces+michaelrwolf=att.net at pm.org [mailto:spug-list- > bounces+michaelrwolf=att.net at pm.org] On Behalf Of jerry gay > Sent: Sunday, January 21, 2007 3:45 PM > To: Michael R. Wolf > Cc: spug-list at mail.pm.org > Subject: Re: SPUG: last index array reference's referent > > On 1/21/07, Michael R. Wolf wrote: > > # Is there a more elegant way to get the equivalent of $#seasons if > > # all you have is a reference? Somehting that would do to references > > # what $# does to arrays.... > > > sure! use C<$#$seasons> > > perl -Mstrict -Mwarnings -e'my $a=[1,2,3]; print $#$a;' > 2 > > ~jerry > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays > WEB PAGE: http://seattleperl.org/ From MichaelRWolf at att.net Tue Jan 23 10:59:49 2007 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Tue, 23 Jan 2007 10:59:49 -0800 Subject: SPUG: Perl CGI book for loan or sale Message-ID: <005701c73f20$a8f2db60$0500a8c0@mlaptop> Anyone have an idle copy of the O'Reilly "CGI Programming with Perl" book that you'd like to sell (or loan for a few weeks)? I was at the airline gate yesterday when a client called to cancel my teaching gig. That means I've got some time to move a project forward, and I'd rather pick up a copy from a SPUG-ster than wait for delivery. Thanks, Michael -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From jerry.gay at gmail.com Tue Jan 23 11:20:03 2007 From: jerry.gay at gmail.com (jerry gay) Date: Tue, 23 Jan 2007 11:20:03 -0800 Subject: SPUG: Perl CGI book for loan or sale In-Reply-To: <005701c73f20$a8f2db60$0500a8c0@mlaptop> References: <005701c73f20$a8f2db60$0500a8c0@mlaptop> Message-ID: <1d9a3f400701231120h7403c0dvf741a0e3003ff5b4@mail.gmail.com> On 1/23/07, Michael R. Wolf wrote: > Anyone have an idle copy of the O'Reilly "CGI Programming with Perl" book > that you'd like to sell (or loan for a few weeks)? > > I was at the airline gate yesterday when a client called to cancel my > teaching gig. That means I've got some time to move a project forward, and > I'd rather pick up a copy from a SPUG-ster than wait for delivery. > i've got a copy of the second edition on my bookshelf that you're welcome to borrow. if i'm in a pinch and need it (doubtful) i can always get it online from safari with my acm membership. if you're interested, contact me privately so we arrange the transfer. ~jerry From cos at indeterminate.net Tue Jan 23 12:25:51 2007 From: cos at indeterminate.net (John Costello) Date: Tue, 23 Jan 2007 12:25:51 -0800 (PST) Subject: SPUG: Perl CGI book for loan or sale In-Reply-To: <1d9a3f400701231120h7403c0dvf741a0e3003ff5b4@mail.gmail.com> Message-ID: On Tue, 23 Jan 2007, jerry gay wrote: > On 1/23/07, Michael R. Wolf wrote: > > Anyone have an idle copy of the O'Reilly "CGI Programming with Perl" book > > that you'd like to sell (or loan for a few weeks)? > i've got a copy of the second edition on my bookshelf that you're > welcome to borrow. if i'm in a pinch and need it (doubtful) i can > always get it online from safari with my acm membership. Annoyingly, the Safari membershiop available through Seattle Public Library doesn't include the book, though other goodies (Perl Testing, Perl Best Practices) are available. From jarich at perltraining.com.au Tue Jan 23 16:37:49 2007 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Wed, 24 Jan 2007 11:37:49 +1100 Subject: SPUG: Perl CGI book for loan or sale In-Reply-To: <005701c73f20$a8f2db60$0500a8c0@mlaptop> References: <005701c73f20$a8f2db60$0500a8c0@mlaptop> Message-ID: <45B6AA5D.6010908@perltraining.com.au> Michael R. Wolf wrote: > Anyone have an idle copy of the O'Reilly "CGI Programming with Perl" book > that you'd like to sell (or loan for a few weeks)? > > I was at the airline gate yesterday when a client called to cancel my > teaching gig. That means I've got some time to move a project forward, and > I'd rather pick up a copy from a SPUG-ster than wait for delivery. I can't help you with a copy of the book, but you may find our Web Development with Perl course notes handy. These cover both classical Perl CGI and HTML Mason. We've only run the course through beta at the moment, so I'd be extremely greatful if you passed on any feedback you had. The full course notes can be found at: http://perltraining.com.au/notes.html All the best, J -- ("`-''-/").___..--''"`-._ | Jacinta Richardson | `6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia | (_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 | _..`--'_..-_/ /--'_.' ,' | contact at perltraining.com.au | (il),-'' (li),' ((!.-' | www.perltraining.com.au | From atom.powers at gmail.com Wed Jan 24 16:17:55 2007 From: atom.powers at gmail.com (Atom Powers) Date: Wed, 24 Jan 2007 16:17:55 -0800 Subject: SPUG: How can I find @1 - @2? Message-ID: I need to find the difference between two sets of data, two arrays. I have in @enrolled a list of enrolled students and in @students a list of all students. How would I go about finding the contents of @students who are not @enrolled? -- -- Perfection is just a word I use occasionally with mustard. --Atom Powers-- From cwilkes-spug at ladro.com Wed Jan 24 16:24:25 2007 From: cwilkes-spug at ladro.com (Chris Wilkes) Date: Wed, 24 Jan 2007 16:24:25 -0800 Subject: SPUG: How can I find @1 - @2? In-Reply-To: References: Message-ID: <20070125002425.GD10991@www2.ladro.com> This might get you started: perldoc -q intersection @union = @intersection = @difference = (); %count = (); foreach $element (@array1, @array2) { $count{$element}++ } foreach $element (keys %count) { push @union, $element; push @{ $count{$element} > 1 ? \@intersection : \@difference }, $element; } On Wed, Jan 24, 2007 at 04:17:55PM -0800, Atom Powers wrote: > I need to find the difference between two sets of data, two arrays. > > I have in @enrolled a list of enrolled students and in @students a > list of all students. How would I go about finding the contents of > @students who are not @enrolled? From muzzle at imdb.com Wed Jan 24 16:28:11 2007 From: muzzle at imdb.com (Murray Chapman) Date: Thu, 25 Jan 2007 00:28:11 +0000 (GMT) Subject: SPUG: How can I find @1 - @2? In-Reply-To: Message-ID: On Wed, 24 Jan 2007, Atom Powers wrote: > I need to find the difference between two sets of data, two arrays. Convert one array to a hash and use it as a filter: my @students = qw(fred peter alex john susan penny); my @enrolled = qw(john fred peter); my %enrolled = map {$_ => 1} @enrolled; my @not_enrolled = grep {!$enrolled{$_}} @students; Murray -- Murray Chapman Zheenl Punczna -- -- muzzle at imdb.com zhmmyr at vzqo.pbz -- -- Internet Movie Database Vagrearg Zbivr Qngnonfr -- -- http://www.imdb.com uggc://jjj.vzqo.pbz -- From AEH at akc.org Wed Jan 24 16:40:54 2007 From: AEH at akc.org (Adrian Hands) Date: Wed, 24 Jan 2007 19:40:54 -0500 Subject: SPUG: How can I find @1 - @2? References: Message-ID: <862E491E88FFFE44846C445B4881DD7C737D42@PUG.ad.akc.org> #!/usr/bin/perl -w use strict; my @students = qw{ Bashful Doc Dopey Grumpy Happy Sleepy Sneezy }; my @enrolled = @students[ 2, 3, 4 ]; my @not_enrolled; print "Enrolled = " . join( ', ', @enrolled ) . "\n"; { my %tmp; @tmp{ @students } = @students; delete( @tmp{ @enrolled } ); @not_enrolled = keys %tmp; } print "NOT enrolled = " . join( ', ', @not_enrolled ) . "\n"; -----Original Message----- ... I have in @enrolled a list of enrolled students and in @students a list of all students. How would I go about finding the contents of @students who are not @enrolled? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20070124/3364915b/attachment.html From kenslinux at shaw.ca Wed Jan 24 18:14:13 2007 From: kenslinux at shaw.ca (Ken Clarke) Date: Wed, 24 Jan 2007 18:14:13 -0800 Subject: SPUG: How can I find @1 - @2? References: <862E491E88FFFE44846C445B4881DD7C737D42@PUG.ad.akc.org> Message-ID: <001401c74026$82752a40$1000a8c0@kens> RE: SPUG: How can I find @1 - @2?my %enrolled = map { $_ => 1} @enrolled; my @not_enrolled = grep { not $enrolled{$_} } @students; The more you work with map and grep, the easier it is to see simple solutions. From jmates at sial.org Wed Jan 24 19:08:33 2007 From: jmates at sial.org (Jeremy Mates) Date: Wed, 24 Jan 2007 19:08:33 -0800 Subject: SPUG: How can I find @1 - @2? In-Reply-To: <001401c74026$82752a40$1000a8c0@kens> References: <862E491E88FFFE44846C445B4881DD7C737D42@PUG.ad.akc.org> <001401c74026$82752a40$1000a8c0@kens> Message-ID: <20070125030833.GK21385@neamh.sial.org> * Ken Clarke > my %enrolled = map { $_ => 1} @enrolled; # No map nor 1's floating around in memory. my %enrolled; @enrolled{@enrolled} = (); From sthoenna at efn.org Wed Jan 24 19:11:09 2007 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Wed, 24 Jan 2007 19:11:09 -0800 (PST) Subject: SPUG: How can I find @1 - @2? In-Reply-To: <20070125030833.GK21385@neamh.sial.org> References: <862E491E88FFFE44846C445B4881DD7C737D42@PUG.ad.akc.org> <001401c74026$82752a40$1000a8c0@kens> <20070125030833.GK21385@neamh.sial.org> Message-ID: <2695.67.40.28.188.1169694669.squirrel@67.40.28.188> > * Ken Clarke >> my %enrolled = map { $_ => 1} @enrolled; > > # No map nor 1's floating around in memory. > my %enrolled; @enrolled{@enrolled} = (); And changing $enrolled{...} to exists $enrolled{...} From james at banshee.com Thu Jan 25 07:02:56 2007 From: james at banshee.com (James Moore) Date: Thu, 25 Jan 2007 07:02:56 -0800 Subject: SPUG: Free copies of Advanced Perl Programming, Perl Cookbook, and Programming Perl Message-ID: <009301c74091$e5494b90$6401a8c0@BansheeSoftware.local> I've got a copy each of Advanced Perl Programming Perl Cookbook Programming Perl (2nd ed) Free to the first taker who wants to pick them up at my place (next to the zoo.) - James From cos at indeterminate.net Thu Jan 25 09:36:59 2007 From: cos at indeterminate.net (John Costello) Date: Thu, 25 Jan 2007 09:36:59 -0800 (PST) Subject: SPUG: Free copies of Advanced Perl Programming, Perl Cookbook, and Programming Perl In-Reply-To: <009301c74091$e5494b90$6401a8c0@BansheeSoftware.local> Message-ID: On Thu, 25 Jan 2007, James Moore wrote: > I've got a copy each of > > Advanced Perl Programming Hi James, Which version of APP do you have? John From andrew at sweger.net Thu Jan 25 11:33:23 2007 From: andrew at sweger.net (Andrew Sweger) Date: Thu, 25 Jan 2007 11:33:23 -0800 (PST) Subject: SPUG: OSCON 2007 Call for Participation Ends Soon Message-ID: [forwarded...] Be Heard at OSCON 2007 -- Submit Your Proposal to Lead Sessions and Tutorials by February 5! The O'Reilly Open Source Convention July 23-27, 2007 Portland, Oregon http://conferences.oreillynet.com/os2007/ More than 2500 open source developers, gurus, experts and users will gather, eager to network, learn, and share the latest knowledge on open source software. We think of this group as "the best of the best," and we invite you to contribute to the more than 400 sessions and 40 tutorials designed to build inspiration and know-how. Submit your proposals at: http://conferences.oreillynet.com/cs/os2007/create/e_sess Share your favorite techniques, your proven successes, and newly developed technology in tracks for Linux, PHP, Perl, Python, Ruby, Java, Databases, Desktop Applications, Web Applications (client-side and server-side), Windows, Administration, Security, and Emerging Topics. No topic (other than closed source software) is off-limits, so send us your best ideas. Among the hot topics we want to hear about are: - Tools for the administration and deployment of large server farms - Parallelization, grid, and multicore technologies - Virtualization - Ajax, Javascript, standards-based design, and other client-side web issues - Seaside, Rails, Django, and other interesting server-side technology - Ubuntu as an emergent usable Linux distro and contender for Red Hat and Sun's client and server markets - Java as open source - AI, machine learning, and other ways of making software smarter than the people using it - User experience and usability engineering lessons for web and desktop software - The spread of open source into law, culture, data, and services, and the accompanying issues and lessons For full details and guidelines on submitting your proposal, go to http://conferences.oreillynet.com/os2007/. If you know someone who would be a good speaker, please pass this email on. Whether as a speaker or as an attendee, you'll want to participate in this meeting of the best minds in the business, which will also include the O'Reilly Radar Executive Briefing. Be sure to save the dates -- July 23-27. Registration will open in early April. We hope to see you in Portland in July! The OSCON Team P.S. Remember, proposals for sessions and tutorials must be submitted to http://conferences.oreillynet.com/os2007/ by (11:59PM Pacific Standard Time) Monday, February 5. From Eric.D.Peterson at alltel.com Thu Jan 25 14:34:23 2007 From: Eric.D.Peterson at alltel.com (Eric.D.Peterson at alltel.com) Date: Thu, 25 Jan 2007 16:34:23 -0600 Subject: SPUG: Odd characters in string Message-ID: <8476CE21F2E6E543851495D6AB09F2A402385F5F@scarlitnt642.alltel.com> How can I count the number of odd (non-alphanumeric, on control) characters in a string? For example: a string "aAA$%\/1 50" has 3 numeric, 3 alphabetic, 1 (or 2) control/whitespace (\n or two \r\n) and 4 odd characters. I thought maybe a RegEx but I keep getting lost with the character escaping. Eric ****************************************************************************************** The information contained in this message, including attachments, may contain privileged or confidential information that is intended to be delivered only to the person identified above. If you are not the intended recipient, or the person responsible for delivering this message to the intended recipient, Alltel requests that you immediately notify the sender and asks that you do not read the message or its attachments, and that you delete them without copying or sending them to anyone else. From sthoenna at efn.org Thu Jan 25 15:08:15 2007 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Thu, 25 Jan 2007 15:08:15 -0800 (PST) Subject: SPUG: Odd characters in string In-Reply-To: <8476CE21F2E6E543851495D6AB09F2A402385F5F@scarlitnt642.alltel.com> References: <8476CE21F2E6E543851495D6AB09F2A402385F5F@scarlitnt642.alltel.com> Message-ID: <4411.67.40.28.188.1169766495.squirrel@67.40.28.188> (resending, this time to the list :) Eric.D.Peterson wrote: > How can I count the number of odd (non-alphanumeric, on control) > characters in a string? > > For example: a string "aAA$%\/1 > 50" has 3 numeric, 3 alphabetic, 1 (or 2) control/whitespace (\n or two > \r\n) and 4 odd characters. I thought maybe a RegEx but I keep getting > lost with the character escaping. Use tr///. For instance, $string =~ tr/A-Za-z0-9//c returns a count of how many non-alphanumerics there are. The /c is for complement, making the SEARCHLIST specified included rather than excluded. tr/\x00-\x1f// would count control characters, if that is specifically what you are after. -- I'm looking for a job: http://perlmonks.org/?node=ysth#looking From veritosproject at gmail.com Thu Jan 25 15:13:41 2007 From: veritosproject at gmail.com (veritosproject at gmail.com) Date: Thu, 25 Jan 2007 15:13:41 -0800 Subject: SPUG: Odd characters in string In-Reply-To: <4411.67.40.28.188.1169766495.squirrel@67.40.28.188> References: <8476CE21F2E6E543851495D6AB09F2A402385F5F@scarlitnt642.alltel.com> <4411.67.40.28.188.1169766495.squirrel@67.40.28.188> Message-ID: <6dcbe5980701251513m5480261fg47339135521f0107@mail.gmail.com> I would have said: my $bar; { my @foo = /\W/g; $bar = @foo; } But your way is easier and faster. On 1/25/07, Yitzchak Scott-Thoennes wrote: > (resending, this time to the list :) > > Eric.D.Peterson wrote: > > How can I count the number of odd (non-alphanumeric, on control) > > characters in a string? > > > > For example: a string "aAA$%\/1 > > 50" has 3 numeric, 3 alphabetic, 1 (or 2) control/whitespace (\n or two > > \r\n) and 4 odd characters. I thought maybe a RegEx but I keep getting > > lost with the character escaping. > > Use tr///. For instance, $string =~ tr/A-Za-z0-9//c returns a count of > how many non-alphanumerics there are. The /c is for complement, making > the SEARCHLIST specified included rather than excluded. tr/\x00-\x1f// > would count control characters, if that is specifically what you are after. > > -- > I'm looking for a job: http://perlmonks.org/?node=ysth#looking > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays > WEB PAGE: http://seattleperl.org/ > From krahnj at telus.net Thu Jan 25 15:32:08 2007 From: krahnj at telus.net (John W. Krahn) Date: Thu, 25 Jan 2007 15:32:08 -0800 Subject: SPUG: Odd characters in string In-Reply-To: <8476CE21F2E6E543851495D6AB09F2A402385F5F@scarlitnt642.alltel.com> References: <8476CE21F2E6E543851495D6AB09F2A402385F5F@scarlitnt642.alltel.com> Message-ID: <45B93DF8.8070403@telus.net> Eric.D.Peterson at alltel.com wrote: > How can I count the number of odd (non-alphanumeric, on control) > characters in a string? > > For example: a string "aAA$%\/1 > 50" has 3 numeric, 3 alphabetic, 1 (or 2) control/whitespace (\n or two > \r\n) and 4 odd characters. I thought maybe a RegEx but I keep getting > lost with the character escaping. Perhaps you meant the string: "aAA\$%\1 50" instead. The variable $% interpolates in a double quoted string and "\/" interpolates as "/". $ perl -le' my $str = "aAA\$%\1 50"; print for $str =~ s/([[:digit:]])/$1/g, $str =~ s/([[:alpha:]])/$1/g, $str =~ s/([[:cntrl:]])/$1/g, $str =~ s/([[:punct:]])/$1/g; ' 2 3 2 2 The substitution operator returns the number of characters that were substituted and the POSIX character classes (should) work with any non-ASCII character sets. John -- Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts of tools at low cost and in short order. -- Larry Wall From charles.e.derykus at boeing.com Thu Jan 25 15:53:12 2007 From: charles.e.derykus at boeing.com (DeRykus, Charles E) Date: Thu, 25 Jan 2007 15:53:12 -0800 Subject: SPUG: Odd characters in string In-Reply-To: <45B93DF8.8070403@telus.net> Message-ID: > How can I count the number of odd (non-alphanumeric, on control) > characters in a string? > > For example: a string "aAA$%\/1 > 50" has 3 numeric, 3 alphabetic, 1 (or 2) control/whitespace (\n or > two > \r\n) and 4 odd characters. I thought maybe a RegEx but I keep getting > lost with the character escaping. >> Perhaps you meant the string: >> "aAA\$%\1 >> 50" >> instead. The variable $% interpolates in a double quoted string and "\/" >> interpolates as "/". >> $ perl -le' >> my $str = "aAA\$%\1 >> 50"; >> print for $str =~ s/([[:digit:]])/$1/g, >> $str =~ s/([[:alpha:]])/$1/g, >> $str =~ s/([[:cntrl:]])/$1/g, >> $str =~ s/([[:punct:]])/$1/g; >> ' >> 2 >> 3 >> 2 >> 2 >> The substitution operator returns the number of characters that were substituted and the POSIX character classes >> >> (should) work with any non-ASCII character sets. Here's a slight variant: my $alnum =0; $alnum++ while $str =~ /[[:alnum:]]/g; print "non alnum: ", length($str)-$alnum, "\n"; -- Charles DeRykus From Eric.D.Peterson at alltel.com Fri Jan 26 13:15:07 2007 From: Eric.D.Peterson at alltel.com (Eric.D.Peterson at alltel.com) Date: Fri, 26 Jan 2007 15:15:07 -0600 Subject: SPUG: Odd characters in string Message-ID: <8476CE21F2E6E543851495D6AB09F2A402385F62@scarlitnt642.alltel.com> Thanks for all the suggestions. I did not know that tr returned the number of characters changed. Thanks for the insight. So I'm left with: my $cap = $new =~ tr/A-Z//; my $low = $new =~ tr/a-z//; my $num = $new =~ tr/0-9//; my $ctl = $new =~ tr/A-Za-z0-9//c; Which works for me. Eric ****************************************************************************************** The information contained in this message, including attachments, may contain privileged or confidential information that is intended to be delivered only to the person identified above. If you are not the intended recipient, or the person responsible for delivering this message to the intended recipient, Alltel requests that you immediately notify the sender and asks that you do not read the message or its attachments, and that you delete them without copying or sending them to anyone else. From MichaelRWolf at att.net Fri Jan 26 23:28:11 2007 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Fri, 26 Jan 2007 23:28:11 -0800 Subject: SPUG: How can I find @1 - @2? In-Reply-To: References: Message-ID: <003801c741e4$b7119440$0500a8c0@mlaptop> use Set::Scalar; # Set::Object works similarly my $students = Set::Scalar->new(qw{Manny Moe Jack Jill}); my $enrolled = Set::Scalar->new(qw{Manny Moe}); my $unenrolled_students; $unenrolled_students = $students->difference($enrolled); printf "Set::Scalar method: %s\n", join q{, }, $unenrolled_students->members(); $unenrolled_students = $students - $enrolled; printf "Set::Scalar overloading: %s\n", join q{, }, $unenrolled_students->members(); print <