From danielj at cheshirecat.net Fri Dec 1 00:05:25 2000 From: danielj at cheshirecat.net (Daniel Jacobs) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: scanning directories In-Reply-To: <27870000.975649022@flashingchance.whistlingfish.net> Message-ID: Doh! Sorry, it was late and I was thinking Windows & backslashes. Brain fart. On Thu, 30 Nov 2000, Matt Tucker wrote: > -- Daniel Jacobs spake thusly: > > > Do you possibly need to escape the '/' characters? i.e. > > > > $portal{BASEDIR} = "\/\/machinename\/sharedirectory"; > > This would do absolutely nothing in Perl. Escaping forward slashes is > never necessary unless you're using them as the separator character > for regexes or quotes, in which case you should just pick a different > separator. > > I really wish people would take the time to learn what does and > doesn't need to be escaped in Perl. Excessive backslashes make code > more difficult to read, and I've seen far too much gratuitous use of > them. It's too bad, really, because Perl provides enough ways to avoid > them (alternate quote characters, heredocs, \Q...\E, etc.) that > they're hardly ever necessary for anything other than metacharacters. > Daniel Jacobs | danielj@cheshirecat.net | Internet & Unix Consulting "In art and dream, may you proceed with abandon. In life, may you proceed with balance and stealth." - Patti Smith - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From bobhilt at eskimo.com Fri Dec 1 01:54:11 2000 From: bobhilt at eskimo.com (Bob Hiltner) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: Newbie problem with Win32::OLE In-Reply-To: <86EDBD151558D311BB5700508B2E03FC03FB12B1@pikachu.wrq.com> Message-ID: On Wed, 29 Nov 2000, Tracie Edelson wrote: > > to .csv files. I then open the .csv files in Excel and "save as" Excel files > (.xls). The whole thing works great, except that when I open the "converted" > .xls files, the data is no longer columnar (it is a single line separated by > commas. Could it be something as simple as the 'visable' typo? If the sheet is required to be visible, then this could explain the problem. (Don't know enough perl to give anything more definitive... But one thing I do see is that you might want to move the setting of $ex to a spot before the loop--no need to re-deal with it for each iteration. (And, of course, leave the $workbook setting inside the loop...) Hope this helps. -Bob > foreach($dir){ > > use Win32::OLE qw (in with); > use Win32::OLE::Const; > use Win32::OLE::Const 'Microsoft Excel'; > $Win32::OLEWarn=3; #die on errors > > $ex = > Win32::OLE->GetActiveObject('Excel.Application') > || Win32::OLE->new('Excel.Application', 'Quit'); # use the Excel application > if it's open, otherwise open new > $ex->{Visable} =1; > $workbook = $ex->Workbooks->Open("$csvfolder$dir"); > $workbook->SaveAs > ("$xlsfolder$dir.xls")->{FileFormat}= > xlExcel9795->{ReadOnlyRecommended}=False; > $ex->ActiveWorkbook->Close(0); > } > $ex->Quit(); > } > } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From scott at sabmail.rresearch.com Fri Dec 1 10:34:00 2000 From: scott at sabmail.rresearch.com (Scott Blachowicz) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: Problem deleting files In-Reply-To: <30430000.975649736@flashingchance.whistlingfish.net> References: <0056910008948121000002L112*@MHS> <30430000.975649736@flashingchance.whistlingfish.net> Message-ID: <20001201083400.B13670@sabami.seaslug.org> On Thu, Nov 30, 2000 at 09:48:56PM -0800, Matt Tucker wrote: > -- rick.croote@philips.com spake thusly: > > > To backup what Tim said, more so, don't use unlink <$oldfile>, use > > unlink $oldfile or unlink ($oldfile). > > This wouldn't work, because he's trying to delete files using globbing. > The following would work: > > my $oldfiles = 'foo.*'; > unlink < $oldfiles >; Yes, unlink takes a LIST of files and the <$oldfiles> should return a list of filenames matching the glob pattern contained in the $oldfiles var. > ... > As for why the code isn't working, does it have something to do with mixing > up shell variables and perl variables? > ... You might try sticking some debugging prints in there... my $oldfiles = 'foo.*'; my @filenames = <$oldfiles>; print map {">>$_<<\n"} @filenames; unlink @filenames; Hmmmm...that's odd...I guess the globbing thing is kinda special... gator:/tmp% ls -l foo.* -rw-rw-r-- 1 scott scott 0 Dec 1 08:26 foo.a -rw-rw-r-- 1 scott scott 0 Dec 1 08:26 foo.b -rw-rw-r-- 1 scott scott 0 Dec 1 08:26 foo.c gator:/tmp% cat foodel.pl #! /usr/bin/perl my $oldfiles = 'foo.*'; my @filenames = <$oldfiles>; print map {">>$_<<\n"} @filenames; unlink @filenames; gator:/tmp% perl foodel.pl No output...but if I change the script a little... gator:/tmp% cat foodel.pl #! /usr/bin/perl my $oldfiles = 'foo.*'; my @filenames = eval "<$oldfiles>"; print map {">>$_<<\n"} @filenames; unlink @filenames; gator:/tmp% perl foodel.pl >>foo.a<< >>foo.b<< >>foo.c<< gator:/tmp% ls -l foo.* zsh: no matches found: foo.* It must not to variable expansion inside the globbing brackets, so you have to the expansion yourself by using "eval". -- Scott Blachowicz - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Fri Dec 1 11:09:22 2000 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: Problem deleting files In-Reply-To: <20001201083400.B13670@sabami.seaslug.org>; from Scott Blachowicz on Fri, Dec 01, 2000 at 08:34:00AM -0800 References: <0056910008948121000002L112*@MHS> <30430000.975649736@flashingchance.whistlingfish.net> <20001201083400.B13670@sabami.seaslug.org> Message-ID: <20001201170922.A11549@timji.consultix.wa.com> On Fri, Dec 01, 2000 at 08:34:00AM -0800, Scott Blachowicz wrote: > On Thu, Nov 30, 2000 at 09:48:56PM -0800, Matt Tucker wrote: > > -- rick.croote@philips.com spake thusly: > > > > > To backup what Tim said, more so, don't use unlink <$oldfile>, use > > > unlink $oldfile or unlink ($oldfile). As I told Rick in a private communication, that's not at all what I said; my point was <$oldfile> looks like a filehandle reference, so use < $oldfile > instead. But as it turns out, that wasn't the problem here anyway (see below). > gator:/tmp% cat foodel.pl > #! /usr/bin/perl > my $oldfiles = 'foo.*'; > my @filenames = eval "<$oldfiles>"; > print map {">>$_<<\n"} @filenames; > unlink @filenames; > gator:/tmp% perl foodel.pl > >>foo.a<< > >>foo.b<< > >>foo.c<< > gator:/tmp% ls -l foo.* > zsh: no matches found: foo.* > > It must not do variable expansion inside the globbing brackets, so you > have to the expansion yourself by using "eval". > > -- > Scott Blachowicz Like the shells, Perl *will* do variable expansion within the "globbing brackets", but any wildcards have to be visible when the innards of those brackets are first scanned (as opposed to arising out of variable interpolation). Because an eval allows the interpolation to occur before the globbing operation is attempted, it allows the wildcard characters to be presented via variables. So this is the approach that is needed: #! /usr/bin/perl -w my $oldfiles = 'foo.'; my @filenames = eval "<$oldfiles*>"; print map {">>$_<<\n"} @filenames; unlink @filenames; And it works! 8-} Sorry I didn't pick up on this before as I should have; we actually have a lab exercise that illustrates this very point in my basic Perl Programming class, so I'm familiar with this situation, but I was concentrating on other aspects of the sample code earlier. > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > -- *========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | |Training- TIM MAHER: Unix, Perl DAMIAN CONWAY: Adv. Perl, OOP, Parsing | |12/12: UNIX 1/15: Perl/DBI 2/20: Data Munging;Perl 2/22: Adv. OO Perl| *========================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From joesaphiloff at onebox.com Fri Dec 1 11:18:17 2000 From: joesaphiloff at onebox.com (Joe Saphiloff) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: vi Message-ID: <20001201171817.WOEE10692.mta10.onebox.com@onebox.com> anybody know where or in what title I can get a good tutorial of LEMMY (vi for Windows)? Thank You -- "Let your brain go and see what it brings back" Joe Saphilof joesaphiloff@onebox.com - email (425) 586-6719 - voice mail/fax - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From daniel at chetlin.com Fri Dec 1 11:44:38 2000 From: daniel at chetlin.com (Daniel Chetlin) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: Problem deleting files In-Reply-To: <20001201083400.B13670@sabami.seaslug.org>; from scott@sabmail.rresearch.com on Fri, Dec 01, 2000 at 08:34:00AM -0800 References: <0056910008948121000002L112*@MHS> <30430000.975649736@flashingchance.whistlingfish.net> <20001201083400.B13670@sabami.seaslug.org> Message-ID: <20001201094438.A5845@darkstar.ebizquality.net> On Fri, Dec 01, 2000 at 08:34:00AM -0800, Scott Blachowicz wrote: > Yes, unlink takes a LIST of files and the <$oldfiles> should return a > list of filenames matching the glob pattern contained in the $oldfiles > var. Because `<>' is overloaded in Perl, `<$oldfiles>' won't do what you'd expect here. [snip] > It must not to variable expansion inside the globbing brackets, so you > have to the expansion yourself by using "eval". Well, no, not exactly. See perlop: If angle brackets contain is a simple scalar variable (e.g., <$foo>), then that variable contains the name of the filehandle to input from, or its typeglob, or a reference to the same. For example: $fh = \*STDIN; $line = <$fh>; If what's within the angle brackets is neither a filehandle nor a simple scalar variable containing a filehandle name, typeglob, or typeglob reference, it is interpreted as a filename pattern to be globbed, and either a list of filenames or the next filename in the list is returned, depending on context. This distinction is determined on syntactic grounds alone. That means '<$x>' is always a readline() from an indirect handle, but '<$hash{key}>' is always a glob(). That's because $x is a simple scalar variable, but '$hash{key}' is not--it's a hash element. One level of double-quote interpretation is done first, but you can't say '<$foo>' because that's an indirect filehandle as explained in the previous paragraph. (In older versions of Perl, programmers would insert curly brackets to force interpretation as a filename glob: '<${foo}>'. These days, it's considered cleaner to call the internal function directly as 'glob($foo)', which is probably the right way to have done it in the first place.) I haven't used the `<>' form of globbing in years. Come to think of it, I haven't used globbing in Perl at all in years. Generally readdir and/or File::Find are much more robust, predictable, easy to use, and Perlish. -dlc - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tuck at whistlingfish.net Fri Dec 1 12:14:44 2000 From: tuck at whistlingfish.net (Matt Tucker) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: Problem deleting files In-Reply-To: <20001201170922.A11549@timji.consultix.wa.com> Message-ID: <23430000.975694484@flashingchance.whistlingfish.net> Have we beat this one enough? ;-) -- "Tim Maher/CONSULTIX" spake thusly: > Like the shells, Perl *will* do variable expansion within the > "globbing brackets", but any wildcards have to be visible when the > innards of those brackets are first scanned (as opposed to arising > out of variable interpolation). Because an eval allows the > interpolation to occur before the globbing operation is attempted, it > allows the wildcard characters to be presented via variables. Actually, this isn't true: #!/usr/bin/perl -w use strict; system qw(touch foo.bar foo.baz foo.bang); system 'ls'; my $oldfiles = 'foo.*'; my @oldfiles = < $oldfiles >; print "Oldfiles: ", join(' ', @oldfiles), "\n"; unlink @oldfiles; system 'ls'; >>>foo.bang foo.bar foo.baz http_test try try.c try.pl >>>Use of uninitialized value in subroutine entry at >>>/usr/lib/perl5/5.6.0/i386-linux/File/Glob.pm line 145. >>>Oldfiles: foo.bang foo.bar foo.baz >>>http_test try try.c try.pl So Perl apparently does do variable expansion before globbing. The important thing is still that the spaces are required. (And I wonder if perhaps the Perl version is a factor; I'm running 5.6.0.) Although perhaps the eval trick is safer, as long as you're guaranteed to have metacharacters. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/spug-list/attachments/20001201/fd381b4d/attachment.bin From tim at consultix-inc.com Fri Dec 1 12:16:12 2000 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: UW Needs Perl Instructor Message-ID: <20001201181612.B11764@timji.consultix.wa.com> ----- Forwarded message from Rebecca Hackman ----- From: Rebecca Hackman To: "'tim@consultix-inc.com'" Subject: Instructor Search Date: Fri, 1 Dec 2000 10:06:53 -0800 X-Mailer: Internet Mail Service (5.5.2650.21) Dear Tim, I hope this message finds you well. I am searching for an instructor who could co-teach "Perl and the WWW" with Joel Grow spring quarter. Do you know of any qualified candidates? Perl and the World Wide Web The program's final term applies the tools of Perl to Web and Internet programming. Topics: * HTML, HTTP, CGI protocols * CGI Perl module * Construction of a business Web site * Special topics: OLE, Tk, Shared Memory, Taint, Regex topics, Sockets * Practice with DBI, DBD, relational databases * Automatic class creation * Safety and security in Perl * Advanced use of embedded Perl; Perl executables on Web sites Schedule: (10 sessions) Mondays, 6-9 p.m., March 26-June 4, 2001 (no class May 28); $545; 3 CEUs Best regards, Rebecca Hackman Academic Programs University of Washington Educational Outreach 5001 25th Avenue NE, Seattle, WA 98105-4190 rhackman@ese.washington.edu (206) 221-6243 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Fri Dec 1 12:27:16 2000 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: Problem deleting files In-Reply-To: <23430000.975694484@flashingchance.whistlingfish.net>; from Matt Tucker on Fri, Dec 01, 2000 at 10:14:44AM -0800 References: <20001201170922.A11549@timji.consultix.wa.com> <23430000.975694484@flashingchance.whistlingfish.net> Message-ID: <20001201182716.C11764@timji.consultix.wa.com> On Fri, Dec 01, 2000 at 10:14:44AM -0800, Matt Tucker wrote: > Have we beat this one enough? ;-) Yes! I see now that my haphazardly-constructed test procedure fooled me, because unlike you I hadn't incorporated the creating of the foo* files in the script itself, and I attributed their failure to show up in the listing of the next run to the wrong source! Now if you'll excuse me, I've got to wipe all this egg off my face . . 8-} (And I too am wondering if prior versions of Perl handled globbing differently, which could help justify my contrary notions about how it works.) -Tim *========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | |Training- TIM MAHER: Unix, Perl DAMIAN CONWAY: Adv. Perl, OOP, Parsing | |12/12: UNIX 1/15: Perl/DBI 2/20: Data Munging;Perl 2/22: Adv. OO Perl| *========================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From djames at serv.net Fri Dec 1 12:28:03 2000 From: djames at serv.net (Daniel James) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: vi In-Reply-To: <20001201171817.WOEE10692.mta10.onebox.com@onebox.com>; from Joe Saphiloff on Fri, Dec 01, 2000 at 09:18:17AM -0800 References: <20001201171817.WOEE10692.mta10.onebox.com@onebox.com> Message-ID: <20001201102803.B69548@itchy.serv.net> On Fri, Dec 01, 2000 at 09:18:17AM -0800, Joe Saphiloff wrote: > anybody know where or in what title I can get a good tutorial of LEMMY > (vi for Windows)? I've never seen such a thing, but the author has always been quite responsive to questions. I'm not sure what you'd net a tutorial in aside from the normal vi stuff (except maybe the syntax highlighting and OLE stuff). For those who aren't familiar with Lemmy, it's (IMHO) the best vi clone for the PeeCee. It seems to fully support all the good vi stuff (including bindings and macros if I remember correctly) and it's yank buffer interacts with the windoze clipboard making it quite handy for parsing text from/into other windoze apps. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From daniel at chetlin.com Fri Dec 1 12:28:23 2000 From: daniel at chetlin.com (Daniel Chetlin) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: Problem deleting files In-Reply-To: <20001201170922.A11549@timji.consultix.wa.com>; from tim@consultix-inc.com on Fri, Dec 01, 2000 at 05:09:22PM +0000 References: <0056910008948121000002L112*@MHS> <30430000.975649736@flashingchance.whistlingfish.net> <20001201083400.B13670@sabami.seaslug.org> <20001201170922.A11549@timji.consultix.wa.com> Message-ID: <20001201102823.B5845@darkstar.ebizquality.net> On Fri, Dec 01, 2000 at 05:09:22PM +0000, Tim Maher/CONSULTIX wrote: > As I told Rick in a private communication, that's not at all what I > said; my point was <$oldfile> looks like a filehandle reference, so use > < $oldfile > instead. But as it turns out, that wasn't the problem > here anyway (see below). Why `< $oldfile >'? That causes strange other (unexpected) effects. > > gator:/tmp% cat foodel.pl > > #! /usr/bin/perl > > my $oldfiles = 'foo.*'; > > my @filenames = eval "<$oldfiles>"; > > print map {">>$_<<\n"} @filenames; > > unlink @filenames; > > gator:/tmp% perl foodel.pl > > >>foo.a<< > > >>foo.b<< > > >>foo.c<< > > gator:/tmp% ls -l foo.* > > zsh: no matches found: foo.* > > Like the shells, Perl *will* do variable expansion within the "globbing > brackets", but any wildcards have to be visible when the innards of > those brackets are first scanned (as opposed to arising out of variable > interpolation). Because an eval allows the interpolation to occur before > the globbing operation is attempted, it allows the wildcard characters > to be presented via variables. [~] $ perl -we'$h{f}="foo.*";my@f=<$h{f}>;print map{">>$_<<\n"}@f' >>foo.a<< >>foo.b<< >>foo.c<< [~] $ perl -we'$f="foo.*";my@f=<${f}>;print map{">>$_<<\n"}@f' >>foo.a<< >>foo.b<< >>foo.c<< Wildcards certainly can arise out of variable interpolation. > So this is the approach that is needed: > > #! /usr/bin/perl -w > my $oldfiles = 'foo.'; > my @filenames = eval "<$oldfiles*>"; > print map {">>$_<<\n"} @filenames; > unlink @filenames; Why do you think this version is different than Scott's, and why do you think it's necessary to move the `*' from the variable to the glob? The only gotcha in this thread is that `<>' is interpreted as readline() instead of glob() when it sees a lone scalar. The most reasonable approach to that is to use the glob() function directly. All of this talk about interpolation is a red herring. -dlc - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From daniel at chetlin.com Fri Dec 1 13:06:33 2000 From: daniel at chetlin.com (Daniel Chetlin) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: Problem deleting files In-Reply-To: <20001201182716.C11764@timji.consultix.wa.com>; from tim@consultix-inc.com on Fri, Dec 01, 2000 at 06:27:16PM +0000 References: <20001201170922.A11549@timji.consultix.wa.com> <23430000.975694484@flashingchance.whistlingfish.net> <20001201182716.C11764@timji.consultix.wa.com> Message-ID: <20001201110633.F5845@darkstar.ebizquality.net> On Fri, Dec 01, 2000 at 06:27:16PM +0000, Tim Maher/CONSULTIX wrote: > (And I too am wondering if prior versions of Perl handled globbing > differently, which could help justify my contrary notions about how it > works.) (Agreed on the beat to death, but for those interested): [~] $ perl54 -we'warn $];$f="foo.*";my@f=<${f}>;print map{">>$_<<\n"}@f' 5.00405 at -e line 1. >>foo.a<< >>foo.b<< >>foo.c<< [~] $ perl55 -we'warn $];$f="foo.*";my@f=<${f}>;print map{">>$_<<\n"}@f' 5.00503 at -e line 1. >>foo.a<< >>foo.b<< >>foo.c<< [~] $ perl56 -we'warn $];$f="foo.*";my@f=<${f}>;print map{">>$_<<\n"}@f' 5.006 at -e line 1. >>foo.a<< >>foo.b<< >>foo.c<< [~] $ perl57 -we'warn $];$f="foo.*";my@f=<${f}>;print map{">>$_<<\n"}@f' 5.007 at -e line 1. >>foo.a<< >>foo.b<< >>foo.c<< [~] $ perlbl -we'warn $];$f="foo.*";my@f=<${f}>;print map{">>$_<<\n"}@f' 5.007 at -e line 1. >>foo.a<< >>foo.b<< >>foo.c<< -dlc - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From john.brittingham at attws.com Fri Dec 1 13:10:20 2000 From: john.brittingham at attws.com (Brittingham, John) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: Problem deleting files, last one Message-ID: Looks like y'all are getting tired of this one. So this will be my last post on this question. Anyway Thanks to all you help I managed to get it working. This is what worked. if ($week_day !~ /Mon/) { my ($oldfile)='../html/wrt_archive/monthly_archive/*to'.$today.'*.*'; print "inside if $weekday $oldfile\n"; my @filenames = eval "<$oldfile>"; print map {">>$_<<\n"} @filenames || warn "having trouble finding $oldfile: $!"; foreach $filename (@filenames) { print "deleting filename=$filename\n" || warn "having trouble with $filename: $!\n"; unlink $filename|| warn "having trouble deleting $oldfile: $!\n"; } } Again Thanks, jb -----Original Message----- From: Tim Maher/CONSULTIX [mailto:tim@consultix-inc.com] Sent: Friday, December 01, 2000 10:27 AM To: spug-list@pm.org Subject: Re: SPUG: Problem deleting files On Fri, Dec 01, 2000 at 10:14:44AM -0800, Matt Tucker wrote: > Have we beat this one enough? ;-) Yes! I see now that my haphazardly-constructed test procedure fooled me, because unlike you I hadn't incorporated the creating of the foo* files in the script itself, and I attributed their failure to show up in the listing of the next run to the wrong source! Now if you'll excuse me, I've got to wipe all this egg off my face . . 8-} (And I too am wondering if prior versions of Perl handled globbing differently, which could help justify my contrary notions about how it works.) -Tim *========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | |Training- TIM MAHER: Unix, Perl DAMIAN CONWAY: Adv. Perl, OOP, Parsing | |12/12: UNIX 1/15: Perl/DBI 2/20: Data Munging;Perl 2/22: Adv. OO Perl| *========================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From gardner at sounddomain.com Fri Dec 1 14:37:56 2000 From: gardner at sounddomain.com (Jonathan Gardner) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: HTML::Mason - anyone ever used it? Message-ID: Curious whether anyone has ever used HTML::Mason before. They have their own website (http://www.masonhq.com/) and it looks a lot like something I was thinking of doing to make CGI/Perl work a lot easier. Just wondering what their reputation is, and what difficulties anyone who has ever tried to use it encountered. Jonathan M. Gardner CarDomain Networks (formerly SoundDomain, Inc) (425)820-2244 x23 gardner@sounddomain.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From starfire at zipcon.net Fri Dec 1 16:26:54 2000 From: starfire at zipcon.net (starfire@zipcon.net) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: Inline doesn't like my code Message-ID: <20001201222654.5883.qmail@zipcon.net> I'm a first-time user of Inline.pm. The following code generates a segmentation fault. If I step through it with the Perl debugger, the error message is "Signal SEGV: No such file or directory". Any suggestions? use Inline C => <<'END_OF_C_CODE'; #include void get_localtime(int utc) { Inline_Stack_Vars; int *utc, seconds; struct tm *ltime; SV* return_value; seconds = Inline_Stack_Item(0); utc = &seconds; ltime = localtime(utc); Inline_Stack_Reset; return_value = ltime->tm_year; Inline_Stack_Push(return_value); return_value = ltime->tm_mon; Inline_Stack_Push(return_value); return_value = ltime->tm_mday; Inline_Stack_Push(return_value); return_value = ltime->tm_hour; Inline_Stack_Push(return_value); return_value = ltime->tm_min; Inline_Stack_Push(return_value); return_value = ltime->tm_sec; Inline_Stack_Push(return_value); return_value = ltime->tm_isdst; Inline_Stack_Push(return_value); Inline_Stack_Done; } END_OF_C_CODE Richard Anderson www.rayCosoft.com RayCosoft Richard.Anderson@rayCosoft.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From scott at sabmail.rresearch.com Fri Dec 1 18:44:06 2000 From: scott at sabmail.rresearch.com (Scott Blachowicz) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: Inline doesn't like my code In-Reply-To: <20001201222654.5883.qmail@zipcon.net> References: <20001201222654.5883.qmail@zipcon.net> Message-ID: <20001201164406.A24156@sabami.seaslug.org> On Fri, Dec 01, 2000 at 02:26:54PM -0800, starfire@zipcon.net wrote: > I'm a first-time user of Inline.pm. The following code generates a > segmentation fault. If I step through it with the Perl debugger, the error > message is "Signal SEGV: No such file or directory". > > Any suggestions? > > use Inline C => <<'END_OF_C_CODE'; > > #include > > void get_localtime(int utc) { > > Inline_Stack_Vars; > int *utc, seconds; Your "utc" local var is hiding your "utc" function argument...which I imagine isn't what you want? > struct tm *ltime; > SV* return_value; > > seconds = Inline_Stack_Item(0); > utc = &seconds; > ltime = localtime(utc); Hmmm...shouldn't the C part of it go something like this: void get_localtime(int utc) { int seconds = utc; struct tm *ltime = localtime(&seconds); } But I've not used Inline yet, so I'm not sure what those Inline_Stack_Vars & Inline_Stack_Item guys do, but I'd bet they're not being used quite right. -- Scott Blachowicz - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From briani at activestate.com Fri Dec 1 18:55:47 2000 From: briani at activestate.com (Brian Ingerson) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: Inline doesn't like my code References: <20001201222654.5883.qmail@zipcon.net> Message-ID: <3A284893.5E59B3C5@activestate.com> Richard, No need to make a "science project" out of it ;^) This works: --------------------------------------8<------------------------------------- print map {"$_\n"} get_localtime(time); use Inline C => <<'END_OF_C_CODE'; #include void get_localtime(int utc) { struct tm *ltime = localtime(&utc); Inline_Stack_Vars; Inline_Stack_Reset; Inline_Stack_Push(newSViv(ltime->tm_year)); Inline_Stack_Push(newSViv(ltime->tm_mon)); Inline_Stack_Push(newSViv(ltime->tm_mday)); Inline_Stack_Push(newSViv(ltime->tm_hour)); Inline_Stack_Push(newSViv(ltime->tm_min)); Inline_Stack_Push(newSViv(ltime->tm_sec)); Inline_Stack_Push(newSViv(ltime->tm_isdst)); Inline_Stack_Done; } END_OF_C_CODE --------------------------------------8<------------------------------------- Any questions? Brian starfire@zipcon.net wrote: > > I'm a first-time user of Inline.pm. The following code generates a > segmentation fault. If I step through it with the Perl debugger, the error > message is "Signal SEGV: No such file or directory". > > Any suggestions? > > use Inline C => <<'END_OF_C_CODE'; > > #include > > void get_localtime(int utc) { > > Inline_Stack_Vars; > int *utc, seconds; > struct tm *ltime; > SV* return_value; > > seconds = Inline_Stack_Item(0); > utc = &seconds; > ltime = localtime(utc); > > Inline_Stack_Reset; > return_value = ltime->tm_year; > Inline_Stack_Push(return_value); > return_value = ltime->tm_mon; > Inline_Stack_Push(return_value); > return_value = ltime->tm_mday; > Inline_Stack_Push(return_value); > return_value = ltime->tm_hour; > Inline_Stack_Push(return_value); > return_value = ltime->tm_min; > Inline_Stack_Push(return_value); > return_value = ltime->tm_sec; > Inline_Stack_Push(return_value); > return_value = ltime->tm_isdst; > Inline_Stack_Push(return_value); > Inline_Stack_Done; > } > END_OF_C_CODE > > Richard Anderson www.rayCosoft.com RayCosoft Richard.Anderson@rayCosoft.com > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ -- perl -le 'use Inline C=>q{SV*JAxH(char*x){return newSVpvf ("Just Another %s Hacker",x);}};print JAxH+Perl' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Fri Dec 1 23:01:27 2000 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: Damian's Feb. Classes, Seattle Message-ID: <20001202050127.A19042@timji.consultix.wa.com> SPUGsters, I know that those of you who have managed to attend any of Damian Conway's SPUG talks or training classes have found the experience to be very entertaining and worthwhile, so I'm happy to announce that "The Perl Wonder from Down Under" will be back in Seattle for one or two SPUG talks and two short courses this coming February! The PR info follows, and the rest of the details are on the Consultix web page. Hope most of you can benefit from Damian's presence in some way, and that you realize how fortunate we are to have such frequent access to a guru of this magnitude! *========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | |Training- TIM MAHER: Unix, Perl DAMIAN CONWAY: Adv. Perl, OOP, Parsing | |12/12: UNIX 1/15: Perl/DBI 2/20: Data Munging;Perl 2/22: Adv. OO Perl| *========================================================================* From: Tim Maher, CONSULTIX RE: Damian's Perl Classes in Feb. Dr. Damian Conway, author of the groundbreaking book "Object Oriented Perl", popular Perl Conference speaker, and award-winning author of freely distributed Perl modules, will be presenting two seminars in the Seattle area during February, 2001. The first, called "Data Munging", is about data processing in Perl, and is suitable for beginning/intermediate level Perl programmers. The second is his popular "Advanced Object Oriented Perl" seminar, which requires firm intermediate-level skills, and benefits from some previous exposure to object oriented programming. To help students whose skills might be somewhat lacking attend that latter class during this special Seattle offering, we've arranged our schedule to provide prerequisite courses in the week preceding his seminars. As usual, we're offering a substantial discount for early registrants, and additional details are available on our web site. CONSULTIX WINTER SCHEDULE Course Dates Days UNIX Fundamentals 12/12-12/15 4 Intermediate Perl 02/12-02/14 3 Object-Oriented Perl 02/15-02/16 2 Data Munging* 02/20-02/21 2 Advanced OO Perl* 02/22-02/23 2 ------------------------------------------- * These courses, by Dr. Damian Conway, are lecture only. The others, by Dr. Tim Maher, are lecture/lab format. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CONSULTIX ON-LINE RESOURCES General Consultix information: http://www.consultix-inc.com/ On-Site training information: http://www.consultix-inc.com/on-site.html Course Listings: UNIX/Shell, http://www.consultix-inc.com/unixlist.html AWK/Perl, http://www.consultix-inc.com/perllist.html Instructor Evaluations: http://www.consultix-inc.com/evals.html Registration and Pricing: http://www.consultix-inc.com/reg.html *========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | |Training- TIM MAHER: Unix, Perl DAMIAN CONWAY: Adv. Perl, OOP, Parsing | |12/12: UNIX 1/15: Perl/DBI 2/20: Data Munging;Perl 2/22: Adv. OO Perl| *========================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Fri Dec 1 23:11:45 2000 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: Beta Students Needed: DBI Class Message-ID: <20001202051145.B19042@timji.consultix.wa.com> SPUGsters, We're planning to stage a "beta test" of a new "Database Programming with Perl" course early next year, and we need some students who are smart, capable of constructive criticism, and willing to overlook a few rough spots to help us work out the bugs. Our primary interest is in identifying companies willing to host an offering of the course, who can also provide at least 4 qualified students (see below). A secondary interest is in finding individuals who would be interested in participating, in case we hold an offering in a location open to the public. More details follow; hope that some of you can help us with this project! Anybody wanting to participate please get in touch with me: tim@consultix-inc.com -Tim *========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | |Training- TIM MAHER: Unix, Perl DAMIAN CONWAY: Adv. Perl, OOP, Parsing | |12/12: UNIX 1/15: Perl/DBI 2/20: Data Munging;Perl 2/22: Adv. OO Perl| *========================================================================* ** Database Programming with Perl; Need "Beta Testers" The "Perl DBI approach" to database programming allows one to write generic database-access programs that can interface with any of the popular database management systems (Oracle, Sybase, MySQL, etc.). We'll have a new course on this subject in its initial form by early January. It's being written and presented by a local expert, who has years of production-level Perl DBI experience with well-known local high-tech companies. But the first offering of any new course always gives a bumpy ride, so we're looking for some help in testing it! Accordingly, we're trying to identify companies (perhaps as many as three) willing to have us present this 2.5 day class at their facility, on their equipment, and to their students, for a nominal fee. Students would need to have intermediate-level Perl skills, as provided in our "Intermediate Perl Programming" course (http://www.consultix-inc.com/perl_int.html). Interested parties please contact Tim Maher (tim@consultix-inc.com) with information about what dates suit you (the weeks of 1/15 and 2/5 are currently available), how many students you'd provide, their current Perl/DBI knowledge levels (a variety is best), and what brand of database you can provide on the class system. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CONSULTIX ON-LINE RESOURCES General Consultix information: http://www.consultix-inc.com/ On-Site training information: http://www.consultix-inc.com/on-site.html Course Listings: UNIX/Shell, http://www.consultix-inc.com/unixlist.html AWK/Perl, http://www.consultix-inc.com/perllist.html Instructor Evaluations: http://www.consultix-inc.com/evals.html Registration and Pricing: http://www.consultix-inc.com/reg.html *========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | |Training- TIM MAHER: Unix, Perl DAMIAN CONWAY: Adv. Perl, OOP, Parsing | |12/12: UNIX 1/15: Perl/DBI 2/20: Data Munging;Perl 2/22: Adv. OO Perl| *========================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From daniel at chetlin.com Mon Dec 4 01:45:31 2000 From: daniel at chetlin.com (Daniel Chetlin) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: HTML::Mason - anyone ever used it? In-Reply-To: ; from gardner@sounddomain.com on Fri, Dec 01, 2000 at 12:37:56PM -0800 References: Message-ID: <20001203234531.F9244@darkstar.ebizquality.net> On Fri, Dec 01, 2000 at 12:37:56PM -0800, Jonathan Gardner wrote: > Curious whether anyone has ever used HTML::Mason before. They have their own > website (http://www.masonhq.com/) and it looks a lot like something I was > thinking of doing to make CGI/Perl work a lot easier. > > Just wondering what their reputation is, and what difficulties anyone who > has ever tried to use it encountered. I use Mason on a daily basis, and would highly recommend it. It's got a lot of features that you won't find in other templating systems. It also has drawbacks, and is a young and actively developed product. Most major difficulty I've encountered: it doesn't give useful line numbers when reporting errors. This is scheduled to be fixed, but is a more difficult problem than it sounds, and may be a while. Other similar systems to consider: the Template Toolkit, and (dare I say) Zope. -dlc - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From daniel at chetlin.com Mon Dec 4 01:51:22 2000 From: daniel at chetlin.com (Daniel Chetlin) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: Problem deleting files, last one In-Reply-To: ; from john.brittingham@attws.com on Fri, Dec 01, 2000 at 11:10:20AM -0800 References: Message-ID: <20001203235122.G9244@darkstar.ebizquality.net> On Fri, Dec 01, 2000 at 11:10:20AM -0800, Brittingham, John wrote: > my @filenames = eval "<$oldfile>"; I hate to keep beating a dead horse, but since you said this is the solution you actually chose, I thought I'd try once more. This is really not the correct way to do things. The problem you were facing was the fact that `<$oldfile>' was being interpreted as a readline instead of a glob. There are easier, faster, and more secure ways of solving that then using `eval STRING'. For example: * my @filenames = glob($oldfile); * my @filenames = <${oldfile}> In this specific instance, you have control over the `$oldfile' variable. But code changes. Consider what would happen if `$oldfile' contained ">;system('rm -rf /')". Etc. `eval STRING' is something to always be very careful of. It can be quite useful, but there's no reason to use it here. -dlc - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From brian.altman at attws.com Mon Dec 4 13:25:32 2000 From: brian.altman at attws.com (Altman, Brian) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: Password Protection? Message-ID: <61A811DC8715D411BF0100508B94DB1C0242780A@WA-MSG11> Hello, I have a Perl/CGI script that allows users to edit a flat file database on a Unix server. Now I need to secure this script so only specified users have access to it. Any thoughts on how I can password protect this script? Thanx, Brian - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jmates at mbt.washington.edu Mon Dec 4 13:58:37 2000 From: jmates at mbt.washington.edu (Jeremy A. Mates) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: Password Protection? In-Reply-To: <61A811DC8715D411BF0100508B94DB1C0242780A@WA-MSG11> Message-ID: On Mon, 4 Dec 2000, Altman, Brian wrote: > I have a Perl/CGI script that allows users to edit a flat file > database on a Unix server. Now I need to secure this script so only > specified users have access to it. Any thoughts on how I can password > protect this script? Assuming Apache, you could easily setup a .htaccess file to restrict access to that area to specified users/groups. You might also want to use https, depending on how sensitive the information being modified is and where the edits are coming from. Or, you could go whole hog and setup a centralized LDAP/SQL/DBM user/group management system for the entire company, and integrate it with the flat-file editing CGI script... :) -- Jeremy A. Mates (206) 221-4714 Fax: 685-7301 Senior Systems Administrator K 353B, Health Sciences Center http://www.mbt.washington.edu/ Mail Box 357730 University of Washington Seattle, WA 98195 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From asa.martin at attws.com Mon Dec 4 14:40:46 2000 From: asa.martin at attws.com (Martin, Asa) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: Password Protection? Message-ID: <67FC0E2A32D0D31194500008C7CF2E6F015157C6@wa-msg09.nwest.attws.com> > On Mon, 4 Dec 2000, Altman, Brian wrote: > > I have a Perl/CGI script that allows users to edit a flat file > > database on a Unix server. Now I need to secure this script so only > > specified users have access to it. Any thoughts on how I can password > > protect this script? > > Assuming Apache, you could easily setup a .htaccess file to restrict > access to that area to specified users/groups. > For a good description of how to do this in apache, check out: http://www.apacheweek.com/features/userauth - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From asherr at cs.unm.edu Mon Dec 4 15:41:27 2000 From: asherr at cs.unm.edu (Aryeh "Cody" Sherr) Date: Wed Aug 4 00:07:47 2004 Subject: SPUG: Password Protection? In-Reply-To: <67FC0E2A32D0D31194500008C7CF2E6F015157C6@wa-msg09.nwest.attws.com> Message-ID: there are a few different approaches you can take: basic authentication. this sends the password in what amounts to plain text. ok for casual stuff, but people get in if they want. basic authentication over https (secure http) connection. better, but you have to start in secure mode. md5 digest authentication. this is more secure, and harder to implement. rfc 2617 is entirely about these 2 forms of http based authentication/authorization. application level authentication. the username/password checking is done by the application. the user logs in through a form, and then a session is kept through the application about what the user can do and where thay can go. this should be done over https, or at least through unique session ids that get passed around, and are asssociated with the user. the sessions should eventually expire. hope this is useful. cody On Mon, 4 Dec 2000, Martin, Asa wrote: > > On Mon, 4 Dec 2000, Altman, Brian wrote: > > > I have a Perl/CGI script that allows users to edit a flat file > > > database on a Unix server. Now I need to secure this script so only > > > specified users have access to it. Any thoughts on how I can password > > > protect this script? > > > > Assuming Apache, you could easily setup a .htaccess file to restrict > > access to that area to specified users/groups. > > > For a good description of how to do this in apache, check out: > http://www.apacheweek.com/features/userauth > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From cmeyer at helvella.org Mon Dec 4 16:06:45 2000 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: HTML::Mason - anyone ever used it? In-Reply-To: <20001203234531.F9244@darkstar.ebizquality.net> References: <20001203234531.F9244@darkstar.ebizquality.net> Message-ID: <20001204140645.B4585@hobart.helvella.org> On Sun, Dec 03, 2000 at 11:45:31PM -0800, Daniel Chetlin wrote: ... > > Other similar systems to consider: the Template Toolkit, and (dare I > say) Zope. Not that I endorse or have even tried it, but now you can program Zope in Perl: http://www.zope.org/Wikis/zope-perl/FrontPage -C. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From mathew at kdpublish.com Mon Dec 4 16:20:50 2000 From: mathew at kdpublish.com (Mathew Mills) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Password Protection? In-Reply-To: Message-ID: One thing to note: Server-side security can be a big problem. If you are on a server with other users you need to make sure the file is not readable/writ able to anyone else on the UNIX server while permitting the web server user full access. -----Original Message----- From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org]On Behalf Of Aryeh "Cody" Sherr Sent: Monday, December 04, 2000 1:41 PM To: spug-list@pm.org Subject: RE: SPUG: Password Protection? there are a few different approaches you can take: basic authentication. this sends the password in what amounts to plain text. ok for casual stuff, but people get in if they want. basic authentication over https (secure http) connection. better, but you have to start in secure mode. md5 digest authentication. this is more secure, and harder to implement. rfc 2617 is entirely about these 2 forms of http based authentication/authorization. application level authentication. the username/password checking is done by the application. the user logs in through a form, and then a session is kept through the application about what the user can do and where thay can go. this should be done over https, or at least through unique session ids that get passed around, and are asssociated with the user. the sessions should eventually expire. hope this is useful. cody On Mon, 4 Dec 2000, Martin, Asa wrote: > > On Mon, 4 Dec 2000, Altman, Brian wrote: > > > I have a Perl/CGI script that allows users to edit a flat file > > > database on a Unix server. Now I need to secure this script so only > > > specified users have access to it. Any thoughts on how I can password > > > protect this script? > > > > Assuming Apache, you could easily setup a .htaccess file to restrict > > access to that area to specified users/groups. > > > For a good description of how to do this in apache, check out: > http://www.apacheweek.com/features/userauth > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From meonkeys at hotmail.com Mon Dec 4 19:57:14 2000 From: meonkeys at hotmail.com (Adam Monsen) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Newbie problem with Win32::OLE Message-ID: >In a nutshell, I am importing some text files from Unix, "converting" them >to .csv files. I then open the .csv files in Excel and "save as" Excel >files >(.xls). The whole thing works great, except that when I open the >"converted" >.xls files, the data is no longer columnar (it is a single line separated >by >commas. I would recommend Text::CSV_XS for parsing/generating files in csv format. Try something like this (# added before each Perl line for clarity): # #!/usr/bin/perl -w # use strict; # use Text::CSV_XS; # my $csv = Text::CSV_XS->new( {always_quote=>1} ); # my @arr = qw(one two three); # $csv->combine(@arr); # $line = $csv->string; # print $line,"\r\n"; Setting always_quote to 1 ensures that every field is quoted, which should allow all your Win32 apps to read the csv file. Your problem may be later on when you save the file in Excel. I have messed around with this somewhat, and it appears that different Win32 apps use different formats for csv files. For instance, after I saved a file in cvs format in Excel 98, it could not be imported as csv by Access 2000. On a side note, I would be interested if you have read and could point me to a spec for csv. Did that help? Adam Monsen _____________________________________________________________________________________ Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From mark.johnston at pnl.gov Tue Dec 5 12:17:24 2000 From: mark.johnston at pnl.gov (Johnston, Mark) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Newbie problem with Win32::OLE Message-ID: I don't know if this might help, but MS Excel can read a file in HTML format and save it in .XLS format. If you create an HTML page with the data contained in a , then give the page a MIME type which the client machine can associate with MS Excel (Microsoft automagically installs the type "application/vnd.ms-excel" for Office 97), then that's all you have to do -- and it bypasses the complication of what the proper CSV format ought to be. Sincerely, Mark Johnston Pacific Northwest National Laboratory mailto:mark.johnston@pnl.gov -----Original Message----- From: Adam Monsen [SMTP:meonkeys@hotmail.com] Sent: Monday, December 04, 2000 5:57 PM To: traciee@wrq.com; spug-list@pm.org Subject: Re: SPUG: Newbie problem with Win32::OLE >In a nutshell, I am importing some text files from Unix, "converting" them >to .csv files. I then open the .csv files in Excel and "save as" Excel >files >(.xls). The whole thing works great, except that when I open the >"converted" >.xls files, the data is no longer columnar (it is a single line separated >by >commas. I would recommend Text::CSV_XS for parsing/generating files in csv format. Try something like this (# added before each Perl line for clarity): # #!/usr/bin/perl -w # use strict; # use Text::CSV_XS; # my $csv = Text::CSV_XS->new( {always_quote=>1} ); # my @arr = qw(one two three); # $csv->combine(@arr); # $line = $csv->string; # print $line,"\r\n"; Setting always_quote to 1 ensures that every field is quoted, which should allow all your Win32 apps to read the csv file. Your problem may be later on when you save the file in Excel. I have messed around with this somewhat, and it appears that different Win32 apps use different formats for csv files. For instance, after I saved a file in cvs format in Excel 98, it could not be imported as csv by Access 2000. On a side note, I would be interested if you have read and could point me to a spec for csv. Did that help? Adam Monsen - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From stuart_poulin at yahoo.com Tue Dec 5 22:17:59 2000 From: stuart_poulin at yahoo.com (Stuart Poulin) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: TimeZone on Windows Message-ID: <20001206041759.72681.qmail@web10007.mail.yahoo.com> Anybody know what's the proper way in perl to figure out the timezone for a windows system? Thanks, Stu __________________________________________________ Do You Yahoo!? Yahoo! Shopping - Thousands of Stores. Millions of Products. http://shopping.yahoo.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From Dax.Menardo at reedbusiness.com.au Wed Dec 6 00:17:42 2000 From: Dax.Menardo at reedbusiness.com.au (Menardo, Dax) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: NET::FTP Message-ID: <7B0B93DC35D8D2119CD308002BB3E2F70484E013@REACS2MAIL> If any of you have ftp.pm for windows install. please email it to me on dax.menardo@reedbusiness.com.au or If you can point me where to get it.... cheers, Dax - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From ericj at cubesearch.com Wed Dec 6 00:38:13 2000 From: ericj at cubesearch.com (Eric Johanson) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: NET::FTP In-Reply-To: <7B0B93DC35D8D2119CD308002BB3E2F70484E013@REACS2MAIL> Message-ID: You can get it from your local CPAN mirror. It's part of of libnet package. http://www.cpan.org http://cpan.valueclick.com/authors/id/G/GB/GBARR/ I hope this helps, Eric Johanson On Wed, 6 Dec 2000, Menardo, Dax wrote: > > > If any of you have ftp.pm for windows install. > please email it to me on dax.menardo@reedbusiness.com.au > > or > > If you can point me where to get it.... > > cheers, > > Dax > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From ajalis at cobaltgroup.com Wed Dec 6 03:26:27 2000 From: ajalis at cobaltgroup.com (Asim Jalis) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: E-SPUG Presentation Slides And Demo (Test::Unit) Message-ID: <20001206012627.A28114@xenon.cobaltgroup.com> I have uploaded the slides (ppt) and the demo tarball from my Test::Unit presentation at ESPUG last week to my web-page. You can find this at http://ajalis.twu.net. Asim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From starfire at zipcon.net Wed Dec 6 23:46:06 2000 From: starfire at zipcon.net (Richard Anderson) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Re: E-SPUG Presentation Slides And Demo (Test::Unit) References: <20001206012627.A28114@xenon.cobaltgroup.com> Message-ID: <013901c06011$00f01b20$700ff93f@adcom133> How about making the slides available in a non-proprietary format? Richard.Anderson@rayCosoft.com RayCosoft Perl/Java/SQL/Unix software engineering www.rayCosoft.com www.zipcon.net/~starfire/home Seattle, WA, USA ----- Original Message ----- From: "Asim Jalis" To: Sent: Wednesday, December 06, 2000 1:26 AM Subject: SPUG: E-SPUG Presentation Slides And Demo (Test::Unit) > I have uploaded the slides (ppt) and the demo tarball > from my Test::Unit presentation at ESPUG last week to > my web-page. You can find this at http://ajalis.twu.net. > > Asim > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From briani at activestate.com Thu Dec 7 01:26:24 2000 From: briani at activestate.com (Brian Ingerson) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Re: E-SPUG Presentation Slides And Demo (Test::Unit) References: <20001206012627.A28114@xenon.cobaltgroup.com> <013901c06011$00f01b20$700ff93f@adcom133> Message-ID: <3A2F3BA0.2346ADE9@activestate.com> Go Unix! Sorry, I've had a bit to drink. Brian BTW, I am looking for a cross-platform alternative to PowerPoint. Any suggestions out there? Richard Anderson wrote: > > How about making the slides available in a non-proprietary format? > > Richard.Anderson@rayCosoft.com RayCosoft > Perl/Java/SQL/Unix software engineering www.rayCosoft.com > www.zipcon.net/~starfire/home Seattle, WA, USA > ----- Original Message ----- > From: "Asim Jalis" > To: > Sent: Wednesday, December 06, 2000 1:26 AM > Subject: SPUG: E-SPUG Presentation Slides And Demo (Test::Unit) > > > I have uploaded the slides (ppt) and the demo tarball > > from my Test::Unit presentation at ESPUG last week to > > my web-page. You can find this at http://ajalis.twu.net. > > > > Asim > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ -- perl -le 'use Inline C=>q{SV*JAxH(char*x){return newSVpvf ("Just Another %s Hacker",x);}};print JAxH+Perl' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From ajalis at twu.net Thu Dec 7 02:40:12 2000 From: ajalis at twu.net (ajalis@twu.net) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Re: E-SPUG Presentation Slides And Demo (Test::Unit) In-Reply-To: <3A2F3BA0.2346ADE9@activestate.com>; from briani@activestate.com on Wed, Dec 06, 2000 at 11:26:24PM -0800 References: <20001206012627.A28114@xenon.cobaltgroup.com> <013901c06011$00f01b20$700ff93f@adcom133> <3A2F3BA0.2346ADE9@activestate.com> Message-ID: <20001207034012.A21679@twu.net> On Wed, Dec 06, 2000 at 11:26:24PM -0800, Brian Ingerson wrote: > Go Unix! > > Sorry, I've had a bit to drink. > > Brian > > BTW, I am looking for a cross-platform alternative to PowerPoint. Any > suggestions out there? > > Richard Anderson wrote: > > > > How about making the slides available in a non-proprietary format? Are there any Unix programs that convert .ppt to plain text? I haev been using antiword to convert .doc files to text and a similar utility for .ppt would be really useful. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From bill at celestial.com Thu Dec 7 11:01:38 2000 From: bill at celestial.com (Bill Campbell) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Re: E-SPUG Presentation Slides And Demo (Test::Unit) In-Reply-To: <3A2F3BA0.2346ADE9@activestate.com>; from briani@activestate.com on Wed, Dec 06, 2000 at 11:26:24PM -0800 References: <20001206012627.A28114@xenon.cobaltgroup.com> <013901c06011$00f01b20$700ff93f@adcom133> <3A2F3BA0.2346ADE9@activestate.com> Message-ID: <20001207090138.A1289@kstarr.celestial.com> On Wed, Dec 06, 2000 at 11:26:24PM -0800, Brian Ingerson wrote: >Go Unix! > >Sorry, I've had a bit to drink. > >Brian > >BTW, I am looking for a cross-platform alternative to PowerPoint. Any >suggestions out there? I'm pretty sure that Applixware will handle PPT stuff. How about StarOffice? Bill -- INTERNET: bill@Celestial.COM Bill Campbell; Celestial Software LLC UUCP: camco!bill PO Box 820; 6641 E. Mercer Way FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676 URL: http://www.celestial.com/ ``I have learned what some people are like. And if some people are like that, other people must have the means to shoot them.'' Donald Hamilton -- The Vanishers - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From snickels at u.washington.edu Thu Dec 7 13:45:25 2000 From: snickels at u.washington.edu (Stephen Nickels) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Re: E-SPUG Presentation Slides And Demo (Test::Unit) (fwd) Message-ID: StarOffice handles .ppt files pretty well. (at least for >= v5.1) Some minor problems with backgrounds occasionally, but it generally does a good job. It can write them pretty well too. --Steve On Thu, 7 Dec 2000, Bill Campbell wrote: > On Wed, Dec 06, 2000 at 11:26:24PM -0800, Brian Ingerson wrote: > >Go Unix! > > > >Sorry, I've had a bit to drink. > > > >Brian > > > >BTW, I am looking for a cross-platform alternative to PowerPoint. Any > >suggestions out there? > > I'm pretty sure that Applixware will handle PPT stuff. How about StarOffice? > > Bill > -- > INTERNET: bill@Celestial.COM Bill Campbell; Celestial Software LLC > UUCP: camco!bill PO Box 820; 6641 E. Mercer Way > FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676 > URL: http://www.celestial.com/ > > ``I have learned what some people are like. And if some people are like > that, other people must have the means to shoot them.'' > Donald Hamilton -- The Vanishers > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > "When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for there you have been, and there you will always long to return" -Leonardo da Vinci - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jeff at vertexdev.com Thu Dec 7 14:58:11 2000 From: jeff at vertexdev.com (Jeff Barr) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Re: E-SPUG Presentation Slides And Demo (Test::Unit) In-Reply-To: <013901c06011$00f01b20$700ff93f@adcom133> Message-ID: <004101c06090$695f3c20$070d0dc0@monster> Recent versions of PowerPoint allow the presentation to be saved as a series of web pages. It does a pretty decent job. (See http://www.vertexdev.com/~jeff/LinuxLG for an example of what it could do 4 years ago :-). Jeff; Jeff Barr - Vertex Development - (mailto:jeff@vertexdev.com) Address: 4610 191st Place NE. Redmond, WA 98074; Phone: Office: 425-868-4919 - Home: 425-836-5624 Homepage: http://www.vertexdev.com/~jeff Weblog: http://jeffbarr.editthispage.com/ Resume: http://www.vertexdev.com/~jeff/real_jb_resume.html -----Original Message----- From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org]On Behalf Of Richard Anderson Sent: Wednesday, December 06, 2000 9:46 PM To: ajalis@cobaltgroup.com; spug-list@pm.org Subject: SPUG: Re: E-SPUG Presentation Slides And Demo (Test::Unit) How about making the slides available in a non-proprietary format? Richard.Anderson@rayCosoft.com RayCosoft Perl/Java/SQL/Unix software engineering www.rayCosoft.com www.zipcon.net/~starfire/home Seattle, WA, USA ----- Original Message ----- From: "Asim Jalis" To: Sent: Wednesday, December 06, 2000 1:26 AM Subject: SPUG: E-SPUG Presentation Slides And Demo (Test::Unit) > I have uploaded the slides (ppt) and the demo tarball > from my Test::Unit presentation at ESPUG last week to > my web-page. You can find this at http://ajalis.twu.net. > > Asim > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From ajalis at twu.net Thu Dec 7 18:56:11 2000 From: ajalis at twu.net (ajalis@twu.net) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Re: E-SPUG Presentation Slides And Demo (Test::Unit) In-Reply-To: <004101c06090$695f3c20$070d0dc0@monster>; from jeff@vertexdev.com on Thu, Dec 07, 2000 at 12:58:11PM -0800 References: <013901c06011$00f01b20$700ff93f@adcom133> <004101c06090$695f3c20$070d0dc0@monster> Message-ID: <20001207195611.A20221@twu.net> On Thu, Dec 07, 2000 at 12:58:11PM -0800, Jeff Barr wrote: > Recent versions of PowerPoint allow the presentation to be saved > as a series of web pages. It does a pretty decent job. > > (See http://www.vertexdev.com/~jeff/LinuxLG for an example of > what it could do 4 years ago :-). Unfortunately things have gone downhill since then. The most recent version of PowerPoint saves the HTML in an IE-specific format. So the slides are still inaccessible to non-Windows users. And the web-site could be considered broken. I'll see if there is an option to produce simpler HTML. In an ideal world there would be a command line tool to convert ppt to HTML or plain text (something like antiword). Asim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Sat Dec 16 13:08:42 2000 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: TPC 5 Web Site Up Message-ID: <20001216190842.A4470@timji.consultix.wa.com> Just noticed on use.perl.org that O'Reilly now has details of the July 2001, San Diego Perl Conference on-line, including details on how and when to submit papers, etc. Check it out: http://conferences.ora.com/perl5/ *========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | |Training- TIM MAHER: Unix, Perl DAMIAN CONWAY: Adv. Perl, OOP, Parsing | |12/12: UNIX 1/15: Perl/DBI 2/20: Data Munging;Perl 2/22: Adv. OO Perl| *========================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Sun Dec 17 11:58:27 2000 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Dec. Mtg: State of the SPUGion; Free Books Message-ID: <20001217175827.A11466@timji.consultix.wa.com> December 19, 2000 Seattle Perl Users Group Meeting ------------------------------------------------------------ Topics: "State of the SPUGion, and Book Give-away" Speaker: Tim Maher, leading Group Discussion Time: December 19th, 2000 (Third Tuesday), 7pm-9pm LOCATION: Union Bank of California Bldg, 5th Floor Mtg Room Cost: Free, but limited to past participants (see below) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - To wrap up this past year of SPUGgery and plan for the next one, we'll review what was good and bad, and talk about how we can make things better next time around. Issues like the following are expected to be discussed: * allocation of new responsibilities to members * speaker coordinator * talk archivist * job lister * bringing Perl newbies back into fold * ideas about new meeting places * reviving collaborative CPAN project * practicing Perl-Golf in preparation for TPC5 in July * topics for future meetings Santa Maher will give away the following books: "OO-Perl", autographed by Damian Conway, "Perl for System Administrators" (two copies), and "Programming Perl, 3rd Edition". The catches are: recipients have to agree to publish reviews somewhere (web pages okay), and members who have made SPUG presentations will be favored over others. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Admission is free and, for this meeting only, restricted to those who have attended at least three previous SPUG or E-SPUG meetings. Attendees are encouraged to arrive at the building's 5th & Madison door by 6:45pm, which might be locked at other times. Parking We recommend avoiding the parking lot below the Union Bank building, due to the very hefty fee you'll be assessed if you leave after 9pm. There are plenty of other parking garages in the vicinity that are more affordable, and some on-street parking too. Pre/Post-Meeting Gathering Place Come and pass the pre-meeting time with other SPUGsters at the Rock Bottom brewpub, at 1333 5th Ave., (206) 623-3070, in downtown Seattle. Look to your left, near the bar or pool table, for bizarre yet strangely appealing characters wielding laptops and hearty ales. Attendees tend to arrive after 6pm, and to leave for the meeting by 6:40pm. For more information, including driving directions and street addresses, see http://www.halcyon.com/spug/. ========================================================== | Tim Maher, Ph.D. Tel: (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 Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From pann at ourmanpann.com Sun Dec 17 16:51:56 2000 From: pann at ourmanpann.com (Pann McCuaig) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Dec. Mtg: State of the SPUGion; Free Books In-Reply-To: <20001217175827.A11466@timji.consultix.wa.com>; from tim@consultix-inc.com on Sun, Dec 17, 2000 at 05:58:27PM +0000 References: <20001217175827.A11466@timji.consultix.wa.com> Message-ID: <20001217145156.A606@ourmanpann.com> On Sun, Dec 17, 2000 at 17:58, Tim Maher/CONSULTIX wrote: > Admission is free and, for this meeting only, restricted to those > who have attended at least three previous SPUG or E-SPUG meetings. What the FUCK? If you're going to make an exclusion like this it would be polite to explain why. Cheers, Pann -- geek by nature, Linux by choice L I N U X .~. The Choice /V\ http://www.ourmanpann.com/linux/ of a GNU /( )\ Generation ^^-^^ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jmunger1 at yahoo.com Sun Dec 17 20:35:32 2000 From: jmunger1 at yahoo.com (James Munger) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Dec. Mtg: State of the SPUGion; Free Books Message-ID: <20001218023532.16150.qmail@web3102.mail.yahoo.com> --- Pann McCuaig wrote: > On Sun, Dec 17, 2000 at 17:58, Tim Maher/CONSULTIX wrote: > > > Admission is free and, for this meeting only, restricted to those > > who have attended at least three previous SPUG or E-SPUG meetings. > > What the FUCK? If you're going to make an exclusion like this it > would > be polite to explain why. So oppurtunist vultures like myself, who've never gone to a meeting, don't just show up for the freebies. I suspect. James __________________________________________________ Do You Yahoo!? Yahoo! Shopping - Thousands of Stores. Millions of Products. http://shopping.yahoo.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Sun Dec 17 17:23:44 2000 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Dec. Mtg: State of the SPUGion; Free Books In-Reply-To: <20001217145156.A606@ourmanpann.com>; from Pann McCuaig on Sun, Dec 17, 2000 at 02:51:56PM -0800 References: <20001217175827.A11466@timji.consultix.wa.com> <20001217145156.A606@ourmanpann.com> Message-ID: <20001217232344.A1658@timji.consultix.wa.com> On Sun, Dec 17, 2000 at 02:51:56PM -0800, Pann McCuaig wrote: > On Sun, Dec 17, 2000 at 17:58, Tim Maher/CONSULTIX wrote: > > > Admission is free and, for this meeting only, restricted to those > > who have attended at least three previous SPUG or E-SPUG meetings. > I thought the reasoning behind this provision was obvious, but apparently not, so here's the explanation. Since we'll be reviewing the successes and failures of the past year, and plotting our course for the next one, it only makes sense for people who have actually participated in SPUG to attend. I.e., instead of being a regular meeting that anyone could benefit from, this is more of a "Steering Committee" meeting, that would only bore those attending in the hope of learning something about Perl. One other point; thus far, the traffic on this list has been a model of professionalism and productivity. There have been spirited exchanges on occasion, to be sure, but no juevenile name-calling or profanity, as found on many other lists. Let's keep it that way! -Tim ========================================================== | Tim Maher, Ph.D. Tel: (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 Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From acme at astray.com Mon Dec 18 03:34:52 2000 From: acme at astray.com (Leon Brocard) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Dec. Mtg: State of the SPUGion; Free Books In-Reply-To: <20001218023532.16150.qmail@web3102.mail.yahoo.com>; from jmunger1@yahoo.com on Sun, Dec 17, 2000 at 06:35:32PM -0800 References: <20001218023532.16150.qmail@web3102.mail.yahoo.com> Message-ID: <20001218093452.B10819@ns0.astray.com> James Munger sent the following bits through the ether: > So oppurtunist vultures like myself, who've never gone to a meeting, > don't just show up for the freebies. Interesting tactic. Generally I've found in the past at Bath.pm and London.pm that giving freebies attracts people who might not turn up. Thing is, they generally turn up for every meeting after that ;-) Perl Mongers tends to be about including, not excluding. OTOH perhaps the group is getting too big? Leon -- Leon Brocard.............................http://www.astray.com/ yapc::Europe............................http://yapc.org/Europe/ ... All new improved Brocard, now with Template Toolkit! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From gardner at sounddomain.com Mon Dec 18 13:51:43 2000 From: gardner at sounddomain.com (Jonathan Gardner) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Counting the number of instances in a string using Perl's regexes... Message-ID: Say I had a string with a whole bunch of characters - "asdfjkhafjklhaf". How would I go about counting the number of individual characters (say, 'a')? One way I found in the book is this: @arr = $string =~ m/a/g; $number_of_a = scalar @arr; Is there a more elegant way of going about this? I want to skip the creation of @arr (I am worried about performance. The actual thing I will match is a little big and will take some time to write to an array.) I have a gut feeling that there is, and I just don't know what it is yet... BTW, it's not: $number = scalar $string =~ m/a/g; or $number = scalar ($string =~ m/a/g); This use of scalar forces the function (m//) to return a scalar not an array. It doesn't take the array we want so badly and count the number of elements. Jonathan M. Gardner CarDomain Networks (425)820-2244 x23 gardner@sounddomain.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Mon Dec 18 07:01:39 2000 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Dec. Mtg: State of the SPUGion; Free Books In-Reply-To: <20001218093452.B10819@ns0.astray.com>; from Leon Brocard on Mon, Dec 18, 2000 at 09:34:52AM +0000 References: <20001218023532.16150.qmail@web3102.mail.yahoo.com> <20001218093452.B10819@ns0.astray.com> Message-ID: <20001218130139.B2215@timji.consultix.wa.com> On Mon, Dec 18, 2000 at 09:34:52AM +0000, Leon Brocard wrote: > James Munger sent the following bits through the ether: > > > So oppurtunist vultures like myself, who've never gone to a meeting, > > don't just show up for the freebies. > > Interesting tactic. Generally I've found in the past at Bath.pm and > London.pm that giving freebies attracts people who might not turn > up. Thing is, they generally turn up for every meeting after that ;-) We've given away free books at *most* meetings over the past 6 months, so those interested only in freebies have already had plenty of opportunities to compete for them. > Perl Mongers tends to be about including, not excluding. OTOH perhaps > the group is getting too big? > Leon Brocard.............................http://www.astray.com/ The primary reason for excluding newbies at tomorrow's meeting, as I've stated elsewhere, is that it's an organizational meeting, geared to collecting feedback from experienced participants and making plans for the future. This is the only meeting in our nearly 3-year history to which the general public has not been invited; we're *all about inclusivity*, and have been that way since long before "Perl Mongering" caught on. Excessive attendance is not a problem; although we always pack our room to capacity (about 50 people) when "The Damian" is the speaker, my guestimated attendance for a meeting with no technical content just prior to Christmas would be about 8 people. I find it ironic that nearly that many people, most of whom have never attended a single meeting, have voiced objections about being excluded, and imagined all sorts of nefarious underlying reasons. Is the lesson here that to boost attendance, we should be much more restrictive about who can attend, and perhaps even start charging admission? It worked for Studio 54! 8-} ========================================================== | Tim Maher, Ph.D. Tel: (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 Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From largest at largest.org Mon Dec 18 14:24:32 2000 From: largest at largest.org (Joel Grow) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Counting the number of instances in a string using Perl's regexes... Message-ID: Jonathan Gardner wrote: > Say I had a string with a whole bunch of characters - > "asdfjkhafjklhaf". > > How would I go about counting the number of individual characters > (say, 'a')? Here's 2 ways. If you're unfamiliar with the tr operator, see pages 155-157 of the new Camel for an explanation of transliteration. my $count; $count++ while ( $string =~ /a/g ); # Or, my $count = ($string =~ tr/a/a/); Joel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From fossumar at hotmail.com Mon Dec 18 14:25:20 2000 From: fossumar at hotmail.com (Aaron Fossum) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Re: Counting the number of instances in a string using Perl's Message-ID: I think there's a recipe for this in the Perl Cookbook, but my copy's not handy here. :) while( $string =~ /yourstringhere/g ) { $count++; } should work. Cheers! Aaron Fossum bCentral.com ----- Original Message ----- From: Jonathan Gardner Sent: Monday, December 18, 2000 12:02 PM To: spug-list@pm.org Subject: SPUG: Counting the number of instances in a string using Perl's Say I had a string with a whole bunch of characters - "asdfjkhafjklhaf". How would I go about counting the number of individual characters (say, 'a')? One way I found in the book is this: @arr = $string =~ m/a/g; $number_of_a = scalar @arr; Is there a more elegant way of going about this? I want to skip the creation of @arr (I am worried about performance. The actual thing I will match is a little big and will take some time to write to an array.) I have a gut feeling that there is, and I just don't know what it is yet... BTW, it's not: $number = scalar $string =~ m/a/g; or $number = scalar ($string =~ m/a/g); This use of scalar forces the function (m//) to return a scalar not an array. It doesn't take the array we want so badly and count the number of elements. Jonathan M. Gardner CarDomain Networks (425)820-2244 x23 gardner@sounddomain.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/

Get your FREE download of MSN Explorer at http://explorer.msn.com

-------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20001218/5f45affe/attachment.htm From cmeyer at helvella.org Mon Dec 18 15:59:06 2000 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Counting the number of instances in a string using Perl's regexes... In-Reply-To: References: Message-ID: <20001218135906.A280@hobart.helvella.org> On Mon, Dec 18, 2000 at 11:51:43AM -0800, Jonathan Gardner wrote: > Say I had a string with a whole bunch of characters - "asdfjkhafjklhaf". > > How would I go about counting the number of individual characters (say, > 'a')? $str = 'asdfjkhafjklhaf'; $num_a = $str =~ tr/a/a/; from perldoc perlop: tr/SEARCHLIST/REPLACEMENTLIST/cds y/SEARCHLIST/REPLACEMENTLIST/cds Transliterates all occurrences of the characters found in the search list with the corresponding character in the replacement list. *It returns the number of characters replaced or deleted.* ... also see perldoc perlfaq4 and search for: How can I count the number of occurrences of a substring within a string? -C. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From daniel at chetlin.com Mon Dec 18 14:55:01 2000 From: daniel at chetlin.com (Daniel Chetlin) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Counting the number of instances in a string using Perl's regexes... In-Reply-To: ; from gardner@sounddomain.com on Mon, Dec 18, 2000 at 11:51:43AM -0800 References: Message-ID: <20001218125501.J1903@darkstar.ebizquality.net> On Mon, Dec 18, 2000 at 11:51:43AM -0800, Jonathan Gardner wrote: > Say I had a string with a whole bunch of characters - "asdfjkhafjklhaf". > > How would I go about counting the number of individual characters (say, > 'a')? Quickest and most idiomatic for counting a single character: $string = "asdfjkhafjklhaf"; # => asdfjkhafjklhaf $count = $string =~ tr/a//; # => 3 $string; # => asdfjkhafjklhaf (In other words, don't be afraid of tr/// -- it doesn't always modify the string it operates on). Most idiomatic for more than a single character: $count = () = $string =~ /af/g; # => 2 -dlc - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From daryn at marinated.org Mon Dec 18 15:09:46 2000 From: daryn at marinated.org (Daryn Nakhuda) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Counting the number of instances in a string using Perl's regexes... In-Reply-To: Message-ID: i'm guessing he meant the frequency of each character, like 3 a's, 1 s, 1 d, etc... it's easy to extrapolate that from your answer, but not particularly elegant to do it in that way for each char.. On Mon, 18 Dec 2000, Joel Grow wrote: > Jonathan Gardner wrote: > > > Say I had a string with a whole bunch of characters - > > "asdfjkhafjklhaf". > > > > How would I go about counting the number of individual characters > > (say, 'a')? > > > Here's 2 ways. If you're unfamiliar with the tr operator, see pages > 155-157 of the new Camel for an explanation of transliteration. > > my $count; > $count++ while ( $string =~ /a/g ); > > # Or, > my $count = ($string =~ tr/a/a/); > > Joel > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From LaurenS at bsquare.com Mon Dec 18 15:14:22 2000 From: LaurenS at bsquare.com (Lauren Smith) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Counting the number of instances in a string using Perl 's regexes... Message-ID: > > > > How would I go about counting the number of individual characters > > (say, 'a')? > > > Here's 2 ways. If you're unfamiliar with the tr operator, see pages > 155-157 of the new Camel for an explanation of transliteration. > > my $count; > $count++ while ( $string =~ /a/g ); > > # Or, > my $count = ($string =~ tr/a/a/); A quick benchmark: c:\>perl use Benchmark; $string = 'asdfljkblj;asdflj;a;ljkas;ldfasljf;'; timethese(1000000, { trans => sub { $count = ($string =~ tr/a/a/); }, regex => sub { $count++ while ($string =~ /a/g); } } ); ^Z Benchmark: timing 1000000 iterations of regex, trans... regex: 5 wallclock secs ( 5.92 usr + 0.00 sys = 5.92 CPU) @ 168976.01/s (n=1000000) trans: 0 wallclock secs ( 1.33 usr + 0.00 sys = 1.33 CPU) @ 750750.75/s (n=1000000) Lauren Smith -- eVT Maintenance (425) 519-5253 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jason at strangelight.com Mon Dec 18 16:02:14 2000 From: jason at strangelight.com (Jason Lamport) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Counting the number of instances in a string using Perl's regexes... In-Reply-To: References: Message-ID: At 11:51 AM -0800 12/18/00, Jonathan Gardner wrote: >Say I had a string with a whole bunch of characters - "asdfjkhafjklhaf". > >How would I go about counting the number of individual characters (say, >'a')? > >One way I found in the book is this: >@arr = $string =~ m/a/g; >$number_of_a = scalar @arr; > >Is there a more elegant way of going about this? I want to skip the creation >of @arr Here's one way: $number_of_a = 0; $string =~ s/a/ ++$number_of_a , 'a' /eg; 5000 iterations on a 29k-character $string (which contained 1188 'a's) took 33 seconds on my machine. (In comparison, using the original approach of assigning to @arr took 46 seconds.) If you're certain that you'll only be searching for single characters (not strings of characters, or more complex patterns) this is much more efficient: $number_of_a = ( $string =~ tr/a/a/ ); (And yes, I am aware that those paren's are probably unnecessary: they make the code more readable IMO.) The same 5000 iterations took only 5 seconds using tr. >(I am worried about performance. The actual thing I will match is a >little big and will take some time to write to an array.) If you're worried about performance, doing a pattern match on a very large scalar is probably not going to be the fastest approach, regardless of whether you create an intermediate array or not. Consider scanning the data as it's being input, rather than storing it all in a huge scalar and *then* scanning it. E.g. if you're reading from a file with filehandle IN, this would work: $/ = 'a'; $number_of_a = -1; while ( ) { $string .= $_; ++$number_of_a; } (Surprisingly, this works as-is: when the file ends with 'a', the while loop will be called one extra time with $_ set to the empty string. At least it does in 5.004 -- I'm not sure if I'd trust this behavior to remain constant in other versions.) -jason - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From gardner at sounddomain.com Mon Dec 18 16:52:36 2000 From: gardner at sounddomain.com (Jonathan Gardner) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: To sum it up... counting the number of occurences... Message-ID: To count the number of occurences of a rgex match in a string, I got the following suggestions: $count = $string =~ tr/a//; # From several of you... This works only if you are looking for individual characters. That isn't what I intended, but it was a very good solution to the example I posed. It is very fast, too. Trouble is that I never even think of using tr even when I should. It sits in the corner of my mind called "Perl Trivia" along with all the other stuff you can do but won't remember until someone else points out you should've. $count =0; $string =~ s/a/ ++$count , 'a' /eg; # Thanks to Jason Lampert This one is a little less obvious, but if you are familiar with the "," operator, it makes perfect sense. Each time the search comes up with a match, it executes the second half, which increments the count and returns the sub. The problem is you have to replace it if you want the string intact afterwards. I don't know what the overhead for this one is time wise compared to the following. There is another version using the matching operator: $count = () = $string =~ /a/g; # Thanks to Daniel Chetlin This one is a bit cryptic, but it gets the point across. How in the WORLD did you know about doing $SizeOfTheArrayReturnedByTheFunction = () = SomeFunctionWeWantAnArrayFromNotAScalar(); is a mystery to me... but now I know. The main point from this is that in array context, m//g returns an array of all the matches. There is a similar one: $count = 0; $count ++ while ($string =~ /a/g); # Thanks to Joel Grow That matches em all, puts it in an array and iterates over the array incrementing count each time. I learn more about "while" and "for/foreach" every day in perl. Those two functions have endless possibilities... The next one comes from Jason Lamport as well, it having to use the variable $/: $/ = 'a'; $count = -1; while (<>) { ++$count; } This is pretty cool, but you can't use regexes. $/ is one of those variables that I read about, forgot, seen it used, forgot, and seen it used again, but keep forgetting about. I suspect that if you have large files you want to count, this is the way to go. There's more than one way to do it, as the saying goes... Thanks for all the input! Jonathan M. Gardner CarDomain Networks (425)820-2244 x23 gardner@sounddomain.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tuck at whistlingfish.net Mon Dec 18 18:30:14 2000 From: tuck at whistlingfish.net (Matt Tucker) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: To sum it up... counting the number of occurences... In-Reply-To: Message-ID: <69450000.977185814@benzene> -- Jonathan Gardner spake thusly: > There is a similar one: > > $count = 0; > $count ++ while ($string =~ /a/g); # Thanks to Joel Grow > > That matches em all, puts it in an array and iterates over the array > incrementing count each time. I learn more about "while" and > "for/foreach" every day in perl. Those two functions have endless > possibilities... Actually, this doesn't store the matches in an array. It executes the match and iteration until it doesn't get any more matches. An important distinction if you're worried about speed and space issues. To do what you're talking about, you would do: $count++ foreach $string =~ /a/g; -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/spug-list/attachments/20001218/422e91a5/attachment.bin From tim at consultix-inc.com Mon Dec 18 12:34:40 2000 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Marty Cudmore is Gravely Ill Message-ID: <20001218183440.B1559@timji.consultix.wa.com> SPUGsters, Marty Cudmore is one of the "founding members" of SPUG, and was a frequent speaker and enthusiastic participant at our early meetings. He won an award for his user-submitted paper at the 1998 Perl Conference, and presented a talk on it at one of our meetings. He likes to quote SouthPark characters, uses a cane, and walks with a limp (to help you remember him). I've just heard that he is gravely ill, and not expected to recover. (Complications between his normal medical regime and the flu, from what I can gather.) Those wishing to visit him should do so soon (as detailed below). I'm sure I speak for all SPUGsters in wishing Marty all the best, and thanking him for his help in making SPUG what it is today. -Tim P.S. In the message below, the "Brook" being referred to is his wife. ========================================================== | Tim Maher, Ph.D. Tel: (206) 781-UNIX | | SPUG Founder & Leader Email: spug@halcyon.com | | Seattle Perl Users Group HTTP: www.halcyon.com/spug | ========================================================== ----- Forwarded message from "Pate, Jonathan W" ----- From: "Pate, Jonathan W" To: "'tim@consultix-inc.com'" Subject: Marty Cudmore Date: Mon, 18 Dec 2000 15:41:42 -0800 X-Mailer: Internet Mail Service (5.5.2650.21) Tim, I wasn't sure if you had heard about Marty. If not, details are below. Johnny Pate > As you are all aware, per our conversations yesterday, it does not appear that Marty will recover. The results of an EEG(may be wrong on the acronymn) shows he has severe brain damage. At this point it appears Brook and Marty's parents need to make a decision on when to pull the ventilator, which will cause Marty to die. > > Brook has said that people may come to visit, if they wish, but should would like them to come early this week, Monday or probably Tuesday at the latest. She doesn't want people to see him as his condition worsens, as he is already starting to breathe erratically and have seizures. > > The number at the hospital is 425-899-2300. Ask for the Cudmore room. I also have Brooks cell number and will give that out to those who ask. > > Please feel free to forward this note on. > > > Thanks, > > Royal Nienkark ========================================================== | Tim Maher, Ph.D. Tel: (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 Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From scott at sabmail.rresearch.com Mon Dec 18 19:45:56 2000 From: scott at sabmail.rresearch.com (Scott Blachowicz) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: To sum it up... counting the number of occurences... In-Reply-To: References: Message-ID: <20001218174555.A70043@sabami.seaslug.org> On Mon, Dec 18, 2000 at 02:52:36PM -0800, Jonathan Gardner wrote: > To count the number of occurences of a rgex match in a string, I got the > following suggestions: > > $count = $string =~ tr/a//; # From several of you... > > This works only if you are looking for individual characters. That isn't > what I intended, but it was a very good solution to the example I posed. It > is very fast, too. Trouble is that I never even think of using tr even when > I should. It sits in the corner of my mind called "Perl Trivia" along with > all the other stuff you can do but won't remember until someone else points > out you should've. > > $count =0; > $string =~ s/a/ ++$count , 'a' /eg; # Thanks to Jason Lampert What about extending that one... gator:~% cat ~/bin/charcount.pl #! /usr/bin/perl while (@ARGV) { my $string = shift @ARGV; %counts = (); $string =~ s/([a-z])/++$counts{$1}, $1 /eg; print "=== '$string' ===\n"; print map {"\t$_=$counts{$_}\n"} sort keys %counts; } gator:~% charcount.pl aldkfjasldfjasfjasldkjasdfjapirouerpowjfksdjfiaurpqej === 'aldkfjasldfjasfjasldkjasdfjapirouerpowjfksdjfiaurpqej' === a=7 d=5 e=2 f=6 i=2 j=8 k=3 l=3 o=2 p=3 q=1 r=3 s=5 u=2 w=1 Is that closer to the sort of thing you were looking for? No idea how slow/fast it is... -- Scott Blachowicz - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jdevlin at stadiumdistrict.com Mon Dec 18 23:19:30 2000 From: jdevlin at stadiumdistrict.com (Joe Devlin) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Installing Crypt, not su Message-ID: <01C06938.64D464E0@tac-lx100-ip42.nwnexus.net> I am not the super user on a certain machine, but still want to install modules in my local directory. I have several of my own modules working. > I want to install: > Crypt-CBC-1.25 Crypt-DES-2.01 MD5-1.7 > > with standard manual method like this: > > perl Makefile.PL > PREFIX=/home/a/myAccount/public_html/cgi-bin/modules/Crypt-DES-2.01 > make > make test > make install > > The installation seems to go smoothly until I try to access the modules > according the documented procedures from inside my code seminars.pl. > Then I get a bunch of error messages saying: The latest advice by the system administrators is that I should copy the modules from the install directory into myAccount/cgi-bin directory. This has not worked properly. Does anyone have a suggestion about what next steps I should try? my session follows: +*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+* [myAccount@thes cgi-bin]$ ls -l total 106 -rwxr-xr-x 1 myAccount commerce 9399 Jun 8 2000 CBC.pm -rwxr-xr-x 1 myAccount commerce 12486 Oct 18 11:27 Common.pm -rwxr-xr-x 1 myAccount commerce 3471 Sep 11 13:14 DES.pm -rwxr-xr-x 1 apollo commerce 3824 Dec 4 21:54 Datimenu.pm -rwxr-xr-x 1 myAccount commerce 6828 Aug 12 1996 MD5.pm drwxrwxrwx 5 myAccount commerce 512 Nov 24 18:37 modules -rwxr-xr-x 1 myAccount commerce 18890 Dec 14 22:15 seminars.pl [myAccount@thes cgi-bin]$ pwd /home/a/myAccount/public_html/cgi-bin [myAccount@thes cgi-bin]$ [myAccount@thes cgi-bin]$ ./seminars.pl -c Uncaught exception from user code: Uncaught exception from user code: Uncaught exception from user code: Can't locate loadable object for module Crypt::DES in @INC (@INC contain s: /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 .) at ./seminars.pl line 62 Carp::croak('Can\'t locate loadable object for module Crypt::DES in @INC (@IN...') called at /usr/lib/perl5/5.00503/i386-linux/DynaLoader.pm line 93 DynaLoader::croak('Can\'t locate loadable object for module Crypt::DES i n @INC (@IN...') called at /usr/lib/perl5/5.00503/i386-linux/DynaLoader.pm line 144 DynaLoader::bootstrap('Crypt::DES') called at DES.pm line 21 require DES.pm called at ./seminars.pl line 62 main::BEGIN() called at DES.pm line 0 eval {...} called at DES.pm line 0 main::BEGIN() called at DES.pm line 62 eval {...} called at DES.pm line 62 BEGIN failed--compilation aborted at ./seminars.pl line 62. [myAccount@thes cgi-bin]$ +*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+* line 62 of the code is use CBC; use DES; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tuck at whistlingfish.net Tue Dec 19 01:46:02 2000 From: tuck at whistlingfish.net (Matt Tucker) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Installing Crypt, not su In-Reply-To: <01C06938.64D464E0@tac-lx100-ip42.nwnexus.net> Message-ID: <10590000.977211962@flashingchance.whistlingfish.net> -- Joe Devlin spake thusly: > The latest advice by the system administrators is that I should copy > the modules from the install directory into myAccount/cgi-bin > directory. This has not worked properly. You shouldn't need to do this if you have a proper 'use lib' line in your script. Ie: use lib '/home/a/myAccount/lib'; use Crypt::DES; ... > Does anyone have a suggestion about what next steps I should try? If you're going to manually install Perl modules, you should do it properly. Maintain the complete structure, and copy the requisite shared libraries. Shared libraries are kept in a directory called 'auto' with a directory structure that mirrors that of the module loading the shared library. For Crypt::DES, you should have: Crypt/ Crypt/DES.pm auto/ auto/Crypt/ auto/Crypt/DES/ auto/Crypt/DES/DES.bs auto/Crypt/DES/DES.so All this stuff could either go in cgi-bin or in /home/a/myAccount/lib, depending on how you want things set up. Just be sure to use the proper 'use lib' directive (if it's not the same directory that contains the script), and provide the correct structure. > line 62 of the code is > > use CBC; > use DES; This should be: use Crypt::CBC; use Crypt::DES; ...with CBC.pm and DES.pm placed in a directory called 'Crypt'. It's not absolutely necessary to maintain the mapping between filename and module, but it helps keep things from being confusing. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/spug-list/attachments/20001218/3e4a5cda/attachment.bin From Jay at Scherrer.com Tue Dec 19 10:14:34 2000 From: Jay at Scherrer.com (jay) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: a perl debugger Message-ID: <00121908242900.01666@localhost.localdomain> Fellow Spugers, I have found a really neat graphical Perl debugger which I find very useful. You can get the link ar http://cs.tu-bs.de/softech/ddd/ddd.html they refer to ddd's home page at http://www.gnu.org/software/ddd/. I have found ddd very usfull as you can watch the variable initializations as you step through your script. Jay Jay@Scherrer.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jason at strangelight.com Tue Dec 19 13:05:15 2000 From: jason at strangelight.com (Jason Lamport) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Installing Crypt, not su In-Reply-To: <10590000.977211962@flashingchance.whistlingfish.net> References: <10590000.977211962@flashingchance.whistlingfish.net> Message-ID: At 11:46 PM -0800 12/18/00, Matt Tucker wrote: >All this stuff could either go in cgi-bin or in >/home/a/myAccount/lib, depending on how you want things set up. Just >be sure to use the proper 'use lib' directive (if it's not the same >directory that contains the script), and provide the correct >structure. It's a good idea to use lib even if the library is in the same directory as your script, and to remove '.' from the search path (I think running perl with the -T option does this automatically?), since you can't be certain what the current directory will be when your script is run, *especially* if it's a cgi. (Although nearly all web servers set the current directory of cgi's to the directory containing the script, this is *not* a requirement of the cgi standard. Also, a favorite method of hackers is to trick world-executable script into loading malicious code by setting the working directory to something unexpected.) -jason - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From briani at activestate.com Wed Dec 20 20:30:20 2000 From: briani at activestate.com (Brian Ingerson) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Inline 0.30 has Shipped Message-ID: <3A416B3C.2D4BDDA9@activestate.com> SPUG, Thought you guys should be the first to know. I just uploaded Inline version 0.30 to the CPAN. (Give it a few hours to get processed.) 0.30 is a very major release. (See below) I also posted the first edition of Inline::CPR (C Perl Run). This is the thing I talked about at the SPUG meeting where you put a hashbang (#!/usr/bin/cpr) at the top of your C code, and then just run it. Sometime tonight, Neil Watkiss will also release Inline::Python (very cool, I'm sad to admit :-) and Inline::CPP. In addition, I am officially announcing inline@perl.org , the new Inline mailing list. Send email to inline-subscribe@perl.org to join. Cheers, Brian Here is the README notes: -------------------------------------------------------------------------- FEATURES: Inline version 0.30 is a major upgrade from previous verions. It includes: + Integrated support for typemap files in C. + All the recognized types now come *only* from typemaps. + The default types come from the default typemap installed with core Perl. + Typemaps are used to modify the Parse::RecDescent grammar for parsing C. + This means you can easily use your existing typemaps. + Language support completely separated from base Inline code. + Beta supoort for C (Inline::C, included) + Alpha support for C++ (Inline::CPP, available separately) + Alpha support for Python (Inline::Python, available separately) + Support for 'embedding' Perl in C with my new programming language, CPR. (Inline::CPR, available separately) This one may warp your mind :^) + Simple API for adding your own language support. + Write your own Inline::Foo + Write your own implementation of Inline::C, or just modify Inline::C::grammar. + Support for interpreted languages in addition to compiled ones. + Autodetection of new Inline language modules. + Much easier and more powerful configuration syntax. + More XS and MakeMaker features exposed for configuration (for C and C++). + Flexible new syntax for specifying source code. + Use DATA section for AutoLoader, Inline, and POD simultaneously. + Support for using Inline 'with' other modules. + "use Inline with 'Event';" lets Event.pm pass config info to Inline.pm. + Event.pm 0.80 has built in support for Inline.pm 0.30 and higher. + Write Event callbacks in C with extreme ease. + More documentation + perldoc Inline + perldoc Inline-Support + perldoc Inline-API + perldoc Inline::C + perldoc Inline::C-Cookbook + Better error messages and easier debugging. + Mailing list: inline@perl.org Other features of Inline.pm include: = Automatically compiles your source code and caches the shared object. = Automatically DynaLoads the shared object and binds it to Perl. = Recompiles only when the C code changes. = Changing the Perl code will not cause a recompile of the C code. = Support for writing extension modules, suitable for distributing to the CPAN. = Support for generating and binding Inline subs at run time. = Works on all Unix and MS Windows configurations. -- perl -le 'use Inline C=>q{SV*JAxH(char*x){return newSVpvf ("Just Another %s Hacker",x);}};print JAxH+Perl' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From briani at activestate.com Thu Dec 21 00:21:15 2000 From: briani at activestate.com (Brian Ingerson) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: ActivePerl 623 Message-ID: <3A41A15B.BF7409A6@activestate.com> SPUG, ActivePerl 623 is finally out on the web. It has those 1000+ modules that I talked about at the November meeting. It also automatically updates the ActivePerl HTML doc tree when you install a module. http://www.ActiveState.com/Corporate/Communications/Releases/Press977200461.html Also, I would like to advocate ActivePerl for Unix (Linux, Solaris). It's very quick and easy to install. The same goes for module installation. If you're one of those people who always complains about not having Perl 5.6 to play with at work, ActivePerl works out great because you can just install it in your home dir, and delete it at the end of the day. You could even write a small script to install your favorite mods. Something like: #!/bin/sh ppm install XML::Simple ppm install Inline # etc... I really think its a great idea. I use it all the time. Nobody told me to write this. I do not have a gun to my head... :) Brian ingy@ActiveState.com -- perl -le 'use Inline C=>q{SV*JAxH(char*x){return newSVpvf ("Just Another %s Hacker",x);}};print JAxH+Perl' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From brian at tangent.org Thu Dec 21 14:55:45 2000 From: brian at tangent.org (Brian Aker) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Threads and perl References: Message-ID: <3A426E51.49E62B1E@tangent.org> So has anyone had much experience with perl and threads? I have a small server that creates a thread to handle requests. It would be really nice if I could occasionally call a perl interpreter to run certain pieces of code. I have been trying to use the following function: #include #include #include "proto.h" gchar * perl_handler(gchar *string) { STRLEN n_a; PerlInterpreter *my_perl; gchar *returnable = NULL; char *embedding[] = { "", "-e", "0" }; my_perl = perl_alloc(); perl_construct(my_perl); perl_parse(my_perl, NULL, 3, embedding, NULL); perl_run(my_perl); eval_pv(string, TRUE); returnable = SvPV(perl_get_sv("a", FALSE), n_a); perl_destruct(my_perl); perl_free(my_perl); return returnable; } I am finding though that if more then one thread happens to call the perl interpreter at once I can expect a core dump. So how thread safe is perl at this point? Anyone know of anything special that has to be done to make it happy? Got an idea of a better place to ask this question? thanks, -Brian -- _______________________________________________________ Brian Aker, brian@tangent.org Slashdot Senior Developer Seattle, Washington http://tangent.org/~brian/ http://slashdot.org/ _______________________________________________________ You can't grep a dead tree. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jdevlin at stadiumdistrict.com Fri Dec 29 03:29:44 2000 From: jdevlin at stadiumdistrict.com (Joe Devlin) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Installing Crypt, not su Message-ID: <01C07136.D52F6680@tac-lx100-ip38.nwnexus.net> Matt, The use DES; is still failing, while MD5 and CBC use statements seem to succeed. I re-installed DES from a clean tar file. There are several DES modules floating around after the installation, I'm not sure which one is supposed to be referenced in @INC. I confirmed directory structure as you suggested +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- [myAccount@seker DES]$ pwd /home/a/myAccount/public_html/cgi-bin/modules/Crypt-DES-2.03/lib/site_perl/5.6.0/ i386-inux/auto/Crypt/DES [myAccount@seker DES]$ ls DES.bs DES.so [myAccount@seker Crypt]$ pwd /home/a/myAccount/public_html/cgi-bin/modules/Crypt-DES-2.03/lib/site_perl/5.6.0/i3 86-linux/Crypt [myAccount@seker Crypt]$ ls DES.pm +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- Session follows: = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = [myAccount@seker cgi-bin]$ ./seminars.pl -c Uncaught exception from user code: Uncaught exception from user code: Uncaught exception from user code: Can't locate loadable object for module Crypt::DES in @INC (@INC contain s: /home/a/myAccount/public_html/cgi-bin/modules/Crypt-CBC-1.25/lib/perl5/site_perl /5.005/Crypt /home/a/myAccount/public_html/cgi-bin/modules/Crypt-DES-2.03/lib/site_ perl/5.6.0/i386-linux/Crypt /home/a/myAccount/public_html/cgi-bin/modules/MD5-1.7/l ib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/5.6.0/i386-linux /usr/lib/per l5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6. 0 /usr/lib/perl5/site_perl .) ...... = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = End Session use lib qw( /home/a/myAccount/public_html/cgi-bin/modules/Crypt-CBC-1.25/lib/perl5/site_perl/5.005/Crypt /home/a/myAccount/public_html/cgi-bin/modules/Crypt-DES-2.03/lib/site_perl/5.6.0/i386-linux/Crypt /home/a/myAccount/public_html/cgi-bin/modules/MD5-1.7/lib/perl5/site_perl/5.005/i386-linux ); use Common; #standard project stuff use DBI; #datbase interface use CGI qw(:all); #creating web pages use CGI param; use English; use diagnostics; #verbose failure codes use MD5; use CBC; #to encrypt registration info use DES; use strict; #must declare global variables #here are the globals use vars qw( $action $item $dummy $mstate $i $n %form_data $form_data $document_root %fields $path $filetoopen $dsn $user $password $sub_dir $sth $dbh); ---------- From: Matt Tucker[SMTP:tuck@whistlingfish.net] Sent: Monday, December 18, 2000 11:46 PM To: Joe Devlin Cc: 'spug-list@pm.org' Subject: Re: SPUG: Installing Crypt, not su -- Joe Devlin spake thusly: > The latest advice by the system administrators is that I should copy > the modules from the install directory into myAccount/cgi-bin > directory. This has not worked properly. You shouldn't need to do this if you have a proper 'use lib' line in your script. Ie: use lib '/home/a/myAccount/lib'; use Crypt::DES; ... > Does anyone have a suggestion about what next steps I should try? If you're going to manually install Perl modules, you should do it properly. Maintain the complete structure, and copy the requisite shared libraries. Shared libraries are kept in a directory called 'auto' with a directory structure that mirrors that of the module loading the shared library. For Crypt::DES, you should have: Crypt/ Crypt/DES.pm auto/ auto/Crypt/ auto/Crypt/DES/ auto/Crypt/DES/DES.bs auto/Crypt/DES/DES.so All this stuff could either go in cgi-bin or in /home/a/myAccount/lib, depending on how you want things set up. Just be sure to use the proper 'use lib' directive (if it's not the same directory that contains the script), and provide the correct structure. > line 62 of the code is > > use CBC; > use DES; This should be: use Crypt::CBC; use Crypt::DES; ...with CBC.pm and DES.pm placed in a directory called 'Crypt'. It's not absolutely necessary to maintain the mapping between filename and module, but it helps keep things from being confusing. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tuck at whistlingfish.net Fri Dec 29 03:52:00 2000 From: tuck at whistlingfish.net (Matt Tucker) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: Installing Crypt, not su In-Reply-To: <01C07136.D52F6680@tac-lx100-ip38.nwnexus.net> Message-ID: <1184710000.978083520@flashingchance.whistlingfish.net> -- Joe Devlin spake thusly: > The use DES; is still failing, while MD5 and CBC use statements seem > to succeed. > > I re-installed DES from a clean tar file. > > There are several DES modules floating around after the installation, > I'm not sure which one is supposed to be referenced in @INC. > > I confirmed directory structure as you suggested > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- > [myAccount@seker DES]$ pwd > /home/a/myAccount/public_html/cgi-bin/modules/Crypt-DES-2.03/lib/site > _perl/5.6.0/ i386-inux/auto/Crypt/DES > [myAccount@seker DES]$ ls > DES.bs DES.so > > > [myAccount@seker Crypt]$ pwd > /home/a/myAccount/public_html/cgi-bin/modules/Crypt-DES-2.03/lib/site > _perl/5.6.0/i3 86-linux/Crypt > [myAccount@seker Crypt]$ ls > DES.pm > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- > use lib qw( > > /home/a/myAccount/public_html/cgi-bin/modules/Crypt-CBC-1.25/lib/perl > 5/site_perl/5.005/Crypt > > /home/a/myAccount/public_html/cgi-bin/modules/Crypt-DES-2.03/lib/site > _perl/5.6.0/i386-linux/Crypt > > /home/a/myAccount/public_html/cgi-bin/modules/MD5-1.7/lib/perl5/site_ > perl/5.005/i386-linux > > ); > > use Common; #standard project stuff > use DBI; #datbase interface > use CGI qw(:all); #creating web pages > use CGI param; > use English; > use diagnostics; #verbose failure codes > > > use MD5; > use CBC; #to encrypt registration info > use DES; Wow. That's certainly more complicated than I'd bother with; I would just install everything in '/home/a/myAccount/lib' and do one 'use lib', but that's all you, I suppose. As I said last time, I've noticed people doing things like: use lib qw(/home/tuck/lib/Crypt); use DES; Which works, but is not appropiate. The proper thing to do is: use lib qw(/home/tuck/lib); use Crypt::DES; This allows perl to find the proper auto hierarchies as well, and makes your code more consistent in that you do 'use Crypt::DES' and reference the module later as 'Crypt::DES', rather than doing 'use DES' and then later calling it 'Crypt::DES'. To sum up, you should probably do the following: # Note the removal of '/Crypt' from the end of the first one use lib qw( /home/a/myAccount/public_html/cgi-bin/modules/Crypt-DES-2.03/lib/\ site_perl/5.6.0/i386-linux /home/a/myAccount/public_html/cgi-bin/modules/MD5-1.7/lib/perl5/\ site_perl/5.005/i386-linux ); use Crypt::DES; # <-- note the full name on these two use Crypt::CBC; use Digest::MD5; # <-- note the use of Digest::MD5 instead # of plain old MD5, which is deprecated By the way, you probably shouldn't install things under directories like 'site_perl/5.6.0' unless you actually HAVE perl 5.6.0. If you do, then that's fine, otherwise you're better off matching your actual version or just not bothering with all that extra path stuff. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/spug-list/attachments/20001229/57fa8e3e/attachment.bin From jason at strangelight.com Sat Dec 30 00:57:34 2000 From: jason at strangelight.com (Jason Lamport) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: VERY weird syntax "error"... Message-ID: I was wondering if someone could explain this VERY puzzling behavior. Consider these three programs, which *should* be symantically identical: --------------------------------------- #!/usr/bin/perl use strict; my @foo; print ( $foo[ rand ] ); ----------------------------------------- #!/usr/bin/perl use strict; my @foo; print ( $foo[ rand ] ); ---------------------------------------- #!/usr/bin/perl use strict; my @foo; print ( @foo[ rand ] ); --------------------------------------- The first and third do exactly what I would expect (nothing). However, the second one dies with: Global symbol "$foo" requires explicit package name at ./test.pl line 8. Execution of ./test.pl aborted due to compilation errors. Exit 255 What the...?!?!?! The only difference between this program and the one above it is the insertion of a single newline, which should have no effect whatsoever. I've tried this with Perl 5.6 on Linux and Perl 5.004 on both Linux and MacOS, with identical results. -jason - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From briani at activestate.com Sat Dec 30 04:16:03 2000 From: briani at activestate.com (Brian Ingerson) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: VERY weird syntax "error"... References: Message-ID: <3A4DB5E3.BC16FCED@activestate.com> Jason Lamport wrote: > > I was wondering if someone could explain this VERY puzzling behavior. > Consider these three programs, which *should* be symantically > identical: Looks like you've stumbled across a known obscure bug. My coworker, Jan Dubois, says there are similar problems with grep and map when you put the first argument of a parenthesized list on a separate line from the opening paren. Evidently it's a hard bug to fix. Your problem can be boiled down to: -------------8<------------ use strict; my @foo = (5, 7, 9); print( $foo[0]); -------------8<------------ but this works: -------------8<------------ use strict; my @foo = (5, 7, 9); print(3, $foo[0]); -------------8<------------ Brian PS Try this on 5.6.0 for fun: perl -e 'x{}' or 3 bytes shorter: perl -ex{} It's the Perl Golf solution to "Make Perl Crash!" (It's fixed in 5.6.1) :( -- perl -le 'use Inline C=>q{SV*JAxH(char*x){return newSVpvf ("Just Another %s Hacker",x);}};print JAxH+Perl' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From john.brittingham at attws.com Sat Dec 30 13:00:55 2000 From: john.brittingham at attws.com (Brittingham, John) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: declarations Message-ID: How do you declare $in in the following line? my $one_server= $in{'server'}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jdevlin at stadiumdistrict.com Sat Dec 30 13:27:18 2000 From: jdevlin at stadiumdistrict.com (Joe Devlin) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: declarations Message-ID: <01C07253.7E4CFA80@tac-lx100-ip40.nwnexus.net> my %in;#separate command for declaration, not in same line my $one_server= $in{'server}; #alternately as global variable in the first few lines of the program use vars qw( %in $other_var1 $other_var2 $other_var3 %other_hash); ---------- From: Brittingham, John[SMTP:john.brittingham@attws.com] Sent: Saturday, December 30, 2000 11:00 AM To: spug-list@pm.org Subject: SPUG: declarations How do you declare $in in the following line? my $one_server= $in{'server'}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From dha at panix.com Sat Dec 30 19:39:48 2000 From: dha at panix.com (David H. Adler) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: declarations In-Reply-To: <01C07253.7E4CFA80@tac-lx100-ip40.nwnexus.net>; from jdevlin@stadiumdistrict.com on Sat, Dec 30, 2000 at 11:27:18AM -0800 References: <01C07253.7E4CFA80@tac-lx100-ip40.nwnexus.net> Message-ID: <20001230203948.D12985@panix.com> On Sat, Dec 30, 2000 at 11:27:18AM -0800, Joe Devlin wrote: > my %in;#separate command for declaration, not in same line > my $one_server= $in{'server}; > > #alternately as global variable in the first few lines of the program > use vars qw( %in $other_var1 $other_var2 $other_var3 %other_hash); > > ---------- > From: Brittingham, John[SMTP:john.brittingham@attws.com] > Sent: Saturday, December 30, 2000 11:00 AM > To: spug-list@pm.org > Subject: SPUG: declarations > > How do you declare $in in the following line? > my $one_server= $in{'server'}; My question is, why would you even have a line of code like this in a program at a point where %in wouldn't already exist? And if you localize it as at top, you're effectively just assinging a value of undef to $one_server. Am I missing something? dha -- David H. Adler - - http://www.panix.com/~dha/ "That's one of the tragedies of this life: that the men most in need of a beating up are always enormous." - John D. Hackensacker III - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From greg at mccarroll.demon.co.uk Sun Dec 31 20:17:40 2000 From: greg at mccarroll.demon.co.uk (Greg McCarroll) Date: Wed Aug 4 00:07:48 2004 Subject: SPUG: declarations In-Reply-To: <20001230203948.D12985@panix.com>; from dha@panix.com on Sat, Dec 30, 2000 at 08:39:48PM -0500 References: <01C07253.7E4CFA80@tac-lx100-ip40.nwnexus.net> <20001230203948.D12985@panix.com> Message-ID: <20010101021740.A17413@mccarroll.demon.co.uk> * David H. Adler (dha@panix.com) wrote: > > My question is, why would you even have a line of code like this in a > program at a point where %in wouldn't already exist? And if you > localize it as at top, you're effectively just assinging a value of > undef to $one_server. based on a few leaps of logic, is the question - how do i set a default for $in{'server'} if its not already defined. if this isn't the real question please forgive me, but i'm just joining into the guessing game along with everyone else .... anyway the neatest way to declare the defaults just before they are used is (imho), $in{'server'} ||= 'default.mydomain.com'; my $server = $in{'server'}; for more info about ||= do a search for ``orcish maneuver'' on your favourite search engine (or better still google ;-) ) hth - but i am guessing * DHA then wrote: > > Am I missing something? > the BBC? ulster frys? good guiness? ;-) Greg -- Greg McCarroll http://www.mccarroll.uklinux.net - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jason at strangelight.com Sun Dec 31 21:31:00 2000 From: jason at strangelight.com (Jason Lamport) Date: Wed Aug 4 00:07:49 2004 Subject: SPUG: declarations In-Reply-To: <20010101021740.A17413@mccarroll.demon.co.uk> References: <01C07253.7E4CFA80@tac-lx100-ip40.nwnexus.net> <20001230203948.D12985@panix.com> <20010101021740.A17413@mccarroll.demon.co.uk> Message-ID: At 2:17 AM +0000 1/1/01, Greg McCarroll wrote: > >anyway the neatest way to declare the defaults just before they are >used is (imho), > >$in{'server'} ||= 'default.mydomain.com'; >my $server = $in{'server'}; > >for more info about ||= do a search for ``orcish maneuver'' on your >favourite search engine (or better still google ;-) ) Actually, when I looked up "orcish maneuver" it didn't really explain the ||= operator. So, I'll do the honors: $a ||= $b; seems rather cryptic, until you remember two things. First, that it's simply a shorthand for: $a = ( $a || $b ); and second, that || is a short-circuit operator which simply returns the last evaluated operand, so the above is semantically equivalent to: $a = ( $a ? $a : $b ); So $a ||= $b; is a clever way if assigning a value to $a if and only if $a does not *already* have a (boolean true) value; In the above example, writing the initialization like this: $in{'server'} ||= 'default.mydomain.com'; only makes sense if you think that $in{'server'} *might* already contain a value (which you don't want to clobber). If you're certain that $in{'server'} starts out undef, then it would be (slightly) more efficient to write: $in{'server'} = 'default.mydomain.com'; (And I'm guessing that if %in starts out undef, then it would be even more efficient to write: %in = ( 'server', 'default.mydomain.com' ); but I'm not sure.) And if you want $in{'server'} to become 'default.mydomain.com' *regardless* of what its initial value might be, then you DON'T want to use the ||= operator. Hope this helps. -jason - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/