From perl-pm at joshheumann.com Thu Mar 4 12:36:00 2004 From: perl-pm at joshheumann.com (Josh Heumann) Date: Mon Aug 2 21:34:30 2004 Subject: [Pdx-pm] March Meeting Reminder Message-ID: <33054.209.162.205.24.1078425360.squirrel@www.joshheumann.com> March is Present to Your Local Programming Group Month! Really! As luck would have it, it's also Lightning Talks this month, so anyone can talk. Between five and 15 minutes, on any subject, Perl-related or not. Let's hear some voices! Already signed up: Jeff Zucker, "The private nature of DBI apparently-public hashes" Michael Schwern, "Simple privacy or My code has a shotgun" When: March 10th, 2004 6:30pm Where: Free Geek, 1741 SE 10th (not the main entrance) What: You, talking about anything you want! Afterwards: Beer at the Lucky Lab... Sign up on the LightningTalks page of the kwiki, http://pdx.pm.org/kwiki/index.cgi?LightningTalks Wondering what the heck a lightning talk is? Check out the kwiki. Josh __________________________ 13 portraits in one series of photos, 88 photos total http://www.joshheumann.com From ingy at ttul.org Thu Mar 4 23:36:52 2004 From: ingy at ttul.org (Brian Ingerson) Date: Mon Aug 2 21:34:30 2004 Subject: [Pdx-pm] March Meeting Reminder In-Reply-To: <33054.209.162.205.24.1078425360.squirrel@www.joshheumann.com> References: <33054.209.162.205.24.1078425360.squirrel@www.joshheumann.com> Message-ID: <20040305053652.GB18898@ttul.org> On 04/03/04 11:36 -0700, Josh Heumann wrote: > > March is Present to Your Local Programming Group Month! Really! > > As luck would have it, it's also Lightning Talks this month, so anyone > can talk. Between five and 15 minutes, on any subject, Perl-related or > not. Let's hear some voices! I could give a lightning talk on Pointer.pm > > Already signed up: > > Jeff Zucker, "The private nature of DBI apparently-public hashes" > Michael Schwern, "Simple privacy or My code has a shotgun" > > When: March 10th, 2004 6:30pm > Where: Free Geek, 1741 SE 10th (not the main entrance) > What: You, talking about anything you want! > Afterwards: Beer at the Lucky Lab... > > Sign up on the LightningTalks page of the kwiki, > http://pdx.pm.org/kwiki/index.cgi?LightningTalks > > Wondering what the heck a lightning talk is? Check out the kwiki. > > Josh > __________________________ > 13 portraits in one series > of photos, 88 photos total > http://www.joshheumann.com > > > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list@mail.pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list From ARichard at AZAD.com Fri Mar 5 13:38:00 2004 From: ARichard at AZAD.com (Aaron Richard) Date: Mon Aug 2 21:34:30 2004 Subject: [Pdx-pm] Test Engineer Message-ID: Test Engineer This is an excellent opportunity for a Test Engineer to join AZAD's team of professionals and contribute to a Systems Engineering team and implement exiting test plans for a Linux based system. The AZAD consultant will be responsible for creating and executing the tests, as well as, investigating and debugging the system level issues. The ideal candidate must possess experience in the following: - Proven Experience with testing software/firmware as well as hardware and boards for complex embedded systems. - Experience creating and executing test scripts and diagnostics utilizing PERL. - Excellent written and verbal communication skills. ** Must be a US Citizen or a green card holder.** Location: Portland, Oregon Please send resumes to: arichard@azad.com or call AZAD Toll Free at (503) 617-9490 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/pdx-pm-list/attachments/20040305/81c205b5/attachment.htm From raanders at acm.org Mon Mar 8 12:16:24 2004 From: raanders at acm.org (Roderick A. Anderson) Date: Mon Aug 2 21:34:30 2004 Subject: [Pdx-pm] Dependency Hell Message-ID: I'm trying to install Siesta on a very old RHL system (6.1 Cartman) and I am in a dependency hell. I'd prefer not to do a full CPAN update at this time as I'll be upgrading the OS later and it will happen then. What is happening is I'm trying to install File::Spec which needs Test::More but Test::Simple needs a piece of File::Spec. Any ideas as to how I can get past this? TIA, Rod -- "Open Source Software - You usually get more than you pay for..." "Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL" From perl-pm at joshheumann.com Mon Mar 8 17:01:48 2004 From: perl-pm at joshheumann.com (Josh Heumann) Date: Mon Aug 2 21:34:30 2004 Subject: [Pdx-pm] March Meeting Reminder Message-ID: <52082.209.162.205.24.1078786908.squirrel@www.joshheumann.com> March Meeting When: March 10th, 2004 6:30pm Where: Free Geek, What: A whole host of interesting talks, including -The private nature of DBI apparently-public hashes, by Jeff Zucker -Simple privacy or My code has a shotgun, by MichaelSchwern -This Parrot Plays Games, by chromatic -Look Ma, Software, by Austin Schutz -Pointer.pm, by BrianIngerson -You, talking about anything you want! Sign up on the kwiki, pdx.pm.org/kwiki. YO! Got a bridge? We need a wifi bridge/router to provide us with lovely, lovely wifi access at the meeting. Email me if you have one. If no one does, we get no wifi, and we will be sad. Josh __________________________ 13 portraits in one series of photos, 88 photos total http://www.joshheumann.com From rootbeer at redcat.com Mon Mar 8 20:16:10 2004 From: rootbeer at redcat.com (Tom Phoenix) Date: Mon Aug 2 21:34:30 2004 Subject: [Pdx-pm] Dependency Hell In-Reply-To: References: Message-ID: On Mon, 8 Mar 2004, Roderick A. Anderson wrote: > I'm trying to install File::Spec which needs Test::More but Test::Simple > needs a piece of File::Spec. Any ideas as to how I can get past this? Install everything simultaneously? Seriously, try manually installing one of the modules, instead of doing it through the CPAN shell. (That is what you're doing, right?) If that module refuses to go first, find out which one will go first. And you could install a module even if its tests fail (but consider going back and doing it again, too, once you can run the tests). Also, if you're installing anywhere outside the standard @INC paths on your system, be sure that you have PERL5LIB (or equivalent) set properly, else your later-installed modules won't be able to find the earlier ones. Hope this helps! --Tom Phoenix From raanders at acm.org Tue Mar 9 13:35:14 2004 From: raanders at acm.org (Roderick A. Anderson) Date: Mon Aug 2 21:34:30 2004 Subject: [Pdx-pm] Dependency Hell In-Reply-To: Message-ID: On Mon, 8 Mar 2004, Tom Phoenix wrote: > On Mon, 8 Mar 2004, Roderick A. Anderson wrote: > > > I'm trying to install File::Spec which needs Test::More but Test::Simple > > needs a piece of File::Spec. Any ideas as to how I can get past this? > > Install everything simultaneously? Not sure I follow this. (Looking back I get it now. Sloped shoulders and flat forehead :-) Typically I download a CPAN tarball, unpack it, move into the directory, do a perl Makefile.PL, watch for errors (missing utilities/packages). If something is missing I download it and do the same for it. Usually I get only so deep and then work my way out finally getting back to the package I'm installing. Sometimes it takes several times doing this. > Seriously, try manually installing one of the modules, instead of doing it > through the CPAN shell. (That is what you're doing, right?) If that module > refuses to go first, find out which one will go first. And you could > install a module even if its tests fail (but consider going back and doing > it again, too, once you can run the tests). Ah. This is what I'm doing. (see above). The real pit is File::Spec seems to require a part of File::Spec to install -- abs2rel or rel2abs if I remember correctly. (Too many projects going on at the same time.) > Also, if you're installing anywhere outside the standard @INC paths on > your system, be sure that you have PERL5LIB (or equivalent) set properly, > else your later-installed modules won't be able to find the earlier ones. I'll look into this but I tend to do it the way it's suppose to be done. Nothing fancy going on here. > Hope this helps! Push comes to shove I'll go with an OS upgrade and try again. (geez that feels like Windows) I have a 'newer' system I can try an install on so that should tell me is it is tied to the old RHL install, an actual buglet or id10t on my part. Thanks for the suggestions, Rod -- "Open Source Software - You usually get more than you pay for..." "Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL" From sechrest at peak.org Tue Mar 9 22:12:53 2004 From: sechrest at peak.org (John Sechrest) Date: Mon Aug 2 21:34:30 2004 Subject: [Pdx-pm] Lean Programming Talk and Workshop in Corvallis Message-ID: <200403100412.i2A4CuM22564@jas.peak.org> Hello, I think that there are two events that are worth considering: On thursday March 18th, there will be an SAO Corvallis Tech Pub. at 5:30 at the Ramada Inn on 9th street. The speaker will be Dr. Peter Middleton, Professor of Computer Science, Queens University, Belfast, UK - It will be an informal discussion about Lean programming. You can find some additional information on the SAO web site at http://www.sao.corvallis.or.us On the next day, there will be a 1/2 day workshop: Applied Lean Software Development Workshop March 19, 8:30-12:30 at HP Corvallis $40 fee ----------------------------------------- In a half-day workshop, through a combination of discussion and hands-on simulation, we will demonstrate the successful application of Lean and Six Sigma to software development. We will present results from an actual project. We will show benefits in improved software release predictability, speed, team productivity, and quality. You will take away practical insights into how to improve your own software development process and implement change in your business. Sponsored by SAO Corvallis Chapter in partnership with Lean360 LLC, and hosted at HP Corvallis Campus. Presenters for this half-day workshop are: Ammon Cookson, Vice President of Product Development, ProWorks, and President, Lean360 Has over 15 years of experience managing software projects, and has led several lean software development projects. Larry Godt, Principal, Lean360 LLC Has over 20 years of business experience with the last 9 years devoted to helping companies achieve improved business performance in a variety of industries including software development. Dr. Peter Middleton, Professor of Computer Science, Queens University, Belfast, UK Has been researching lean software development processes in collaboration with Lockheed Martin Aerospace. He's also the author of a forthcoming book on lean software development. Dr. Mike Rowney, President, Rowney Consulting Inc. Has spent 20 years applying lean and six sigma in a variety of industries including software development. Where: HP Corvallis Campus, conference room Valley A in Building 3 1000 NE Circle Boulevard, Corvallis, Oregon When: 8:30am to 12:30pm, Friday, March 19, 2004 Registration: Fee: $40 payable in cash/check at the door. Attendees will be provided with a workshop notebook. Seating is limited; we recommend that you register early. To register, send an email to: ammonc@lean360.com -- John Sechrest . Helping people use . computers and the Internet . more effectively . . Internet: sechrest@peak.org . . http://www.peak.org/~sechrest From perl-pm at joshheumann.com Wed Mar 10 17:52:37 2004 From: perl-pm at joshheumann.com (Josh Heumann) Date: Mon Aug 2 21:34:30 2004 Subject: [Pdx-pm] Perlmongers meeting tonight Message-ID: <33609.130.94.161.146.1078962757.squirrel@www.joshheumann.com> March Meeting When: March 10th, 2004 6:30pm Where: Free Geek, 1741 SE 10th Ave What: A whole host of interesting talks, including -The private nature of DBI apparently-public hashes, by Jeff Zucker -Simple privacy or My code has a shotgun, by MichaelSchwern -This Parrot Plays Games, by chromatic -Look Ma, Software, by Austin Schutz -Pointer.pm, by BrianIngerson -My first Perl-Tk program, by Randall Schwartz -You, talking about anything you want! Sign up on the kwiki, pdx.pm.org/kwiki. We still have no wifi bridge, so speakers, have your stuff ready on your laptop. Josh __________________________ 13 portraits in one series of photos, 88 photos total http://www.joshheumann.com From wcooley at nakedape.cc Wed Mar 10 23:54:44 2004 From: wcooley at nakedape.cc (Wil Cooley) Date: Mon Aug 2 21:34:30 2004 Subject: [Pdx-pm] Perlmongers meeting tonight In-Reply-To: <33609.130.94.161.146.1078962757.squirrel@www.joshheumann.com> References: <33609.130.94.161.146.1078962757.squirrel@www.joshheumann.com> Message-ID: <1078984484.16887.42.camel@denk.nakedape.priv> On Wed, 2004-03-10 at 15:52, Josh Heumann wrote: > We still have no wifi bridge, so speakers, have your stuff ready on your > laptop. You know, ISTR there was a LinkSys bought for Homestreet that didn't get used; maybe you or someone should talk to (Ron|Richard) about keeping it available, even if they don't want to leave it up all the time. Wil -- Wil Cooley wcooley@nakedape.cc Naked Ape Consulting http://nakedape.cc * * * * Linux, UNIX, Networking and Security Solutions * * * * * Naked Ape Consulting http://nakedape.cc * * Tired of spam and viruses in your e-mail? * * Get the Naked Ape Mail Defender! http://nakedape.cc/r/md * -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mail.pm.org/pipermail/pdx-pm-list/attachments/20040310/63c963e3/attachment.bin From curtis_ovid_poe at yahoo.com Thu Mar 11 15:10:18 2004 From: curtis_ovid_poe at yahoo.com (Ovid) Date: Mon Aug 2 21:34:30 2004 Subject: [Pdx-pm] Pointer.pm Message-ID: <20040311211018.68618.qmail@web60805.mail.yahoo.com> I've been playing with Pointer.pm and am trying to figure out what I *think* should be simple. Let's say I have a scalar with an integer: my $x = "foo"; $x = 42; Getting the string is simple: print pointer->of_scalar($x)->get_pointer->get_pointer->get_string; I can't figure out how to get the 42 back, though. The internals are straightforward: sv xpviv +---------------+ +-----+ | ANY |-->| PVX |-->(the array with the string) +---------------+ +-----+ | REFCOUNT | | CUR | +---------------+ +-----+ | FLAGS | TYPE | | LEN | +---------------+ +-----+ | IVX | +-----+ In short, how do I get the second struct's IVX value with Pointer.pm? Cheers, Ovid ===== Silence is Evil http://users.easystreet.com/ovid/philosophy/indexdecency.htm Ovid http://www.perlmonks.org/index.pl?node_id=17000 Web Programming with Perl http://users.easystreet.com/ovid/cgi_course/ From ingy at ttul.org Fri Mar 12 12:18:22 2004 From: ingy at ttul.org (Brian Ingerson) Date: Mon Aug 2 21:34:30 2004 Subject: [Pdx-pm] Re: Pointer.pm In-Reply-To: <20040311211018.68618.qmail@web60805.mail.yahoo.com> References: <20040311211018.68618.qmail@web60805.mail.yahoo.com> Message-ID: <20040312181822.GA4602@ttul.org> On 11/03/04 13:10 -0800, Ovid wrote: > I've been playing with Pointer.pm and am trying to figure out what I > *think* should be simple. Let's say I have a scalar with an integer: > > my $x = "foo"; > $x = 42; > > Getting the string is simple: > > print pointer->of_scalar($x)->get_pointer->get_pointer->get_string; > > I can't figure out how to get the 42 back, though. The internals are > straightforward: The integer is the IVX below. It's the 4th integer in the set. use Pointer; use Pointer::int; my $x = 42; print ((pointer->of_scalar($x)->get_pointer('int') + 3)->get); That works. In the next rev of Pointer.pm I'd like it to be like this: use Pointer; # Pointer::int is inside Pointer.pm my $x = 42; print pointer->of_scalar($x)->get_pointer('int')->get(3); # get takes offset So the breakdown of the first program is like this. # Use the class for regular pointers (void *) use Pointer; # Use the class for integer pointers # Note. As shown above, I think all basic C types should be inside # Pointer.pm use Pointer::int; # create an integer scalar $x = 42; # create a pointer to the sv. since pointer() has no arguments passed # in, it returns a pointer to void. ie of *type* void my $sv_pointer = pointer->of_scalar($x); # get a pointer (to int) of the xpviv. this pointer will have a type # of int which is important. my $xpviv_pointer = $sv_pointer->get_pointer('int'); # point past the first 3 integers my $ivx_pointer = $xpviv_pointer + 3; # get the integer my $integer = $ivx_pointer->get; Simple eh? Cheers, Brian PS Nice diagram > sv xpviv > +---------------+ +-----+ > | ANY |-->| PVX |-->(the array with the string) > +---------------+ +-----+ > | REFCOUNT | | CUR | > +---------------+ +-----+ > | FLAGS | TYPE | | LEN | > +---------------+ +-----+ > | IVX | > +-----+ > > In short, how do I get the second struct's IVX value with Pointer.pm? > > Cheers, > Ovid > > ===== > Silence is Evil http://users.easystreet.com/ovid/philosophy/indexdecency.htm > Ovid http://www.perlmonks.org/index.pl?node_id=17000 > Web Programming with Perl http://users.easystreet.com/ovid/cgi_course/ From darthsmily at verizon.net Sat Mar 13 17:19:46 2004 From: darthsmily at verizon.net (darthsmily) Date: Mon Aug 2 21:34:30 2004 Subject: [Pdx-pm] regular expression In-Reply-To: <20040312181822.GA4602@ttul.org> References: <20040311211018.68618.qmail@web60805.mail.yahoo.com> <20040312181822.GA4602@ttul.org> Message-ID: <40539712.9060402@verizon.net> I need regular expression help. I'm sure I'm overlooking some small detail. I am working with this string for this example: keyword NeedThis_1(blah, bloh); keyword NeedThis_2(blah, bloh,foo, bar); I have tried "keyword.*\(" but this returns: keyword NeedThis_1(blah, bloh); keyword NeedThis_2( What I want to return: NeedThis_1 NeedThis_2 Any Ideas? Thanks. From sechrest at peak.org Sat Mar 13 17:19:21 2004 From: sechrest at peak.org (John Sechrest) Date: Mon Aug 2 21:34:30 2004 Subject: [Pdx-pm] regular expression In-Reply-To: Your message of Sat, 13 Mar 2004 15:19:46 PST. <40539712.9060402@verizon.net> Message-ID: <200403132319.i2DNJLP02440@jas.peak.org> So regular expressions are greedy. So you have to provide more constraints. Instead of % "keyword.*\(" % but this returns: % keyword NeedThis_1(blah, bloh); keyword NeedThis_2( You could say: keyword [0-9_A-Za-z]*]\( And limit it to characters You will want to put parens around it, so that you have a handle to use it later. Or you could say: keyword [^( ]* \( negate the list. And find all the things that are not ( or ' ' darthsmily writes: % I need regular expression help. % I'm sure I'm overlooking some small detail. % % I am working with this string for this example: % keyword NeedThis_1(blah, bloh); keyword NeedThis_2(blah, bloh,foo, bar); % % % I have tried % "keyword.*\(" % but this returns: % keyword NeedThis_1(blah, bloh); keyword NeedThis_2( % % What I want to return: % NeedThis_1 % NeedThis_2 % % Any Ideas? % % Thanks. % % _______________________________________________ % Pdx-pm-list mailing list % Pdx-pm-list@mail.pm.org % http://mail.pm.org/mailman/listinfo/pdx-pm-list ----- John Sechrest . Helping people use . computers and the Internet . more effectively . . Internet: sechrest@peak.org . . http://www.peak.org/~sechrest From jeff at zeroclue.com Sat Mar 13 17:25:05 2004 From: jeff at zeroclue.com (Jeff Lavallee) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] regular expression In-Reply-To: <40539712.9060402@verizon.net> References: <20040311211018.68618.qmail@web60805.mail.yahoo.com> <20040312181822.GA4602@ttul.org> <40539712.9060402@verizon.net> Message-ID: You might use something like /keyword\s*([^(]+)\(/ That assumues that what your NeedThis_blah doesn't include a "(", of course. jeff On Sat, 13 Mar 2004, darthsmily wrote: > I need regular expression help. > I'm sure I'm overlooking some small detail. > > I am working with this string for this example: > keyword NeedThis_1(blah, bloh); keyword NeedThis_2(blah, bloh,foo, bar); > > > I have tried > "keyword.*\(" > but this returns: > keyword NeedThis_1(blah, bloh); keyword NeedThis_2( > > What I want to return: > NeedThis_1 > NeedThis_2 > > Any Ideas? > > Thanks. > > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list@mail.pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list > From tkil at scrye.com Sat Mar 13 23:09:29 2004 From: tkil at scrye.com (Tkil) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] regular expression In-Reply-To: <200403132319.i2DNJLP02440@jas.peak.org> (John Sechrest's message of "Sat, 13 Mar 2004 15:19:21 -0800") References: <200403132319.i2DNJLP02440@jas.peak.org> Message-ID: >>>>> "John" == John Sechrest writes: John> So regular expressions are greedy. So you have to provide more John> constraints. Note that Perl has exactly what is needed to turn a greedy quantifier into a non-greedy one: suffix the quantifier with a '?' character. In this case: | $ cat in.txt | keyword NeedThis_1(blah, bloh); keyword NeedThis_2(blah, bloh,foo, bar); Original expression: | $ perl -lnwe 'while ( /keyword (.*)\(/g ) { print $1 }' in.txt | NeedThis_1(blah, bloh); keyword NeedThis_2 Non-greedy version (note ".*?" instead of ".*"): | $ perl -lnwe 'while ( /keyword (.*?)\(/g ) { print $1 }' in.txt | NeedThis_1 | NeedThis_2 John> You could say: John> keyword [0-9_A-Za-z]*]\( John> And limit it to characters This is a pretty good suggestion anyway; most tokens are going to be alphanumeric+underscore ... which, as it turns out, is exactly what "\w" matches: | $ perl -lnwe 'while ( /keyword (\w+)/g ) { print $1 }' in.txt | NeedThis_1 | NeedThis_2 t. From darthsmily at verizon.net Sun Mar 14 21:47:45 2004 From: darthsmily at verizon.net (darthsmily) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] regular expression In-Reply-To: References: <200403132319.i2DNJLP02440@jas.peak.org> Message-ID: <40552761.80105@verizon.net> Thanks to everyone who helped me out with me regular expression troubles. Tkil wrote: >>>>>>"John" == John Sechrest writes: >>>>>> >>>>>> > >John> So regular expressions are greedy. So you have to provide more >John> constraints. > >Note that Perl has exactly what is needed to turn a greedy quantifier >into a non-greedy one: suffix the quantifier with a '?' character. > >In this case: > >| $ cat in.txt >| keyword NeedThis_1(blah, bloh); keyword NeedThis_2(blah, bloh,foo, bar); > >Original expression: > >| $ perl -lnwe 'while ( /keyword (.*)\(/g ) { print $1 }' in.txt >| NeedThis_1(blah, bloh); keyword NeedThis_2 > >Non-greedy version (note ".*?" instead of ".*"): > >| $ perl -lnwe 'while ( /keyword (.*?)\(/g ) { print $1 }' in.txt >| NeedThis_1 >| NeedThis_2 > >John> You could say: >John> keyword [0-9_A-Za-z]*]\( >John> And limit it to characters > >This is a pretty good suggestion anyway; most tokens are going to be >alphanumeric+underscore ... which, as it turns out, is exactly what >"\w" matches: > >| $ perl -lnwe 'while ( /keyword (\w+)/g ) { print $1 }' in.txt >| NeedThis_1 >| NeedThis_2 > >t. > > > From nick2canz at yahoo.com Mon Mar 15 19:01:05 2004 From: nick2canz at yahoo.com (Nick Wehr) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] regex Message-ID: <20040316010105.55128.qmail@web10807.mail.yahoo.com> Don't forget that regular expressions gobble up ALL that it is allowed. Use the ? modifier! __________________________________ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com From jamarks at jamarks.com Thu Mar 18 01:48:13 2004 From: jamarks at jamarks.com (James marks) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] Noob... Message-ID: <9C4B65CC-78B0-11D8-AB98-000A956EF5EC@jamarks.com> Hi, I'm wondering if you can give me some help. I'm trying to learn Perl but could use some advice as I go about trying to solve a practice project (I'm just getting started at learning Perl): I want to parse an HTML file that exists on the web. I know I can have Perl retrieve the file but, to make things simpler, I've downloaded it to my hard drive. My attempts so far have involved reading the entire file into a variable (I'm using a demo version of Late Night Software's Affrus, by the way) then trying to parse the string contained by the variable. Is it "better" Perl programming to have the Perl script read the file in one line at a time or is reading the entire file into a variable ok? How do I have the script jump from the first regex match the the next? I've tried several loops but none have worked so far. Should I be trying to work with the string contained in the $' ($POSTMATCH) variable? Are Perl scripts normally invoked in the Terminal? I don't see how, other than making an executable, a script would be launched from the GUI. Again, I'm just starting out in Perl so I'm sure some of these questions seem pretty elementary. I'm coming to Perl from about 3 years using AppleScript so I think I have a handle on the concepts of variables, globals, loops, branching, libraries, etc... but I haven't really worked with the UNIX command line before this. Thanks for any help you can provide! James From jamarks at jamarks.com Thu Mar 18 02:18:08 2004 From: jamarks at jamarks.com (James marks) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] Re: Noob... Message-ID: And, of course, as soon as I sent my question in I solved the looping problem by using $' to search the portion of the string that remained after the first regex match... D'oh! James From tex at off.org Thu Mar 18 02:38:23 2004 From: tex at off.org (Austin Schutz) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] Noob... In-Reply-To: <9C4B65CC-78B0-11D8-AB98-000A956EF5EC@jamarks.com> References: <9C4B65CC-78B0-11D8-AB98-000A956EF5EC@jamarks.com> Message-ID: <20040318083823.GS1249@gblx.net> On Wed, Mar 17, 2004 at 11:48:13PM -0800, James marks wrote: > Hi, > > I'm wondering if you can give me some help. I'm trying to learn Perl > but could use some advice as I go about trying to solve a practice > project (I'm just getting started at learning Perl): > > I want to parse an HTML file that exists on the web. > > I know I can have Perl retrieve the file but, to make things simpler, > I've downloaded it to my hard drive. > Sure. I hear the LWP module is handy for that, but as you say best to make life easy to start off with. > My attempts so far have involved reading the entire file into a > variable (I'm using a demo version of Late Night Software's Affrus, by > the way) then trying to parse the string contained by the variable. > You might consider looking for something from cpan.org, e.g. HTML::Parser, which would do what you want without reinventing the wheel. Further, you can usually use the CPAN module to do the work of building and installing it for you, by running 'perl -MCPAN -e shell'. But sometimes it's worthwhile to build your own wheel so you can get a better feel for what's involved with building one. > Is it "better" Perl programming to have the Perl script read the file > in one line at a time or is reading the entire file into a variable ok? > If you are reading in a file which is small compared to the available system ram, it's usually faster/better to read in a file all at once. If you are reading in a huge file, such as a web server log file, it's better to do it in small chunks or line by line. In general doing one big read is faster than a lot of little ones, unless you are going to starve your machine for ram. > How do I have the script jump from the first regex match the the next? > I've tried several loops but none have worked so far. Should I be > trying to work with the string contained in the $' ($POSTMATCH) > variable? > The way _I_ usually do this is to have the regex eat some of the data in the buffer, using s///, e.g.: my($buffer); $buffer = "my pagewhee"; my($before_tag, $tag); # Regex: remove everything up to the first <> tag. Everything before the # tag will go into $1, everything in the tag $2 because they are in ()s. while ( $buffer =~ s/^(.*?)(\<[^\<]\>)// ) { $before_tag = $1; $tag = $2; # Do stuff with the tag... ... } This probably doesn't do what you intend to do with your parser, but hopefully it will help you understand the mechanism. As the aged saw goes, "TMTOWTDI". That's one way. > Are Perl scripts normally invoked in the Terminal? I don't see how, > other than making an executable, a script would be launched from the > GUI. > see 'perldoc perlrun'. > Again, I'm just starting out in Perl so I'm sure some of these > questions seem pretty elementary. I'm coming to Perl from about 3 years > using AppleScript so I think I have a handle on the concepts of > variables, globals, loops, branching, libraries, etc... but I haven't > really worked with the UNIX command line before this. > Yeah, that's great. Any previous programming experience definitely helps. Welcome to the Perl community. Austin From jkeroes at eli.net Thu Mar 18 02:39:35 2004 From: jkeroes at eli.net (Joshua Keroes) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] Noob... In-Reply-To: <9C4B65CC-78B0-11D8-AB98-000A956EF5EC@jamarks.com> References: <9C4B65CC-78B0-11D8-AB98-000A956EF5EC@jamarks.com> Message-ID: On Mar 17, 2004, at 11:48 PM, James marks wrote: > I want to parse an HTML file that exists on the web. What URL are you fetching? What's the desired datum you want? Can you post your script here? Thanks, J From tkil at scrye.com Thu Mar 18 03:00:45 2004 From: tkil at scrye.com (Tkil) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] Noob... In-Reply-To: <9C4B65CC-78B0-11D8-AB98-000A956EF5EC@jamarks.com> (James marks's message of "Wed, 17 Mar 2004 23:48:13 -0800") References: <9C4B65CC-78B0-11D8-AB98-000A956EF5EC@jamarks.com> Message-ID: >>>>> "James" == James marks writes: James> I know I can have Perl retrieve the file but, to make things James> simpler, I've downloaded it to my hard drive. James> My attempts so far have involved reading the entire file into a James> variable (I'm using a demo version of Late Night Software's James> Affrus, by the way) then trying to parse the string contained James> by the variable. If you just want to get the entire contents into a single variable, there's LWP::Simple (LWP stands for "libwww-perl"): use LWP::Simple qw( get ); my $page = get "http://blah.whatever.com"; James> Is it "better" Perl programming to have the Perl script read James> the file in one line at a time or is reading the entire file James> into a variable ok? Having only the minimal amount of text in memory is a good thing... but keeping track of what is "minimal" can be difficult. As an example, I often write HTML that looks like this: Honker! If you read it line-by-line, you will very probably miss that. James> How do I have the script jump from the first regex match the James> the next? The typical idiom is to use \G in conjunction with /gc flags. There are good examples of this in Freidl's _Mastering Regular Expressions_. In the free documentation, look at the use of /gc in the "perldoc perlre" (also available online at www.perldoc.com). (For what it's worth, the example in _MRE_ is exactly that of doing primitive parsing of HTML.) Finally, note that there are modules which can parse HTML and do various things with it, including callbacks in the SAX style (which basically means that you can have the module do the "hard work" of parsing, while you subclass it and figure out what to do when it spots an opening tag, a closing tag, a comment, plain text, etc...) Shockingly enough, one of them is called "HTML::Parser", although I am not sure if there are other more-preferred methods these days. There are also modules that parse HTML into memory (instead of a stream of events); HTML::TreeBuilder used to be one of these, if I recall correctly. If you can find some cached versions of my perl samples, there are some that deal with this sort of thing (e.g., extracting links + descriptions from HTML). The disk they are hosted on has gone totally dead, however, and I haven't had the opportunity to rebuild it. James> Are Perl scripts normally invoked in the Terminal? I don't see James> how, other than making an executable, a script would be James> launched from the GUI. Depending on which GUI you're talking about (OSX? Win32? X window WM of some sort?), you can likely set up a "shortcut" that invokes the command-line environment, then runs the script within it. I don't remember the details, but there is a magic suffix you can add to file names in OSX that cause them to be interpreted by the shell. Also, I suspect that OSX is smart enough to understand that executable bits + "#! line" means executable, but I've not had the opportunity to try it myself. Randal is a MacHead, perhaps he'll chirp up. Good luck, t. p.s. In addition to www.perldoc.com, familiarize yourself with search.cpan.org and the perlfaq. In particular, there is an entry in the FAQ that deals with stripping out HTML, which might give you some pointers. If you want to know why I waffle on so many of the HTML-specific portions, consider that this is not unreasonable HTML: <bang!> Finding a regex that can properly handle this is exciting. Read _Mastering Regular Expressions_ for much, much, much more detail. From john at digitalmx.com Fri Mar 19 01:10:24 2004 From: john at digitalmx.com (John Springer) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] Re: Noob... In-Reply-To: References: Message-ID: <7DE91BB2-7974-11D8-8A58-000A95DC32DA@digitalmx.com> Perl will be really rewarding once you "get it". I learned perl "on the fly" when I started doing web scripting about 10 years ago. It's taken a long time, and there's still a big gap between me and the kind of skills you see represented on this list. I mean, this is the best of the best. Portland is a gold mine of perl expertise. But there's nothing that's a substitute for just writing code to solve various real world problems. I highy recommend two books: the Programming Perl book and the Perl Cookbook. Both are OReilly publications. The first is THE reference book for Perl and the other has lots of practical sample applications in it. CPAN can be a bit overwhelming at first. There's lots of stuff there: in fact, maybe too much stuff. It can be really hard to separate the great from the not so great and it's a little scarey the first time CPAN decides it needs to update everything in your perl library, including perl. There are a few extremely important modules though, like LWP and CGI, that are in everyone's toolkit. Perl Cookbook is very helpful for identifying critical perl modules as well. Anyway, you will discover that once you learn some perl and in particular get comfortable with regular expressions, you will be able to do stuff easily that other programmers struggle with. Knowing perl is really liberating, because you can solve just about any text-handling problem quickly and easily. On Mar 18, 2004, at 12:18 AM, James marks wrote: > And, of course, as soon as I sent my question in I solved the looping > problem by using $' to search the portion of the string that remained > after the first regex match... -- John Springer Somewhere in Portland Where it's probably raining. From jamarks at jamarks.com Fri Mar 19 01:35:53 2004 From: jamarks at jamarks.com (James marks) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] Noob... In-Reply-To: References: <9C4B65CC-78B0-11D8-AB98-000A956EF5EC@jamarks.com> Message-ID: <0D7FB1E5-7978-11D8-8966-000A956EF5EC@jamarks.com> Ok. As I said in an earlier post, I downloaded the HTML file just to make the project a little easier although I know it's possible to download the file from the web using a Perl script. I'm just trying to take things one step at a time. Here's my script. #!/usr/bin/perl open FILEIN, "some_web_page.html"; #web page saved to my drive $_ = ; $counter = 0; while (/.*?<\/B>/) { print "$&\n\n"; # this is just to test the success of the match $counter += 1; $_ = $'; } print "There were $counter matches.\n"; close FILEIN; My understanding is this: The default scalar variable, $_, takes in the entire text of the HTML file as a string. Because the value of $_ is a single long string rather than an array, a foreach loop wouldn't be appropriate here so I've used a while loop instead. I want to step through the long string one regex match at a time, however, and extract the matched substring. My solution was to replace the value of $_ with that of $' (everything after the regex match) then search $_ again for the next match. I suspect there's a better, or at least more common way to do this but I haven't found it yet. How would the more experienced programmers do it? Thanks for your help! James On Mar 18, 2004, at 12:39 AM, Joshua Keroes wrote: > > On Mar 17, 2004, at 11:48 PM, James marks wrote: >> I want to parse an HTML file that exists on the web. > > What URL are you fetching? > What's the desired datum you want? > Can you post your script here? > > Thanks, > J > > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list@mail.pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list > From chromatic at wgz.org Fri Mar 19 01:48:11 2004 From: chromatic at wgz.org (chromatic) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] Learning HTML Parsing In-Reply-To: <0D7FB1E5-7978-11D8-8966-000A956EF5EC@jamarks.com> References: <9C4B65CC-78B0-11D8-AB98-000A956EF5EC@jamarks.com> <0D7FB1E5-7978-11D8-8966-000A956EF5EC@jamarks.com> Message-ID: <1079682491.27910.8.camel@localhost> On Thu, 2004-03-18 at 23:35, James marks wrote: > The default scalar variable, $_, takes in the entire text of the HTML > file as a string. Unfortunately, no. You've (innocently and inadvertently) asked Perl for one thing, and Perl obliges by giving you one line from the file. If you want the whole thing, use this instead: local $/; $_ = ; $/ is a magic variable that contains the "input record specifier". That's the Perlish way of specifying the characters that come at the end of a record. In this case, it's a newline (whatever that is on your platform). By localizing it, you're effectively removing that value, so Perl will slurp up the entire file for you into that variable, which is what you want. As for the actual parsing of HTML, I'm pretty happy with running HTML through tidy, producing XML, then using XML::Parser's SAX callbacks, but that's not exactly what you asked and it's pretty cruel to inflict both XML and SAX on someone at this hour. It'd be easier to give you pointers if you gave us a snippet of real HTML and what you were looking for in it though. Sometimes regexes are pretty quick. -- c From MichaelRWolf at att.net Fri Mar 19 02:15:42 2004 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] Noob... In-Reply-To: <9C4B65CC-78B0-11D8-AB98-000A956EF5EC@jamarks.com> (James marks's message of "Wed, 17 Mar 2004 23:48:13 -0800") References: <9C4B65CC-78B0-11D8-AB98-000A956EF5EC@jamarks.com> Message-ID: James marks writes: > I'm wondering if you can give me some help. I'm trying to learn Perl > but could use some advice as I go about trying to solve a practice > project (I'm just getting started at learning Perl): > > I want to parse an HTML file that exists on the web. As long as it's only practice, feel free to use Regular Expressions. If it needs to scale, RE's are not a parsing tool sufficient to the richness of real-world HTML. In that case, look for a real parsing tool or module. It's not my baliwick, but it's in a FAQ somewhere. Welcome to the wonderful world of Perl, rich with all it's tools -- sharp, dull, general, specific, appropriate and obtuse. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf@att.net From jamarks at jamarks.com Fri Mar 19 02:25:13 2004 From: jamarks at jamarks.com (James marks) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] Learning HTML Parsing In-Reply-To: <1079682491.27910.8.camel@localhost> References: <9C4B65CC-78B0-11D8-AB98-000A956EF5EC@jamarks.com> <0D7FB1E5-7978-11D8-8966-000A956EF5EC@jamarks.com> <1079682491.27910.8.camel@localhost> Message-ID: On Mar 18, 2004, at 11:48 PM, chromatic wrote: >> The default scalar variable, $_, takes in the entire text of the HTML >> file as a string. > > Unfortunately, no. You've (innocently and inadvertently) asked Perl > for > one thing, and Perl obliges by giving you one line from the file. > > If you want the whole thing, use this instead: > > local $/; > $_ = ; I'm not sure I understand. When I run the script in Affrus (my Perl debugger) it shows the value of $_ as containing the entire HTML file. The string does contain line breaks, but that doesn't make it something other than a string, does it? (Like an array, for example.) The script I posted does, in fact, loop through the regex matches as I was wanting. At least on my machine (mac osx). > $/ is a magic variable that contains the "input record specifier". So, the default for $/ is newline, correct? I'm not necessarily wanting to limit my regex search to one line, however. > As for the actual parsing of HTML, I'm pretty happy with running HTML > through tidy, producing XML, then using XML::Parser's SAX callbacks, > but > that's not exactly what you asked and it's pretty cruel to inflict both > XML and SAX on someone at this hour. :) Thanks! > It'd be easier to give you pointers if you gave us a snippet of real > HTML and what you were looking for in it though. Sometimes regexes are > pretty quick. Actually, I'm just trying to understand the best method for looping through regex matches in a long text document. I'm not actually searching for any substring in particular. I suspect there's a better way that the one I've used (swapping $' for $_). Thanks, James From curtis_ovid_poe at yahoo.com Fri Mar 19 10:16:00 2004 From: curtis_ovid_poe at yahoo.com (Ovid) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] Noob... In-Reply-To: <9C4B65CC-78B0-11D8-AB98-000A956EF5EC@jamarks.com> Message-ID: <20040319161600.79608.qmail@web60806.mail.yahoo.com> Hi James, > but could use some advice as I go about trying to solve a practice > project (I'm just getting started at learning Perl): > > I want to parse an HTML file that exists on the web Obviously, with the advice people have given you, it's clear that there are many ways of approaching this problem. Here's one way that's easy to understand and use. use LWP::Simple; # get the web page use HTML::FormatText::WithLinks; # parse the HTML # get is from LWP::Simple my $document = get('http://www.cnn.com/'); # always do sanity checking unless you want difficult to fix bugs die "No document" unless $document; my $f = HTML::FormatText::WithLinks->new; my $text = $f->parse($document); print $text; That allows for easy formatting, but here's a variation that also does this. You lose some formatting, but you can use the module to gain greater control over what you're trying to parse use LWP::Simple; # get the web page use HTML::TokeParser::Simple; # parse the web page use HTML::Entities; # decode special characters # get is from LWP::Simple my $document = get('http://www.yahoo.com/'); die "No document" unless $document; my $parser = HTML::TokeParser::Simple->new(\$document); $parser->get_tag('body'); # advance to first body tag while (my $token = $parser->get_token) { next unless $token->is_text; # decode_entities is from HTML::Entities print decode_entities($token->as_is); } That while{} loop is where you would be doing the bulk of your parsing. Did you only want to print out HTML comment? It's pretty simple: while (my $token = $parser->get_token) { next unless $token->is_comment; # decode_entities is from HTML::Entities print decode_entities($token->as_is); } See the docs on CPAN.org for more information. Good luck! Cheers, Ovid ===== Silence is Evil http://users.easystreet.com/ovid/philosophy/indexdecency.htm Ovid http://www.perlmonks.org/index.pl?node_id=17000 Web Programming with Perl http://users.easystreet.com/ovid/cgi_course/ From jamarks at jamarks.com Sat Mar 20 02:13:19 2004 From: jamarks at jamarks.com (James marks) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] Noob... In-Reply-To: <9C4B65CC-78B0-11D8-AB98-000A956EF5EC@jamarks.com> References: <9C4B65CC-78B0-11D8-AB98-000A956EF5EC@jamarks.com> Message-ID: <7279E134-7A46-11D8-9C0E-000A956EF5EC@jamarks.com> On Mar 17, 2004, at 11:48 PM, James marks wrote: > How do I have the script jump from the first regex match the the next? > I've tried several loops but none have worked so far. Should I be > trying to work with the string contained in the $' ($POSTMATCH) > variable? And now I discover the s///g and realize that I don't have to use loop at all. Sorry to bother you all with what I knew were elementary questions. I'll try to do more reading next time before I post such questions. Thanks, James From perl-pm at joshheumann.com Mon Mar 22 16:01:28 2004 From: perl-pm at joshheumann.com (Josh Heumann) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] A call to books Message-ID: <33658.130.94.161.146.1079992888.squirrel@www.joshheumann.com> Now is the time for all great Perlmongers who have books to return them to the library. We have a new book that's up for review! Perl Medic: Transforming Legacy Code, by Peter J. Scott. "If you code in Perl, you need to read this book," says Adam Turoff, according to the cover. Here's more info: http://tinyurl.com/3ydl8. A free read, provided you provide the rest of us with a review of the book. But before I can check it into the library where anyone can check it out for the price of a review, let's see a show of hands: who has a book checked out from pdx.pm? Conan the Librarian __________________________ http://www.joshheumann.com From raanders at acm.org Tue Mar 23 16:54:08 2004 From: raanders at acm.org (Roderick A. Anderson) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] Pass by reference(?) Message-ID: I think I've got the correct terms but a very weak understanding. I'm using HTML:Template to fill in some HTML (go figure) and XML templates. I use a hash to hold the template variables and then use this construct. my $add_plans = HTML::Template->new( filename => "$TemplateDIR/$Template", die_on_bad_params => 0); foreach my $key (keys %SUI) { $add_plans->param($key => $SUI{$key}); } And though it's only 2 lines of code it goes (to my way of thought) against the grain. I'd like to do something like a fill_form subroutine that I could call. The hash (%SUI) is global (main) but $add_plans is local to the subroutine it is in. So my question(s) are how to call the sub and how to access the variables. My thoughts are &fill_form(\$add_plans, %SUI); I do realize I can get by without passing the %SUI since it's global but it seems good form and probably should be \%SUI with then the subroutine would be completely generic. But I'm completely out of my depth when it comes to the actual subroutine and how to get at $add_plans and if I need any special magic to return it. As always any and all help, pointers and clue-stick are appreciate. Rod -- "Open Source Software - You usually get more than you pay for..." "Build A Brighter Lamp :: Linux Apache {middleware}* PostgreSQL" * My middleware looks like perl, smells like perl, and feels like perl. Heck it must be right. From gminter at hevanet.com Tue Mar 23 23:56:49 2004 From: gminter at hevanet.com (Greg Minter) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] Re: Pass by reference(?) References: Message-ID: <40612321.9080707@hevanet.com> Roderick A. Anderson wrote: >I'm using HTML:Template to fill in some HTML (go figure) and XML >templates. I use a hash to hold the template variables and then use this >construct. > > my $add_plans = HTML::Template->new( > filename => "$TemplateDIR/$Template", > die_on_bad_params => 0); > > foreach my $key (keys %SUI) { > $add_plans->param($key => $SUI{$key}); > } > >And though it's only 2 lines of code it goes (to my way of thought) >against the grain. I'd like to do something like a fill_form subroutine >that I could call. The hash (%SUI) is global (main) but $add_plans is >local to the subroutine it is in. > The param() method will also accept a hash reference, so you don't need to use a loop. The lines: foreach my $key (keys %SUI) { $add_plans->param($key => $SUI{$key}); can be replaced by : $add_plans->param( \%SUI); This is described in the HTML::Template page. By the way, if your only task is filling in values on form fields, then check out the CPAN module HTML::FillInForm. It does all the work of filling in values for all types of input fields, even radio buttons and selections. I hope this helps, Greg From raanders at acm.org Wed Mar 24 00:22:30 2004 From: raanders at acm.org (Roderick A. Anderson) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] Re: Pass by reference(?) In-Reply-To: <40612321.9080707@hevanet.com> Message-ID: On Tue, 23 Mar 2004, Greg Minter wrote: > The param() method will also accept a hash reference, so you don't > need to use a loop. The lines: > can be replaced by : > > $add_plans->param( \%SUI); > > This is described in the HTML::Template page. Geez. I don't remember this at all and obviously I should have re-read the page. > By the way, if your only task is filling in values on form fields, > then check out the CPAN > module HTML::FillInForm. It does all the work of filling in values for > all types of input fields, > even radio buttons and selections. Not forms - templates. I ended up using HTML::Template instead of Template-Toolkit because of a problem with getting TT on a Win2K system. Probably me and I wasn't willing to put too much work into it as the hounds were breathing down my neck. > I hope this helps, It did. Thanks. Rod -- "Open Source Software - You usually get more than you pay for..." "Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL" From perl-pm at joshheumann.com Wed Mar 24 12:40:08 2004 From: perl-pm at joshheumann.com (Josh Heumann) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] YAPC::Australia::2004 Message-ID: <50224.130.94.162.208.1080153608.squirrel@www.joshheumann.com> >From the desk of Scott Penrose, leader of Melbourne, Australia Perlmongers: Hi Dudes. We have now announced YAPC::Australia::2004 YAPC::Australia::2004 is to be held on the 1st, 2nd and 3rd of December 2004 in Melbourne Australia at Monash University. You can find details and submit outlines http://yapc.dlist.com.au/ Thanks Scott From curtis_ovid_poe at yahoo.com Wed Mar 24 15:14:40 2004 From: curtis_ovid_poe at yahoo.com (Ovid) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] We're hiring Message-ID: <20040324211440.13926.qmail@web60807.mail.yahoo.com> (Side note to Clint: I sent an email to you asking for your resume, but I didn't hear back. Did you get it?) If you don't mind pair programming, test-driven development, Mason, Perl, no overtime and your choice of OS to develop on, you might want to send your resume to publiustemp-rentrakjobs@yahoo.com. If it goes straight to me, you bypass HR and go straight to the head of the line (and I might get a hiring bonus). We actually don't care if you know Perl or Mason. We care about whether or not you are a good programmer (or have solid potential). You can learn Perl and Mason on the job. Check out our Web site at http://www.rentrak.com/ to get an idea of who we are. We're located in beautiful Portland, Oregon (near the airport, if that matters to you). On a personal note: I've worked for a number of companies and this is one of the best working environments I've enjoyed. My email address above is a temporary, so get yours while supply lasts! Or something like that ... ===== Silence is Evil http://users.easystreet.com/ovid/philosophy/indexdecency.htm Ovid http://www.perlmonks.org/index.pl?node_id=17000 Web Programming with Perl http://users.easystreet.com/ovid/cgi_course/ From darthsmily at verizon.net Wed Mar 24 16:58:18 2004 From: darthsmily at verizon.net (darthsmily) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] Time to feel great In-Reply-To: <20040324211440.13926.qmail@web60807.mail.yahoo.com> References: <20040324211440.13926.qmail@web60807.mail.yahoo.com> Message-ID: <4062128A.2060303@verizon.net> Here is a good laugh: *http://www.turnpikefilms.com/spots/nutrigrain.cgi* From wcooley at nakedape.cc Wed Mar 24 23:14:41 2004 From: wcooley at nakedape.cc (Wil Cooley) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] CGI & flushing filehandles Message-ID: <1080191681.14801.13.camel@denk.nakedape.priv> I'm working on a CGI application that needs to sleep() a minute or two before performing some final operations (it needs to send an e-mail to an account that's being created, but the external process that creates the account checks for new tasks every minute). The problem is the the page doesn't seem to finish loading regardless of whether I have $|=1 set or whether I close(STDOUT). What does work is to fork(), sleep(), then send the e-mail, but this seems rather kludgy to me. Is this the best way to handle this sort of thing? Wil -- Wil Cooley wcooley@nakedape.cc Naked Ape Consulting http://nakedape.cc * * * * Linux, UNIX, Networking and Security Solutions * * * * * Naked Ape Consulting http://nakedape.cc * * Cisco Support & Sales http://nakedape.cc/r/cisco * -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mail.pm.org/pipermail/pdx-pm-list/attachments/20040324/daaef200/attachment.bin From wcooley at nakedape.cc Wed Mar 24 23:24:06 2004 From: wcooley at nakedape.cc (Wil Cooley) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] CGI & flushing filehandles In-Reply-To: <1080191681.14801.13.camel@denk.nakedape.priv> References: <1080191681.14801.13.camel@denk.nakedape.priv> Message-ID: <1080192246.14801.18.camel@denk.nakedape.priv> On Wed, 2004-03-24 at 21:14, Wil Cooley wrote: > The problem is the the > page doesn't seem to finish loading regardless of whether I have $|=1 > set or whether I close(STDOUT). Er, rather, it finishes loading, but only after the time sleep()'d (slept()?) plus some. Wil -- Wil Cooley wcooley@nakedape.cc Naked Ape Consulting http://nakedape.cc * * * * Linux, UNIX, Networking and Security Solutions * * * * * Naked Ape Consulting http://nakedape.cc * * AIX Support & Service http://nakedape.cc/r/aix * -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mail.pm.org/pipermail/pdx-pm-list/attachments/20040324/ce0673eb/attachment.bin From merlyn at stonehenge.com Wed Mar 24 23:26:00 2004 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] CGI & flushing filehandles In-Reply-To: <1080191681.14801.13.camel@denk.nakedape.priv> References: <1080191681.14801.13.camel@denk.nakedape.priv> Message-ID: <86d671ebvh.fsf@blue.stonehenge.com> >>>>> "Wil" == Wil Cooley writes: Wil> I'm working on a CGI application that needs to sleep() a minute or two Wil> before performing some final operations (it needs to send an e-mail to Wil> an account that's being created, but the external process that creates Wil> the account checks for new tasks every minute). The problem is the the Wil> page doesn't seem to finish loading regardless of whether I have $|=1 Wil> set or whether I close(STDOUT). What does work is to fork(), sleep(), Wil> then send the e-mail, but this seems rather kludgy to me. Is this the Wil> best way to handle this sort of thing? Watching Long Processes through CGI is at . -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! From wcooley at nakedape.cc Wed Mar 24 23:39:18 2004 From: wcooley at nakedape.cc (Wil Cooley) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] CGI & flushing filehandles In-Reply-To: <86d671ebvh.fsf@blue.stonehenge.com> References: <1080191681.14801.13.camel@denk.nakedape.priv> <86d671ebvh.fsf@blue.stonehenge.com> Message-ID: <1080193158.14801.36.camel@denk.nakedape.priv> On Wed, 2004-03-24 at 21:25, Randal L. Schwartz wrote: > Watching Long Processes through CGI is at > . Thanks; I'd thought about the server-push/meta-refresh approach, but I expressly don't need to send the agent any further output, so all the framework necessary for implementing this is unnecessary. Wil -- Wil Cooley wcooley@nakedape.cc Naked Ape Consulting http://nakedape.cc * * * * * * Linux Consulting in Portland, Oregon * * * * * * * Naked Ape Consulting http://nakedape.cc * -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mail.pm.org/pipermail/pdx-pm-list/attachments/20040324/79d7d00f/attachment.bin From merlyn at stonehenge.com Wed Mar 24 23:59:48 2004 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] CGI & flushing filehandles In-Reply-To: <1080193158.14801.36.camel@denk.nakedape.priv> References: <1080191681.14801.13.camel@denk.nakedape.priv> <86d671ebvh.fsf@blue.stonehenge.com> <1080193158.14801.36.camel@denk.nakedape.priv> Message-ID: <867jx9eab5.fsf@blue.stonehenge.com> >>>>> "Wil" == Wil Cooley writes: Wil> On Wed, 2004-03-24 at 21:25, Randal L. Schwartz wrote: >> Watching Long Processes through CGI is at >> . Wil> Thanks; I'd thought about the server-push/meta-refresh approach, but I Wil> expressly don't need to send the agent any further output, so all the Wil> framework necessary for implementing this is unnecessary. I misunderstood. I thought that you wanted the browser to know when the possibly delayed task was done. If not, then a simple fork will do it: ... normal cgi stuff here to return a normal page ... ... at end of script: exit 0 if fork; close STDOUT; # essential to let child continue without tying up browser ... start of things to do after browser is released ... -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! From jamarks at jamarks.com Tue Mar 30 00:54:52 2004 From: jamarks at jamarks.com (James marks) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] DBD::mysql Message-ID: <24DB5FBA-8217-11D8-8520-000A956EF5EC@jamarks.com> Hi, First off, I'm very new to Perl, CPAN and the command line so my apologies if my question is unclear or misdirected. I'm running through example Perl scripts provided in "Managing & Using MySQL" and the current script fails with the following message: "Can't locate DBD/mysql.pm in @INC ... Perhaps the DBD::mysql perl module hasn't been fully installed..." So, I attempt to install DBD::mysql via CPAN and the attempted installation fails as follows: (lots of text snipped) make: *** [blib/arch/auto/DBD/mysql/mysql.bundle] Error 1 /usr/bin/make -- NOT OK Running make test Can't test without successful make Running make install make had returned bad status, install seems impossible I've excluded much of the attempted installation text for the sake of brevity and, in so doing, may have withheld information necessary to answer this question, but is the installation failure more likely to be a problem on my computer or is there something inherently wrong with DBD::mysql on CPAN? In other words, is anyone else having this problem or is DBD::mysql installing correctly for others? The MySQL sample Perl scripts all seem to need DBD::mysql to run and I seem to be unable to install it. Thanks! James From jamarks at jamarks.com Tue Mar 30 00:59:18 2004 From: jamarks at jamarks.com (James marks) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] DBD::mysql cont. Message-ID: Regarding my previous post of the same subject, I probably should have mentioned that I'm on a Mac G4/OS10.3.2 running Perl 5.8.1 Thanks! James From cdawson at webiphany.com Tue Mar 30 01:26:05 2004 From: cdawson at webiphany.com (Chris Dawson) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] DBD::mysql cont. In-Reply-To: References: Message-ID: <4069210D.60308@webiphany.com> Take a look in the ~.cpan/build directory and enter the DBD-mysql directory (command line: "cd ~/.cpan/build/" from a terminal window). Then type make and let us know more about what the build problem is. I am sure there is nothing wrong with the CPAN version; this is one of the most commonly used modules in perl so it is very unlikely a broken version would be checked in. You do have mysql installed on the machine which you are building the DBD-mysql driver, right? I think building DBD-mysql requires header files from the mysql sources. But, hard to tell without more information from you. Chris James marks wrote: > Regarding my previous post of the same subject, I probably should have > mentioned that I'm on a Mac G4/OS10.3.2 running Perl 5.8.1 > > Thanks! > > James > > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list@mail.pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list From jamarks at jamarks.com Tue Mar 30 01:39:51 2004 From: jamarks at jamarks.com (James marks) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] DBD::mysql cont. In-Reply-To: <4069210D.60308@webiphany.com> References: <4069210D.60308@webiphany.com> Message-ID: <6D9C2BAF-821D-11D8-8520-000A956EF5EC@jamarks.com> I'm still hesitant to post all the terminal text related to the failed install attempt (unless you really want it) but here are some of the errors that I can see: (snip) Can't exec "mysql_config": No such file or directory at Makefile.PL line 174. readline() on closed filehandle PIPE at Makefile.PL line 176. (Above was repeated 9 times in a row) (snip) Checking if your kit is complete... Looks good Note (probably harmless): No library found for -lgz (snip) /usr/bin/perl /System/Library/Perl/5.8.1/ExtUtils/xsubpp -typemap /System/Library/Perl/5.8.1/ExtUtils/typemap mysql.xs > mysql.xsc && mv mysql.xsc mysql.c Warning: duplicate function definition 'do' detected in mysql.xs, line 192 Warning: duplicate function definition 'rows' detected in mysql.xs, line 290 (snip) Running Mkbootstrap for DBD::mysql () chmod 644 mysql.bs rm -f blib/arch/auto/DBD/mysql/mysql.bundle LD_RUN_PATH="/usr/lib" /usr/bin/perl myld MACOSX_DEPLOYMENT_TARGET=10.3 cc -bundle -undefined dynamic_lookup -L/usr/local/lib dbdimp.o mysql.o -o blib/arch/auto/DBD/mysql/mysql.bundle -L/usr/local/mysql/lib -lmysqlclient -lz make: *** [blib/arch/auto/DBD/mysql/mysql.bundle] Error 1 /usr/bin/make -- NOT OK Running make test Can't test without successful make Running make install make had returned bad status, install seems impossible James On Mar 29, 2004, at 11:26 PM, Chris Dawson wrote: > Take a look in the ~.cpan/build directory and enter the DBD-mysql > directory (command line: "cd ~/.cpan/build/" from a terminal window). > Then type make and let us know more about what the build problem is. > I am sure there is nothing wrong with the CPAN version; this is one of > the most commonly used modules in perl so it is very unlikely a broken > version would be checked in. You do have mysql installed on the > machine which you are building the DBD-mysql driver, right? I think > building DBD-mysql requires header files from the mysql sources. But, > hard to tell without more information from you. > > Chris > > James marks wrote: > >> Regarding my previous post of the same subject, I probably should >> have mentioned that I'm on a Mac G4/OS10.3.2 running Perl 5.8.1 >> >> Thanks! >> >> James >> >> _______________________________________________ >> Pdx-pm-list mailing list >> Pdx-pm-list@mail.pm.org >> http://mail.pm.org/mailman/listinfo/pdx-pm-list > > From jamarks at jamarks.com Tue Mar 30 02:03:02 2004 From: jamarks at jamarks.com (James marks) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] DBD::mysql cont. In-Reply-To: <4069210D.60308@webiphany.com> References: <4069210D.60308@webiphany.com> Message-ID: Went to the build directory, tried "perl Makefile.PL" then "make" and got the following: [iMac:~/.cpan/build/DBD-mysql-2.9003] jamesmar% ls -l total 1088 -rwxr-xr-x 1 500 500 39568 26 Oct 19:25 ChangeLog -rwxr-xr-x 1 500 500 26305 26 Oct 19:33 INSTALL.html -rwxr-xr-x 1 500 500 522 15 Jun 2003 MANIFEST -rwxr-xr-x 1 500 500 31 17 Mar 2003 MANIFEST.SKIP -rw-r--r-- 1 root 500 27952 29 Mar 22:18 Makefile -rwxr-xr-x 1 500 500 8955 17 Oct 10:20 Makefile.PL -rwxr-xr-x 1 500 500 2716 17 Mar 2003 README -rw-r--r-- 1 500 500 896 15 Jun 2003 TODO drwxr-xr-x 8 root 500 272 29 Mar 22:18 blib -rw-r--r-- 1 root 500 0 29 Mar 22:18 blibdirs -rwxr-xr-x 1 500 500 1937 17 Mar 2003 constants.h -rwxr-xr-x 1 500 500 68120 17 Oct 10:20 dbdimp.c -rwxr-xr-x 1 500 500 6115 17 Oct 10:20 dbdimp.h -rw-r--r-- 1 root 500 117632 29 Mar 22:18 dbdimp.o drwxr-xr-x 6 500 500 204 26 Oct 19:33 lib -rwxr-xr-x 1 500 500 1419 7 Aug 2003 myld -rw-r--r-- 1 root 500 0 29 Mar 22:18 mysql.bs -rw-r--r-- 1 root 500 43021 29 Mar 22:18 mysql.c -rw-r--r-- 1 root 500 144872 29 Mar 22:18 mysql.o -rwxr-xr-x 1 500 500 8691 17 Oct 10:20 mysql.xs -rw-r--r-- 1 root 500 17763 29 Mar 22:18 mysql.xsi -rw-r--r-- 1 root 500 0 29 Mar 22:18 pm_to_blib drwxr-xr-x 23 500 500 782 26 Oct 19:33 t [iMac:~/.cpan/build/DBD-mysql-2.9003] jamesmar% perl Makefile.PL Can't exec "mysql_config": No such file or directory at Makefile.PL line 174. readline() on closed filehandle PIPE at Makefile.PL line 176. Can't exec "mysql_config": No such file or directory at Makefile.PL line 174. readline() on closed filehandle PIPE at Makefile.PL line 176. Can't exec "mysql_config": No such file or directory at Makefile.PL line 174. readline() on closed filehandle PIPE at Makefile.PL line 176. Can't exec "mysql_config": No such file or directory at Makefile.PL line 174. readline() on closed filehandle PIPE at Makefile.PL line 176. Can't exec "mysql_config": No such file or directory at Makefile.PL line 174. readline() on closed filehandle PIPE at Makefile.PL line 176. Can't exec "mysql_config": No such file or directory at Makefile.PL line 174. readline() on closed filehandle PIPE at Makefile.PL line 176. Can't exec "mysql_config": No such file or directory at Makefile.PL line 174. readline() on closed filehandle PIPE at Makefile.PL line 176. Can't exec "mysql_config": No such file or directory at Makefile.PL line 174. readline() on closed filehandle PIPE at Makefile.PL line 176. Can't exec "mysql_config": No such file or directory at Makefile.PL line 174. readline() on closed filehandle PIPE at Makefile.PL line 176. I will use the following settings for compiling and testing: cflags (guessed) = -I/usr/local/mysql/include libs (guessed) = -L/usr/local/mysql/lib -lmysqlclient -lz -lgz nocatchstderr (default) = 0 nofoundrows (default) = 0 ssl (guessed) = 0 testdb (default) = test testhost (default) = testpassword (default) = testuser (default) = To change these settings, see 'perl Makefile.PL --help' and 'perldoc INSTALL'. Failed to create t/mysql.mtest: Permission denied at Makefile.PL line 62. [iMac:~/.cpan/build/DBD-mysql-2.9003] jamesmar% make touch: blibdirs: Permission denied make: *** [blibdirs] Error 1 [iMac:~/.cpan/build/DBD-mysql-2.9003] jamesmar% James On Mar 29, 2004, at 11:26 PM, Chris Dawson wrote: > Take a look in the ~.cpan/build directory and enter the DBD-mysql > directory (command line: "cd ~/.cpan/build/" from a terminal window). > Then type make and let us know more about what the build problem is. > I am sure there is nothing wrong with the CPAN version; this is one of > the most commonly used modules in perl so it is very unlikely a broken > version would be checked in. You do have mysql installed on the > machine which you are building the DBD-mysql driver, right? I think > building DBD-mysql requires header files from the mysql sources. But, > hard to tell without more information from you. > > Chris > > James marks wrote: > >> Regarding my previous post of the same subject, I probably should >> have mentioned that I'm on a Mac G4/OS10.3.2 running Perl 5.8.1 >> >> Thanks! >> >> James >> >> _______________________________________________ >> Pdx-pm-list mailing list >> Pdx-pm-list@mail.pm.org >> http://mail.pm.org/mailman/listinfo/pdx-pm-list > > From cdawson at webiphany.com Tue Mar 30 02:01:32 2004 From: cdawson at webiphany.com (Chris Dawson) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] DBD::mysql cont. In-Reply-To: <6D9C2BAF-821D-11D8-8520-000A956EF5EC@jamarks.com> References: <4069210D.60308@webiphany.com> <6D9C2BAF-821D-11D8-8520-000A956EF5EC@jamarks.com> Message-ID: <4069295C.1090506@webiphany.com> James, mysql_config is a program which returns information about the mysql libraries and header files, like where they are installed in case you placed them in a custom path. This is so a compiler can properly link in the correct files to a mysql related program or library, which is what you are doing here by building the .so for DBD-mysql. So, I wonder if you: a) have mysql installed on your Mac? If so, you just need to find out where the mysql_config program is located, and add this to your path (probably "export PATH=$PATH:/usr/local/bin" would do it, or try "set PATH...") so that the CPAN script can run mysql_config and provide the correct paths during compilation of the mysql shared object. b) or, if you don't have mysql installed and don't want to, or aren't able to install it, you might be able to find prebuilt binaries of the DBD-mysql packages. I am not a Mac user so I cannot really help there, but it seems like most of the perl hackers here use Macs, so someone else might be able to offer suggestions there. Btw, you can download mysql for free from mysql.com, in case you didn't know. Chris James marks wrote: > I'm still hesitant to post all the terminal text related to the > failed install attempt (unless you really want it) but here are some > of the errors that I can see: > > (snip) > > Can't exec "mysql_config": No such file or directory at Makefile.PL > line 174. > readline() on closed filehandle PIPE at Makefile.PL line 176. > From cdawson at webiphany.com Tue Mar 30 02:23:59 2004 From: cdawson at webiphany.com (Chris Dawson) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] DBD::mysql cont. In-Reply-To: References: <4069210D.60308@webiphany.com> <6D9C2BAF-821D-11D8-8520-000A956EF5EC@jamarks.com> <4069295C.1090506@webiphany.com> Message-ID: <40692E9F.20408@webiphany.com> The process which is executing the CPAN script should have the PATH enviroment variable include the path to the mysql_config script... :) Which means: [iMac:~] jamesmar% export PATH=/usr/local/mysql-standard-4.0.15-apple-darwin6.4-powerpc/bin/:$PATH [iMac:~] jamesmar% mysql_config /(.. should see something like this...)/ Usage: /opt/wiab/support/mysql/bin/mysql_config [OPTIONS] Options: --cflags [-I'/opt/wiab/support/mysql/include/mysql'] --libs [-L'/opt/wiab/support/mysql/lib/mysql' -lmysqlclient -lz -lcrypt -lnsl -lm] [iMac:~] jamesmar% cd ~/.cpan/build/DBD-mysql-2.9003 && perl Makefile.PL && make You might have to use something like "set PATH /usr/local/mysql-standard-4.0.15-apple-darwin6.4-powerpc/bin/:$PATH" depending on what your shell requires... Chris James marks wrote: > On Mar 30, 2004, at 12:01 AM, Chris Dawson wrote: > >> James, >> >> mysql_config is a program which returns information about the mysql >> libraries and header files, like where they are installed in case >> you placed them in a custom path. This is so a compiler can >> properly link in the correct files to a mysql related program or >> library, which is what you are doing here by building the .so for >> DBD-mysql. So, I wonder if you: >> >> a) have mysql installed on your Mac? > > > Yes, I've installed it and have build several test databases in it. > >> If so, you just need to find out where the mysql_config program is >> located, and add this to your path (probably "export >> PATH=$PATH:/usr/local/bin" would do it, or try "set PATH...") so >> that the CPAN script can run mysql_config and provide the correct >> paths during compilation of the mysql shared object. > > > I located mysql_config as follows: > > [iMac:~] jamesmar% locate mysql_config > /usr/local/mysql-standard-4.0.15-apple-darwin6.4-powerpc/bin/ > mysql_config > > When you say "add this to your path" where, exactly, do I do that? In > the Terminal? In CPAN? In Makefile.PL? (I'm sorry. As I said, I'm > pretty new to Perl and the Terminal) > >> James marks wrote: >> >>> I'm still hesitant to post all the terminal text related to the >>> failed install attempt (unless you really want it) but here are >>> some of the errors that I can see: >>> >>> (snip) >>> >>> Can't exec "mysql_config": No such file or directory at Makefile.PL >>> line 174. >>> readline() on closed filehandle PIPE at Makefile.PL line 176. >>> >> > From tex at off.org Tue Mar 30 02:41:24 2004 From: tex at off.org (Austin Schutz) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] DBD::mysql cont. In-Reply-To: References: <4069210D.60308@webiphany.com> Message-ID: <20040330084124.GV1249@gblx.net> On Tue, Mar 30, 2004 at 12:03:02AM -0800, James marks wrote: > Went to the build directory, tried "perl Makefile.PL" then "make" and > got the following: > > > [iMac:~/.cpan/build/DBD-mysql-2.9003] jamesmar% ls -l > total 1088 > -rwxr-xr-x 1 500 500 39568 26 Oct 19:25 ChangeLog Who is user 500? you? Hint, run 'id', look in /etc/passwd. > -rw-r--r-- 1 root 500 0 29 Mar 22:18 pm_to_blib > drwxr-xr-x 23 500 500 782 26 Oct 19:33 t > [iMac:~/.cpan/build/DBD-mysql-2.9003] jamesmar% perl Makefile.PL > Can't exec "mysql_config": No such file or directory at Makefile.PL > line 174. > > To change these settings, see 'perl Makefile.PL --help' and > 'perldoc INSTALL'. > > Failed to create t/mysql.mtest: Permission denied at Makefile.PL line > 62. That "permission denied" is trying to tell you something about your permissions. Hint: most users can't touch most things owned by root or other users. > [iMac:~/.cpan/build/DBD-mysql-2.9003] jamesmar% make > touch: blibdirs: Permission denied > make: *** [blibdirs] Error 1 > [iMac:~/.cpan/build/DBD-mysql-2.9003] jamesmar% > > See the other note in this thread about setting your path to include wherever mysql_config is hidden. you can do this either with the shell command 'find / -name mysql_config' or maybe with the apple file finder tool. Austin From wcooley at nakedape.cc Tue Mar 30 02:53:04 2004 From: wcooley at nakedape.cc (Wil Cooley) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] DBD::mysql cont. In-Reply-To: References: Message-ID: <1080636783.16564.0.camel@denk.nakedape.priv> On Mon, 2004-03-29 at 22:59, James marks wrote: > Regarding my previous post of the same subject, I probably should have > mentioned that I'm on a Mac G4/OS10.3.2 running Perl 5.8.1 It looks to me like you don't have 'make' installed. What happens when you run 'make' and 'which make'? Wil -- Wil Cooley mailto:wcooley@nakedape.cc Naked Ape Consulting http://nakedape.cc xmpp:wcooley@jabber.nakedape.cc * * * * * * * Good, fast and cheap: Pick all 3! * * * * * * * * Naked Ape Consulting http://nakedape.cc * * Naked Ape Business Server http://nakedape.cc/r/smb * -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mail.pm.org/pipermail/pdx-pm-list/attachments/20040330/192063da/attachment.bin From wcooley at nakedape.cc Tue Mar 30 02:55:36 2004 From: wcooley at nakedape.cc (Wil Cooley) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] DBD::mysql cont. In-Reply-To: <1080636783.16564.0.camel@denk.nakedape.priv> References: <1080636783.16564.0.camel@denk.nakedape.priv> Message-ID: <1080636935.16564.2.camel@denk.nakedape.priv> On Tue, 2004-03-30 at 00:53, Wil Cooley wrote: > On Mon, 2004-03-29 at 22:59, James marks wrote: > > Regarding my previous post of the same subject, I probably should have > > mentioned that I'm on a Mac G4/OS10.3.2 running Perl 5.8.1 > > It looks to me like you don't have 'make' installed. What happens when > you run 'make' and 'which make'? Ooooh, nevermind, I was mis-reading the error messages. Wil -- Wil Cooley mailto:wcooley@nakedape.cc Naked Ape Consulting http://nakedape.cc xmpp:wcooley@jabber.nakedape.cc * * * * * * * Good, fast and cheap: Pick all 3! * * * * * * * * Naked Ape Consulting http://nakedape.cc * * Naked Ape Business Server http://nakedape.cc/r/smb * -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mail.pm.org/pipermail/pdx-pm-list/attachments/20040330/9f61e12a/attachment.bin From merlyn at stonehenge.com Tue Mar 30 04:42:57 2004 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] DBD::mysql In-Reply-To: <24DB5FBA-8217-11D8-8520-000A956EF5EC@jamarks.com> References: <24DB5FBA-8217-11D8-8520-000A956EF5EC@jamarks.com> Message-ID: <864qs6d39s.fsf@blue.stonehenge.com> >>>>> "James" == James marks writes: James> So, I attempt to install DBD::mysql via CPAN and the attempted James> installation fails as follows: James> (lots of text snipped) James> make: *** [blib/arch/auto/DBD/mysql/mysql.bundle] Error 1 James> /usr/bin/make -- NOT OK James> Running make test James> Can't test without successful make James> Running make install James> make had returned bad status, install seems impossible Do you have the mysql client libs installed (from the mysql distro)? I see ".bundle" there. Presuming this is OSX, MySQL isn't standard. :) -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! From tex at off.org Tue Mar 30 11:39:46 2004 From: tex at off.org (Austin Schutz) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] DBD::mysql cont. In-Reply-To: <20040330084124.GV1249@gblx.net> References: <4069210D.60308@webiphany.com> <20040330084124.GV1249@gblx.net> Message-ID: <20040330173946.GW1249@gblx.net> On Tue, Mar 30, 2004 at 12:41:24AM -0800, Austin Schutz wrote: > > See the other note in this thread about setting your path to include > wherever mysql_config is hidden. you can do this either with the shell command ^^^^^^^ > 'find / -name mysql_config' or maybe with the apple file finder tool. s/do this/discover its location/ My proofreading skills aren't so great late at night :-) Austin From jamarks at jamarks.com Tue Mar 30 23:55:26 2004 From: jamarks at jamarks.com (James marks) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] DBD::mysql cont. In-Reply-To: <20040331053959.GB1249@gblx.net> References: <4069210D.60308@webiphany.com> <20040330084124.GV1249@gblx.net> <8709AB7E-82D4-11D8-8BA8-000A956EF5EC@jamarks.com> <20040331053959.GB1249@gblx.net> Message-ID: <0209DC1D-82D8-11D8-8BA8-000A956EF5EC@jamarks.com> On Mar 30, 2004, at 9:39 PM, Austin Schutz wrote: > Also Unix is case sensitive, you probably want the command 'make', not > the command 'Make'. Mis-typed the actual command I used. I did use the lower-case "make" in my attempts. The weird thing to me - and, again, I'm very new at this - is that every Perl module that's been installed on my machine has been installed using the MCPAN auto install method in order to properly deal with module dependencies and such, and every installation up until this one has gone smoothly (as far as I can tell, anyway) so I'm not sure why, suddenly, the installer is unable to find the mysql_config file when it has apparently had no problem finding in the past. Using the "locate mysql_config" command, I immediately located the mysql_config file. I can try to set "PATH" variables and such but why would it suddenly be necessary now when it hasn't been for the other modules I've installed using the same method? Something else that seems weird to me; when I do a find for every file ending in ".pm" I get a list of 697 files, many of which appear to be duplicates in different directories (same name, modification date and file size but residing in different directories). Isn't the MCAPN auto install method supposed to be properly installing these modules in their correct directories? Frankly, I don't know enough about Mac OSX *NIX or Perl and its modules to be able to look at my directories and determine if they're located where they should be, and I wouldn't have the first clue about how to go about moving the modules to the correct locations and eliminating unnecessary duplicates manually. From tex at off.org Wed Mar 31 00:56:23 2004 From: tex at off.org (Austin Schutz) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] DBD::mysql cont. In-Reply-To: <0209DC1D-82D8-11D8-8BA8-000A956EF5EC@jamarks.com> References: <4069210D.60308@webiphany.com> <20040330084124.GV1249@gblx.net> <8709AB7E-82D4-11D8-8BA8-000A956EF5EC@jamarks.com> <20040331053959.GB1249@gblx.net> <0209DC1D-82D8-11D8-8BA8-000A956EF5EC@jamarks.com> Message-ID: <20040331065623.GC1249@gblx.net> On Tue, Mar 30, 2004 at 09:55:26PM -0800, James marks wrote: > The weird thing to me - and, again, I'm very new at this - is that > every Perl module that's been installed on my machine has been > installed using the MCPAN auto install method in order to properly deal > with module dependencies and such, and every installation up until this > one has gone smoothly (as far as I can tell, anyway) so I'm not sure > why, suddenly, the installer is unable to find the mysql_config file > when it has apparently had no problem finding in the past. > I'm not sure either, but because the ownership of the files was weird you seem to have done something non-standard to get yourself where you are now, such as untar the package as one user and then build it as another. > Using the "locate mysql_config" command, I immediately located the > mysql_config file. I can try to set "PATH" variables and such but why > would it suddenly be necessary now when it hasn't been for the other > modules I've installed using the same method? Not sure, maybe it has something to do with the changing user issues. The 'su' command, for example, may fool with your PATH variable for "security" reasons. When in doubt 'echo $PATH' when you switch users. > Something else that seems weird to me; when I do a find for every file > ending in ".pm" I get a list of 697 files, many of which appear to be > duplicates in different directories (same name, modification date and > file size but residing in different directories). Isn't the MCAPN auto > install method supposed to be properly installing these modules in > their correct directories? It does, but it tends to leave a bunch of stuff in the .cpan folders if errors occur. Also if you've set PREFIX when installing modules maybe you inadvertantly installed a module twice. > Frankly, I don't know enough about Mac OSX *NIX or Perl and its > modules to be able to look at my directories and determine if they're > located where they should be, and I wouldn't have the first clue about > how to go about moving the modules to the correct locations and > eliminating unnecessary duplicates manually. If you do 'perl -V' perl will show you much data about your perl installation, including your INC path. Don't fool with anything in any of those directories manually and you will go a long way toward not hosing your perl installation. Also individual perl applications may have chosen to keep separate installations of requisite modules privately so they don't have to concern themselves with versioning issues and the like, so be careful removing stuff. Anything under a .cpan/ directory is probably fair game for removal, but don't quote me on that if your system is supporting someone's iron lung. Austin From jamarks at jamarks.com Wed Mar 31 01:24:43 2004 From: jamarks at jamarks.com (James marks) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] DBD::mysql cont. In-Reply-To: <20040331065623.GC1249@gblx.net> References: <4069210D.60308@webiphany.com> <20040330084124.GV1249@gblx.net> <8709AB7E-82D4-11D8-8BA8-000A956EF5EC@jamarks.com> <20040331053959.GB1249@gblx.net> <0209DC1D-82D8-11D8-8BA8-000A956EF5EC@jamarks.com> <20040331065623.GC1249@gblx.net> Message-ID: <7AE5F6BE-82E4-11D8-8BA8-000A956EF5EC@jamarks.com> On Mar 30, 2004, at 10:56 PM, Austin Schutz wrote: > On Tue, Mar 30, 2004 at 09:55:26PM -0800, James marks wrote: >> The weird thing to me - and, again, I'm very new at this - is that >> every Perl module that's been installed on my machine has been >> installed using the MCPAN auto install method in order to properly >> deal >> with module dependencies and such, and every installation up until >> this >> one has gone smoothly (as far as I can tell, anyway) so I'm not sure >> why, suddenly, the installer is unable to find the mysql_config file >> when it has apparently had no problem finding in the past. >> > > I'm not sure either, but because the ownership of the files was > weird you seem to have done something non-standard to get yourself > where you > are now, such as untar the package as one user and then build it as > another. That's possible. I initially downloaded several Perl modules and installed them manually, then ran into module dependency problems when trying to install others and was then shown how to use the MCAN auto install method (THAT was a godsend to a new user!). Perhaps the use of "sudo" for some installs and not others created an ownership problem? >> Something else that seems weird to me; when I do a find for every file >> ending in ".pm" I get a list of 697 files, many of which appear to be >> duplicates in different directories (same name, modification date and >> file size but residing in different directories). Isn't the MCAPN auto >> install method supposed to be properly installing these modules in >> their correct directories? > > It does, but it tends to leave a bunch of stuff in the .cpan folders > if errors occur. Also if you've set PREFIX when installing modules > maybe > you inadvertantly installed a module twice. Yes. Many of the duplicates are in the /.cpan/build/ directories. >> Frankly, I don't know enough about Mac OSX *NIX or Perl and its >> modules to be able to look at my directories and determine if they're >> located where they should be, and I wouldn't have the first clue about >> how to go about moving the modules to the correct locations and >> eliminating unnecessary duplicates manually. > > If you do 'perl -V' perl will show you much data about your perl > installation, including your INC path. Don't fool with anything in any > of those directories manually and you will go a long way toward not > hosing > your perl installation. Because I am new and inexperienced, I'm almost willing to just clear everything out of the /Library/Perl/5.8.1/ directory and start over. (That would still leave Perl itself installed on my machine, wouldn't it?) That probably sounds drastic but, to me, it almost sounds simpler in terms of making sure everything is properly installed. I _really_ appreciate the help I'm getting from list members but some of the suggestions are difficult for me to understand and follow given my limited understanding of the system. I don't want to ask too many questions and become a pest but I also don't want to "smile and nod" when I don't really get it. > Anything under a .cpan/ directory is probably fair game for removal, > but don't quote me on that if your system is supporting someone's iron > lung. :) Thanks! James From tex at off.org Wed Mar 31 01:44:38 2004 From: tex at off.org (Austin Schutz) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] DBD::mysql cont. In-Reply-To: <7AE5F6BE-82E4-11D8-8BA8-000A956EF5EC@jamarks.com> References: <4069210D.60308@webiphany.com> <20040330084124.GV1249@gblx.net> <8709AB7E-82D4-11D8-8BA8-000A956EF5EC@jamarks.com> <20040331053959.GB1249@gblx.net> <0209DC1D-82D8-11D8-8BA8-000A956EF5EC@jamarks.com> <20040331065623.GC1249@gblx.net> <7AE5F6BE-82E4-11D8-8BA8-000A956EF5EC@jamarks.com> Message-ID: <20040331074438.GE1249@gblx.net> On Tue, Mar 30, 2004 at 11:24:43PM -0800, James marks wrote: > > If you do 'perl -V' perl will show you much data about your perl > >installation, including your INC path. Don't fool with anything in any > >of those directories manually and you will go a long way toward not > >hosing > >your perl installation. > > Because I am new and inexperienced, I'm almost willing to just clear > everything out of the /Library/Perl/5.8.1/ directory and start over. > (That would still leave Perl itself installed on my machine, wouldn't > it?) That probably sounds drastic but, to me, it almost sounds simpler > in terms of making sure everything is properly installed. > Doing this will probably gain you a painful headache. If you want to clean this up, perhaps you could use apple's package management tool (whatever that is) to reinstall perl. Just removing the directory may end up generating some inconsistancy in a package management database somewhere. Reinstalling is usually pretty unpleasant because it involves reinstalling all your favorite modules too. I would probably not go this route unless you're really convinced you've done something really bad to your main perl tree. > I _really_ appreciate the help I'm getting from list members but some > of the suggestions are difficult for me to understand and follow given > my limited understanding of the system. I don't want to ask too many > questions and become a pest but I also don't want to "smile and nod" > when I don't really get it. > If it were my box I'd make sure my path were what I expected it to be (as root) and then go for install via -MCPAN again, e.g.: $ sudo -s -u root # echo $PATH (path) # perl -MCPAN -eshell (etc.) It doesn't sound like you've done anything destructive (yet) to your system or your base perl install, other than take up a few extra filesystem bytes. If you're getting angry at your current progress you might just clear out everything under .cpan/build/ and go from there. *shrug* Hth, Austin From jamarks at jamarks.com Wed Mar 31 02:00:39 2004 From: jamarks at jamarks.com (James marks) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] DBD::mysql cont. In-Reply-To: <20040331074438.GE1249@gblx.net> References: <4069210D.60308@webiphany.com> <20040330084124.GV1249@gblx.net> <8709AB7E-82D4-11D8-8BA8-000A956EF5EC@jamarks.com> <20040331053959.GB1249@gblx.net> <0209DC1D-82D8-11D8-8BA8-000A956EF5EC@jamarks.com> <20040331065623.GC1249@gblx.net> <7AE5F6BE-82E4-11D8-8BA8-000A956EF5EC@jamarks.com> <20040331074438.GE1249@gblx.net> Message-ID: <7FFC576F-82E9-11D8-8BA8-000A956EF5EC@jamarks.com> On Mar 30, 2004, at 11:44 PM, Austin Schutz wrote: > If it were my box I'd make sure my path were what I expected it to be > (as root) and then go for install via -MCPAN again, e.g.: > > $ sudo -s -u root > # echo $PATH > (path) > # perl -MCPAN -eshell > (etc.) > > It doesn't sound like you've done anything destructive (yet) to your > system or your base perl install, other than take up a few extra > filesystem > bytes. If you're getting angry at your current progress you might just > clear > out everything under .cpan/build/ and go from there. *shrug* Not angry at all, just feeling a little like my Perl/programming/*NIX legs aren't as long as the water is deep and just trying to make it to shore. I will try your suggestions and the suggestions offered by others and, again, I really appreciate all the help. Thanks again, James From kyle at cepaso.com Wed Mar 31 02:54:21 2004 From: kyle at cepaso.com (Kyle Dawkins) Date: Mon Aug 2 21:34:31 2004 Subject: Fwd: [Pdx-pm] DBD::mysql Message-ID: <007D0338-82F1-11D8-BBF2-000393A6C1D2@cepaso.com> Dang, tried to send this to the list with the wrong From: address. Here I am, trying with the right one... Begin forwarded message: > From: Kyle Dawkins > Date: 31 March 2004 0:52:16 GMT-08:00 > To: James marks > Cc: pdx pm > Subject: Re: [Pdx-pm] DBD::mysql > > Hi > > Sorry to jump in on this so late, but when I first installed Panther > on my laptop I had to do this to get the Mysql perl mods to install: > > "...Edit > > /System/Library/Perl/5.8.1/darwin-thread-multi-2level/Config.pm > > and change the line > > ld="MACOSX_...." > > to read > > ld="env MACOSX_...." > > and then you'll be able to build Mysql (and a few others)..." > > Not sure if it'll help you, but once I made that change, it worked > fine for me. They may have fixed that in 10.3.X, but in 10.3 it was > not. > > Good luck > > Kyle Dawkins > Central Park Software > > On 29 Mar 2004, at 22:54, James marks wrote: > >> Hi, >> >> First off, I'm very new to Perl, CPAN and the command line so my >> apologies if my question is unclear or misdirected. >> >> I'm running through example Perl scripts provided in "Managing & >> Using MySQL" and the current script fails with the following message: >> >> >> "Can't locate DBD/mysql.pm in @INC ... Perhaps the DBD::mysql perl >> module hasn't been fully installed..." >> >> >> So, I attempt to install DBD::mysql via CPAN and the attempted >> installation fails as follows: >> >> (lots of text snipped) >> >> make: *** [blib/arch/auto/DBD/mysql/mysql.bundle] Error 1 >> /usr/bin/make -- NOT OK >> Running make test >> Can't test without successful make >> Running make install >> make had returned bad status, install seems impossible >> >> >> I've excluded much of the attempted installation text for the sake of >> brevity and, in so doing, may have withheld information necessary to >> answer this question, but is the installation failure more likely to >> be a problem on my computer or is there something inherently wrong >> with DBD::mysql on CPAN? In other words, is anyone else having this >> problem or is DBD::mysql installing correctly for others? >> >> The MySQL sample Perl scripts all seem to need DBD::mysql to run and >> I seem to be unable to install it. >> >> Thanks! >> >> James >> >> _______________________________________________ >> Pdx-pm-list mailing list >> Pdx-pm-list@mail.pm.org >> http://mail.pm.org/mailman/listinfo/pdx-pm-list >> > From jamarks at jamarks.com Wed Mar 31 02:56:21 2004 From: jamarks at jamarks.com (James marks) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] DBD::mysql In-Reply-To: References: <24DB5FBA-8217-11D8-8520-000A956EF5EC@jamarks.com> Message-ID: <4832511E-82F1-11D8-8BA8-000A956EF5EC@jamarks.com> On Mar 31, 2004, at 12:52 AM, Kyle Dawkins wrote: > Hi > > Sorry to jump in on this so late, but when I first installed Panther > on my laptop I had to do this to get the Mysql perl mods to install: > > "...Edit > > /System/Library/Perl/5.8.1/darwin-thread-multi-2level/Config.pm > > and change the line > > ld="MACOSX_...." > > to read > > ld="env MACOSX_...." > > and then you'll be able to build Mysql (and a few others)..." I've successfully installed and used MySQL. The problem I'm having is I'm apparently unable to install the Perl module "DBD::mysql" which is needed for a number of Perl scripts I'm studying. I've installed quite a few other Perl modules without any problems. It's just this one that repeatedly returns the message: "make had returned bad status, install seems impossible" I've tried as many of the suggestions given here as I've been able to but am still unable to install the module. The problem seems to involve a problem with the process running the -MCPAN script in locating the "mysql_config" file. I'm currently trying to set the options from the command line. I'm pretty new to Perl, Unix and working from the command line but I'm plugging away at it and am confident (ok, hopeful) that I'll figure it out at some point. I'll add your suggestions to my list of things to try! :) Thanks! James From jamarks at jamarks.com Wed Mar 31 04:01:22 2004 From: jamarks at jamarks.com (James marks) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] DBD::mysql cont. In-Reply-To: <40692E9F.20408@webiphany.com> References: <4069210D.60308@webiphany.com> <6D9C2BAF-821D-11D8-8520-000A956EF5EC@jamarks.com> <4069295C.1090506@webiphany.com> <40692E9F.20408@webiphany.com> Message-ID: <5D17843B-82FA-11D8-8BA8-000A956EF5EC@jamarks.com> This is the situation as I understand it: The Makefile.PL script, when run, returns this error: Can't exec "mysql_config": No such file or directory at Makefile.PL line 174. readline() on closed filehandle PIPE at Makefile.PL line 176. The relevant lines in Makefile.PL are as follows: 173 # First try mysql_config 174 open(PIPE, "mysql_config --$param |"); 175 my $str = ""; 176 while (defined(my $line = )) { with line 174 returning an error (null value?) causing line 176 to fail. It seems that the script is unable to locate the "mysql_config" file which, in fact, resides in this directory: /usr/local/mysql/bin/ where "mysql" is an alias to "mysql-standard-4.0.15-apple-darwin6.4-powerpc" I don't know how to direct the Makefile.PL script to that directory. > You might have to use something like "set PATH > /usr/local/mysql-standard-4.0.15-apple-darwin6.4-powerpc/bin/:$PATH" > depending on what your shell requires... I've tried this: [iMac:~/.cpan/build/DBD-mysql-2.9003] jamesmar% set PATH /usr/local/mysql-standard-4.0.15-apple-darwin6.4-powerpc/bin/:$PATH but it returns the following: tcsh: set: Variable name must begin with a letter. I'm not sure what that means. To me, the obvious shell variable is "PATH" which begins with a letter, and the obvious Perl variable is $PATH but Perl variables must begin with a symbol rather than just a letter and, ignoring the $ symbol, the next character IS a letter. (Again, please keep in mind that I'm just learning Perl - and programming for that matter - and some things which might appear to be blatantly obvious to the average programmer my sail right past me without a sound.) I could try leaving the $ symbol off of the last word in the "set" statement but that would, to me, represent "PATH" as a file or directory. I tried leaving the Perl variable off of the end of the "set" statement and got the same response: tcsh: set: Variable name must begin with a letter. It's late (2 a.m.) and I have to be at work early this morning so I'll have to put it on hold for now and try again this evening. I really appreciate all the advice and suggestions that have been offered so far. Please let me know if I wear out my welcome! James From cdawson at webiphany.com Wed Mar 31 04:21:22 2004 From: cdawson at webiphany.com (Chris Dawson) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] DBD::mysql cont. In-Reply-To: <5D17843B-82FA-11D8-8BA8-000A956EF5EC@jamarks.com> References: <4069210D.60308@webiphany.com> <6D9C2BAF-821D-11D8-8520-000A956EF5EC@jamarks.com> <4069295C.1090506@webiphany.com> <40692E9F.20408@webiphany.com> <5D17843B-82FA-11D8-8BA8-000A956EF5EC@jamarks.com> Message-ID: <406A9BA2.5090501@webiphany.com> James, I don't personally use tcsh shell, but here is the issue, I think: sh-2.05b$ tcsh > set foo bar > echo $foo > set foo=bar > echo $foo bar > So, in other words, your set command below is not setting the PATH variable to anything, since it requires a '=' sign. Try this, set PATH=/usr/local/mysql-standard-4.0.15-apple-darwin6.4-powerpc/bin/:$PATH Then, try to run mysql_config. It should work now, right? If so, then try to re-run "perl -MCPAN -e 'install DBD::mysql'" Chris James marks wrote: > This is the situation as I understand it: > > > The Makefile.PL script, when run, returns this error: > > Can't exec "mysql_config": No such file or directory at Makefile.PL > line 174. > readline() on closed filehandle PIPE at Makefile.PL line 176. > > > > The relevant lines in Makefile.PL are as follows: > > 173 # First try mysql_config > 174 open(PIPE, "mysql_config --$param |"); > 175 my $str = ""; > 176 while (defined(my $line = )) { > > > with line 174 returning an error (null value?) causing line 176 to > fail. It seems that the script is unable to locate the "mysql_config" > file which, in fact, resides in this directory: > > /usr/local/mysql/bin/ > > where "mysql" is an alias to > "mysql-standard-4.0.15-apple-darwin6.4-powerpc" > > I don't know how to direct the Makefile.PL script to that directory. > >> You might have to use something like "set PATH >> /usr/local/mysql-standard-4.0.15-apple-darwin6.4-powerpc/bin/:$PATH" >> depending on what your shell requires... > > > I've tried this: > > [iMac:~/.cpan/build/DBD-mysql-2.9003] jamesmar% set PATH > /usr/local/mysql-standard-4.0.15-apple-darwin6.4-powerpc/bin/:$PATH > > but it returns the following: > > tcsh: set: Variable name must begin with a letter. > > I'm not sure what that means. To me, the obvious shell variable is > "PATH" which begins with a letter, and the obvious Perl variable is > $PATH but Perl variables must begin with a symbol rather than just a > letter and, ignoring the $ symbol, the next character IS a letter. > > (Again, please keep in mind that I'm just learning Perl - and > programming for that matter - and some things which might appear to be > blatantly obvious to the average programmer my sail right past me > without a sound.) > > I could try leaving the $ symbol off of the last word in the "set" > statement but that would, to me, represent "PATH" as a file or directory. > > I tried leaving the Perl variable off of the end of the "set" > statement and got the same response: > > tcsh: set: Variable name must begin with a letter. > > > It's late (2 a.m.) and I have to be at work early this morning so I'll > have to put it on hold for now and try again this evening. > > I really appreciate all the advice and suggestions that have been > offered so far. Please let me know if I wear out my welcome! > > James > > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list@mail.pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list From jeff at zeroclue.com Wed Mar 31 11:22:44 2004 From: jeff at zeroclue.com (Jeff Lavallee) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] DBD::mysql cont. In-Reply-To: <406A9BA2.5090501@webiphany.com> References: <4069210D.60308@webiphany.com> <6D9C2BAF-821D-11D8-8520-000A956EF5EC@jamarks.com> <4069295C.1090506@webiphany.com> <40692E9F.20408@webiphany.com> <5D17843B-82FA-11D8-8BA8-000A956EF5EC@jamarks.com> <406A9BA2.5090501@webiphany.com> Message-ID: James - I have always used tcsh$ setenv FOO bar HTH jeff On Wed, 31 Mar 2004, Chris Dawson wrote: > James, > > I don't personally use tcsh shell, but here is the issue, I think: > > sh-2.05b$ tcsh > > set foo bar > > echo $foo > > > set foo=bar > > echo $foo > bar > > > > So, in other words, your set command below is not setting the PATH > variable to anything, since it requires a '=' sign. > > Try this, > > set > PATH=/usr/local/mysql-standard-4.0.15-apple-darwin6.4-powerpc/bin/:$PATH > > Then, try to run mysql_config. It should work now, right? If so, then > try to re-run "perl -MCPAN -e 'install DBD::mysql'" > > Chris > > James marks wrote: > > > This is the situation as I understand it: > > > > > > The Makefile.PL script, when run, returns this error: > > > > Can't exec "mysql_config": No such file or directory at Makefile.PL > > line 174. > > readline() on closed filehandle PIPE at Makefile.PL line 176. > > > > > > > > The relevant lines in Makefile.PL are as follows: > > > > 173 # First try mysql_config > > 174 open(PIPE, "mysql_config --$param |"); > > 175 my $str = ""; > > 176 while (defined(my $line = )) { > > > > > > with line 174 returning an error (null value?) causing line 176 to > > fail. It seems that the script is unable to locate the "mysql_config" > > file which, in fact, resides in this directory: > > > > /usr/local/mysql/bin/ > > > > where "mysql" is an alias to > > "mysql-standard-4.0.15-apple-darwin6.4-powerpc" > > > > I don't know how to direct the Makefile.PL script to that directory. > > > >> You might have to use something like "set PATH > >> /usr/local/mysql-standard-4.0.15-apple-darwin6.4-powerpc/bin/:$PATH" > >> depending on what your shell requires... > > > > > > I've tried this: > > > > [iMac:~/.cpan/build/DBD-mysql-2.9003] jamesmar% set PATH > > /usr/local/mysql-standard-4.0.15-apple-darwin6.4-powerpc/bin/:$PATH > > > > but it returns the following: > > > > tcsh: set: Variable name must begin with a letter. > > > > I'm not sure what that means. To me, the obvious shell variable is > > "PATH" which begins with a letter, and the obvious Perl variable is > > $PATH but Perl variables must begin with a symbol rather than just a > > letter and, ignoring the $ symbol, the next character IS a letter. > > > > (Again, please keep in mind that I'm just learning Perl - and > > programming for that matter - and some things which might appear to be > > blatantly obvious to the average programmer my sail right past me > > without a sound.) > > > > I could try leaving the $ symbol off of the last word in the "set" > > statement but that would, to me, represent "PATH" as a file or directory. > > > > I tried leaving the Perl variable off of the end of the "set" > > statement and got the same response: > > > > tcsh: set: Variable name must begin with a letter. > > > > > > It's late (2 a.m.) and I have to be at work early this morning so I'll > > have to put it on hold for now and try again this evening. > > > > I really appreciate all the advice and suggestions that have been > > offered so far. Please let me know if I wear out my welcome! > > > > James > > > > _______________________________________________ > > Pdx-pm-list mailing list > > Pdx-pm-list@mail.pm.org > > http://mail.pm.org/mailman/listinfo/pdx-pm-list > > > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list@mail.pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list > From tex at off.org Wed Mar 31 11:50:11 2004 From: tex at off.org (Austin Schutz) Date: Mon Aug 2 21:34:31 2004 Subject: [Pdx-pm] DBD::mysql cont. In-Reply-To: References: <4069210D.60308@webiphany.com> <6D9C2BAF-821D-11D8-8520-000A956EF5EC@jamarks.com> <4069295C.1090506@webiphany.com> <40692E9F.20408@webiphany.com> <5D17843B-82FA-11D8-8BA8-000A956EF5EC@jamarks.com> <406A9BA2.5090501@webiphany.com> Message-ID: <20040331175011.GG1249@gblx.net> On Wed, Mar 31, 2004 at 12:22:44PM -0500, Jeff Lavallee wrote: > James - I have always used > > tcsh$ setenv FOO bar > Probably works better than set FOO bar. Here's a tidbit from the handy 'man tcsh' command. Esp note the tidbit about "null string": set set name ... set name=word ... set [-r] [-f|-l] name=(wordlist) ... (+) set name[index]=word ... set -r (+) set -r name ... (+) set -r name=word ... (+) The first form of the command prints the value of all shell variables. Variables which contain more than a single word print as a parenthesized word list. The second form sets name to the null string. The third form sets name to the single word. The fourth form sets name to the list of words in wordlist. In all cases the value is com? mand and filename expanded. If -r is specified, the value is set read-only. If -f or -l are spec? ified, set only unique words keeping their order. -f prefers the first occurrence of a word, and -l the last. The fifth form sets the index'th compo? nent of name to word; this component must already exist. The sixth form lists only the names of all shell variables that are read-only. The seventh form makes name read-only, whether or not it has a value. The second form sets name to the null string. The eighth form is the same as the third form, but make name read-only at the same time. These arguments can be repeated to set and/or make read-only multiple variables in a single set com? mand. Note, however, that variable expansion hap? pens for all arguments before any setting occurs. Note also that `=' can be adjacent to both name and word or separated from both by whitespace, but cannot be adjacent to only one or the other. See also the unset builtin command. setenv [name [value]] Without arguments, prints the names and values of all environment variables. Given name, sets the environment variable name to value or, without value, to the null string. From kyle at cepaso.com Wed Mar 31 12:41:18 2004 From: kyle at cepaso.com (Kyle Dawkins) Date: Mon Aug 2 21:34:32 2004 Subject: [Pdx-pm] DBD::mysql In-Reply-To: <4832511E-82F1-11D8-8BA8-000A956EF5EC@jamarks.com> References: <24DB5FBA-8217-11D8-8520-000A956EF5EC@jamarks.com> <4832511E-82F1-11D8-8BA8-000A956EF5EC@jamarks.com> Message-ID: James Sorry, my email was not clear... those changes are necessary to install the PERL modules for Mysql. I had cut and pasted that from another email I had sent and forgot to read it over and "realign" it now that it was out of context. From what I am reading, I think this will solve your problems. Kyle On 31 Mar 2004, at 0:56, James marks wrote: > > On Mar 31, 2004, at 12:52 AM, Kyle Dawkins wrote: > >> Hi >> >> Sorry to jump in on this so late, but when I first installed Panther >> on my laptop I had to do this to get the Mysql perl mods to install: >> >> "...Edit >> >> /System/Library/Perl/5.8.1/darwin-thread-multi-2level/Config.pm >> >> and change the line >> >> ld="MACOSX_...." >> >> to read >> >> ld="env MACOSX_...." >> >> and then you'll be able to build Mysql (and a few others)..." > > I've successfully installed and used MySQL. The problem I'm having is > I'm apparently unable to install the Perl module "DBD::mysql" which is > needed for a number of Perl scripts I'm studying. > > I've installed quite a few other Perl modules without any problems. > It's just this one that repeatedly returns the message: "make had > returned bad status, install seems impossible" > > I've tried as many of the suggestions given here as I've been able to > but am still unable to install the module. > > The problem seems to involve a problem with the process running the > -MCPAN script in locating the "mysql_config" file. I'm currently > trying to set the options from the command line. I'm pretty new to > Perl, Unix and working from the command line but I'm plugging away at > it and am confident (ok, hopeful) that I'll figure it out at some > point. > > I'll add your suggestions to my list of things to try! > > :) > > Thanks! > > James > > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list@mail.pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list >