From jobs-noreply at seattleperl.org Thu Mar 1 07:24:05 2007 From: jobs-noreply at seattleperl.org (SPUG Jobs) Date: Thu, 1 Mar 2007 07:24:05 -0800 (PST) Subject: SPUG: JOB: Software Engineer, System Test Development, Mountain View, CA Message-ID: GOOGLE IS GROWING!! We need world-class software engineers to help us develop one of the world's largest and most impressive Linux cluster deployments. You will have a chance to work on the unique challenges involved in building the system infrastructure that powers our Web search engine, as well as our many other services. __________________________________________________________ Software Engineer, System Test Development This is a full-time position located in Mountain View, CA. (Relocation assistance will be provided.) Play a key role in the development of one of the world's most impressive computing infrastructures! Google is looking for outstanding Software Developers to design, procure, and build test platforms as part of Google's world-class server team. Responsibilities: - Use your software engineering experience to produce discrete programs to test Google platforms products - Based on product specifications, use your expertise to design, procure and build test platforms to support new and existing hardware designs - Analyze, troubleshoot and perform root cause failure analysis on identified systems. Drive issues to closure with preventive measures - Work with contract manufacturers for all test process issues, including Process readiness and ongoing issue resolution - Develop automated test scripts for functional test, installation, and burn-in - Drive cost reduction by value engineering current test process - Train datacenter technicians on troubleshooting of new hardware - Monitor test capacity and yields - Mentor junior team members - Some travel may be required Qualifications: - BS/MS in EE, CS or equivalent (Ph.D. a plus) - Recent 5+ years manufacturing test development experience in x86 server and telecommunications industry - C/C++, Perl expertise, Linux; Python and Tcl/Tk a plus - Ability to communicate manufacturing test requirements into design layout requirements - Extensive test software/scripting experience - An advanced knowledge of disk drives interfaces - Excellent oral and written communication skills - Demonstrated technical leadership and mentoring skills - Self-directed Why is Google the #1 place to work? http://money.cnn.com/magazines/fortune/bestcompanies/2007/snapshots/1.html _________________________________________________________ Thanks in advance, and I hope to hear from you! Cheers, Cinde Lucas Engineering Recruiter, Platforms - Systems Software | Google, Inc. cinde at google.com | www.google.com/jobs | http://labs.google.com/why-google.html From ppcook at gmail.com Fri Mar 2 19:12:09 2007 From: ppcook at gmail.com (Paul Cook) Date: Fri, 2 Mar 2007 19:12:09 -0800 Subject: SPUG: "Cargo Cult" narratives Re: Minimal Perl for $17.46 In-Reply-To: <200702241014.22519.m3047@inwa.net> References: <200702241014.22519.m3047@inwa.net> Message-ID: Thanks, Fred. By "cargo cult", I meant that I didn't know how detailed the steps needed to be for anyone else to get the same deal, but I guess you knew. The book arrived yesterday, and there it is, all 460+ pages, for $17.46. On 2/24/07, Fred Morris wrote: > > Paul: > > A.k.a. "taking things at 'interface value'". > > Sometimes that is unfortunately all one can do. Of course both of the > phrases > refer to internalizing things we don't understand and giving them mystical > attributes: whether that's cargo mysteriously appearing on the beach > (unless > one's prayers led to the shipwreck or altered the ocean currents, not > likely > due to the intercession of deities) or having the feeling that your > computer > is "having a bad day". > > As long as you have not taken leave of reason because of this strange > series > of gestures, then to paraphrase Freud: sometimes a gesture is just a > gesture. > > On Friday 23 February 2007 17:04, Paul Cook wrote: > > I just purchased Tim's new book online for $17.46 (it lists for > $44.95!), > > with no sales tax, and free shipping. > > > > I used a price comparison site to do this, and I'm not sure how much > that > > had to do with me getting that price. At the risk of giving you a > > "cargo-cult" narrative, I'll give the exact steps that I took. YMMV. > > > > [...] > > > > I am not making this up. > ^^^^^^^^^^^^^^^^^^^^^ > > THAT made me laugh! > > -- > > Fred Morris > http://www.inwa.net/~m3047/contact.html > > _____________________________________________________________ > 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/20070302/170c7bbd/attachment.html From jobs-noreply at seattleperl.org Sat Mar 3 09:36:16 2007 From: jobs-noreply at seattleperl.org (SPUG Jobs) Date: Sat, 3 Mar 2007 09:36:16 -0800 (PST) Subject: SPUG: JOB: 6+ month data munger in Kirkland Message-ID: Six month plus W2 Contract Position open with a client in Kirkland Pay DOE Telecommunications Telecommuting not offered at this time Project description: Routers and equipment are across the country. Fetch the statistical data; write reports and do performance reporting. Write scripts and solutions for large amounts of data. 5-10 different network elements; parse it out; store it in a regional database. Downtown Kirkland immediately needs two contractors to do development and some operational reporting. Contracts will be 6+ months. - Work with engineering and operations teams to define network reporting and tools requirements - Network tools development including design, documentation, code development, testing, installation procedures, operations manuals, system backup procedures, and maintenance requirements. - Support existing and newly created tools that are used within the production network. - Primary skills needed are PERL for parsing of the data and SQL - In depth knowledge of networking and IP protocols - SNMP would be "pretty important; C++ Java interface might be good to know; maybe HTML" Out of a network or operational environment would be a plus; monitoring and reporting; know how to write and program reports Environment is run somewhat like a start-up company. No firm documented requirements/not a classic development shop; "here's the problem, try to figure out a solution", so they need to be able to work in this kind of environment. Fairly flexible; open to some telecommuting after they are established (not all the time) normal hours are 8-5; OT available If interested please send resumes to: Kirk Nishi Senior Technical Recruiter SolutionsIQ 425-519-6653 800-235-4091 Ext 136 Thank you From jobs-noreply at seattleperl.org Mon Mar 5 13:36:03 2007 From: jobs-noreply at seattleperl.org (SPUG Jobs) Date: Mon, 5 Mar 2007 13:36:03 -0800 (PST) Subject: SPUG: JOB: Web App Dev for Internet retailer Message-ID: Job title: Web application developer for Internet retailer Pay rate: DOE Travel: 0% Terms: Salaried employee, exempt Hours: full time Onsite: Yes Description: CollegeGear.com, the largest and most powerful collaboration of collegiate and pro licensed manufacturers and retailers on the Internet, is currently seeking a web application developer. We are looking for a bright, self-motivated, and experienced web application developer to work on our internally developed web and e-commerce applications. You will be working with our system architect and lead programmer to create new tools and adapt old ones to keep up with a dynamic business environment. What we offer: - A small, growing company - Fast development cycles - Your efforts are visible and have immediate impact on the business - CollegeGear.com started in 1997 and is an industry leader - Paid holidays, vacation, and sick leave - A highly motivated team Required Skills: - 5 years Perl programming (for hire) in web applications with positive experience working closely with others. - 1 year developing or modifying a functioning e-commerce system. - 6 years successfully working closely with others in a team environment. This can be in any field of endeavor. - 2 years working in modern web-based application development (involving generation of HTML, CSS, or Javascript). - Clear and consistent coding style; willing to adapt to a corporate coding standard. - Clearly communicate ideas and concepts through spoken and written word and diagrams (whiteboard communication skills). - Demonstrated experience with some or all of the following standard CPAN modules: HTML::Template, Template Toolkit, DBI, CGI::Application, Catalyst, or other Perl-based MVC frameworks. - Intermediate SQL query creation (advanced joins, transactions). Desired Skills: - Experience in the retail/warehouse/distribution industry (any level). - Database design & advanced SQL. - A love of the Perl language. - Pragmatic object oriented programming experience. - Experience with inventory management, order fulfillment, financial accounting, shopping cart, geocoding, sales tax, shipping, receiving, content management, payment services, affiliate account, accounts receivable, account payable, bulk email, and advertising accounting systems. Bonus points for the following: - Debian GNU/Linux package maintenance. Send text (ASCII) cover letter and resume to perl+jpowad at collegegear.com From jobs-noreply at seattleperl.org Tue Mar 6 07:48:36 2007 From: jobs-noreply at seattleperl.org (SPUG Jobs) Date: Tue, 6 Mar 2007 07:48:36 -0800 (PST) Subject: SPUG: JOB: Anti-Fraud Perl developer, Tacoma Message-ID: Perl Anti-Fraud Application Developer 2 positions open immediately. Employee or contract opportunity (W-2 or 1099, unrestricted) in Tacoma, WA. Telecommuting is a future possibility. Come join the leading company dedicated to providing anti-phishing services in the world! Develop great software and make the Internet safe for your friends and family at the same time. Located in Tacoma, WA we are self-financed, profitable company that isn't beholden to outside interests so we can, "do the right thing." We are seeking an experienced Perl and/or PHP Developer to collaborate with business and technical staff to design, develop, and maintain mission critical systems. We are looking for a Development/Systems Engineer and scripting/automation expert with solid Linux system and database development experience and at least 5 years of engineering experience. The ideal candidate must have experience in business process automation, writing complex shell and programming CGI/web applications in languages such as Perl, PHP, and/or Ruby. Secondarily, this person will need to be able to assist with the administration of development and production systems. The candidate must also have basic network engineering skills and good cross-departmental communication skills. Required Qualifications - Development of tools to assist with data parsing, manipulation, mining, database analysis using Perl and/or PHP - 5 years of development experience - SQL Database Design, Development and Administration experience - Query Performance Optimization - Linux System Administration experience - Server Clustering / High Availability - Ability to troubleshoot common hardware / software issues on servers running various Unix / Linux operating systems - Ability to write clean, well-documented code, provide training and support to non-technical users Desired Qualifications - B.S. degree in Computer Science / Electrical Engineering or equivalent preferred - Familiarity with version control, e.g., CSV, SVN - Recent experience with design and deployment of a data warehouse - Expert knowledge of networking, security, VPNs, and firewalls - Understanding of email servers and communications protocols - Excellent customer service and communication skills - Experience installing and managing Linux platforms and applications - Experience in start-up environments and/or commercial software development experience is a plus Additional skills a plus, e.g., Ruby, Web Services, SMTP, SOAP, AJAX. Pay is DOE with full benefits and will be competitive with market rates. Fun and collaborative small company environment with no political BS and a dedication to the mission of fighting Internet fraud. Send resume to: careers {at} internetidentity.com RE: Anti-Fraud PERL developer Internet Identity P.O. Box 1295 Tacoma, WA 98402 From MichaelRWolf at att.net Tue Mar 6 14:19:21 2007 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Tue, 6 Mar 2007 14:19:21 -0800 Subject: SPUG: Excel module recommendation Message-ID: <001b01c7603d$80f04510$c300080a@mlaptop> Any suggestions on which ones of these Excel modules is best suited to create a one-tab excel spreadsheet dumped from a 3-dimensional hash? http://search.cpan.org/search?query=excel&mode=all -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From mcrawfor at u.washington.edu Tue Mar 6 14:22:09 2007 From: mcrawfor at u.washington.edu (Miles Crawford) Date: Tue, 6 Mar 2007 14:22:09 -0800 (PST) Subject: SPUG: Excel module recommendation In-Reply-To: <001b01c7603d$80f04510$c300080a@mlaptop> References: <001b01c7603d$80f04510$c300080a@mlaptop> Message-ID: Spreadsheet::WriteExcel has routinely struck me as reliable, easy-to-understand, and well documented. -miles On Tue, 6 Mar 2007, Michael R. Wolf wrote: > Any suggestions on which ones of these Excel modules is best suited to > create a one-tab excel spreadsheet dumped from a 3-dimensional hash? > > http://search.cpan.org/search?query=excel&mode=all > > > -- > 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/ > From cos at indeterminate.net Tue Mar 6 14:28:24 2007 From: cos at indeterminate.net (John Costello) Date: Tue, 6 Mar 2007 14:28:24 -0800 (PST) Subject: SPUG: Excel module recommendation In-Reply-To: Message-ID: On Tue, 6 Mar 2007, Miles Crawford wrote: > Spreadsheet::WriteExcel has routinely struck me as reliable, > easy-to-understand, and well documented. Seconded. It works fine under Unix or Windows. From MichaelRWolf at att.net Wed Mar 7 00:02:30 2007 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Wed, 7 Mar 2007 00:02:30 -0800 Subject: SPUG: IPC::Cmd doesn't return I/O when run from apache Message-ID: <001701c7608e$fac8bab0$c300080a@mlaptop> Am I missing something obvious about I/O redirection that's apparent to Apache folks? I've got a script (tidy_up.pl) that uses IPC::Cmd to call perltidy like this: C:\Perl\bin\perltidy.BAT -i=4 -nt -se -st c:/PerlCGI/ugly.pl It works fine from a DOS command prompt. Not so from a CGI script. Well, half not-so. The script runs before and after the IPC::Cmd::run() method. The method returns 1 to indicate success, but none of the references that are supposed to point to the output are empty. Should it even be possible to have IPC::Run work in Apache2? If so, are there tricks to make sure that IPC::Run::run() gets connected to capture my output. I'm running ActivePerl 5.8.8 and IPC::Cmd v0.36. Does this line in the apache error log have any significance? [Tue Mar 06 23:55:21 2007] [error] [client 127.0.0.1] [Tue Mar 6 23:55:19 2007] tidy_up.pl: Set up gcc environment - 3.4.4 (cygming special, gdc 0.12, using dmd 0.125), referer: http://localhost/perlcgi/dir.pl After 4 hours' hacking, I'm tapped out. Any fresh ideas? -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From jobs-noreply at seattleperl.org Fri Mar 9 10:05:54 2007 From: jobs-noreply at seattleperl.org (SPUG Jobs) Date: Fri, 9 Mar 2007 10:05:54 -0800 (PST) Subject: SPUG: JOB: senior technologist, New York City Message-ID: Looking for a senior technologist with very much hands-on to manage a very talented team of Geek developers mandated to design, develop a distributed file system to develop and deploy distributed applications globally. The right candidate should consider himself to be a geek and should have a proven track record supporting it. In addition, the following skills are absolutely required. - Must understand Andrew File System (in a lot of detail), NFS (in a lot of detail) and other distributed file systems - Must have administered the software distribution for a large organization or university. "Large" includes several groups, several locations and possibly across the globe - Must be very proficient in Perl and Object Oriented Perl. Must have proven track record in developing complex and reliable applications in Perl - Must have extensive experience in compiling software (Open Source, In-house developed) across multiple platforms - Must quickly understand existing thousands of lines already developed in Perl to give direction to the existing development teams - Must have experience in managing people - Industry leadership in Systems Administration, Perl Development, Software Distribution and large site management is a big plus. - The Manager is open to a Contract or Permanent position (candidate's choice). - As for Perm, the compensation is open but based on what we're willing to pay a contractor we're looking at a total compensation package of about $180-200K. - As a Perm the position will be with Merrill Lynch (which provides outstanding benefits). As far as Stock Options, etc. it needs to be discussed with the hiring manager during the interview process. - No 1099's (but legitimate Corp-to-Corp is acceptable) - No telecommuting Please e-mail me with any questions to ben_knauer at ml.com From ryan at the-summit.net Fri Mar 9 11:58:42 2007 From: ryan at the-summit.net (Ryan Allen) Date: Fri, 9 Mar 2007 11:58:42 -0800 Subject: SPUG: Is format evil? Message-ID: <20070309195841.GA25159@the-summit.net> No I'm not complaining, just in need of a little sage guidance. Does anybody know a painless way to send a format to two places at once? I'd like for the format to go to STDOUT and an open filehandle. For example: sub displayUpgradeConfig(){ my ($k, $v); my $c = 1; format STDOUT = blade @<< : @<<<<<<<<<<<<<<<< : @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $c, $k, $v . foreach $i (\%blade1, \%blade2, \%blade3, \%blade4){ while ( ($k, $v) = each (%$i)){ write; write $logFH; } $c++; } } Notice the two "write" lines. Possible? I'm pulling my hair out? The above code produces this error: Undefined format "Symbol::GEN0" called at ./clusterInstaller line 531. Thanks!! -Ryan -- +-----------------------------+ | ryan at the-summit.net | | http://www.the-summit.net | +-----------------------------+ From sthoenna at efn.org Fri Mar 9 12:27:14 2007 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Fri, 9 Mar 2007 12:27:14 -0800 (PST) Subject: SPUG: Is format evil? In-Reply-To: <20070309195841.GA25159@the-summit.net> References: <20070309195841.GA25159@the-summit.net> Message-ID: <3712.65.102.130.157.1173472034.squirrel@65.102.130.157> Ryan wrote: > Does anybody know a painless way to send a format to two places at once? > I'd like for the format to go to STDOUT and an open filehandle. For > example: > > sub displayUpgradeConfig(){ > > my ($k, $v); > my $c = 1; > > format STDOUT = > blade @<< : @<<<<<<<<<<<<<<<< : @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< > $c, $k, $v > . > > > foreach $i (\%blade1, \%blade2, \%blade3, \%blade4){ > > while ( ($k, $v) = each (%$i)){ > write; > write $logFH; > } > > $c++; > } > } > > > Notice the two "write" lines. Possible? I'm pulling my hair out? The > above code produces this error: > > Undefined format "Symbol::GEN0" called at ./clusterInstaller line 531. The format (and top-of-page format) used for each filehandle defaults to a name based on the filehandle, but you can change it. Try: use IO::Handle; $logFH->format_name( $~ ); $logFH->format_top_name( $^ ); at some point after you've opened $logFH. Or you can avoid write and named formats, and build a string with formline to print anywhere you want. Or (in 5.8.0 or later), you can copy formats from one filehandle to another by assigning format references to globs: *$logFH = *STDOUT{FORMAT}; though this doesn't work so well for _top formats for "anonymous" globs like your $logFH (generated by Symbol::gensym). From dwilburn at whitepages.com Fri Mar 16 10:22:05 2007 From: dwilburn at whitepages.com (Daina Wilburn) Date: Fri, 16 Mar 2007 10:22:05 -0700 Subject: SPUG: Meeting Announcement -- 20 March 2007 Message-ID: March 2007 Seattle Perl Users Group (SPUG) Meeting ==================================================== Topic: The New Kwiki Meeting Date: Tuesday, 20 March 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 this coming Tuesday evening on the 20 of March 2007 at the regular monthly meeting of the Seattle Perl Users Group. This month Ingy will be telling us all about the new Kwiki. Thanks, Ingy! So, come one and all! Bring your favorite JAPH! Or perhaps even better, bring a NON-JAPH!....No, wait that can't better....Anyway, just bring 'em! And help become a part of all things SPUG. 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 the host a call on his cell phone[2] or [3] 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 [3] - 206-271-9267 _____________________________________________________________ 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 will at marketproductions.com Mon Mar 19 18:53:37 2007 From: will at marketproductions.com (Will Kidwell) Date: Mon, 19 Mar 2007 21:53:37 -0400 Subject: SPUG: Using a Duplicate Value Error Message Message-ID: <000e01c76a92$99babcb0$6501a8c0@house> Greetings, Am new to list, so I just wanted to say hello and post my first question. :) I am writing a simple script right now (attached) to allow people to register usernames/passwords into a MySQL DB. The script works, but in the "make_handle" subroutine, which inserts the username/passwords input to the DB, I am trying to figure out what to do if the proposed handles already exist. How do I notify the user of the error and to try again? The error would occur around line 120 of the script. Somehow I'm going to have to initialize a variable and set it into a conditional that will allow me to post a "Success" or "Try again" statement, but I'm not sure how to do so. I've got RaiseError working, and it might be possible to use it somehow to set a variable equal to 1 for "Try Again" or "0" for "Success", but if thats the answer I'm still not sure of how to write it out. Can anyone give me some pointers here? Thanks, Will -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20070319/8395525d/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: handles.pl Type: application/octet-stream Size: 2963 bytes Desc: not available Url : http://mail.pm.org/pipermail/spug-list/attachments/20070319/8395525d/attachment.obj From m3047 at inwa.net Tue Mar 20 08:53:10 2007 From: m3047 at inwa.net (Fred Morris) Date: Tue, 20 Mar 2007 08:53:10 -0700 Subject: SPUG: Using a Duplicate Value Error Message In-Reply-To: <000e01c76a92$99babcb0$6501a8c0@house> References: <000e01c76a92$99babcb0$6501a8c0@house> Message-ID: <200703200853.11156.m3047@inwa.net> Hello Will, welcome to the list! Without critiquing style (doesn't this come down to style?), isn't the answer obviously that what you'd normally do at that point in the code is display whatever congratulations page you're planning to send to the user for registering? You have to send something to the user as a success page if they are successful. FIRST: You have to test $sth for success, that is to say $an_error = (! $sth); At that point you can conditionally decide to display the success page or the existing error page. If you parameterize the existing error page: sub error { my $message; (defined ($message = shift)) or $message = ''; then you can decide to print the message out at some point in the body of your error document:

$message

Whoa! You just ran into an error!

Putting it together: if ($sth) { thankyou(); # to-do } else { error("Registration Failed!"); } Note that you could parameterize your welcome() page the same way, and simply redisplay it with a message that registration failed. Hope that helps... -- Fred Morris http://devil.m3047.inwa.net/contact.html -- On Monday 19 March 2007 18:53, Will Kidwell wrote: > [...] > The script works, but in the "make_handle" subroutine, which inserts the > username/passwords input to the DB, I am trying to figure out what to do if > the proposed handles already exist. How do I notify the user of the error > and to try again? > [...] From benb at speakeasy.net Tue Mar 20 09:56:09 2007 From: benb at speakeasy.net (BenRifkah Bergsten-Buret) Date: Tue, 20 Mar 2007 09:56:09 -0700 Subject: SPUG: Using a Duplicate Value Error Message In-Reply-To: <000e01c76a92$99babcb0$6501a8c0@house> References: <000e01c76a92$99babcb0$6501a8c0@house> Message-ID: <46001229.9070108@speakeasy.net> Welcome Will, Will Kidwell wrote: > I've got RaiseError working, and it might be possible to use it > somehow to set a variable equal to 1 for "Try Again" or "0" for > "Success", but if thats the answer I'm still not sure of how to write > it out. Just some background to start: Is the handles.users column restricted to unique values using some kind of duplicate key constraint? If so it seems like you won't be able to insert duplicate entries am I right? If that's the case then you're most of the way there. You mentioned having RaiseError working. This means that if you try to insert a duplicate record the DBI will throw an exception (i.e.: die). You can use this to your advantage. Try this for make_handle: sub make_handle { my ($dbh, $username, $password, $URL) = @_; my $sth = shift; my $sth = $dbh->prepare("INSERT INTO handles (users, passwords) VALUES(?,?)"); my $success = 0; # trap any errors that may occur so that if the DBI dies the web page doesn't have to eval { $sth->execute($username, $password); $sth->finish(); # if we got this far then there was no error and we succeeded in creating a new entry $success = 1; }; $dbh->disconnect(); # return a status code that says whether we were successful and also return any error that may have occurred. return $success, $@; } Then when you call make_handle you can see if you were successful and if not you can see what kind of error occurred: if ($x eq ""){ welcome(); } elsif ($x eq "Submit"){ my ($success, $error) = make_handle ($dbh, $username, $password, $URL); # if we succeeded let the user know if ($success) { success_page(); } # otherwise we give them an error page else { # if the error was due to a duplicate entry the message will say so if ($error =~ m/duplicate entry/i) { # clean up the error message so that the user doesn't have to read DBI error talk $error = "The username '$username' is already in use. Please try again"; # Then show the welcome page with a message this time so they can try again welcome($error); } # if it's not a duplicate entry we need to tell them that there was a db error and chances # are it won't help to try again else { error($error); } } } else { error(); } Have fun, -- Ben From cmeyer at helvella.org Tue Mar 20 10:20:06 2007 From: cmeyer at helvella.org (Colin Meyer) Date: Tue, 20 Mar 2007 10:20:06 -0700 Subject: SPUG: Using a Duplicate Value Error Message In-Reply-To: <200703200853.11156.m3047@inwa.net> References: <000e01c76a92$99babcb0$6501a8c0@house> <200703200853.11156.m3047@inwa.net> Message-ID: <20070320172006.GC22273@funpoxgig.helvella.org> On Tue, Mar 20, 2007 at 08:53:10AM -0700, Fred Morris wrote: > Hello Will, welcome to the list! > > Without critiquing style (doesn't this come down to style?), isn't the answer > obviously that what you'd normally do at that point in the code is display > whatever congratulations page you're planning to send to the user for > registering? You have to send something to the user as a success page if they > are successful. > > FIRST: You have to test $sth for success, that is to say > $an_error = (! $sth); Note that $sth will have a false value only if $dbh->prepare( $sql ) failed. If $sth was created successfully, but an error occurred during $sth->execute(), then $sth will still hold a true value (which is the statement handle object). Also, Will turned on the RaiseError attribute in $dbh, at DBI->connect time. This means that the DBI will throw an exception for any error, causing the code to be interrupted before having the opportunity to check for return values. The proper way to trap DBI RaiseError exceptions (and other Perl exceptions) is an eval block, as BenRifkah described this in his reply. My only addition is that I would include the $sth = $dbh->prepare() statement in the eval block (or perhaps wrap it in its own eval block), to trap any error that may occurred during statement preparation. hth, -Colin. From dwilburn at whitepages.com Tue Mar 20 13:10:02 2007 From: dwilburn at whitepages.com (Daina Wilburn) Date: Tue, 20 Mar 2007 13:10:02 -0700 Subject: SPUG: Meeting Announcement Reminder-- Tonight, 20 March 2007 Message-ID: Just a reminder that this month's Seattle Perl User Group (SPUG) Meeting is tonight. See below, and see you there. March 2007 Seattle Perl Users Group (SPUG) Meeting ==================================================== Topic: The New Kwiki Meeting Date: Tuesday, 20 March 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 this coming Tuesday evening on the 20 of March 2007 at the regular monthly meeting of the Seattle Perl Users Group. This month Ingy will be telling us all about the new Kwiki. Thanks, Ingy! So, come one and all! Bring your favorite JAPH! Or perhaps even better, bring a NON-JAPH!....No, wait that can't better....Anyway, just bring 'em! And help become a part of all things SPUG. 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 the host a call on his cell phone[2] or [3] 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 [3] - 206-271-9267 _____________________________________________________________ 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 m3047 at inwa.net Tue Mar 20 18:17:04 2007 From: m3047 at inwa.net (Fred Morris) Date: Tue, 20 Mar 2007 18:17:04 -0700 Subject: SPUG: Using a Duplicate Value Error Message In-Reply-To: <20070320172006.GC22273@funpoxgig.helvella.org> References: <000e01c76a92$99babcb0$6501a8c0@house> <200703200853.11156.m3047@inwa.net> <20070320172006.GC22273@funpoxgig.helvella.org> Message-ID: <200703201817.04687.m3047@inwa.net> Golly you're right: my $rv = $sth->execute(); $an_error = (! $rv); Of course, reading the documentation would make all this clear. On Tuesday 20 March 2007 10:20, Colin Meyer wrote: > On Tue, Mar 20, 2007 at 08:53:10AM -0700, Fred Morris wrote: > > Hello Will, welcome to the list! > > > > Without critiquing style (doesn't this come down to style?), isn't the > > answer obviously that what you'd normally do at that point in the code is > > display whatever congratulations page you're planning to send to the user > > for registering? You have to send something to the user as a success page > > if they are successful. > > > > FIRST: You have to test $sth for success, that is to say > > $an_error = (! $sth); > > Note that $sth will have a false value only if $dbh->prepare( $sql ) > failed. If $sth was created successfully, but an error occurred during > $sth->execute(), then $sth will still hold a true value (which is the > statement handle object). From will at marketproductions.com Wed Mar 21 01:52:50 2007 From: will at marketproductions.com (Will Kidwell) Date: Wed, 21 Mar 2007 04:52:50 -0400 Subject: SPUG: Using a Duplicate Value Error Message References: <000e01c76a92$99babcb0$6501a8c0@house><200703200853.11156.m3047@inwa.net><20070320172006.GC22273@funpoxgig.helvella.org> <200703201817.04687.m3047@inwa.net> Message-ID: <000601c76b96$4ebc7af0$6501a8c0@house> Greetings Everyone, I'd like to thank everyone for the helpful replies and the warm welcomes. :) I havent fully had a chance to fully review the responses or finish the script, but I dont think it will be terribly hard now either. And to those who had asked - yes, I do have the handles column set to "unique". Forgot to mention that in my initial email. Seems like a great list you have going here. Glad to be a part of it. Thanks again, :) Will ----- Original Message ----- From: "Fred Morris" To: "Colin Meyer" Cc: Sent: Tuesday, March 20, 2007 9:17 PM Subject: Re: SPUG: Using a Duplicate Value Error Message > Golly you're right: > > my $rv = $sth->execute(); > $an_error = (! $rv); > > Of course, reading the documentation would make all this clear. > > On Tuesday 20 March 2007 10:20, Colin Meyer wrote: >> On Tue, Mar 20, 2007 at 08:53:10AM -0700, Fred Morris wrote: >> > Hello Will, welcome to the list! >> > >> > Without critiquing style (doesn't this come down to style?), isn't the >> > answer obviously that what you'd normally do at that point in the code >> > is >> > display whatever congratulations page you're planning to send to the >> > user >> > for registering? You have to send something to the user as a success >> > page >> > if they are successful. >> > >> > FIRST: You have to test $sth for success, that is to say >> > $an_error = (! $sth); >> >> Note that $sth will have a false value only if $dbh->prepare( $sql ) >> failed. If $sth was created successfully, but an error occurred during >> $sth->execute(), then $sth will still hold a true value (which is the >> statement handle object). > > _____________________________________________________________ > 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 dwilburn at whitepages.com Thu Mar 22 16:04:02 2007 From: dwilburn at whitepages.com (Daina Wilburn) Date: Thu, 22 Mar 2007 16:04:02 -0700 Subject: SPUG: Speakers for upcoming SPUG events Message-ID: Hi, We're looking for volunteers to speak at upcoming SPUG meetings throughout the year. If you would be willing to do so, please let me know which month you might like to volunteer for. If you know someone that would be great to hear, pass the word on to them or let me know. If you have any questions, let me know, OK? Thanks, in advance, for your assistance. Daina Wilburn Sr. Recruiter W H I T E P A G E S .C O M | I N C p: 206.812.9216 | f: 206.621.1375 dwilburn at whitepages.com www.whitepagesinc.com 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. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20070322/3828b650/attachment.html From ingy at ingy.net Fri Mar 23 12:29:29 2007 From: ingy at ingy.net (Ingy dot Net) Date: Fri, 23 Mar 2007 12:29:29 -0700 Subject: SPUG: Big Sorry Message-ID: <20070323192929.GA3205@ttul.org> Hi all, I want to offer my sincere apologies for missing Tuesday night's meeting, where I was supposed to be speaking. :( I would like to offer giving a talk in May to make up for it. Cheers, Ingy From MichaelRWolf at att.net Fri Mar 23 15:31:21 2007 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Fri, 23 Mar 2007 15:31:21 -0700 Subject: SPUG: Local Perl Class - Kent, April 2-4 Message-ID: <005601c76d9a$fc291350$0500a8c0@mlaptop> After being at home only 72 hours in 7 weeks, I'm making a rare local appearance..... I'm teaching a 3-day Intro to Perl class in Kent April 2-4. If you're interested, or know someone who is, let me know. It's a small class, so there's plenty of room, and there will be lots of one-on-one. After teaching Perl in 3 timezones, I especially like to spread it around my home town. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From tim at consultix-inc.com Fri Mar 23 17:54:12 2007 From: tim at consultix-inc.com (Tim Maher) Date: Fri, 23 Mar 2007 17:54:12 -0700 Subject: SPUG: Local Perl Classes in April In-Reply-To: <005601c76d9a$fc291350$0500a8c0@mlaptop> References: <005601c76d9a$fc291350$0500a8c0@mlaptop> Message-ID: <20070324005412.GA541@jumpy.consultix-inc.com> On Fri, Mar 23, 2007 at 03:31:21PM -0700, Michael R. Wolf wrote: > After being at home only 72 hours in 7 weeks, I'm making a rare local > appearance..... > > I'm teaching a 3-day Intro to Perl class in Kent April 2-4. > Michael R. Wolf I'm also teaching Perl in Seattle during April; a 3-day basic class from 4/23-25, followed by a 1.5 day class on Modules (esp. CGI), from 4/26-27. Both will be held at the Tukwila Marriott, which is located where I-5 South meets 450 North. -Tim *-------------------------------------------------------------------* | Tim Maher, PhD (206) 781-UNIX http://www.consultix-inc.com | | tim at ( Consultix-Inc, TeachMePerl, or TeachMeUnix ) dot Com | | CLASSES: 4/9: Shell; 4/12: UNIX/Linux Utilities; 4/23: Perl + CGI | *-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | >> My "Minimal Perl" is an Amazon Best Seller; 5 star rating! << | | # Download chapters, read reviews, and order at MinimalPerl.com # | *-------------------------------------------------------------------* From MichaelRWolf at att.net Sat Mar 24 14:40:46 2007 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Sat, 24 Mar 2007 14:40:46 -0700 Subject: SPUG: Local Perl Classes in April In-Reply-To: <20070324005412.GA541@jumpy.consultix-inc.com> References: <005601c76d9a$fc291350$0500a8c0@mlaptop> <20070324005412.GA541@jumpy.consultix-inc.com> Message-ID: <007901c76e5d$1c458340$0500a8c0@mlaptop> >> I'm teaching a 3-day Intro to Perl class in Kent April 2-4. >> Michael R. Wolf > >I'm also teaching Perl in Seattle during April; > >-Tim To my knowledge, this 5-block area of Ballard has the highest concentration of Perl instructors anywhere in the universe!!! :-) I'm not sure what it is, but I'll bet it's *not* the lutefisk. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From cos at indeterminate.net Mon Mar 26 11:46:31 2007 From: cos at indeterminate.net (John Costello) Date: Mon, 26 Mar 2007 11:46:31 -0700 (PDT) Subject: SPUG: Local Perl Classes in April In-Reply-To: <007901c76e5d$1c458340$0500a8c0@mlaptop> Message-ID: On Sat, 24 Mar 2007, Michael R. Wolf wrote: > To my knowledge, this 5-block area of Ballard has the highest concentration > of Perl instructors anywhere in the universe!!! :-) > > I'm not sure what it is, but I'll bet it's *not* the lutefisk. Cupcake Royale gets my vote. :^) From veritosproject at gmail.com Mon Mar 26 13:12:51 2007 From: veritosproject at gmail.com (veritosproject at gmail.com) Date: Mon, 26 Mar 2007 13:12:51 -0700 Subject: SPUG: Local Perl Classes in April In-Reply-To: References: <007901c76e5d$1c458340$0500a8c0@mlaptop> Message-ID: <6dcbe5980703261312p518ff3d5k707307532292522e@mail.gmail.com> On 3/26/07, John Costello wrote: > On Sat, 24 Mar 2007, Michael R. Wolf wrote: > > To my knowledge, this 5-block area of Ballard has the highest concentration > > of Perl instructors anywhere in the universe!!! :-) > > > > I'm not sure what it is, but I'll bet it's *not* the lutefisk. > > Cupcake Royale gets my vote. :^) Oh, you know nothing. http://maltbycafe.com/ 's cinnamon roll (size of a dinner plate) is much better. And closer to mi casa. From cos at indeterminate.net Mon Mar 26 16:57:24 2007 From: cos at indeterminate.net (John Costello) Date: Mon, 26 Mar 2007 16:57:24 -0700 (PDT) Subject: SPUG: Local Perl Classes in April In-Reply-To: <6dcbe5980703261312p518ff3d5k707307532292522e@mail.gmail.com> Message-ID: On Mon, 26 Mar 2007 veritosproject at gmail.com wrote: > On 3/26/07, John Costello wrote: > > On Sat, 24 Mar 2007, Michael R. Wolf wrote: > > > To my knowledge, this 5-block area of Ballard has the highest concentration > > > of Perl instructors anywhere in the universe!!! :-) > > > > > > I'm not sure what it is, but I'll bet it's *not* the lutefisk. > > > > Cupcake Royale gets my vote. :^) > > Oh, you know nothing. http://maltbycafe.com/ 's cinnamon roll (size of > a dinner plate) is much better. And closer to mi casa. I know plenty of things. maltbycafe.com's cinnamon roll happened not to be one of them. That maltbycafe is not in Ballard is another thing I didn't know. Hm, looking at the photo, I will preserve my ignorance of their cinnamon roll in favor of Grand Central's. From florentin_ at hotmail.com Thu Mar 29 00:26:44 2007 From: florentin_ at hotmail.com (Florentin) Date: Thu, 29 Mar 2007 00:26:44 -0700 Subject: SPUG: range operator Message-ID: <460B6A34.8080903@hotmail.com> Please help me understand how range operator works : # cat _a # x1 # a # x5 # x1 # b # x3 # c # d ##------------- my $start=qr/x1/; my $end=qr/x3|x5/; # prints all aa minus c, d - OK while( <>) { if(/$start/../$end/){ print ; } } # Expect to print only a and b --> it prints all from x1 to x3 as above while( <>) { if(/$start/+1 ../$end/-1) { print ; } } # Expect to print only a and b --> prints nothing ?? while( my $x = <>) { if($x=~m/$start/+1 .. $x=~m/$end/-1){ print ; } } Thank you. From jarich at perltraining.com.au Thu Mar 29 03:38:31 2007 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Thu, 29 Mar 2007 20:38:31 +1000 Subject: SPUG: range operator In-Reply-To: <460B6A34.8080903@hotmail.com> References: <460B6A34.8080903@hotmail.com> Message-ID: <460B9727.3000406@perltraining.com.au> Florentin wrote: > # Expect to print only a and b --> it prints all from x1 to x3 as above > while( <>) { > if(/$start/+1 ../$end/-1) { > print ; > } > } After running through Perltidy, this is the same as writing: while (<>) { if ( /$start/ + 1 .. /$end/ - 1 ) { print; } } which of course is the same as writing: while (<>) { if ( ((/$start/) + 1) .. ((/$end/) - 1) ) { print; } } So, we're doing the regular expression (in a scalar context) and it's returning true or false then we're adding (or subtracting) one from that value. So to walk through you're input we get: # cat _a # first regexp returns false, add 1 to make true # x1 # end of range is false # a # end of range still false # x5 # second regexp returns true, minus 1 for a value of false # x1 # end of range still false # b # end of range still false # x3 # second regexp: true minus 1, end of range still false # c # end of range still false # d # end of range still false so it prints everything. Thanks to the plus one, the first part of your range is always true, and the minus one causes the end of the range to be false even when the regexp is true. I'm not quite sure what you wished to achieve with the above code, but that probably wasn't it. > # Expect to print only a and b --> prints nothing ?? > while( my $x = <>) { > if($x=~m/$start/+1 .. $x=~m/$end/-1){ > print ; > } > } This behaves the same as the previous one. Except you're printing $_ rather than $x. If you had turned warnings on for your test code, Perl would have told you about this. All the best, Jacinta From david.dyck at fluke.com Thu Mar 29 04:27:56 2007 From: david.dyck at fluke.com (David Dyck) Date: Thu, 29 Mar 2007 03:27:56 -0800 (PST) Subject: SPUG: range operator In-Reply-To: <460B6A34.8080903@hotmail.com> References: <460B6A34.8080903@hotmail.com> Message-ID: On Thu, 29 Mar 2007 at 00:26 -0700, Florentin wrote: > # Expect to print only a and b --> prints nothing ?? > while( my $x = <>) { > if($x=~m/$start/+1 .. $x=~m/$end/-1){ > print ; > } > } Florentine, Jacinta did a good job of explaining this, but I think it would be valuable to take a look at the result of the .. operator (by temporarily storing in in $t, and then test for the lines you want to avoid (the first and the last) if ( my $t = ($x=~m/$start/ .. $x=~m/$end/) ) { print "$t: $x" if $t > 1 && $t !~ /E0$/; } Please revisit perldoc perlop which documents the value returned as ... either the empty string for false, or a sequence number (beginning with 1) for true. The sequence number is reset for each range encountered. The final sequence number in a range has the string "E0" appended to it, which doesn't affect its numeric value, but gives you something to search for if you want to exclude the endpoint. You can exclude the beginning point by waiting for the sequence number to be greater than 1. The above code does print just a and b like you were expecting (along with the sequence number described above). Don't feel bad, there aren't any examples in perldoc perlop that actually show using the result of the operator to exclude the first and last values. From charles.e.derykus at boeing.com Thu Mar 29 09:34:33 2007 From: charles.e.derykus at boeing.com (DeRykus, Charles E) Date: Thu, 29 Mar 2007 09:34:33 -0700 Subject: SPUG: range operator In-Reply-To: <460B9727.3000406@perltraining.com.au> References: <460B6A34.8080903@hotmail.com> <460B9727.3000406@perltraining.com.au> Message-ID: > After running through Perltidy, this is the same as writing: > while (<>) { > if ( /$start/ + 1 .. /$end/ - 1 ) { > print; > } > } > which of course is the same as writing: > while (<>) { > if ( ((/$start/) + 1) .. ((/$end/) - 1) ) { > print; > } > } Great explanation... and Deparse can expose parenthesized detail: $ perl -MO=Deparse,-p while( my $x = <>) { if($x=~m/$start/+1 .. $x=~m/$end/-1){ print ; } } ^D while (defined((my $x = ))) { if (((($x =~ /$start/) + 1) .. (($x =~ /$end/) - 1))) { print($_); } } - syntax OK -- Charles DeRykus From florentin_ at hotmail.com Thu Mar 29 20:00:37 2007 From: florentin_ at hotmail.com (Florentin) Date: Thu, 29 Mar 2007 20:00:37 -0700 Subject: SPUG: range operator In-Reply-To: <460B9727.3000406@perltraining.com.au> References: <460B6A34.8080903@hotmail.com> <460B9727.3000406@perltraining.com.au> Message-ID: <460C7D55.2040402@hotmail.com> Thank you everybody for explanations and interpreting perldoc pages. Florentin. Jacinta Richardson wrote: > Florentin wrote: >> # Expect to print only a and b --> it prints all from x1 to x3 as above >> while( <>) { >> if(/$start/+1 ../$end/-1) { >> print ; >> } >> } > > After running through Perltidy, this is the same as writing: > > while (<>) { > if ( /$start/ + 1 .. /$end/ - 1 ) { > print; > } > } > > which of course is the same as writing: > > while (<>) { > if ( ((/$start/) + 1) .. ((/$end/) - 1) ) { > print; > } > } > > So, we're doing the regular expression (in a scalar context) and it's > returning true or false then we're adding (or subtracting) one from > that value. So to walk through you're input we get: > > # cat _a # first regexp returns false, add 1 to make true > # x1 # end of range is false > # a # end of range still false > # x5 # second regexp returns true, minus 1 for a value > of false > # x1 # end of range still false > # b # end of range still false > # x3 # second regexp: true minus 1, end of range still > false > # c # end of range still false > # d # end of range still false > > so it prints everything. Thanks to the plus one, the first part of > your range is always true, and the minus one causes the end of the > range to be false even when the regexp is true. > > I'm not quite sure what you wished to achieve with the above code, but > that probably wasn't it. > >> # Expect to print only a and b --> prints nothing ?? >> while( my $x = <>) { >> if($x=~m/$start/+1 .. $x=~m/$end/-1){ >> print ; >> } >> } > > This behaves the same as the previous one. Except you're printing $_ > rather than $x. If you had turned warnings on for your test code, > Perl would have told you about this. > > All the best, > > Jacinta > > From MichaelRWolf at att.net Thu Mar 29 22:06:26 2007 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Thu, 29 Mar 2007 22:06:26 -0700 Subject: SPUG: range operator In-Reply-To: <460C7D55.2040402@hotmail.com> References: <460B6A34.8080903@hotmail.com><460B9727.3000406@perltraining.com.au> <460C7D55.2040402@hotmail.com> Message-ID: <006201c77289$2c07c060$0500a8c0@mlaptop> Having understood what the range operator (I like to call it a flip-flop in these situations) does, is your question-behind-the-question answered? That is, did you get done what you need to do? It looks like you're trying to mix the match operator (on $_) with the flip-scalar flip-flop behavior (on $. (aka $INPUT_LINE_NUMBER)). If that's what you need, it seems like your need is still unmet. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From florentin_ at hotmail.com Fri Mar 30 00:21:40 2007 From: florentin_ at hotmail.com (Florentin) Date: Fri, 30 Mar 2007 00:21:40 -0700 Subject: SPUG: range operator In-Reply-To: <006201c77289$2c07c060$0500a8c0@mlaptop> References: <460B6A34.8080903@hotmail.com><460B9727.3000406@perltraining.com.au> <460C7D55.2040402@hotmail.com> <006201c77289$2c07c060$0500a8c0@mlaptop> Message-ID: <460CBA84.4000408@hotmail.com> Indeed I mixed returned boolean with <$.> but original explanation from Jacinta, pointed that adding one to false is true. David Dyck solution is elegant - originally I sliced @section like @section[1..(@section-1)]. while ( defined( ( my $x = ) ) ) { if ( my $t = ( ( $x =~ /$start/ ) .. ( $x =~ /$end/ ) ) ) { chomp $x; if ( $t > 1 and $t !~ /E0$/ ) { push @section, $x; } } if ( $x =~ m/$end/ ) { parseSection(@section); @section = (); } } Michael R. Wolf wrote: > Having understood what the range operator (I like to call it a flip-flop in > these situations) does, is your question-behind-the-question answered? > > That is, did you get done what you need to do? > > It looks like you're trying to mix the match operator (on $_) with the > flip-scalar flip-flop behavior (on $. (aka $INPUT_LINE_NUMBER)). If that's > what you need, it seems like your need is still unmet. > > >