From Peter at PSDT.com Wed Aug 7 16:03:45 2002 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:07 2004 Subject: Got spam? Message-ID: <4.3.2.7.2.20020807135501.00ab48a0@shell2.webquarry.com> Did anyone else on the list get a spam just now from Jennifer Atkins ? The body addressed me as a Victoria.pm member, but it did not come through the list. I don't see how the addresses could have been harvested from the mail server, perhaps there is a mail-to-web reflector somewhere? (Like I just discovered that the Beginners' List is at http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&group=perl.beginners). -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From nkuipers at uvic.ca Wed Aug 7 16:39:29 2002 From: nkuipers at uvic.ca (nkuipers) Date: Wed Aug 4 00:11:07 2004 Subject: Got spam? Message-ID: <3D519A23@wm2.uvic.ca> >===== Original Message From Peter Scott ===== >Did anyone else on the list get a spam just now from > >Jennifer Atkins > >? Nope, no spam here... From pavel at md5.ca Wed Aug 7 17:12:46 2002 From: pavel at md5.ca (Pavel Zaitsev) Date: Wed Aug 4 00:11:07 2004 Subject: Got spam? In-Reply-To: <4.3.2.7.2.20020807135501.00ab48a0@shell2.webquarry.com> References: <4.3.2.7.2.20020807135501.00ab48a0@shell2.webquarry.com> Message-ID: <20020807221246.GA16074@md5.ca> not here either, p. Peter Scott(Peter@PSDT.com)@Wed, Aug 07, 2002 at 02:03:45PM -0700: > Did anyone else on the list get a spam just now from > > Jennifer Atkins > > ? The body addressed me as a Victoria.pm member, but it did not come > through the list. I don't see how the addresses could have been > harvested from the mail server, perhaps there is a mail-to-web > reflector somewhere? (Like I just discovered that the Beginners' List > is at > http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&group=perl.beginners). > -- > Peter Scott > Pacific Systems Design Technologies > http://www.perldebugged.com/ > -- Create like god, rule like a king, work like a slave. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://mail.pm.org/archives/victoria-pm/attachments/20020807/3d093fc0/attachment.bin From peter at PSDT.com Fri Aug 9 18:41:15 2002 From: peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:07 2004 Subject: Meeting? Message-ID: <4.3.2.7.2.20020809164016.00ab4530@shell2.webquarry.com> So who's interested in meeting in August? Any time the week of the 19th looks good to me. (Following week: WorldCon!) -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From nkuipers at uvic.ca Fri Aug 9 19:05:09 2002 From: nkuipers at uvic.ca (nkuipers) Date: Wed Aug 4 00:11:07 2004 Subject: Meeting? Message-ID: <3D545E40@wm2.uvic.ca> >===== Original Message From Peter Scott ===== >So who's interested in meeting in August? sure thing. :) >Any time the week of the 19th looks good to me. it's all good by me. nathanael From Peter at PSDT.com Sat Aug 10 12:05:04 2002 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:07 2004 Subject: Meeting - August 20 Message-ID: <4.3.2.7.2.20020810100057.00aaa7c0@shell2.webquarry.com> Okay, hearing little (c.f. Warnock's Dilemma - yes, it's a Perl term) I declare that the next Victoria.pm meeting will be on Tuesday August 20, usual place: Meet 6:45pm at the art gallery inside and right of the doors to the McPherson Library, at 7pm we'll reserve a room upstairs and head there. Agenda can include the postponed talk on objet-oriented programming in Perl, attendance permitting. I may not be answering email for ~ 1 week, FYI. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From abez at abez.ca Sat Aug 10 12:31:04 2002 From: abez at abez.ca (abez) Date: Wed Aug 4 00:11:07 2004 Subject: Meeting - August 20 In-Reply-To: <4.3.2.7.2.20020810100057.00aaa7c0@shell2.webquarry.com> Message-ID: Sounds good. On Sat, 10 Aug 2002, Peter Scott wrote: > Okay, hearing little (c.f. Warnock's Dilemma - yes, it's a Perl term) I > declare that the next Victoria.pm meeting will be on Tuesday August 20, > usual place: Meet 6:45pm at the art gallery inside and right of the > doors to the McPherson Library, at 7pm we'll reserve a room upstairs > and head there. > > Agenda can include the postponed talk on objet-oriented programming in > Perl, attendance permitting. > > I may not be answering email for ~ 1 week, FYI. > -- > Peter Scott > Pacific Systems Design Technologies > http://www.perldebugged.com/ > -- ABeZ------------ ------- ------ - ---------- -- ------------ http://www.indexdirect.com/abez/ Abram Hindle (abez@abez.ca) ---- ------- ----------- ----------- - - ------ --------ABeZ From nkuipers at uvic.ca Sat Aug 10 18:53:20 2002 From: nkuipers at uvic.ca (nkuipers) Date: Wed Aug 4 00:11:07 2004 Subject: Meeting - August 20 Message-ID: <3D559719@wm2.uvic.ca> >===== Original Message From Peter Scott ===== >Okay, hearing little (c.f. Warnock's Dilemma - yes, it's a Perl term) I >declare that the next Victoria.pm meeting will be on Tuesday August 20, okie dokie nathanael From rockie at innocent.com Mon Aug 12 03:38:29 2002 From: rockie at innocent.com (Liz or Rockie Lowe) Date: Wed Aug 4 00:11:07 2004 Subject: Meeting - August 20 References: <4.3.2.7.2.20020810100057.00aaa7c0@shell2.webquarry.com> Message-ID: <009b01c241db$a28650f0$e9954218@bullwinkle2000> > Okay, hearing little (c.f. Warnock's Dilemma - yes, it's a Perl term) I > declare that the next Victoria.pm meeting will be on Tuesday August 20, > usual place: Meet 6:45pm at the art gallery inside and right of the > doors to the McPherson Library, at 7pm we'll reserve a room upstairs > and head there. > It sounds like a good day. I may finally be able to attend instead of just lurking online. From Peter at PSDT.com Mon Aug 19 14:42:53 2002 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:07 2004 Subject: Meeting reminder - Victoria.pm Message-ID: <4.3.2.7.2.20020819111449.00b4edf0@shell2.webquarry.com> Today (Tuesday), 6:45 in art gallery just inside McPherson Library entrance, UVic. I will bring the second edition of "Mastering Regular Expressions". -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From Peter at PSDT.com Mon Aug 19 14:51:16 2002 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:07 2004 Subject: Meeting is tomorrow Message-ID: <4.3.2.7.2.20020819124902.00b49b70@shell2.webquarry.com> Grr, the meeting is of course tomorrow... apparently when you edit a timed delivery message in Eudora and close the window it takes it upon itself to deliver the message immediately instead of leaving it queued up... There may be a presentation on object-oriented Perl programming, depending on attendance. From nkuipers at uvic.ca Mon Aug 19 15:25:11 2002 From: nkuipers at uvic.ca (nkuipers) Date: Wed Aug 4 00:11:07 2004 Subject: Meeting is tomorrow Message-ID: <3D6162D7@wm2.uvic.ca> I'll be there. I picked up Regex 2nd ed yesterday also. Looking forward to tomorrow's meeting. nathanael From nkuipers at uvic.ca Mon Aug 26 16:30:17 2002 From: nkuipers at uvic.ca (nkuipers) Date: Wed Aug 4 00:11:07 2004 Subject: lexical problems (i think) Message-ID: <3D6A9DF1@wm2.uvic.ca> Hello all, I need help with variable persistence. As preamble, carefully consider an input file whose contents look like this: start of file >header1 sequence... sequence... >header2 . . . >headerN sequenceN... end of file My goal is a parsing one: parse the file contents into a hash keyed by header. Here is the subroutine. sub parse_fasta_file { my ($fh, $href) = @_; my $header = undef; my $sequence = undef; #hash: header => 'sequence' while (<$fh>) { if ( /^>(.*)\n$/ && !defined $header ) { ##first '>' in file $header = $1 } elsif ( /^>(.*)\n$/ && defined $header ) { $sequence =~ s/\s//g; $href->{$header} = $sequence; $sequence = undef; $header = $1; } #want persistence here elsif ( /^[acgtACGT\n]+$/ ) { $sequence .= $_ } } #last sequence (no '>' signal followed for dumping into hash) $sequence =~ s/\s//g; #This gets done, last sequence is perfect. $href->{$header} = $sequence; #Header undefined for hashing! } I get the following error messages: "Use of uninitialized value in hash element at REPfind line 121, line 252702." (get this one twice in a row) "Use of uninitialized value in concatenation (.) at REPfend line 121, line 252702." Line 252702 is the very last line in the file, consisting only of letters acgt. Printing $sequence to STDOUT gives what I expect. It's $header that is undefined. I don't understand why the value of $header is apparently not retained after the while loop, while the value of $sequence is. I've looked at what the last header is and it is absolute equivalent to all the other headers as far as format goes, so my regex is not breaking. Thanks, hope everything is well for everyone, Nathanael Kuipers From peter at PSDT.com Mon Aug 26 16:42:27 2002 From: peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:07 2004 Subject: lexical problems (i think) In-Reply-To: <3D6A9DF1@wm2.uvic.ca> Message-ID: <4.3.2.7.2.20020826143341.00b09280@shell2.webquarry.com> At 02:30 PM 8/26/02 -0700, nkuipers wrote: >Hello all, > >I need help with variable persistence. As preamble, carefully consider an >input file whose contents look like this: > >start of file > >header1 >sequence... >sequence... > >header2 >. >. >. > >headerN >sequenceN... >end of file > >My goal is a parsing one: parse the file contents into a hash keyed by header. > Here is the subroutine. > > >sub parse_fasta_file { > my ($fh, $href) = @_; > my $header = undef; > my $sequence = undef; The "= undef" is redundant. > #hash: header => 'sequence' > while (<$fh>) { > if ( /^>(.*)\n$/ && !defined $header ) { ##first > '>' in file > $header = $1 } No need to test whether $header is defined; all the headers come before their contents. Just do /^>(.*)/ and $header = $1 $ matches \n + end-of-string and . doesn't match newline, therefore this is the same as what you have. > elsif ( /^>(.*)\n$/ && defined $header ) { No need for the elsif, unless you think the data may contain lines that look like sequences before the first line that looks like a header. > $sequence =~ s/\s//g; Um, this is more complicated than you need. A lot more. > $href->{$header} = $sequence; > $sequence = undef; > $header = $1; } #want persistence here > elsif ( /^[acgtACGT\n]+$/ ) { $sequence .= $_ } > } > #last sequence (no '>' signal followed for dumping into hash) > $sequence =~ s/\s//g; #This gets done, last sequence > is perfect. > $href->{$header} = $sequence; #Header undefined for hashing! >} > >I get the following error messages: > >"Use of uninitialized value in hash element at REPfind line 121, line >252702." (get this one twice in a row) >"Use of uninitialized value in concatenation (.) at REPfend line 121, >line 252702." > >Line 252702 is the very last line in the file, consisting only of letters >acgt. > >Printing $sequence to STDOUT gives what I expect. It's $header that is >undefined. I don't understand why the value of $header is apparently not >retained after the while loop, while the value of $sequence is. I've looked >at what the last header is and it is absolute equivalent to all the other >headers as far as format goes, so my regex is not breaking. Let me suggest that this will do what you want, and hopefully you'll agree that it's not worth trying to figure out where your code is going wrong: sub parse_fasta_file { my ($fh, $href) = @_; my ($header, $sequence); while (<$fh>) { /^>(.*)/ and $header = $1; next unless /^[acgtACGT]+$/; # I guess there must be some junk lines s/\s//g; $href->{$header} .= $_; } } That, I think, is it... -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From nkuipers at uvic.ca Mon Aug 26 17:18:43 2002 From: nkuipers at uvic.ca (nkuipers) Date: Wed Aug 4 00:11:07 2004 Subject: Thanks RE: lexical problems (i think) Message-ID: <3D6AAC9D@wm2.uvic.ca> >sub parse_fasta_file { > my ($fh, $href) = @_; > my ($header, $sequence); > while (<$fh>) { > /^>(.*)/ and $header = $1; > next unless /^[acgtACGT]+$/; # I guess there must be some junk lines > s/\s//g; > $href->{$header} .= $_; > } >} Looks like that works. I have one other question, this is related to filehandles. Take a look at this subroutine. I am warning you right now that it's a low-brow way to get the job done, but that's the point. sub segregate_by_def { no strict 'refs'; #ugh my $href = shift; my @fharray = ('Ava', 'Sma', 'Nhe', 'Fok', 'Hpa', 'Tc', 'LINE', 'SINE', 'MISC',); for my $fh (@fharray) { open $fh, ">>name.${fh}" or die $!; } for (keys %$href) { if ( / ([SL] (?:ma|INE) |Ava|Nhe|Fok|Hpa|Tc) /x ) { my $handle = $1; print $handle ">$_\n$href->{$_}\n"; } else { print MISC ">$_\n$href->{$_}\n"; } } } Is this *really* bad? Thanks again, Nathanael From Peter at PSDT.com Mon Aug 26 17:55:26 2002 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:07 2004 Subject: Thanks RE: lexical problems (i think) In-Reply-To: <3D6AAC9D@wm2.uvic.ca> Message-ID: <4.3.2.7.2.20020826153441.00b14bc0@shell2.webquarry.com> At 03:18 PM 8/26/02 -0700, nkuipers wrote: >I have one other question, this is related to filehandles. > >Take a look at this subroutine. I am warning you right now that it's a >low-brow way to get the job done, but that's the point. > >sub segregate_by_def { > no strict 'refs'; #ugh > my $href = shift; > my @fharray = ('Ava', 'Sma', 'Nhe', > 'Fok', 'Hpa', 'Tc', > 'LINE', 'SINE', 'MISC',); > for my $fh (@fharray) { open $fh, ">>name.${fh}" or die $!; } > for (keys %$href) { > if ( / ([SL] (?:ma|INE) |Ava|Nhe|Fok|Hpa|Tc) /x ) { > my $handle = $1; > print $handle ">$_\n$href->{$_}\n"; Hmm, you're not testing here that $_ is a key in the hash, I guess you know your data... > } else { print MISC ">$_\n$href->{$_}\n"; } > } >} > >Is this *really* bad? It could be better... it has me wondering why the filehandle isn't closed as soon as it's opened since it's a lexical variable... you don't need to turn off strict refs: sub segregate_by_def { my $href = shift; my %fh; my @prefs = qw(Ava Sma Nh Fok Hpa Tc LINE SINE); for (@prefs, 'MISC') { open my $f, ">>name.$_" or die "open $_: $!\n"; $fh{$_} = $f; } my $regex = join '|' => @prefs; for (keys %$href) { my $where = /($regex)/o ? $fh{$1} : $fh{MISC}; print $where ">$_\n$href->{$_}\n"; } } Not tested... let me know if it doesn't work. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From darren at DarrenDuncan.net Mon Aug 26 21:27:15 2002 From: darren at DarrenDuncan.net (Darren Duncan) Date: Wed Aug 4 00:11:07 2004 Subject: test message Message-ID: that's all folks From darren at DarrenDuncan.net Mon Aug 26 23:40:33 2002 From: darren at DarrenDuncan.net (Darren Duncan) Date: Wed Aug 4 00:11:07 2004 Subject: Greetings, and offer of help Message-ID: Hello. I'm glad to see there's now a group of people I can discuss Perl with that can be done in person rather than just over the internet, so kudos to whoever thought of setting this up in Victoria. I'm not sure how many people are seeing this yet, since the ml is so new, so I may repeat it later when there are more people. So here's a bit of an intro. I'm Darren Duncan, 24 years old, and live around Sidney, BC. I had graduated from the Computing Systems Technology program at Camosun over a year ago, and I have been working as a full-time programmer/designer with a 20-year-old Victoria software company, which makes its own reasonably large database-driven applications (the latest one is also web-based). My paid programming experience in general goes back for about 3 years, and my hobbyist experience goes back at least 8 years. I have been using Perl regularly since early 1998, when I learned it at camosun from Darrell Wick, who some of you may know. He's quite possibly the best teacher in the computing field that Camosun has to offer. I also started to get into full-time website development around the same time. Mostly I've used Perl for web applications, but I've done a few reusable text or data processing scripts as well. For the first few years, I used the Digital Unix server space that all comptech students got for my websites and Perl scripts; around early 2000 I switched to a Linux share hosted by BareMetal.com. My home computer is a Macintosh, where I do all of my development; at first it ran MacPerl 5.004r20 under Mac OS 8-9, and then it ran the Unix Perl under Mac OS X. I've also run Perl under Windows for short periods of time. In general, Perl is my favorite language to work in, although I wish it was possible to make the language more strict than what "use strict" gives you. Since June of 2000 I have been a member of CPAN (author id is DUNCAND), and have contributed 21 modules (7 are officially registered on the Modules list, and the others support or use those) in 6 distributions. If you go to my website at "http://www.DarrenDuncan.net" then you can see links to my module's documentation and code. They are all quite stable and they are fully documented, but where any have an earlier status than "Released" it just means I haven't written an exhaustive test suite yet. I have also taken much time to make the modules robust, extensible, and easy to read. I'm certainly not an obfuscationist of any sort. My modules cover a varity of subject areas, from being useful anywhere to being intended mainly for web applications. The largest distribution, "CGI::Portable", constitutes a medium-sized framework for web applications that makes them easy to modularize, as well as run under any kind of web server or file system without requiring changes to your code. Of course, Perl itself is intended for high portability, but I take it further. For one thing, by writing your app to my framework, it can run either under mod_perl or as a CGI, or without any web server at all (Perl itself implements the HTTP sockets) without changes. CGI::Portable largely consists of an object that stores input from the client and output for the client in an organized fashion. Most of your code would simply read from and write to this object instead of the normal web server interface, or instead of parsing the HTTP request and response yourself. A set of thin interface classes, each specific for a particular server, populate said object when a request comes in and package its output when your response is done. My framework also translates file system paths from one OS to another, all highly customizable. My next largest module is HTML::FormTemplate, which takes a "form definition" (with semi-complex form control types) as input and does everything from generating the form HTML to error checking the user's input and making a report from the results. This class does no I/O by itself, but takes input as Perl multi-dimensional data structures and returns output as strings. The other classes are simpler, but also more generic. While I haven't actively developed my modules since the fall of 2001 (I consider them stable and reasonably complete), I have moved on to building the applications that I wanted the modules to support; the applications are what I'm really interested in getting working at the moment. You can see some of the simpler applications in production use right now; my entire web site is one such app. The more complicated app is a multi-user large database-driven cross between a multimedia catalog and a genealogy program. It is not yet ready for demonstration. I have also used my modules to rapidly develop some cgi scripts for a few friends on the web, and they consisted of things like submission and voting forms, which also happen to send formatted emails of form contents. Feel free to have a look at said modules and see if they are useful to you. For example, the letter I responded to that announced the brand new Victoria.PM group said the group didn't have a website yet. Perhaps I or my modules can be of some help here. P.S. Sorry if I sounded like I was bragging in this email, as it wasn't my intent. And you can of course share your own accomplishments with the group. P.P.S. I also am greatly anticipating the production release of Perl 6 and other technologies built on Parrot. Have a good day. -- Darren Duncan From nkuipers at uvic.ca Tue Aug 27 03:07:09 2002 From: nkuipers at uvic.ca (nkuipers) Date: Wed Aug 4 00:11:07 2004 Subject: Greetings, and offer of help Message-ID: <3D6B0B2D@wm2.uvic.ca> Hello, Welcome to victoria-pm. Look forward to meeting you at our next get-together. :) I will take a look at those modules. Nathanael Kuipers Computational Biologist, Center for Environmental Health, University of Victoria Such a grand sounding signature but anyone in the pm will tell you I am the biggest Perl uber-newby ever. ;) But I really love the language. From Peter at PSDT.com Tue Aug 27 11:17:50 2002 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:07 2004 Subject: Greetings, and offer of help In-Reply-To: Message-ID: <4.3.2.7.2.20020827091502.00ab06a0@shell2.webquarry.com> At 09:40 PM 8/26/02 -0700, Darren Duncan wrote: >Feel free to have a look at said modules and see if they are useful to >you. For example, the letter I responded to that announced the brand >new Victoria.PM group said the group didn't have a website >yet. Perhaps I or my modules can be of some help here. Excellent. The modules look like a good topic for a talk if you're willing some time. I'm about to leave for the WorldCon, let's talk about the web site when I get back. It'll be victoria.pm.org. >P.S. Sorry if I sounded like I was bragging in this email, as it >wasn't my intent. And you can of course share your own >accomplishments with the group. Brag away. Remember, hubris is one of the three principal virtues of a Perl programmer. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/