From dwaring at nwsr.com Wed Mar 1 22:03:03 2000 From: dwaring at nwsr.com (David Waring) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: CGI::Cookies question In-Reply-To: <000701bf7971$87c58f40$61ee6fd8@rc-701> References: <000701bf7971$87c58f40$61ee6fd8@rc-701> Message-ID: I had a problem like this with IE last year. Seems to be a bug in IE. Turns out if you set a cookie with no value, IE (at least v4 and v5 on NT) will not accept any other cookies from that domain. If I remember correctly it behaved as if it was accepting the cookie but it really didn't. Perhaps this is the problem. David Waring >Friends, > I guess I'll take advantage of this slow period on the list to ask my >stupid question. The problem I'm having is that I have a problem with IE >accepting my cookies. My code is thus: > >---------------------------------------------------------------- >use CGI qw/:standard/; >use CGI::Cookie; > >print SetStandardCookies($UserName, $Password); > >s*b SetStandardCookies > { > my ($UserName, $Password) = @_; > > my ($UserNameCookie, $PasswordCookie); > > $UserNameCookie = new CGI::Cookie(-name => 'UserName', > -value => $UserName, > -domain => 'cdarley.dyndns.org', > -path => '/games/', > -expires => "+1h"); > > $PasswordCookie = new CGI::Cookie(-name => 'Password', > -value => $Password, > -domain => 'cdarley.dyndns.org', > -path => '/games/', > -expires => "+1h"); > return header(-cookie=>[$UserNameCookie, $PasswordCookie]); > }; >---------------------------------------------------------------- > > It sets the cookie on Netscape, and used to set the cookie on >IE browsers >when my application was being served from a Win98 machine, but now that I've >ported it to Apache mod_perl under Linux, IE doesn't end up with any >cookies. Anybody have any experience with this kind of thig, or is there >some obvouse error in my code? > > Thanks for your help! > >Peter Darley > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe > Email to majordomo@pm.org: ACTION spug-list your_address - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe Email to majordomo@pm.org: ACTION spug-list your_address From pdarley at serviceintelligence.com Fri Mar 3 09:52:14 2000 From: pdarley at serviceintelligence.com (Peter Darley) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: CGI::Cookies question In-Reply-To: Message-ID: <000c01bf8528$72179f40$61ee6fd8@rc-701> Friends, The problem was apperantly that the clock on the machine was set wrong and it was sending out cookies that were already expired. I don't know why Netscape was returning these expired cookies; maby it assumed that any cookie with an invalid expiration time should never expire. Anyway, that's what the problem was. Thanks, Peter D. > -----Original Message----- > From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org]On Behalf Of > David Waring > Sent: Wednesday, March 01, 2000 8:03 PM > To: pdarley@serviceintelligence.com > Cc: spug-list@pm.org > Subject: Re: SPUG: CGI::Cookies question > > > I had a problem like this with IE last year. Seems to be a bug in IE. > Turns out if you set a cookie with no value, IE (at least v4 and v5 > on NT) will not accept any other cookies from that domain. If I > remember correctly it behaved as if it was accepting the cookie but > it really didn't. Perhaps this is the problem. > > David Waring > > > >Friends, > > I guess I'll take advantage of this slow period on the list > to ask my > >stupid question. The problem I'm having is that I have a problem with IE > >accepting my cookies. My code is thus: > > > >---------------------------------------------------------------- > >use CGI qw/:standard/; > >use CGI::Cookie; > > > >print SetStandardCookies($UserName, $Password); > > > >s*b SetStandardCookies > > { > > my ($UserName, $Password) = @_; > > > > my ($UserNameCookie, $PasswordCookie); > > > > $UserNameCookie = new CGI::Cookie(-name => 'UserName', > > -value => $UserName, > > -domain => 'cdarley.dyndns.org', > > -path => '/games/', > > -expires => "+1h"); > > > > $PasswordCookie = new CGI::Cookie(-name => 'Password', > > -value => $Password, > > -domain => 'cdarley.dyndns.org', > > -path => '/games/', > > -expires => "+1h"); > > return header(-cookie=>[$UserNameCookie, $PasswordCookie]); > > }; > >---------------------------------------------------------------- > > > > It sets the cookie on Netscape, and used to set the cookie on > >IE browsers > >when my application was being served from a Win98 machine, but > now that I've > >ported it to Apache mod_perl under Linux, IE doesn't end up with any > >cookies. Anybody have any experience with this kind of thig, or is there > >some obvouse error in my code? > > > > Thanks for your help! > > > >Peter Darley > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - - - - - > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe > > Email to majordomo@pm.org: ACTION spug-list your_address > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe > Email to majordomo@pm.org: ACTION spug-list your_address > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe Email to majordomo@pm.org: ACTION spug-list your_address From ryan at dbedge.com Sun Mar 5 21:52:26 2000 From: ryan at dbedge.com (Ryan Erwin) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: ESPUG March Meeting... Message-ID: <015001bf871f$652199a0$7dc8fdce@dellbox> Greetings from your friendly neighborhood ESPUG emperor- I am proud to announce that the March ESPUG meeting will be on Wednesday, March 29th at 7:00 pm, Lucent in Redmond. Yes, technically it's the 5th Wednesday, but who's counting? Robert Abarbanel will be back, continuing the discussion of Object Oriented Perl. This month, we will focus on chapters 3 and 7 of Damian Conway's book, "Object Oriented Perl". The actual topics will be the mystical "Pseudo-Hash" and "Polymorphism". For all of the details, check out the ESPUG site: -> http://espug.pm.org If you don't yet have Conway's OOPerl book, I can't recommend it highly enough. It is certainly my favorite Perl book thus far. Just learning about all the havoc that I could cause with Operator Overloading, particularly in conjunction with hashes is well worth the price. Now if I could just figure out a way to tie some variables, and overload all of my operators without anyone knowing, I could insure complete code obfuscation insert evil cackle/laugh here...] Hope to see you all there- Ryan Erwin ESPUG Emperor BTW: is there anything on the docket for the march SPUG meeting? i haven't heard from Tim and the spugsite doesn't yet have a march entry. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe Email to majordomo@pm.org: ACTION spug-list your_address From matthew at lasarletter.com Thu Mar 9 00:43:38 2000 From: matthew at lasarletter.com (Matthew Lasar) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: a word 97/98 module Message-ID: <3.0.1.32.20000308224338.007e7d30@mail.transbay.net> Are any of you aware of some kind of module that would enable me to do perl searches and replaces in Word 97/98 on the PC? Matthew *.* "The absent are always wrong." --French proverb Matthew Lasar 171 Andover Street San Francisco, CA 94110 matthew@lasarletter.com www.lasarletter.com 415-641-1152 415-826-6964 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe Email to majordomo@pm.org: ACTION spug-list your_address From rick at libronix.com Thu Mar 9 09:32:59 2000 From: rick at libronix.com (Rick Brannan) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: a word 97/98 module Message-ID: Matthew -- Win32::OLE is the module you're looking for, I think. It is packaged with ActiveState's distribution. It allows access to Word's document object, among other things. I know there are several folks who are quite acquainted with using Perl to get at word docs through Win32::OLE on ActiveState's perl-win32-users list. You might want to query that list for further information and tips on how to exactly go about it. ------------------------------ Rick Brannan, Libronix Corp. web: http://www.libronix.com "I don't need no radio, I got yodelin' on my noodle-o" -- Swirling Eddies >-----Original Message----- >From: Matthew Lasar [mailto:matthew@lasarletter.com] >Sent: Wednesday, March 08, 2000 10:44 PM >To: spug-list@pm.org >Subject: SPUG: a word 97/98 module > > >Are any of you aware of some kind of module that would enable >me to do perl >searches and replaces in Word 97/98 on the PC? > >Matthew > >*.* > >"The absent are always wrong." > --French proverb > >Matthew Lasar >171 Andover Street >San Francisco, CA 94110 >matthew@lasarletter.com >www.lasarletter.com >415-641-1152 >415-826-6964 > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >- - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Seattle Perl Users Group (SPUG) Home Page: >http://www.halcyon.com/spug/ > SUBSCRIBE/UNSUBSCRIBE: Replace >ACTION below by subscribe or unsubscribe > Email to majordomo@pm.org: ACTION spug-list your_address > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe Email to majordomo@pm.org: ACTION spug-list your_address From Sean at DigiDot.com Thu Mar 9 11:12:02 2000 From: Sean at DigiDot.com (Sean Ruddy) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: XML::Parser Message-ID: <38C7DB62.DD78BC2C@DigiDot.com> Just wondering if any one has notes or something from the xml parser thing given a few months back. I missed it and now I really need to know how to use it! Sean - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe Email to majordomo@pm.org: ACTION spug-list your_address From johnl at meer.net Thu Mar 9 12:17:40 2000 From: johnl at meer.net (John Labovitz) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: XML::Parser In-Reply-To: Your message of "Thu, 09 Mar 2000 09:12:02 PST." <38C7DB62.DD78BC2C@DigiDot.com> Message-ID: Sean Ruddy said: > Just wondering if any one has notes or something from the > xml parser thing given a few months back. I missed it and now I really > need to know how to use it! if that was my presentation, i've still got the talk on my web site, at: http://www.meer.net/~johnl/xml-talk/ john - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe Email to majordomo@pm.org: ACTION spug-list your_address From johnl at meer.net Thu Mar 9 14:40:28 2000 From: johnl at meer.net (John Labovitz) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: XML::Parser In-Reply-To: Your message of "Thu, 09 Mar 2000 12:29:53 PST." <917855E35B7ED211B2970008C7B1EE8101518582@sea-exchsvr.echarge.com> Message-ID: Ryan Bark - Contractor said: > Can you check your website? I'm having trouble accessing the following urls: > > http://www.meer.net/~johnl/xml-talk/shot_to_XML.pl.txt > http://www.meer.net/~johnl/xml-talk/shot_to_XML2.pl.txt yes, something seems to be weird with meer's server. i have the talk info mirrored at my home site, at: http://www.polymecca.com/~johnl/xml-talk/ try that one and see if it works any better for you. john - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe Email to majordomo@pm.org: ACTION spug-list your_address From tim at consultix-inc.com Thu Mar 9 17:03:26 2000 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: Perl Programmers, Downtown Seattle- needed In-Reply-To: ; from kathy.lebarron@neoinformatics.com on Thu, Mar 09, 2000 at 02:41:53PM -0800 References: Message-ID: <20000309150326.A2199@timji.consultix.wa.com> NeoInformatics develops authoritative, informational databases which continue to grow over time. These databases are created to be used as content on websites. Creating the world's most authoritative information resources is exciting work! What can your role be? Because we're growing fast, our people are growing fast, too. When we hire a new team member, we don't look at just what they can do now, but what they may be able to do down the road with the right training and mentoring. We'll be needing lots of different skills as we continue to grow (not just technical ones!). So at NeoInformatics, you can have a role in creating the world's most authoritative information resources, but you could also find a great opportunity to grow yourself! Perl Programmers - perl/cgi programming experience, ideally creating database driven web pages. Lead Perl Programmers - you'll be involved in all aspects of product development including major design decisions. Requires outstanding time managment, customer service and perl programming skills. Perl programming and database experience required, preferably in a web environment. We're a new company, with great benefits and more opportunities to come, we prefer long-term employees but will consider contracts (W2 or 1099 as appropriate). We offer competitive pay based on experience, a comprehensive benefits package that competes with (and beats!)larger companies. Check us out at www.neoinformatics.com - we're located in historic Seattle Tower, we offer a flexible work environment and having fun is one of our guiding principles. Send your resume (along with a sample of your code if possible) to resume@neoinformatics.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe Email to majordomo@pm.org: ACTION spug-list your_address From Richard.Anderson at seaslug.org Thu Mar 9 19:45:34 2000 From: Richard.Anderson at seaslug.org (Richard Anderson) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: Re: a word 97/98 module References: <3.0.1.32.20000308224338.007e7d30@mail.transbay.net> Message-ID: <018901bf8a32$62efbde0$1988ddd1@adcom133> If you install UWin (http://www.research.att.com/sw/tools/uwin/) and the Portable Unix Toolkit Enterprise Edition http://www.raycosoft.com/rayco/put/download.html ), the attached script will to search and replaces on multiple text files. Might be faster than writing your own Perl script. Richard.Anderson@seaslug.org www.raycosoft.com ----- Original Message ----- From: "Matthew Lasar" To: Sent: Wednesday, March 08, 2000 10:43 PM Subject: SPUG: a word 97/98 module > Are any of you aware of some kind of module that would enable me to do perl > searches and replaces in Word 97/98 on the PC? > > Matthew > > *.* > > "The absent are always wrong." > --French proverb > > Matthew Lasar > 171 Andover Street > San Francisco, CA 94110 > matthew@lasarletter.com > www.lasarletter.com > 415-641-1152 > 415-826-6964 > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe > Email to majordomo@pm.org: ACTION spug-list your_address > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: msub Type: application/octet-stream Size: 9322 bytes Desc: not available Url : http://mail.pm.org/archives/spug-list/attachments/20000309/b254c654/msub.obj From seppy at mail.tanzatech.com Sun Mar 12 12:59:36 2000 From: seppy at mail.tanzatech.com (Jafaar Nyang'oro) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: Mailform In-Reply-To: <38C7DB62.DD78BC2C@DigiDot.com> Message-ID: SPUGers, I've created the following script to process form input after it's being filled out. I've writen it for a UNIX-based server. I want to make it work on an NT environ as well. What changes should I make on the script for it to be able to work on Windows NT server? Thanks. ../seppy #!/usr/bin/perl # ######################################################### # # Author: Jafaar Nyang'oro - March 11, 2000 # # This script receives vote inputs from voting form and # sends them by e-mail to returning officers # ######################################################### # Address of the administrator $admin = "seppy\@mail.tanzatech.com"; # Address of the Returning Officers $returning_officers = "kura\@tanzatech.com"; # Parse the inputs from the form and store them # in an associative array 'fields' &parse_input(*fields); # Read the Full Name of the voter $realname = $fields{'real-name'}; # Remove leading and trailing spaces $realname =~ s/^(\s+)|(\s+)$//g; # Make sure the input is not an empty space if (length($realname) == 0) { &print_header; print ''; print 'Please use the Back button of your browser, fill in your Full Name and re-submit the form.'; exit; } # Read the e-mail address of the voter $address = $fields{'sent-by'}; # Remove leading and trailing spaces $address =~ s/^(\s+)|(\s+)$//g; # Make sure the input is not an empty space if (length($address) == 0) { &print_header; print ''; print 'Please use the Back button of your browser, fill in your Address and re-submit the form.'; exit; } # Read the votes $one = $fields{'one'}; $two = $fields{'two'}; $three = $fields{'three'}; $four = $fields{'four'}; $five = $fields{'five'}; $six = $fields{'six'}; $seven = $fields{'seven'}; $eight = $fields{'eight'}; # Now send the mail to the Returning Officers open (MAIL, "|/usr/bin/sendmail $admin"); open (MAIL, "|/usr/bin/sendmail $returning_officers"); print MAIL "From: $realname <$address>\n"; print MAIL "To: Returning Officers <$returning_officers>\n"; print MAIL "Subject: TANZANET Kura 2000\n"; print MAIL "\n"; print MAIL "Mwenyekiti:\n"; print MAIL "$one\n"; print MAIL "\n"; print MAIL "Makamu Mwenyekiti:\n"; print MAIL "$two\n"; print MAIL "\n"; print MAIL "\n"; print MAIL "Katibu:\n"; print MAIL "$three\n"; print MAIL "\n"; print MAIL "Naibu Katibu:\n"; print MAIL "$four\n"; print MAIL "\n"; print MAIL "Mweka Hazina:\n"; print MAIL "$five\n"; print MAIL "\n"; print MAIL "Naibu Mweka Hazina:\n"; print MAIL "$six\n"; print MAIL "\n"; print MAIL "Mwenyekiti Utawala:\n"; print MAIL "$seven\n"; print MAIL "\n"; print MAIL "Mwenyekiti Mitambo:\n"; print MAIL "$eight\n"; print MAIL "\n"; close (MAIL); # Display the vote success results &print_header; print "TANZANET Kura 2000\n"; print ''; print '
THANK YOU FOR VOTING!

YOUR VOTE HAS BEEN SUCCESSFULLY SUBMITTED TO THE RETURNING OFFICERS!
'; sub form_method { $method=$ENV{'REQUEST_METHOD'}; } sub path_info { $path=$ENV{'PATH_INFO'}; $path=~ s/\///; $return=$path; } sub print_header { if (!defined(@_)) { print "Content-type: text/html\n\n"; } else { print "Location: @_\n\n"; } } sub parse_input { if (defined(@_)) { local(*input)=@_; } else { local(*input)="*cgiinput"; } local ($temp,@pairs); if (&form_method eq 'POST') { read(STDIN,$temp,$ENV{'CONTENT_LENGTH'}); } else { $temp=$ENV{'QUERY_STRING'}; } if ($temp ne '') { @pairs=split(/&/,$temp); foreach $item(@pairs) { ($key,$content)=split (/=/,$item,2); $content=~tr/+/ /; $content=~ s/%(..)/pack("c",hex($1))/ge; if (!defined($input{$key})) { $input{$key}=$content; } else { $input{$key} .= "\0$content"; } } return 1; } else { return 0; } } __________________________________________ NetZero - Defenders of the Free World Get your FREE Internet Access and Email at http://www.netzero.net/download/index.html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe Email to majordomo@pm.org: ACTION spug-list your_address From moonbeam at catmanor.com Sun Mar 12 13:26:48 2000 From: moonbeam at catmanor.com (William Julien) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: Mailform In-Reply-To: Mail from '"Jafaar Nyang'oro" ' dated: Sun, 12 Mar 2000 13:59:36 -0500 Message-ID: <200003121926.LAA11280@catmanor.com> > >SPUGers, > >I've created the following script to process form input after it's being >filled out. I've writen it for a UNIX-based server. > >I want to make it work on an NT environ as well. What changes should I make >on the script for it to be able to work on Windows NT server? > >Thanks. > >../seppy > See... perldoc perlport Quote... One especially common bit of Perl code is opening a pipe to sendmail: open(MAIL, '|/usr/lib/sendmail -t') or die $!; This is fine for systems programming when sendmail is known to be available. But it is not fine for many non- Unix systems, and even some Unix systems that may not have sendmail installed. If a portable solution is needed, see the Mail::Send and Mail::Mailer modules in the MailTools distribution. Mail::Mailer provides several mailing methods, including mail, sendmail, and direct SMTP (via Net::SMTP) if a mail transfer agent is not available. The rule of thumb for portable code is: Do it all in portable Perl, or use a module (that may internally implement it with platform-specific code, but expose a common interface). --- William Julien _,'| _.-''``-...___..--'; moonbeam@catmanor.com /, \'. _..-' , ,--...--''' vi is my shepherd; < \ .`--''' ` /| i shall not font. `-,;' ; ; ; __...--'' __...--_..' .;.' (,__....----''' (,..--'' perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe Email to majordomo@pm.org: ACTION spug-list your_address From lou at visca.com Sun Mar 12 16:25:03 2000 From: lou at visca.com (Lou Hevly) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: Mailform In-Reply-To: References: <38C7DB62.DD78BC2C@DigiDot.com> Message-ID: <3.0.6.32.20000312232503.00acc980@visca.com> At 13:59 12/03/00 -0500, Jafaar Nyang'oro wrote: >SPUGers, > >I've created the following script to process form input after it's being >filled out. I've writen it for a UNIX-based server. > >I want to make it work on an NT environ as well. What changes should I make >on the script for it to be able to work on Windows NT server? Try Mail::Sendmail from CPAN (very easy, no attachments). -- Lou Hevly lou@visca.com http://www.visca.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe Email to majordomo@pm.org: ACTION spug-list your_address From trance at drizzle.com Sun Mar 12 17:47:37 2000 From: trance at drizzle.com (Christopher & Shalah) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: Mailform In-Reply-To: <3.0.6.32.20000312232503.00acc980@visca.com> Message-ID: <000001bf8c7d$5c546a60$a7c1a2d8@aghnaught> At 13:59 12/03/00 -0500, Jafaar Nyang'oro wrote: >SPUGers, > >I've created the following script to process form input after it's being >filled out. I've writen it for a UNIX-based server. > >I want to make it work on an NT environ as well. What changes should I make >on the script for it to be able to work on Windows NT server? I would probably use Win32::OLE and automate the NT MAPI through OLE, but then easy and fun arent always the same thing. My suggestion is on the fun side. --Christopher - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe Email to majordomo@pm.org: ACTION spug-list your_address From wings15898 at yahoo.com Sun Mar 12 20:37:24 2000 From: wings15898 at yahoo.com (wings x) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: GIFgraph question Message-ID: <20000313023724.5939.qmail@web3202.mail.yahoo.com> Dear SPUGers, I want to draw a gif using the following code: use GIFgraph::lines; my @LANG = sort qw(java perl vc vb); my @plotdata = ( [ "Oct", "Nov", "Dec" ], [ 1 , 2, 3 ], ); my $graph = GIFgraph::lines->new(640,480); $graph->set( x_label_vertical => 1, title => "number for each month" ); $graph->set_legend(@RANKS); $graph->plot_to_fig("c:/out.gif", \@plotdata); but I keep getting the error message: Can't locate object method "gif" via package "GD::Image" at d:/perl/site/lib/GIFgraph/axestype.pm line 119 I have GD version 1.25 and GIFgraph veresion 2.6 Where am I wrong? Thanks, wings __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe Email to majordomo@pm.org: ACTION spug-list your_address From smorton at pobox.com Mon Mar 13 00:52:36 2000 From: smorton at pobox.com (Sanford Morton) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: GIFgraph question In-Reply-To: <20000313023724.5939.qmail@web3202.mail.yahoo.com> References: <20000313023724.5939.qmail@web3202.mail.yahoo.com> Message-ID: <20000313065236.21D603258B@scribe.pobox.com> wings x writes: > > but I keep getting the error message: > Can't locate object method "gif" via package > "GD::Image" at d:/perl/site/lib/GIFgraph/axestype.pm GD used to support only gif. Now it supports only png. Either use an older version of GD (1.18 for sure, maybe later) or upgrade your GIFgraph, which is now called GD::Graph, I think. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe Email to majordomo@pm.org: ACTION spug-list your_address From bsf at england.com Tue Mar 14 14:08:09 2000 From: bsf at england.com (Benjamin Franks) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: perl programming companies in seattle area? Message-ID: I have a project I'd like to farm out to a perl programmer on a contract basis. The project involves database and web programming in perl. Have any members of the list contracted with perl development firms in the seattle, wa area? Any recommendations or relevant info on good firms/individuals/pricing would be greatly appreciated. Thank you, Benjamin Franks __________________________________________________________________ Get your own free England E-mail address at http://www.england.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe Email to majordomo@pm.org: ACTION spug-list your_address From tim at consultix-inc.com Tue Mar 14 18:41:29 2000 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: March Meeting: Perl DBI Adventures Message-ID: <20000314164129.A786@timji.consultix.wa.com> "Adventures with the Perl DBI" by Phillip Neal March SPUG Meeting (3/21/2000) 7pm - 9pm Phillip Neal (phillipneal@hotmail.com) will talk about programming web database applications using the Perl DataBase Interface (DBI) and MySql. Attendees are encouraged to buy and use the new book "Programming the Perl DBI" by Descartes and Bunce. Phil will discuss his experiences in the following areas: Installing the Perl DBI, Installing DataBase Drivers (DBDs), writing Simple Applications, and Network Access. As usual, early arrivers are encouraged to meet at the Rock Bottom Brewpub, in seats off to the left as you come through the front door. See the web-page for more details. ========================================================== | Tim Maher, Ph.D. Tel/Fax: (206) 781-UNIX | | SPUG Founder & Leader Email: spug@halcyon.com | | Seattle Perl Users Group HTTP: www.halcyon.com/spug | ========================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe Email to majordomo@pm.org: ACTION spug-list your_address From tim at consultix-inc.com Wed Mar 15 12:09:07 2000 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: Call for Cooks: "File Access" Message-ID: <20000315100907.A3679@timji.consultix.wa.com> SPUGsters, I'm looking for a volunteer to lead a discussion on Chapter 7 of the Perl Cookbook, "File Access", for the April 18th meeting. Topics include open(), in-place editing, file-locking, flushing output, manipulating filehandles, and so forth. If the volunteer wishes, Chapter 8, "File Contents", could be bundled in as well (they're both fairly short chapters). This would be a great chance to show off your current knowledge of these topics, or to motivate yourself to acquire this useful knowledge soon! Also, if you'll indulge me in a short "pledge break", I'd like to encourage those of you who have thus far only been on the receiving-end of SPUGery to chip in and give something back to the group! I'LL BE SPUGGING DOWN-UNDER I'll be visiting the Australian Perl Mongers groups for three weeks starting Monday (along with visiting Thor's family (http://www.oz.net/~tmaher/thor), famous wine-growing regions, etc.). After that, I'll be delivering on-site Perl classes out of state until late-April. Therefore, this is the last week I'll be in town until after the next two SPUG meetings have occurred; accordingly, I'd like to have a speaker lined up for the April meeting by this weekend at the latest. The lines are now open for volunteers! 8-} SPONSORSHIP NEWS I met with a local company last week that has volunteered to sponsor a Perl speaker for an upcoming meeting. I've already been in touch with Damian Conway, but the scheduling looks problematic for him. Any requests for other speakers? *========================================================================* | Tim Maher, PhD Consultix & (206) 781-UNIX/8649 | | Pacific Software Gurus, Inc Email: tim@consultix-inc.com | | UNIX/Linux & Perl Training http://www.consultix-inc.com | | Classes- 5/15: UNIX 5/22: Basic Perl+Modules 6/12: Intermediate Perl | *========================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe Email to majordomo@pm.org: ACTION spug-list your_address From tim at consultix-inc.com Fri Mar 17 14:39:07 2000 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: 2 Years of SPUGery; the Damian Cometh! Message-ID: <20000317123907.A10603@timji.consultix.wa.com> SPUGsters, Hard to believe that the first ever SPUG meeting was St. Patrick's Day, 1998! We had a good turnout too, about 25 people who were more interested in banding together with other Perl'ers than in drinking green beer (although some of the attendees found time to do that too, later in the evening). A few days after our inaugural meeting, Larry Wall himself addressed our group, leading some to later opine that: "It's all been downhill since then" 8-} (but see below for a surprise!) Now we've grown to two "Chapters", Westside and Eastside, with two monthly meetings! Other SPUG leaders whine about insufficient turnouts at meetings, but our biggest problem thus far has been insufficient meeting spaces for our turnouts! 8-} We must be doing something right! But we mustn't get complacent, or we'll stagnate - along those lines, I'm happy to announce that, after a bit of arm-twisting I've been able to get Damian Conway (author of the marvelous "Object Oriented Perl" book) to tentatively agree to visit us shortly after July 4th; we're still negotiating the "ground-rules" for the event, but it seems likely that we SPUGers will eventually get to cast votes for different ideas about what we'd like to have him do at the meeting (answer book questions, give summaries of his YAPC (by then, past) and TPC (future) talks, etc.). More on this later . . . The expenses for this anticipated visit by Damian are to be underwritten by a new corporate sponsor, who actually approached SPUG and offered to spend money to help our group! They are "NeoInformatics", a downtown Seattle company developing web-based database systems, using Perl, Linux, and Oracle. They're nice people, and hungry to hire more Perl Programmers! An announcement of their Perl job-openings was posted to this list recently; to apply, send your information to: resume@neoinformatics.com Happy St. Patrick's Day, everybody, and thanks for helping make SPUG such a successful organization! -Tim P.S. Still looking for someone to lead the discussion on the "File Access" Cookbook chapter for the April meeting. ========================================================== | Tim Maher, Ph.D. Tel/Fax: (206) 781-UNIX | | SPUG Founder & Leader Email: spug@halcyon.com | | Seattle Perl Users Group HTTP: www.halcyon.com/spug | ========================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe Email to majordomo@pm.org: ACTION spug-list your_address From otter101 at hotmail.com Fri Mar 17 16:00:15 2000 From: otter101 at hotmail.com (Steve Laybourn) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: DBI book Message-ID: <20000317220015.9795.qmail@hotmail.com> G'day, Perl lovers! Saw the DBI book at the Barnes & Noble's in downtown Bellevue last night, so it's finally here in this area. Just thought you might like to know... Be seeing you... Steve Laybourn ---The Call of Cthulhu wasn't bad enough, he called collect too... ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe Email to majordomo@pm.org: ACTION spug-list your_address From asherr at cs.unm.edu Fri Mar 17 19:13:31 2000 From: asherr at cs.unm.edu (Aryeh "Cody" Sherr) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: DBI book In-Reply-To: <20000317220015.9795.qmail@hotmail.com> Message-ID: I grabbed the book, and read through it. Unless you havn't used the DBI interface before, the man page is better. In fact the appendices are basically that. On the other hand, if you want to learn all the cool ways you can use the DBI module, it's a great book. my .02 cody On Fri, 17 Mar 2000, Steve Laybourn wrote: >G'day, Perl lovers! > Saw the DBI book at the Barnes & Noble's in downtown Bellevue last night, >so it's finally here in this area. > Just thought you might like to know... > Be seeing you... > Steve Laybourn > >---The Call of Cthulhu wasn't bad enough, he called collect too... > >______________________________________________________ >Get Your Private, Free Email at http://www.hotmail.com > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe > Email to majordomo@pm.org: ACTION spug-list your_address > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe Email to majordomo@pm.org: ACTION spug-list your_address From jdevlin at stadiumdistrict.com Mon Mar 20 02:07:52 2000 From: jdevlin at stadiumdistrict.com (Joe Devlin) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: DBI book Message-ID: <01BF9200.592C6440@blv-pm401-ip87.nwnexus.net> I scanned through the book at U/W bookstore downtown and think that I already have what I need in the MySQL book by NewRiders plus Perl in a nutshell, for the current project at least... Joe Devlin ---------- From: Aryeh "Cody" Sherr[SMTP:asherr@cs.unm.edu] Sent: Friday, March 17, 2000 5:13 PM To: Steve Laybourn Cc: spug-list@pm.org Subject: Re: SPUG: DBI book I grabbed the book, and read through it. Unless you havn't used the DBI interface before, the man page is better. In fact the appendices are basically that. On the other hand, if you want to learn all the cool ways you can use the DBI module, it's a great book. my .02 cody On Fri, 17 Mar 2000, Steve Laybourn wrote: >G'day, Perl lovers! > Saw the DBI book at the Barnes & Noble's in downtown Bellevue last night, >so it's finally here in this area. > Just thought you might like to know... > Be seeing you... > Steve Laybourn > >---The Call of Cthulhu wasn't bad enough, he called collect too... > >______________________________________________________ >Get Your Private, Free Email at http://www.hotmail.com > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe > Email to majordomo@pm.org: ACTION spug-list your_address > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe Email to majordomo@pm.org: ACTION spug-list your_address - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From mherrewig at hotmail.com Wed Mar 22 03:23:02 2000 From: mherrewig at hotmail.com (Michael Herrewig) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: Perl Volunteering Message-ID: <20000322092302.48155.qmail@hotmail.com> Greetings, I have been working for the past few years to steer my career toward system administration and/or programming. I will be hiring material after I achieve one more thing: experience. There are only two ways I can think of to gain experience without getting it on-the-job. 1) Buy all the necessary equipment and be my own Sysadmin. This would be fun, however, I have neither the money, nor the space to persue this option. 2) Volunteer my time to a non-profit organization. The only drawback to this is not getting paid for my time. But my payment would be the much-needed experience. My questions to you wonderful people are these: -Is there such a thing as volunteer sysadmin-ing or programming? -Where could I start looking for such an opportunity? I want to focus mostly on *nix and perl and avoid MS if at all possible. I am eager to explore any ideas you may have. Thank you. Mike ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From ChrisM at courtlink.com Wed Mar 22 12:27:48 2000 From: ChrisM at courtlink.com (Christopher Maujean) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: Perl Volunteering Message-ID: <01AC88DAEF3FD311A89800500482730064FD72@hqmsx01.internal.courtlink.com> 1. There is. 2. Eugene Freenet is always looking for volunteers (remote even) They have a bunch of Linux and Solaris boxes. There is probably some Eugene Freenet equivalent in the Seattle area, but the Eugene freenet (Oregon Public Networking) is a great place to work, and champions a wonderful cause. I put over 800 hours of work into that place myself. -----Original Message----- From: Michael Herrewig [mailto:mherrewig@hotmail.com] Sent: Wednesday, March 22, 2000 1:23 AM To: spug-list@pm.org Subject: SPUG: Perl Volunteering My questions to you wonderful people are these: -Is there such a thing as volunteer sysadmin-ing or programming? -Where could I start looking for such an opportunity? I want to focus mostly on *nix and perl and avoid MS if at all possible. I am eager to explore any ideas you may have. Thank you. Mike ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From ChrisM at courtlink.com Wed Mar 22 13:36:04 2000 From: ChrisM at courtlink.com (Christopher Maujean) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: ODBC on Unix Message-ID: <01AC88DAEF3FD311A89800500482730064FD77@hqmsx01.internal.courtlink.com> As promised I have found out what we are using. We have a package called OpenLink http://www.openlinksw.com we paid around a thousand dollars for a 10 user multi tiered license (the more expensive one). You need to set up a package on both the NT box and the Unix box, but I understand it is not hard.. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20000322/c1bce43b/attachment.htm From ChrisM at courtlink.com Wed Mar 22 13:39:30 2000 From: ChrisM at courtlink.com (Christopher Maujean) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: PLSQL Tables (Arrays) Message-ID: <01AC88DAEF3FD311A89800500482730064FD78@hqmsx01.internal.courtlink.com> contrary to my belief that this was supported, I found that we were not doing it. however, I know it is possible, as my DBA let me know that he had been involved in accessing these tables from C/C++ (using the oracle C api). It shouldn't be a hard thing to write an XSUB extension to make this possible in perl. --Christopher -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20000322/008a67fb/attachment.htm From smorton at pobox.com Sun Mar 26 10:46:17 2000 From: smorton at pobox.com (Sanford Morton) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: Saving to DOS file mode from Linux Message-ID: <20000326164617.9698032592@scribe.pobox.com> I'm using LWP to download some binary files (some Debian packages) from the net to a linux box, which I'll then want to transfer to a MS Windows machine. There's something about \r, \n that makes binaries incompatible between the two, which open FILE ... binmode FILE; is supposed to take care of. This doesn't work for me, since binmode writes in Linux format on a Linux box, but I want it to be saved in DOS format. Can I fool binmode to think it's a DOS machine or is there another way to save DOS format binaries? I prefer to do this inside the perl script, but a post processor would work. Mucho Thx, Sandy - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From ryan at dbedge.com Mon Mar 27 15:54:10 2000 From: ryan at dbedge.com (Ryan Erwin) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: Fw: YAPC 19100: Call for Participation (2) Message-ID: <00a001bf9837$01f1a4a0$a7c8fdce@bsdbook> Maybe some e?spuggers would be interested in attending Yet Another Perl Conference? --Ryan Erwin ESPUG Emperor BTW: don't forget about the ESPUG meeting Wednesday Night @ 7:00 pm, Lucent in Redmond. Check http://espug.pm.org for details... ----- Original Message ----- From: Kevin Lenzo To: ; Cc: Sent: Monday, March 27, 2000 11:32 AM Subject: YAPC 19100: Call for Participation (2) > ***************** CALL FOR PARTICIPATION ****************** > > North American > Yet Another Perl Conference > YAPC 19100 > > http://www.yapc.org/America/ > > Wednesday-Friday, June 21-23, 2000 > at > Carnegie Mellon University > Pittsburgh, Pennsylvania > > > ** Abstract submission deadline: April 3, 2000 ** > > Yet Another Perl Conference (YAPC) is an inexpensive ($75) perl > users and developers conference, with a mix of tutorials and > technical talks. The conference is set in Pittsburgh, Pennsylvania, > and so is relatively accessible from both the East and the Midwest. > > YAPC began as a grassroots users conference, from discussions > among Perl Mongers, and has grown from there. We would like > to invite you to join us for two days of Perl, people, and > demonstrations, at a price that shouldn't hurt your wallet. > There will be a limit of just under 500 people for the conference. > > A number of members of the Perl community are contributing to this > event, including: > > Larry Wall, Abigail, Damian Conway, Mark-Jason Dominus, > Joseph Hall, purl, Randal Schwartz, ... > > ... and YOU! See the CALL FOR PAPERS below! > > Look to the main web page for more details -- > http://www.yapc.org/America > > ** Dorm rooms ** > > A limited number of inexpensive dorm rooms are available at > Carnegie Mellon, that will be given preferentially to students, > but more generally on a first-come basis. This is to further > reduce the cost for those with limited resources, especially > students, who we are trying to encourage the most. More > information will become available when registration begins. > > ** Location ** > > YAPC is at Carnegie Mellon University in Pittsburgh, > Pennsylvania once again this year, in the University > Center. We have the Rangos rooms, 1,2 and 3 once again, > as well as McConomy Auditorium,the Conan Room, and some > small rooms set aside. This year there will be an email > garden. > > ** Registration ** > > Registration will open shortly after the abstract submission > deadline. Please watch for the announcements on the web > page at http://www.yapc.org/America/. > > > *********** CALL FOR PAPERS *********** > > Potential presenters should submit a 200-300 word abstract to > > lenzo+abstract@cs.cmu.edu > > in plain ASCII text or HTML by APRIL 3rd for consideration. > We would like that your materials be available online, but > it is not required. If you have materials to include in > the proceedings, or course notes, please let us know your > requirements the abstract. If you have any special presentation > needs, please include them also. > > Talks can be 20 minutes, 40 minutes, or 90 minutes long; > that's actually 20 + 2.5 minutes to change over, 40 + 5 minutes > to change, and 90 + 0 minutes to change over, so questions are > included in the these times. Please specify the amount of time > you'd like for your talk. > > Topics are unlimited, but some suggestions include: > > * Groupware, Agents, and Bots > * Perl for Speech and Language > * Text and Document Processing > * Machine Learning in Perl > * HTML, XML, and Markup Languages > * CGI and Web programming in Perl > * Internet Programming > * Database Interation and Access with Perl > * Scientific Computing (e.g. with PDL) > * Practical Perl Programming > * Module guts and usage on any particular Module. > * Tutorials of all stripes: Modules, Objects, CPAN > * Visionary or position papers on Perl, the past, > the present, and the future > * Anything cool :) > > Conference fees will be waived for presenters at yapc, so > another way to reduce your costs is to give a good talk > on something you're excited about. > > > **** YAPC 100 ** http://www.yapc.org/America/ ******** > ***************** CALL FOR PARTICIPATION ****************** > > **Majordomo list services provided by PANIX ** > **To Unsubscribe, send "unsubscribe groups" to majordomo@lists.pm.org** > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From aeh at akc.org Mon Mar 27 16:15:06 2000 From: aeh at akc.org (Adrian Hands) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: Re: FW: PLSQL Tables (Arrays) Message-ID: <200003272215.RAA09680@Scorpion.akc.org> To: ChrisM@courtLink.com >>> Christopher Maujean 03/22 2:40 PM >>> > > -----Original Message----- > From: Christopher Maujean > Sent: Wednesday, March 22, 2000 11:40 AM > To: 'spug-list@pm.org' > Subject: PLSQL Tables (Arrays) > > > contrary to my belief that this was supported, I found that we were not > doing it. > however, I know it is possible, as my DBA let me know that he had been > involved in accessing these tables from C/C++ (using the oracle C api). It shouldn't > be a hard thing to write an XSUB extension to make this possible in perl. > > --Christopher Thanks for checking. Support for oracle pl/sql tables would be nice to have. Please let me know if you implement something or see it done anywhere. Right now, we've got a few other projects under tight, close deadlines so we won't be doing anything with this right now. I'm not clear on whether it could be done cleanly as a separate module from DBI or if it would be best to incorporate it into DBI/DBD::Oracle. We haven't done anything with xsub'ing, yet... our systems admin guy might've done some stuff with xsub or swig though. As far as we know, Java and Powerbuilder contain no support for PL/SQL tables. ColdFusion's the only tool we've seen support them, and it doesn't do it very well. -Adrian Raleigh, NC - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From toddw at wrq.com Mon Mar 27 22:20:46 2000 From: toddw at wrq.com (Todd Wells) Date: Wed Aug 4 00:07:11 2004 Subject: SPUG: regular expression difficulty, plus compiled perl Message-ID: <1654BC972546D31189DA00508B318AC80122F12D@charmander.wrq.com> I'm using ActiveState Perl on NT4 and trying to set a variable to be equal to the directory name that the script was ran in. So, I look at $0 which contains the name of the script I ran... in this case "D:\PERL\COUNTP~1.PL" But when I try to strip the filename off the end, I can't seem to do it. print "First: $0\n"; ($test1 = $0)=~ m#.*\\#; #$test1 =~ s/(.*\\)/$1/; # I tried this too, and it didn't work either. print "Second: $test1\n"; The output: First: D:\PERL\COUNTP~1.PL Second: D:\PERL\COUNTP~1.PL What's going on here? Is the .* just being _really_ greedy? I'm expecting $test1 to be "D:\PERL\" I know this is silly, but I can't figure out the problem here. BTW, someone at the last SPUG meeting mentioned they were playing around with compiled Perl using ActiveState. I can't seem to find any specifics on how to do this. Perlfaq3 mentions it, but gives no specifics on how to actually do it, nor can I find any at Malcolm Beattie's site. - Todd - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From ryan at dbedge.com Mon Mar 27 23:55:54 2000 From: ryan at dbedge.com (Ryan Erwin) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: regular expression difficulty, plus compiled perl References: <1654BC972546D31189DA00508B318AC80122F12D@charmander.wrq.com> Message-ID: <004e01bf987a$51ed4700$70cafdce@bsdbook> I'm not sure what you are doing with the line '($test1 = $0)=~ m#.*\\#'. It looks like you will just be proving that, yes m#.*\\# does in fact match $test1, but haven't affected the value of $test1 or $0... Try this: $test1 =~ s#.*\\##; # replace everything # before the last \ # with nothing... in your second line, it looks like you are stuffing something like 'd:\perl\' into $1, then replacing d:\perl\ with $1, which is basically doing nothing... To compile perl code on win32, you need to download the 'Activestate Perl Development Kit' from here: The PDK includes a program called PerlApp that will allow you to create both 'free standing' perl executables, as well as executables that depend on perl being installed. You must be running PerlApp on Windows NT (or maybe win2k) but not Win 9X to build perl executables. As a side note, i have not been able to create 'gui' perl executables even with the -gui switch for PDK used on a Win32::GUI script. Running 'editbin' on a program solved the problem... http://www.activestate.com/pdk/ if anything i have stated here is wrong, i apologize and once again declare excessive sleep deprivation 8-} good luck- Ryan Erwin ESPUG Emperor... I wonder when i will get tired of calling myself emperor... ----- Original Message ----- From: Todd Wells To: Sent: Monday, March 27, 2000 8:20 PM Subject: SPUG: regular expression difficulty, plus compiled perl > I'm using ActiveState Perl on NT4 and trying to set a variable to be equal > to the directory name that the script was ran in. > > So, I look at $0 which contains the name of the script I ran... in this case > "D:\PERL\COUNTP~1.PL" > > But when I try to strip the filename off the end, I can't seem to do it. > Try $test1 =~ s#.*\\##; > print "First: $0\n"; > ($test1 = $0)=~ m#.*\\#; > #$test1 =~ s/(.*\\)/$1/; # I tried this too, and it didn't work > either. > print "Second: $test1\n"; > > The output: > First: D:\PERL\COUNTP~1.PL > Second: D:\PERL\COUNTP~1.PL > > What's going on here? Is the .* just being _really_ greedy? I'm expecting > $test1 to be "D:\PERL\" > I know this is silly, but I can't figure out the problem here. > > BTW, someone at the last SPUG meeting mentioned they were playing around > with compiled Perl using ActiveState. I can't seem to find any specifics on > how to do this. Perlfaq3 mentions it, but gives no specifics on how to > actually do it, nor can I find any at Malcolm Beattie's site. > > - Todd - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From davec at icthus.net Tue Mar 28 00:51:14 2000 From: davec at icthus.net (David Corcoran) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: regular expression difficulty, plus compiled perl Message-ID: <200003280651.WAA08074@mail1.bigmailbox.com> Not the most elegant, but it works: print "First: $0\n"; split(/\\/,$0); pop @_; $test1 = join "\\",@_; print "Second: $test1\n"; >From: Todd Wells >To: "'spug-list@pm.org'" >Subject: SPUG: regular expression difficulty, plus compiled perl >Date: Mon, 27 Mar 2000 20:20:46 -0800 > >I'm using ActiveState Perl on NT4 and trying to set a variable to be equal >to the directory name that the script was ran in. > >So, I look at $0 which contains the name of the script I ran... in this case >"D:\PERL\COUNTP~1.PL" > >But when I try to strip the filename off the end, I can't seem to do it. > >print "First: $0\n"; >($test1 = $0)=~ m#.*\\#; >#$test1 =~ s/(.*\\)/$1/; # I tried this too, and it didn't work >either. >print "Second: $test1\n"; > >The output: >First: D:\PERL\COUNTP~1.PL >Second: D:\PERL\COUNTP~1.PL > >What's going on here? Is the .* just being _really_ greedy? I'm expecting >$test1 to be "D:\PERL\" >I know this is silly, but I can't figure out the problem here. > >BTW, someone at the last SPUG meeting mentioned they were playing around >with compiled Perl using ActiveState. I can't seem to find any specifics on >how to do this. Perlfaq3 mentions it, but gives no specifics on how to >actually do it, nor can I find any at Malcolm Beattie's site. > >- Todd > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe > Email to majordomo@pm.org: "action" spug-list your_address ------------------------------------------------------------ Get your FreeMail @ Icthus.Net - http://freemail.icthus.net - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From davec at icthus.net Tue Mar 28 01:03:32 2000 From: davec at icthus.net (David Corcoran) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: regular expression difficulty, plus compiled perl Message-ID: <200003280703.XAA09182@mail1.bigmailbox.com> >$test1 or $0... Try this: >$test1 =~ s#.*\\##; # replace everything > # before the last \ > # with nothing... > I think he wanted the path sans the file name: ($test1 = $0)=~ s#(.*)\\.*$#$1#; which is a combination of the two: >> ($test1 = $0)=~ m#.*\\#; >> #$test1 =~ s/(.*\\)/$1/; # I tried this too, and ------------------------------------------------------------ Get your FreeMail @ Icthus.Net - http://freemail.icthus.net - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From Vince.Skahan at pss.boeing.com Tue Mar 28 09:18:36 2000 From: Vince.Skahan at pss.boeing.com (Skahan, Vince) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: regular expression difficulty, plus compiled perl Message-ID: <71D105274EA7D011905700805FFECA590417967C@xch-sea-10.ca.boeing.com> I'd use dirname() rather than roll my own. Any reason why doing it the unix way doesn't suffice ? The following worked for me on my NT system using ActiveState perl build 522... #!perl # # see page 328 of the PerlCookbook # use File::Basename; $dir=dirname($0); print "I'm called $0\n"; print "I live in $dir\n"; When I save the script as c:\tmp\foo.pl and run it, it reports back output that looks like: I'm called C:\TMP\foo.pl I live in C:\TMP -- -------- Vince.Skahan@boeing.com ------ http://bcstec.ca.boeing.com/~vds/ ------------- Boeing Shared Services Group - Technical Services outside Boeing - http://www.halcyon.com/vince > ---------- > From: Todd Wells[SMTP:toddw@wrq.com] > Sent: Monday, March 27, 2000 8:20 PM > To: 'spug-list@pm.org' > Subject: SPUG: regular expression difficulty, plus compiled perl > > I'm using ActiveState Perl on NT4 and trying to set a variable to be equal > to the directory name that the script was ran in. > > So, I look at $0 which contains the name of the script I ran... in this case > "D:\PERL\COUNTP~1.PL" > > But when I try to strip the filename off the end, I can't seem to do it. > > print "First: $0\n"; > ($test1 = $0)=~ m#.*\\#; > #$test1 =~ s/(.*\\)/$1/; # I tried this too, and it didn't work > either. > print "Second: $test1\n"; > > The output: > First: D:\PERL\COUNTP~1.PL > Second: D:\PERL\COUNTP~1.PL > > What's going on here? Is the .* just being _really_ greedy? I'm expecting > $test1 to be "D:\PERL\" > I know this is silly, but I can't figure out the problem here. > > BTW, someone at the last SPUG meeting mentioned they were playing around > with compiled Perl using ActiveState. I can't seem to find any specifics on > how to do this. Perlfaq3 mentions it, but gives no specifics on how to > actually do it, nor can I find any at Malcolm Beattie's site. > > - Todd > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe > Email to majordomo@pm.org: "action" spug-list your_address > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From toddw at wrq.com Tue Mar 28 11:24:37 2000 From: toddw at wrq.com (Todd Wells) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: regular expression difficulty, plus compiled perl Message-ID: <1654BC972546D31189DA00508B318AC80122F12E@charmander.wrq.com> Yes, dirname() is what I was looking for, just overlooked it in the cookbook -- thank you! Thanks to the academy and everyone who contributed...oh wait, wrong speech. But I'm still interested to know how I would parse the same info out of a variable containing "c:\dir1\subdir1\subdir2\my.exe", basically how to trim the filename off the end. About the other solutions... SOLUTION 1: ================================= $test1 =~ s#.*\\##; # replace everything # before the last \ # with nothing... ================================= This is the exact opposite of what I wanted to do, if you test the code it actually ends up with $test1 = ""; SOLUTION 2: ================================= split(/\\/,$0); pop @_; $test1 = join "\\",@_; ================================= This assumes my path is only one directory deep, not going to work. -----Original Message----- From: Skahan, Vince [mailto:Vince.Skahan@pss.boeing.com] Sent: Tuesday, March 28, 2000 7:19 AM To: 'spug-list@pm.org'; 'Todd Wells' Subject: RE: SPUG: regular expression difficulty, plus compiled perl I'd use dirname() rather than roll my own. Any reason why doing it the unix way doesn't suffice ? The following worked for me on my NT system using ActiveState perl build 522... #!perl # # see page 328 of the PerlCookbook # use File::Basename; $dir=dirname($0); print "I'm called $0\n"; print "I live in $dir\n"; When I save the script as c:\tmp\foo.pl and run it, it reports back output that looks like: I'm called C:\TMP\foo.pl I live in C:\TMP -- -------- Vince.Skahan@boeing.com ------ http://bcstec.ca.boeing.com/~vds/ ------------- Boeing Shared Services Group - Technical Services outside Boeing - http://www.halcyon.com/vince > ---------- > From: Todd Wells[SMTP:toddw@wrq.com] > Sent: Monday, March 27, 2000 8:20 PM > To: 'spug-list@pm.org' > Subject: SPUG: regular expression difficulty, plus compiled perl > > I'm using ActiveState Perl on NT4 and trying to set a variable to be equal > to the directory name that the script was ran in. > > So, I look at $0 which contains the name of the script I ran... in this case > "D:\PERL\COUNTP~1.PL" > > But when I try to strip the filename off the end, I can't seem to do it. > > print "First: $0\n"; > ($test1 = $0)=~ m#.*\\#; > #$test1 =~ s/(.*\\)/$1/; # I tried this too, and it didn't work > either. > print "Second: $test1\n"; > > The output: > First: D:\PERL\COUNTP~1.PL > Second: D:\PERL\COUNTP~1.PL > > What's going on here? Is the .* just being _really_ greedy? I'm expecting > $test1 to be "D:\PERL\" > I know this is silly, but I can't figure out the problem here. > > BTW, someone at the last SPUG meeting mentioned they were playing around > with compiled Perl using ActiveState. I can't seem to find any specifics on > how to do this. Perlfaq3 mentions it, but gives no specifics on how to > actually do it, nor can I find any at Malcolm Beattie's site. > > - Todd > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe > Email to majordomo@pm.org: "action" spug-list your_address > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From trosmus at nwnexus.net Tue Mar 28 12:13:45 2000 From: trosmus at nwnexus.net (Tim Rosmus) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: regular expression difficulty, plus compiled perl In-Reply-To: Your message of "Tue, 28 Mar 2000 09:24:37 PST." <1654BC972546D31189DA00508B318AC80122F12E@charmander.wrq.com> Message-ID: <200003281813.KAA11795@beaker.nwnexus.com> |# But I'm still interested to know how I would parse the same info out of a |# variable containing "c:\dir1\subdir1\subdir2\my.exe", basically how to trim |# the filename off the end. |# |# About the other solutions... |# |# SOLUTION 1: |# ================================= |# $test1 =~ s#.*\\##; # replace everything |# # before the last \ |# # with nothing... |# ================================= |# This is the exact opposite of what I wanted to do, if you test the code it |# actually ends up with $test1 = ""; |# How about... $test1 =~ s#(.*)\\.*?$##; $1 should contain the path leading up to filename. -- Tim Rosmus Postmaster / USENET / DNS WinStar Northwest Nexus - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From chris at pws.net Tue Mar 28 12:20:59 2000 From: chris at pws.net (Christopher Wilkins) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: regular expression difficulty, plus compiled perl Message-ID: <4.3.1.0.20000328101910.00aab830@> Try this: print "\$0 = '$0'\n"; my ($dir) = ($0 =~ m#^(.*)(\\|/)#); print "dir = '$dir'\n"; The regular expression works for both *nix and windows ("\" vs "/"). By using the $0 variable, you are going to only get the full directory if the script was called with a full pathname. Chris At 09:24 AM 3/28/00 -0800, you wrote: >Yes, dirname() is what I was looking for, just overlooked it in the cookbook >-- thank you! > >Thanks to the academy and everyone who contributed...oh wait, wrong speech. > >But I'm still interested to know how I would parse the same info out of a >variable containing "c:\dir1\subdir1\subdir2\my.exe", basically how to trim >the filename off the end. > >About the other solutions... > >SOLUTION 1: >================================= >$test1 =~ s#.*\\##; # replace everything > # before the last \ > # with nothing... >================================= >This is the exact opposite of what I wanted to do, if you test the code it >actually ends up with $test1 = ""; > >SOLUTION 2: >================================= >split(/\\/,$0); >pop @_; >$test1 = join "\\",@_; >================================= >This assumes my path is only one directory deep, not going to work. > > > >-----Original Message----- >From: Skahan, Vince [mailto:Vince.Skahan@pss.boeing.com] >Sent: Tuesday, March 28, 2000 7:19 AM >To: 'spug-list@pm.org'; 'Todd Wells' >Subject: RE: SPUG: regular expression difficulty, plus compiled perl > > > > >I'd use dirname() rather than roll my own. Any reason why doing it the >unix way doesn't suffice ? > >The following worked for me on my NT system using ActiveState >perl build 522... > > #!perl > # > # see page 328 of the PerlCookbook > # > use File::Basename; > $dir=dirname($0); > print "I'm called $0\n"; > print "I live in $dir\n"; > >When I save the script as c:\tmp\foo.pl and run it, it reports back >output that looks like: > > I'm called C:\TMP\foo.pl > I live in C:\TMP > >-- >-------- Vince.Skahan@boeing.com ------ http://bcstec.ca.boeing.com/~vds/ >------------- > Boeing Shared Services Group - Technical Services > outside Boeing - http://www.halcyon.com/vince > > > > ---------- > > From: Todd Wells[SMTP:toddw@wrq.com] > > Sent: Monday, March 27, 2000 8:20 PM > > To: 'spug-list@pm.org' > > Subject: SPUG: regular expression difficulty, plus compiled perl > > > > I'm using ActiveState Perl on NT4 and trying to set a variable to be equal > > to the directory name that the script was ran in. > > > > So, I look at $0 which contains the name of the script I ran... in this >case > > "D:\PERL\COUNTP~1.PL" > > > > But when I try to strip the filename off the end, I can't seem to do it. > > > > print "First: $0\n"; > > ($test1 = $0)=~ m#.*\\#; > > #$test1 =~ s/(.*\\)/$1/; # I tried this too, and it didn't work > > either. > > print "Second: $test1\n"; > > > > The output: > > First: D:\PERL\COUNTP~1.PL > > Second: D:\PERL\COUNTP~1.PL > > > > What's going on here? Is the .* just being _really_ greedy? I'm >expecting > > $test1 to be "D:\PERL\" > > I know this is silly, but I can't figure out the problem here. > > > > BTW, someone at the last SPUG meeting mentioned they were playing around > > with compiled Perl using ActiveState. I can't seem to find any specifics >on > > how to do this. Perlfaq3 mentions it, but gives no specifics on how to > > actually do it, nor can I find any at Malcolm Beattie's site. > > > > - Todd > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe > > Email to majordomo@pm.org: "action" spug-list your_address > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe > Email to majordomo@pm.org: "action" spug-list your_address > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe > Email to majordomo@pm.org: "action" spug-list your_address - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From ryan at dbedge.com Tue Mar 28 13:19:42 2000 From: ryan at dbedge.com (Ryan Erwin) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: regular expression difficulty, plus compiled perl References: <1654BC972546D31189DA00508B318AC80122F12E@charmander.wrq.com> Message-ID: <001701bf98ea$92324340$498fc7cd@bsdbook> OK, OK, OK... I said that I was experiencing extreme sleep deprivation... When I read your post, I thought that you wanted to get just the file name, not the directory it was stored in... #!/usr/bin/perl -w my $test = 'c:\dir1\subdir1\subdir2\my.exe'; print "\$test == $test\n\n"; $test =~ s#.*\\##; print "\$test == $test\n\n"; which this will do quite nicely... if you just wanted the path, try using $1 and capturing parens... #!/usr/bin/perl -w my $test = 'c:\dir1\subdir1\subdir2\my.exe'; print "\$test == $test\n\n"; $test =~ m#(.*\\)#; print "\$1 == $1\n\n"; If you wanted to get just the path Enjoy 8-} Ryan Erwin ESPUG Emperor BTW: we are just 1 day away from the next ESPUG meeting where we will be discussing more Object Oriented Perl! Check out espug-site http://espug.pm.org for the details... ----- Original Message ----- From: Todd Wells To: 'Skahan, Vince' ; Sent: Tuesday, March 28, 2000 9:24 AM Subject: RE: SPUG: regular expression difficulty, plus compiled perl > Yes, dirname() is what I was looking for, just overlooked it in the cookbook > -- thank you! > > Thanks to the academy and everyone who contributed...oh wait, wrong speech. > > But I'm still interested to know how I would parse the same info out of a > variable containing "c:\dir1\subdir1\subdir2\my.exe", basically how to trim > the filename off the end. > > About the other solutions... > > SOLUTION 1: > ================================= > $test1 =~ s#.*\\##; # replace everything > # before the last \ > # with nothing... > ================================= > This is the exact opposite of what I wanted to do, if you test the code it > actually ends up with $test1 = ""; > > SOLUTION 2: > ================================= > split(/\\/,$0); > pop @_; > $test1 = join "\\",@_; > ================================= > This assumes my path is only one directory deep, not going to work. > > > > -----Original Message----- > From: Skahan, Vince [mailto:Vince.Skahan@pss.boeing.com] > Sent: Tuesday, March 28, 2000 7:19 AM > To: 'spug-list@pm.org'; 'Todd Wells' > Subject: RE: SPUG: regular expression difficulty, plus compiled perl > > > > > I'd use dirname() rather than roll my own. Any reason why doing it the > unix way doesn't suffice ? > > The following worked for me on my NT system using ActiveState > perl build 522... > > #!perl > # > # see page 328 of the PerlCookbook > # > use File::Basename; > $dir=dirname($0); > print "I'm called $0\n"; > print "I live in $dir\n"; > > When I save the script as c:\tmp\foo.pl and run it, it reports back > output that looks like: > > I'm called C:\TMP\foo.pl > I live in C:\TMP > > -- > -------- Vince.Skahan@boeing.com ------ http://bcstec.ca.boeing.com/~vds/ > ------------- > Boeing Shared Services Group - Technical Services > outside Boeing - http://www.halcyon.com/vince > > > > ---------- > > From: Todd Wells[SMTP:toddw@wrq.com] > > Sent: Monday, March 27, 2000 8:20 PM > > To: 'spug-list@pm.org' > > Subject: SPUG: regular expression difficulty, plus compiled perl > > > > I'm using ActiveState Perl on NT4 and trying to set a variable to be equal > > to the directory name that the script was ran in. > > > > So, I look at $0 which contains the name of the script I ran... in this > case > > "D:\PERL\COUNTP~1.PL" > > > > But when I try to strip the filename off the end, I can't seem to do it. > > > > print "First: $0\n"; > > ($test1 = $0)=~ m#.*\\#; > > #$test1 =~ s/(.*\\)/$1/; # I tried this too, and it didn't work > > either. > > print "Second: $test1\n"; > > > > The output: > > First: D:\PERL\COUNTP~1.PL > > Second: D:\PERL\COUNTP~1.PL > > > > What's going on here? Is the .* just being _really_ greedy? I'm > expecting > > $test1 to be "D:\PERL\" > > I know this is silly, but I can't figure out the problem here. > > > > BTW, someone at the last SPUG meeting mentioned they were playing around > > with compiled Perl using ActiveState. I can't seem to find any specifics > on > > how to do this. Perlfaq3 mentions it, but gives no specifics on how to > > actually do it, nor can I find any at Malcolm Beattie's site. > > > > - Todd > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe > > Email to majordomo@pm.org: "action" spug-list your_address > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe > Email to majordomo@pm.org: "action" spug-list your_address > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe > Email to majordomo@pm.org: "action" spug-list your_address > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From toddw at wrq.com Tue Mar 28 13:27:55 2000 From: toddw at wrq.com (Todd Wells) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: regular expression difficulty, plus compiled perl Message-ID: <1654BC972546D31189DA00508B318AC80122F13B@charmander.wrq.com> Thanks again too all of you who've offered solutions... So Ryan, it would appear that the difference here is the parentheses inside the regular expression? Why do the parentheses make it work? I must confess some puzzlement over this. My original that didn't work: ($test1 = $0)=~ m#.*\\#; Yours that does work: $test =~ m#(.*\\)#;. -----Original Message----- From: Ryan Erwin [mailto:ryan@dbedge.com] Sent: Tuesday, March 28, 2000 11:20 AM To: Todd Wells; spug-list@pm.org Subject: Re: SPUG: regular expression difficulty, plus compiled perl OK, OK, OK... I said that I was experiencing extreme sleep deprivation... When I read your post, I thought that you wanted to get just the file name, not the directory it was stored in... #!/usr/bin/perl -w my $test = 'c:\dir1\subdir1\subdir2\my.exe'; print "\$test == $test\n\n"; $test =~ s#.*\\##; print "\$test == $test\n\n"; which this will do quite nicely... if you just wanted the path, try using $1 and capturing parens... #!/usr/bin/perl -w my $test = 'c:\dir1\subdir1\subdir2\my.exe'; print "\$test == $test\n\n"; $test =~ m#(.*\\)#; print "\$1 == $1\n\n"; If you wanted to get just the path Enjoy 8-} Ryan Erwin ESPUG Emperor BTW: we are just 1 day away from the next ESPUG meeting where we will be discussing more Object Oriented Perl! Check out espug-site http://espug.pm.org for the details... ----- Original Message ----- From: Todd Wells To: 'Skahan, Vince' ; Sent: Tuesday, March 28, 2000 9:24 AM Subject: RE: SPUG: regular expression difficulty, plus compiled perl > Yes, dirname() is what I was looking for, just overlooked it in the cookbook > -- thank you! > > Thanks to the academy and everyone who contributed...oh wait, wrong speech. > > But I'm still interested to know how I would parse the same info out of a > variable containing "c:\dir1\subdir1\subdir2\my.exe", basically how to trim > the filename off the end. > > About the other solutions... > > SOLUTION 1: > ================================= > $test1 =~ s#.*\\##; # replace everything > # before the last \ > # with nothing... > ================================= > This is the exact opposite of what I wanted to do, if you test the code it > actually ends up with $test1 = ""; > > SOLUTION 2: > ================================= > split(/\\/,$0); > pop @_; > $test1 = join "\\",@_; > ================================= > This assumes my path is only one directory deep, not going to work. > > > > -----Original Message----- > From: Skahan, Vince [mailto:Vince.Skahan@pss.boeing.com] > Sent: Tuesday, March 28, 2000 7:19 AM > To: 'spug-list@pm.org'; 'Todd Wells' > Subject: RE: SPUG: regular expression difficulty, plus compiled perl > > > > > I'd use dirname() rather than roll my own. Any reason why doing it the > unix way doesn't suffice ? > > The following worked for me on my NT system using ActiveState > perl build 522... > > #!perl > # > # see page 328 of the PerlCookbook > # > use File::Basename; > $dir=dirname($0); > print "I'm called $0\n"; > print "I live in $dir\n"; > > When I save the script as c:\tmp\foo.pl and run it, it reports back > output that looks like: > > I'm called C:\TMP\foo.pl > I live in C:\TMP > > -- > -------- Vince.Skahan@boeing.com ------ http://bcstec.ca.boeing.com/~vds/ > ------------- > Boeing Shared Services Group - Technical Services > outside Boeing - http://www.halcyon.com/vince > > > > ---------- > > From: Todd Wells[SMTP:toddw@wrq.com] > > Sent: Monday, March 27, 2000 8:20 PM > > To: 'spug-list@pm.org' > > Subject: SPUG: regular expression difficulty, plus compiled perl > > > > I'm using ActiveState Perl on NT4 and trying to set a variable to be equal > > to the directory name that the script was ran in. > > > > So, I look at $0 which contains the name of the script I ran... in this > case > > "D:\PERL\COUNTP~1.PL" > > > > But when I try to strip the filename off the end, I can't seem to do it. > > > > print "First: $0\n"; > > ($test1 = $0)=~ m#.*\\#; > > #$test1 =~ s/(.*\\)/$1/; # I tried this too, and it didn't work > > either. > > print "Second: $test1\n"; > > > > The output: > > First: D:\PERL\COUNTP~1.PL > > Second: D:\PERL\COUNTP~1.PL > > > > What's going on here? Is the .* just being _really_ greedy? I'm > expecting > > $test1 to be "D:\PERL\" > > I know this is silly, but I can't figure out the problem here. > > > > BTW, someone at the last SPUG meeting mentioned they were playing around > > with compiled Perl using ActiveState. I can't seem to find any specifics > on > > how to do this. Perlfaq3 mentions it, but gives no specifics on how to > > actually do it, nor can I find any at Malcolm Beattie's site. > > > > - Todd > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe > > Email to majordomo@pm.org: "action" spug-list your_address > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe > Email to majordomo@pm.org: "action" spug-list your_address > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe > Email to majordomo@pm.org: "action" spug-list your_address > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From scott at sabmail.rresearch.com Tue Mar 28 13:39:52 2000 From: scott at sabmail.rresearch.com (Scott Blachowicz) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: regular expression difficulty, plus compiled perl In-Reply-To: <1654BC972546D31189DA00508B318AC80122F13B@charmander.wrq.com>; from toddw@wrq.com on Tue, Mar 28, 2000 at 11:27:55AM -0800 References: <1654BC972546D31189DA00508B318AC80122F13B@charmander.wrq.com> Message-ID: <20000328113952.A57210@sabami.seaslug.org> On Tue, Mar 28, 2000 at 11:27:55AM -0800, Todd Wells wrote: > Thanks again too all of you who've offered solutions... > > So Ryan, it would appear that the difference here is the parentheses inside > the regular expression? Why do the parentheses make it work? I must > confess some puzzlement over this. > > My original that didn't work: > ($test1 = $0)=~ m#.*\\#; What you're saying there is to assign $0 to the variable $test1, then test to see if it has a backslash in it. > Yours that does work: > $test =~ m#(.*\\)#;. The parens actually capture part of the matching string. To get at the captured substrings, use $N (where N is a number corresponding to the order of appearance of the open paren in the pattern). Also, the return value of that matching expression (in a list context) will be the list of matching subexpressions. So, for example, $test = 'c:\\foo\\bar\\baz.cpp'; ($WholePath, $DirWithSlash, $Dir, $Base) = ($test =~ m#(((.*)\\)(.*))#); print "$WholePath = $1\n"; print "$DirWithSlash = $2\n"; print "$Dir = $3\n"; print "$Base = $4\n"; prints out this: c:\foo\bar\baz.cpp = c:\foo\bar\baz.cpp c:\foo\bar\ = c:\foo\bar\ c:\foo\bar = c:\foo\bar baz.cpp = baz.cpp Scott - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From scott at sabmail.rresearch.com Tue Mar 28 13:51:01 2000 From: scott at sabmail.rresearch.com (Scott Blachowicz) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: regular expression difficulty, plus compiled perl In-Reply-To: <20000328113952.A57210@sabami.seaslug.org>; from scott@sabmail.rresearch.com on Tue, Mar 28, 2000 at 11:39:52AM -0800 References: <1654BC972546D31189DA00508B318AC80122F13B@charmander.wrq.com> <20000328113952.A57210@sabami.seaslug.org> Message-ID: <20000328115101.A57425@sabami.seaslug.org> On Tue, Mar 28, 2000 at 11:39:52AM -0800, Scott Blachowicz wrote: > > Yours that does work: > > $test =~ m#(.*\\)#;. > > The parens actually capture part of the matching string. And another way to accomplish the same thing is to use the substitution operator: ($test = $0) =~ s#(.*\\).*#$1#; which assigns $0 to the variable $test, then does a 's' command on it effectively getting rid of the part after the first backslash. If there's no backslash, then the match pattern doesn't, so no substitution is made. Since you're going after the the dir name, that's not good, so maybe something like this would do it: ($test = $0) =~ s#(.*\\).*#$1#; $test = "." if $0 !~ /\\/; to set it to "." (the current dir) if there are no backslashes in $0. Scott - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From toddw at wrq.com Tue Mar 28 14:02:20 2000 From: toddw at wrq.com (Todd Wells) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: regular expression difficulty, plus compiled perl Message-ID: <1654BC972546D31189DA00508B318AC80122F13F@charmander.wrq.com> Aha! I previously understood all of this (yes I know about $1, $2, etc...) except for the part about "the return value of that matching expression (in a list context) will be the list of matching subexpressions" -- now I see the light! I was expecting the return value of the matching expression to be the matching expression! -----Original Message----- From: Scott Blachowicz [mailto:scott@sabmail.rresearch.com] Sent: Tuesday, March 28, 2000 11:40 AM To: Todd Wells Cc: 'Ryan Erwin'; spug-list@pm.org Subject: Re: SPUG: regular expression difficulty, plus compiled perl On Tue, Mar 28, 2000 at 11:27:55AM -0800, Todd Wells wrote: > Thanks again too all of you who've offered solutions... > > So Ryan, it would appear that the difference here is the parentheses inside > the regular expression? Why do the parentheses make it work? I must > confess some puzzlement over this. > > My original that didn't work: > ($test1 = $0)=~ m#.*\\#; What you're saying there is to assign $0 to the variable $test1, then test to see if it has a backslash in it. > Yours that does work: > $test =~ m#(.*\\)#;. The parens actually capture part of the matching string. To get at the captured substrings, use $N (where N is a number corresponding to the order of appearance of the open paren in the pattern). Also, the return value of that matching expression (in a list context) will be the list of matching subexpressions. So, for example, $test = 'c:\\foo\\bar\\baz.cpp'; ($WholePath, $DirWithSlash, $Dir, $Base) = ($test =~ m#(((.*)\\)(.*))#); print "$WholePath = $1\n"; print "$DirWithSlash = $2\n"; print "$Dir = $3\n"; print "$Base = $4\n"; prints out this: c:\foo\bar\baz.cpp = c:\foo\bar\baz.cpp c:\foo\bar\ = c:\foo\bar\ c:\foo\bar = c:\foo\bar baz.cpp = baz.cpp Scott - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From ChrisM at courtlink.com Tue Mar 28 14:19:15 2000 From: ChrisM at courtlink.com (Christopher Maujean) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: regular expression difficulty, plus compiled perl Message-ID: <01AC88DAEF3FD311A89800500482730064FD9F@hqmsx01.internal.courtlink.com> I know File::Basename was mentioned before, but you can use it to get all of the information you might ever need: #!perl use strict; # ALWAYS ALWAYS ALWAYS! # imports the dirname, basename, fileparse_set_fstype, and fileparse subs use File::Basename; # the full path we want to parse my $fullpath = 'c:\windows\system\deletebillg.exe'; my ($name,$path,$suffix) = fileparse($fullpath,'.*'); # $name = 'deletebillg' # $path = 'c:\windows\system\' # $suffix = '.exe' __END__ =pod from ActivePerl Help on File::Basename: fileparse The fileparse() routine divides a file specification into three parts: a leading path, a file name, and a suffix. The path contains everything up to and including the last directory separator in the input file specification. The remainder of the input file specification is then divided into name and suffix based on the optional patterns you specify in @suffixlist. Each element of this list is interpreted as a regular expression, and is matched against the end of name. If this succeeds, the matching portion of name is removed and prepended to suffix. By proper use of @suffixlist, you can remove file types or versions for examination. You are guaranteed that if you concatenate path, name, and suffix together in that order, the result will denote the same file as the input file specification. =cut -----Original Message----- From: Ryan Erwin [mailto:ryan@dbedge.com] Sent: Tuesday, March 28, 2000 11:20 AM To: Todd Wells; spug-list@pm.org Subject: Re: SPUG: regular expression difficulty, plus compiled perl OK, OK, OK... I said that I was experiencing extreme sleep deprivation... When I read your post, I thought that you wanted to get just the file name, not the directory it was stored in... #!/usr/bin/perl -w my $test = 'c:\dir1\subdir1\subdir2\my.exe'; print "\$test == $test\n\n"; $test =~ s#.*\\##; print "\$test == $test\n\n"; which this will do quite nicely... if you just wanted the path, try using $1 and capturing parens... #!/usr/bin/perl -w my $test = 'c:\dir1\subdir1\subdir2\my.exe'; print "\$test == $test\n\n"; $test =~ m#(.*\\)#; print "\$1 == $1\n\n"; If you wanted to get just the path Enjoy 8-} Ryan Erwin ESPUG Emperor BTW: we are just 1 day away from the next ESPUG meeting where we will be discussing more Object Oriented Perl! Check out espug-site http://espug.pm.org for the details... ----- Original Message ----- From: Todd Wells To: 'Skahan, Vince' ; Sent: Tuesday, March 28, 2000 9:24 AM Subject: RE: SPUG: regular expression difficulty, plus compiled perl > Yes, dirname() is what I was looking for, just overlooked it in the cookbook > -- thank you! > > Thanks to the academy and everyone who contributed...oh wait, wrong speech. > > But I'm still interested to know how I would parse the same info out of a > variable containing "c:\dir1\subdir1\subdir2\my.exe", basically how to trim > the filename off the end. > > About the other solutions... > > SOLUTION 1: > ================================= > $test1 =~ s#.*\\##; # replace everything > # before the last \ > # with nothing... > ================================= > This is the exact opposite of what I wanted to do, if you test the code it > actually ends up with $test1 = ""; > > SOLUTION 2: > ================================= > split(/\\/,$0); > pop @_; > $test1 = join "\\",@_; > ================================= > This assumes my path is only one directory deep, not going to work. > > > > -----Original Message----- > From: Skahan, Vince [mailto:Vince.Skahan@pss.boeing.com] > Sent: Tuesday, March 28, 2000 7:19 AM > To: 'spug-list@pm.org'; 'Todd Wells' > Subject: RE: SPUG: regular expression difficulty, plus compiled perl > > > > > I'd use dirname() rather than roll my own. Any reason why doing it the > unix way doesn't suffice ? > > The following worked for me on my NT system using ActiveState > perl build 522... > > #!perl > # > # see page 328 of the PerlCookbook > # > use File::Basename; > $dir=dirname($0); > print "I'm called $0\n"; > print "I live in $dir\n"; > > When I save the script as c:\tmp\foo.pl and run it, it reports back > output that looks like: > > I'm called C:\TMP\foo.pl > I live in C:\TMP > > -- > -------- Vince.Skahan@boeing.com ------ http://bcstec.ca.boeing.com/~vds/ > ------------- > Boeing Shared Services Group - Technical Services > outside Boeing - http://www.halcyon.com/vince > > > > ---------- > > From: Todd Wells[SMTP:toddw@wrq.com] > > Sent: Monday, March 27, 2000 8:20 PM > > To: 'spug-list@pm.org' > > Subject: SPUG: regular expression difficulty, plus compiled perl > > > > I'm using ActiveState Perl on NT4 and trying to set a variable to be equal > > to the directory name that the script was ran in. > > > > So, I look at $0 which contains the name of the script I ran... in this > case > > "D:\PERL\COUNTP~1.PL" > > > > But when I try to strip the filename off the end, I can't seem to do it. > > > > print "First: $0\n"; > > ($test1 = $0)=~ m#.*\\#; > > #$test1 =~ s/(.*\\)/$1/; # I tried this too, and it didn't work > > either. > > print "Second: $test1\n"; > > > > The output: > > First: D:\PERL\COUNTP~1.PL > > Second: D:\PERL\COUNTP~1.PL > > > > What's going on here? Is the .* just being _really_ greedy? I'm > expecting > > $test1 to be "D:\PERL\" > > I know this is silly, but I can't figure out the problem here. > > > > BTW, someone at the last SPUG meeting mentioned they were playing around > > with compiled Perl using ActiveState. I can't seem to find any specifics > on > > how to do this. Perlfaq3 mentions it, but gives no specifics on how to > > actually do it, nor can I find any at Malcolm Beattie's site. > > > > - Todd > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe > > Email to majordomo@pm.org: "action" spug-list your_address > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe > Email to majordomo@pm.org: "action" spug-list your_address > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe > Email to majordomo@pm.org: "action" spug-list your_address > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From Richard.Anderson at seaslug.org Tue Mar 28 14:31:52 2000 From: Richard.Anderson at seaslug.org (Richard Anderson) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: "Too late for -T option" message? References: <1654BC972546D31189DA00508B318AC80122F12E@charmander.wrq.com> Message-ID: <00fe01bf98f4$aaac6450$2a88ddd1@adcom133> When I run perl -c on this simple example CGI.pm program, I get: Too late for "-T" option at cgipm_test.pl line 1. What does this mean and what should I do to make the interpreter happy? Program and output from perl -V follow: Program: #! /usr/local/bin/perl -Tw use strict; use CGI qw(:standard); print header; print start_html('A Simple Example'), h1('A Simple Example'), start_form, "What's your name? ",textfield('name'), p, "What's the combination?", p, checkbox_group(-name=>'words', -values=>['eenie','meenie','minie','moe'], -defaults=>['eenie','minie']), p, "What's your favorite color? ", popup_menu(-name=>'color', -values=>['red','green','blue','chartreuse']), p, submit, end_form, hr; if (param()) { print "Your name is",em(param('name')), p, "The keywords are: ",em(join(", ",param('words'))), p, "Your favorite color is ",em(param('color')), hr; } print end_html; Output from perl -V Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration: Platform: osname=linux, osvers=2.2.1-ac1, archname=i386-linux uname='linux porky.devel.redhat.com 2.2.1-ac1 #1 smp mon feb 1 17:44:44 est 1999 i686 unknown ' hint=recommended, useposix=true, d_sigaction=define usethreads=undef useperlio=undef d_sfio=undef Compiler: cc='cc', optimize='-O2', gccversion=egcs-2.91.66 19990314/Linux (egcs-1.1.2 release) cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include' ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include' stdchar='char', d_stdstdio=undef, usevfork=false intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 alignbytes=4, usemymalloc=n, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt libc=, so=so, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Built under linux Compiled at Apr 6 1999 23:34:07 @INC: /usr/lib/perl5/5.00503/i386-linux /usr/lib/perl5/5.00503 /usr/lib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/site_perl/5.005 . Richard.Anderson@seaslug.org www.zipcon.net/~starfire/home (personal) www.raycosoft.com (corporate) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From ced at carios2.ca.boeing.com Tue Mar 28 14:46:45 2000 From: ced at carios2.ca.boeing.com (Charles DeRykus) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: "Too late for -T option" message? Message-ID: <200003282046.MAA25257@carios2.ca.boeing.com> > When I run perl -c on this simple example CGI.pm program, I get: > > Too late for "-T" option at cgipm_test.pl line 1. > What does this mean and what should I do to make the interpreter happy? perl -Mdiagnostics -c cgipm_test.pl knows all, tells all... :) Rgds, -- Charles DeRykus - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From asherr at cs.unm.edu Tue Mar 28 16:49:27 2000 From: asherr at cs.unm.edu (Aryeh "Cody" Sherr) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: "Too late for -T option" message? In-Reply-To: <00fe01bf98f4$aaac6450$2a88ddd1@adcom133> Message-ID: -T is enabling taint mode, perl's excellent facility for keeping track of which data is coming into your program from your environment, which is described as "tainted". Because things can be specified in the command line, to be completely safe -T must be the first option specified. Try #!/usr/bin/perl -T -w rather than #!/usr/bin/perl -w -T Have fun. The perlsec man page has lots more info. cody On Tue, 28 Mar 2000, Richard Anderson wrote: >When I run perl -c on this simple example CGI.pm program, I get: > >Too late for "-T" option at cgipm_test.pl line 1. > >What does this mean and what should I do to make the interpreter happy? > >Program and output from perl -V follow: > >Program: >#! /usr/local/bin/perl -Tw > >use strict; >use CGI qw(:standard); > >print header; >print start_html('A Simple Example'), > h1('A Simple Example'), > start_form, > "What's your name? ",textfield('name'), > p, > "What's the combination?", > p, > checkbox_group(-name=>'words', > -values=>['eenie','meenie','minie','moe'], > -defaults=>['eenie','minie']), > p, > "What's your favorite color? ", > popup_menu(-name=>'color', > -values=>['red','green','blue','chartreuse']), > p, > submit, > end_form, > hr; > >if (param()) { > print > "Your name is",em(param('name')), > p, > "The keywords are: ",em(join(", ",param('words'))), > p, > "Your favorite color is ",em(param('color')), > hr; >} >print end_html; > >Output from perl -V >Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration: > Platform: > osname=linux, osvers=2.2.1-ac1, archname=i386-linux > uname='linux porky.devel.redhat.com 2.2.1-ac1 #1 smp mon feb 1 17:44:44 >est >1999 i686 unknown ' > hint=recommended, useposix=true, d_sigaction=define > usethreads=undef useperlio=undef d_sfio=undef > Compiler: > cc='cc', optimize='-O2', gccversion=egcs-2.91.66 19990314/Linux >(egcs-1.1.2 >release) > cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include' > ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include' > stdchar='char', d_stdstdio=undef, usevfork=false > intsize=4, longsize=4, ptrsize=4, doublesize=8 > d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 > alignbytes=4, usemymalloc=n, prototype=define > Linker and Libraries: > ld='cc', ldflags =' -L/usr/local/lib' > libpth=/usr/local/lib /lib /usr/lib > libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt > libc=, so=so, useshrplib=false, libperl=libperl.a > Dynamic Linking: > dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' > cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' > > >Characteristics of this binary (from libperl): > Built under linux > Compiled at Apr 6 1999 23:34:07 > @INC: > /usr/lib/perl5/5.00503/i386-linux > /usr/lib/perl5/5.00503 > /usr/lib/perl5/site_perl/5.005/i386-linux > /usr/lib/perl5/site_perl/5.005 > . >Richard.Anderson@seaslug.org >www.zipcon.net/~starfire/home (personal) >www.raycosoft.com (corporate) > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe > Email to majordomo@pm.org: "action" spug-list your_address > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From jimfl at colltech.com Tue Mar 28 17:22:54 2000 From: jimfl at colltech.com (jimfl) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: "Too late for -T option" message? In-Reply-To: <00fe01bf98f4$aaac6450$2a88ddd1@adcom133> Message-ID: <232381.3163245774@erdos.nwest.attws.com> --Quoth Richard Anderson On Tuesday, March 28, 2000 12:31 PM -0800: > Too late for "-T" option at cgipm_test.pl line 1. This means that you have to execute the script directly (instead of running 'perl -c script' to get the benefit of the taint checking that is forced by the -T switch on the #! line. It's not an horrible error since you are only checking the syntax. -- Jim Flanagan Collective Technologies jimfl@colltech.com http://www.colltech.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From ryan at dbedge.com Tue Mar 28 18:00:41 2000 From: ryan at dbedge.com (Ryan Erwin) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: ESPUG Meeting Wed. 7:00 pm @ Lucent Message-ID: <002901bf9911$d2df3340$498fc7cd@bsdbook> Greetings all SPUGers- For the last few days I have been burying references to the upcoming ESPUG meetings in spug-list posts, but I would like to take a minute and remind all of you that there will be an ESPUG meeting this Wednesday night at 7:00 pm. The topic of the ESPUG meeting will be a continuation of Robert Abarbanel's Object Oriented Perl presentation. Bob is the manager of the Advanced Design Systems group in the Computer Science section of Boeing's Phantom Works as well as the lead instructor and developer of the UW Outreach Perl Certificate Program Bob will be focusing on Pseudo Hashes and Polymorphism covered in Chapters 3 and 7 of Damian Conway's excellent book 'Object Oriented Perl'. You can view Robert's bio and Directions to Lucent in Redmond as well as other details at the espug website: http://espug.pm.org If you have any questions about the upcoming ESPUG meeting please contact me directly ryan@dbedge.com Hope to see you all there! Ryan Erwin ESPUG Emperor - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From torin at daft.com Wed Mar 29 06:26:15 2000 From: torin at daft.com (Darren/Torin/Who Ever...) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: regular expression difficulty, plus compiled perl In-Reply-To: Todd Wells's message of "Tue, 28 Mar 2000 09:24:37 -0800" References: <1654BC972546D31189DA00508B318AC80122F12E@charmander.wrq.com> Message-ID: <87bt3yhsig.fsf@perv.daft.com> Todd Wells, in an immanent manifestation of deity, wrote: >Yes, dirname() is what I was looking for, just overlooked it in the cookbook >-- thank you! Note that this is another rather useful module for specifically the purpose of finding the directory script was run in: FindBin.pm. This helps in case you type SUBDIR\FOO.PL instead of C:\MYPATH\SUBDIR\FOO.PL. Darren -- Darren Stalder/2608 Second Ave, @282/Seattle, WA 98121-1212/USA/+1-800-921-4996 @ Sysadmin, webweaver, postmaster for hire. C/Perl/CGI/Pilot programmer/tutor @ @ Make a little hot-tub in your soul. @ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From jdevlin at stadiumdistrict.com Wed Mar 29 21:26:48 2000 From: jdevlin at stadiumdistrict.com (Joe Devlin) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: Pod Message-ID: <01BF99B4.E9C618A0@tac-lx100-ip11.nwnexus.net> How to get Pod to return the defined documentation. Here's the first part of my code # * # # * # # * # # * # # * # # * # # * # # * # # * # # Initialize some modules in my program named t.pl use lib qw(/usr/lib/perl5/5.00503/Pod );# Pod path at myProvider use Functions; #Pod module use Html; #Pod module use Text; #Pod module use CGI qw(:all); use CGI param; use English; use strict; #must declare global variables use lib; use vars qw($stuff); =pod =head1 Mainline =cut #etc # * # # * # # * # # * # # * # # * # # * # # * # # * # On the command line I issued the command: pod2text t.pl and it appears to do nothing. I expect it to return the word "Mainline" on STDOUT I tried looking for the manual too: [cgi-bin]$ man pod2text No manual entry for pod2text - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From trance at drizzle.com Thu Mar 30 01:14:09 2000 From: trance at drizzle.com (Christopher & Shalah) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: Pod In-Reply-To: <01BF99B4.E9C618A0@tac-lx100-ip11.nwnexus.net> Message-ID: <000001bf9a17$8c4dd6a0$43c1a2d8@aghnaught> What you want is: =pod =head1 Mainline =cut There must be a blank line after most pod directives. --Christopher Joe Said: ----------- How to get Pod to return the defined documentation. Here's the first part of my code =pod =head1 Mainline =cut - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From andy at n2h2.com Thu Mar 30 01:42:28 2000 From: andy at n2h2.com (Andrew Sweger) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: Pod In-Reply-To: <01BF99B4.E9C618A0@tac-lx100-ip11.nwnexus.net> Message-ID: On Mar 29, 2000 @ 7:26pm, Joe Devlin wrote: > I tried looking for the manual too: > [cgi-bin]$ man pod2text > No manual entry for pod2text Try: $ perldoc perlpod See also: http://users.n2h2.com/~andy/spugtalk/ -- Andrew Sweger | N2H2, Incorporated Systems Architect | 900 Fourth Avenue, Suite 3400 Advanced Technologies Division | Seattle WA 98164-1059 v=206.336.2947 f=206.336.1541 | http://www.n2h2.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From byoung at speakeasy.org Thu Mar 30 03:48:31 2000 From: byoung at speakeasy.org (Bradley E. Young) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: Compiling Mail::Cclient Message-ID: All, I'm having difficulty building Mail:Cclient under perl 5.6. The following is a snippet from the effluvium spewed forth: Cclient.xs: In function `str_to_sv': Cclient.xs:67: `sv_undef' undeclared (first use this function) Cclient.xs:67: (Each undeclared identifier is reported only once Cclient.xs:67: for each function it appears in.) Cclient.xs: In function `make_body': Cclient.xs:293: `sv_undef' undeclared (first use this function) Cclient.c: In function `XS_Mail__Cclient_open': Cclient.c:615: `sv_undef' undeclared (first use this function) Cclient.xs:600: `na' undeclared (first use this function) I suspect that this isn't really even related to the module being compiled; I think that I'm missing something in the CFLAGS: cc -c -I../imap-4.7a/c-client -I/usr/local/include -D_LARGEFILE_SOURCE -D_FI LE_OFFSET_BITS=64 -O2 -DVERSION=\"0.5\" -DXS_VERSION=\"0.5\" -fpic -I/us r/local/lib/perl5/5.6.0/i686-linux/CORE Cclient.c Any input would be greatly appreciated. Brad - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From ryan at dbedge.com Thu Mar 30 04:07:04 2000 From: ryan at dbedge.com (Ryan Erwin) Date: Wed Aug 4 00:07:12 2004 Subject: ESPUG::Meeting::Summary... Message-ID: <004701bf9a2f$b4b403e0$0d92bfce@bsdbook> Just wanted to let everyone know that we just had another great ESPUG meeting and give a report to those who were unable to attend. Robert Abarbanel with Boeing's Phantom Works and the University of Washington continued his excellent presentation of Object Oriented Perl. We started with a brief review about basic object oriented concepts. The 3 little rules: 1) To create a class, build an object 2) To create a method, write a subroutine 3) To create an object, bless a referent We had a brief discussion about closures vs.. "module variables". The majority conclusion was that "by default, make your code as restrictive as possible. loosen it up later if you need to" Hashes make good objects, but: -expensive -slower -autovivify (automatically created when used) Arrays make good objects, but: -still autovivify -no 'named' attributes Constant.pm will take care of the named attributes in an array. Constant creates a simple function that the compiler will optimize and replace with a value. To use constant, try: #!/usr/bin/perl -w use strict; use constant NAME => 0; use constant STAR => 1; use constant ASIN => 2; use constant RELEASE_DATE => 3; use constant RATING => 4; use constant TIMES_I_SAW => 5; my @DVDs; @DVDs[ NAME, STAR, ASIN, RELEASE_DATE, RATING, TIMES_I_SAW ] = 'Fight Club', 'Pitt, Norton', 'B00003W8NM', 'April 25th 2000', '4 Stars', '7 in Theatre'); print $DVDs[NAME], "\t", $DVDs[TIMES_I_SAW], "\n"; Then, there are Pseudo Hashes. Pseudo Hashes were introduced in Perl 5.005. A Pseudo Hash is an *array* with a first element that is a reference to a *hash*. A Pseudo Hash is really just an array reference pretending to be a hash reference. my $pseudo_hash = [ { a=>1, b=>2, c=>3}, "val1", "val2", "val3" ]; print $pseudo_hash->[1]; # returns 'val1' print $pseudo_hash->{"a"}; # returns 'val1' Whenever perl encounters an array reference being used as a hash reference in this way, it translates the expression to something equivalent to the following: $pseudo_hash->[$pseudo_hash->[0]->{"a"}]; fortunately, fields.pm comes to the rescue to give us the best of both worlds while avoiding autovivification. package DVD use strict; use fields qw{ name star rating }; this: -informs the perl compiler that name, star, and rating are the only valid hash keys for DVD objects and throws an exception at compile time if you access any other key -creates %DVD::Fields and initializes it to (name=>1, star=>2, rating=>3) or some other combination. -causes the perl compiler to replace any access of the form $DVD_ref->{name} with the direct access $DVD_ref->[1]. Likewise $DVD_ref->{star} to $DVD_ref->[2] and $DVD_ref->{rating} to $DVD_ref->[3]. Typed Lexicals: Also starting in Perl 5.005, an extension to the lexical variable declaration was added. You can use: my ClassName $variable_name; my ClassName ($var_name1, $var_name2, $var_name3); Just add the name of the class you are using after the 'my'. The ClassName must be one that perl knows about at the point you use it in the program. The package must first appear *before* you use the construct. The typed lexical construct tells perl that the variable is *supposed* to be used to refer to pseudo-hash-based objects of the specified class. The compiler looks for access like $d->{name}, $d->{star}, or $d->{rating}. When the compiler finds such an access, it verifies that the key exists in %FIELDS package hash for the same class. If the field doesn't exist, you get a 'No Such Field Exception'. Compile time optimization only occurs if you use the "typed" my syntax. If you leave out the class name, the code still works but isn't optimized and field name checking will only happen at run-time. Other Blessings... You can bless Scalars, Subroutines, Regular Expressions and even Typeglobs. Scalars can actually make quite useful objects, especially when used with the 'flyweight pattern' where the scalar is passed around by value. A few final notes: SUPER:: is the parent of your object. Ever tried to use 'vec'? If you are interested in presenting something at our next ESPUG meeting, or would be interested in hearing about a particular topic, please contact me ryan@dbedge.com --- Ryan Erwin ESPUG Emperor BTW: don't talk about fight club 8-} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From byoung at speakeasy.org Thu Mar 30 05:12:15 2000 From: byoung at speakeasy.org (Bradley E. Young) Date: Wed Aug 4 00:07:12 2004 Subject: SPUG: Compiling Mail::Cclient In-Reply-To: Message-ID: I figured it out, and I'm going to submit a patch to the author. Apparently sv_undef is supposed to be PL_sv_undef. Ditto with na/PL_na. Hrmph. Brad > -----Original Message----- > From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org]On Behalf Of > Bradley E. Young > Sent: Thursday, March 30, 2000 1:49 AM > To: Spug List > Subject: SPUG: Compiling Mail::Cclient > > > All, > > I'm having difficulty building Mail:Cclient under perl 5.6. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address From ryan at dbedge.com Thu Mar 30 17:46:46 2000 From: ryan at dbedge.com (Ryan Erwin) Date: Wed Aug 4 00:07:12 2004 Subject: ESPUG::Lost+Found... Message-ID: <01e101bf9aa2$39d05fc0$0d92bfce@bsdbook> A person by the name of 'Patricia Bronger' left her purse at our espug meeting last night. Could you help us locate her. If you can contact Patricia please have her call Lucent Technologies at (425) 558-8008. Thank You- Ryan Erwin ESPUG Emperor - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe Email to majordomo@pm.org: "action" spug-list your_address