From cash at flashcom.net Sat Mar 4 12:22:35 2000 From: cash at flashcom.net (Cash Perkins) Date: Thu Aug 5 00:19:57 2004 Subject: Date format Message-ID: <008601bf8606$9d955ac0$3504f83f@fashcom.com> How do I convert local time into the format: YYYY-MM-DD HH:MM:SS Thanks in advance! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/san-diego-pm/attachments/20000304/052b4393/attachment.htm From eugenet at mailcity.com Sat Mar 4 15:18:48 2000 From: eugenet at mailcity.com (Eugene Tsyrklevich) Date: Thu Aug 5 00:19:57 2004 Subject: Date format Message-ID: ~sdpm~ see http://www.perl.com/CPAN-local/doc/manual/html/pod/perlfunc/localtime.html cheers. -- On Sat, 4 Mar 2000 10:22:35 Cash Perkins wrote: >How do I convert local time into the format: > >YYYY-MM-DD HH:MM:SS > >Thanks in advance! > MailCity. Secure Email Anywhere, Anytime! http://www.mailcity.com ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From cabney at cyberpass.net Sat Mar 4 12:54:52 2000 From: cabney at cyberpass.net (C. Abney) Date: Thu Aug 5 00:19:58 2004 Subject: Date format In-Reply-To: <008601bf8606$9d955ac0$3504f83f@fashcom.com> Message-ID: ~sdpm~ On Sat, 4 Mar 2000, Cash Perkins wrote: > > YYYY-MM-DD HH:MM:SS how 'bout use POSIX qw/ strftime /; $time = strftime "%Y-%m-%d %H:%M:%S", localtime; 'man 1 date' will tell you more about those formatting params. CA -- Einstein himself said that God doesn't roll dice. But he was wrong. And in fact, anyone who has played role-playing games knows that God probably had to roll quite a few dice to come up with a character like Einstein. -- Larry Wall C. Abney ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From cabney at cyberpass.net Sat Mar 4 13:13:46 2000 From: cabney at cyberpass.net (C. Abney) Date: Thu Aug 5 00:19:58 2004 Subject: Date format In-Reply-To: <008601bf8606$9d955ac0$3504f83f@fashcom.com> Message-ID: ~sdpm~ On Sat, 4 Mar 2000, Cash Perkins wrote: > How do I convert local time into the format: > > YYYY-MM-DD HH:MM:SS Hmm, cool: ============================================================ #! /usr/bin/perl -w use strict; my @t = localtime(time); my $foo = sprintf ("%d-%02d-%02d %d:%d:%02d\n", $t[5]+1900, $t[4]+1, $t[3], $t[2], $t[1], $t[0]); print $foo; ============================================================ CA -- Einstein himself said that God doesn't roll dice. But he was wrong. And in fact, anyone who has played role-playing games knows that God probably had to roll quite a few dice to come up with a character like Einstein. -- Larry Wall C. Abney ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From adms at cts.com Mon Mar 6 20:43:36 2000 From: adms at cts.com (adms@cts.com) Date: Thu Aug 5 00:19:58 2004 Subject: March Perl Mongers Meeting Message-ID: <200003070243.SAA78557@batman.cts.com> ~sdpm~ I just wanted everyone to know that the March meeting will be held at 7:00pm on March 15, 2000. The location is the same: Binary Evolution 8380 Miramar Mall, San Diego, CA 92121 We will be in the conference room upstairs. Take 805 to Miramar. East. Second traffic light: Miramar Mall, left. Go two blocks until you see sharp right turn, turn left into parking lot. You'll see large sign on left side: 8380 Miramar mall. I WILL BE EMAILING TOMORROW WITH THE MEETING'S AGENDA. I hope you can attend!!! I am sorry I have not been able to discuss much on the email list. I had trouble with the email server and eventually found 482 stranded messages :( I am happy to see a lot of people using the San Diego Perl Mongers list. Remember, if you have a Perl question, comment or suggestion, please feel free to email the group! -Garrett ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From todd.rockhold at ontogen.com Fri Mar 10 02:20:14 2000 From: todd.rockhold at ontogen.com (Todd Rockhold) Date: Thu Aug 5 00:19:58 2004 Subject: Parse::RecDescent syntax of grammar rules??? Message-ID: <00Mar10.002014pst.118081@gateway.ontogen.com> ~sdpm~ This is a simple example script that comes with Parse::RecDescent. As far as I know the syntax of the grammar is correct, but the following error messages are generated when I run the script. Any help would be appreciated. FWIW I am trying to run this using ActiveState build 522 (Perl 5.005_03). -------------------- start of script ----------------------- #! /usr/local/bin/perl -sw # WHO IS NEXT TO WHOM? use lib 'C:/Perl/lib/Parse/Parse-RecDescent-1.65/lib' ; use Parse::RecDescent; $::RD_HINT = 1 ; $grammar = q{ input : input(s) input : who_question "\n" {1} | is_question "\n" {1} | statement "\n" {1} | /bye|quit|exit/ { exit } | # ERROR IF NOT END OF TEXT | statement: namelist are 'next' 'to' namelist { ::nextto $item[1], $item[6], $thisline; 1 } | who_question : 'who' are 'next' 'to' name '?' { ::whonextto $item[6] ; 1 } | is_question : 'is' name 'next' 'to' name '?' { ::isnextto($item[3], $item[6]); 1 } | namelist : name(s) 'and' namelist { [ @{$item[1]}, @{$item[3]} ] } | name(s) name : ...!'who' ...!'and' ...!are /[A-Za-z]+/ are : 'is' | 'are' }; $parse = new Parse::RecDescent ($grammar); $parse->{tokensep} = '[ \t]*'; $input = ''; print "> "; while (<>) { if (/^\.$/) { $parse->inputs($input) || print "huh?\n"; $input = '' } else { $input .= $_ } print "> "; } sub nextto($$$) { foreach $A ( @{$_[0]} ) { foreach $B ( @{$_[1]} ) { nexttoAB($A,$B,$_[2]); } } print "okay\n"; } sub nexttoAB($$$) { $nextto{$_[0]} or $nextto{$_[0]} = []; $nextto{$_[1]} or $nextto{$_[1]} = []; push @{$nextto{$_[0]}}, $_[1]; push @{$nextto{$_[1]}}, $_[0]; print "Learnt something from line $_[2]\n"; } sub whonextto($) { if (defined $nextto{$_[0]}) { print join(" and ", @{$nextto{$_[0]}}) . ".\n"; } else { print "sorry, I've never heard of $_[0].\n"; } } sub isnextto($$) { if (!$nextto{$_[0]}) { print "sorry, I've never heard of $_[0].\n"; } elsif (!$nextto{$_[1]}) { print "sorry, I've never heard of $_[1].\n"; } else { foreach $name (@{$nextto{$_[0]}}) { if ($name eq $_[1]) { print "yes\n"; return } } print "no\n"; } } ---------- end of script ------------------------- Errors: ERROR (line 15): Unexpected colon encountered (Hint: Did you mean "|" (to start a new production)? Or perhaps you forgot that the colon in a rule definition must be on the same line as the rule name?) ERROR (line 20): Unexpected colon encountered (Hint: Did you mean "|" (to start a new production)? Or perhaps you forgot that the colon in a rule definition must be on the same line as the rule name?) ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From todd.rockhold at ontogen.com Fri Mar 10 02:37:08 2000 From: todd.rockhold at ontogen.com (Todd Rockhold) Date: Thu Aug 5 00:19:58 2004 Subject: Parse::RecDescent syntax of grammar rules??? Message-ID: <00Mar10.003717pst.118081@gateway.ontogen.com> ~sdpm~ RE the question I sent earlier. Never mind. The incorrect productions are: who_question : 'who' are 'next' 'to' name '?' { ::whonextto $item[6] ; 1 } | is_question : 'is' name 'next' 'to' name '?' { ::isnextto($item[3], $item[6]); 1 } | ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From cabney at cyberpass.net Fri Mar 10 16:01:24 2000 From: cabney at cyberpass.net (C. Abney) Date: Thu Aug 5 00:19:58 2004 Subject: precedence Message-ID: ~sdpm~ Just let me know if I'm a pain... I was playing with error output in one of my scripts today, and here's what I found: Perl does pretty much what you expect. Go figure. This isn't always the case as I once found out (using something lame like: "$opt_D ? $DEBUG = 1 : $DEBUG = 0;") but it was possibly worth it because how often does one get email from Tom Christiansen and Uri Gutman? Well I learned (a little bit, anyway) to read and test my assumptions since then, and can test things like the following: I have a line of code: system ( "$cmd" ) == 0 or warn "failed remote copy: $!" unless $QUIET; but I'm so brain dead that knowing 'or' is evaled left to right isn't enough for me to be sure that its low precedence won't be trumped by that of the 'unless'. Too, 'unless' isn't listed in the list of operators in which their precedence is scaled against each others (that's 'perldoc perlop'.) I had to test it. I used the following script: (2)[2136]$ cat or_unless.pl #! /usr/bin/perl $FOO = shift; $ERR = shift; $ERR or warn "gah!\n" unless $FOO; Which, when executed, prints (or doesn't) the following: (2)[2136]$ ./or_unless.pl 1 1 (2)[2136]$ ./or_unless.pl 1 0 (2)[2136]$ ./or_unless.pl 0 1 (2)[2136]$ ./or_unless.pl 0 0 gah! (2)[2137]$ Unless I interpreted it wrong, I would have gotten a warning in the second test if the 'unless' took precedence. And I shouldn't have had /any/ warnings in the third and fourth tests. But... just ignore this. I'm really just a overly chatty Perl script. CA -- Einstein himself said that God doesn't roll dice. But he was wrong. And in fact, anyone who has played role-playing games knows that God probably had to roll quite a few dice to come up with a character like Einstein. -- Larry Wall C. Abney ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From cash at flashcom.net Sat Mar 11 11:09:53 2000 From: cash at flashcom.net (Cash Perkins) Date: Thu Aug 5 00:19:58 2004 Subject: Stumpped again! References: Message-ID: <000c01bf8b7c$9e4fd1e0$3504f83f@fashcom.com> ~sdpm~ Hi SDPM friends, I guess I'm easily stumpped... but here's the deal. I'm trying to insert and update rows into a database at the same time a flat file is updated by my message board. There are two functions below. The appenddata fuction works perfectly. The writedata generates the orrect sql (if i paste the printed $sqlstatement into mysql it works correctly) yet, the database is never updated. I know I'm getting into the if because it prints the $sqlstatement. Since it uses exactly the same info to connect to the database and perform the sql as the other working function I don't know what the heck could be wrong. Can someone point me in the right direction? Thanks a bundle. Cash. #======================================================================# # writedata # #======================================================================# sub writedata { my($datafile,$r_rows, $selected) = @_; # Cash Start if ($datafile eq "$password_file_dir/$password_file" ) { use DBI; $dbh = DBI->connect("DBI:mysql:$mySQLdatabase:$mySQLserver", $mySQLuser, $mySQLpswd); #prepare and execute SQL statement foreach (@$r_rows) { chomp($_); my ( $pswd, $username, $user_group, $firstname, $lastname, $email1, $status ) = split(/$split_delim/, $_); if ( $selected eq $username ) { $status = ($status == "on" ) ? "active" : "pending"; $sqlstatement = qq~ UPDATE members SET username='$username', firstname='$firstname', lastname='$lastname', password='$pswd', email1='$email1', status='$status', user_group='$user_group' WHERE username='$selected'; ~; } } print "$sqlstatement\n\n"; $sth = $dbh->prepare($sqlstatement); $sth->execute || die "Could not execute SQL statement ... maybe invalid?"; $sth->finish; } # Cash Finish if (open(DATA,">$datafile")) { flock(DATA,2); print DATA @$r_rows; flock(DATA,8); close(DATA); chmod(0666,$datafile); } else { my_die("Error in subroutine writedata: Can't open $datafile",$!); } } #======================================================================# # appenddata # #======================================================================# sub appenddata { my($datafile,$row) = @_; # Cash Start if ($datafile eq "$password_file_dir/$password_file" ) { use DBI; $dbh = DBI->connect("DBI:mysql:$mySQLdatabase:$mySQLserver", $mySQLuser, $mySQLpswd); #prepare and execute SQL statement my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); my $now = sprintf "%4d-%02d-%02d %02d:%02d:%02d\n", 1900+$year,$mon+1,$mday,$hour,$min,$sec; my ( $pswd, $username, $user_group, $firstname, $lastname, $email1, $status ) = split(/$split_delim/, $row); $status = ($status == "on" ) ? "active" : "pending"; $sqlstatement = qq~ INSERT INTO members (key_member_id, username, title, firstname, lastname, password, address, country, timezone, city, state, zipcode, homephone, workphone, sex, email1, email2, url, birthday, icq, msm, aim, photo, occupation, gaming_experience, comments, status, display_member_info, block_user_flag, block_user_message, block_user_date, send_newsletter, charter_member, joined_date, quit_date, last_login, applied_date, active_character_count, pending_character_count, user_group) VALUES ('', '$username', '','$firstname', '$lastname', '$password', '', '', '', '', '', '', '', '', '', '$email1', '', '', '', '', '', '', '', '', '', '','$status', 'Y', 'N', '', '0000-00-00 00:00:00', 'Y', 'N', '$now','0000-00-00 00:00:00', '$now', '$now', '', '', '$user_group')~; $sth = $dbh->prepare($sqlstatement); $sth->execute || die "Could not execute SQL statement ... maybe invalid?"; $sth->finish; } # Cash Finish if (open(DATA,">>$datafile")) { flock(DATA,2); print DATA "$row\n"; flock(DATA,8); close(DATA); } else { my_die("Error in subroutine appenddata: Can't open $datafile",$!); } } ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From cash at flashcom.net Sat Mar 11 11:16:03 2000 From: cash at flashcom.net (Cash Perkins) Date: Thu Aug 5 00:19:58 2004 Subject: Unstumpped! References: Message-ID: <001101bf8b7d$7b2a3600$3504f83f@fashcom.com> ~sdpm~ I found the little bugger! It was the semi-colon I had at the end of the sqlstatement. Disreguard my last message.... I'm unstumpped... for the time being. Thanks anyway! Cash. ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From astewart at spawar.navy.mil Sat Mar 11 11:49:41 2000 From: astewart at spawar.navy.mil (Alan Stewart) Date: Thu Aug 5 00:19:58 2004 Subject: precedence In-Reply-To: Message-ID: <20000311174942.EDFR11144.lh2.rdc1.sdca.home.com@cx465707-a> ~sdpm~ On 10 Mar 00, at 14:01, C. Abney wrote: [. . .] > but I'm so brain dead that knowing 'or' is evaled left to right > isn't enough for me to be sure that its low precedence won't be > trumped by that of the 'unless'. Too, 'unless' isn't listed in > the list of operators in which their precedence is scaled against > each others (that's 'perldoc perlop'.) I had to test it. I used > the following script: unless isn't in the list of operator precedence because it isn't an operator, it is a statement modifier. > > (2)[2136]$ cat or_unless.pl > #! /usr/bin/perl > $FOO = shift; > $ERR = shift; > $ERR or warn "gah!\n" unless $FOO; > > Which, when executed, prints (or doesn't) the following: > > (2)[2136]$ ./or_unless.pl 1 1 > (2)[2136]$ ./or_unless.pl 1 0 > (2)[2136]$ ./or_unless.pl 0 1 > (2)[2136]$ ./or_unless.pl 0 0 > gah! > (2)[2137]$ > > Unless I interpreted it wrong, I would have gotten a warning in the > second test if the 'unless' took precedence. And I shouldn't have > had /any/ warnings in the third and fourth tests. > The unless doesn't bind left or right, it modifies the entire preceeding statement. $ERR or warn "gah!\n" unless $FOO; is the same as unless ($FOO) {$ERR or warn "gah!\n"} which is the same as if (!$FOO) {$ERR or warn "gah!\n"} so only the fourth test should print a warning. In your other example system ( "$cmd" ) == 0 or warn "failed remote copy: $!" unless $QUIET; I would expect $QUIET to control the whole statement, as in unless ($QUIET) { system ( "$cmd" ) == 0 or warn "failed remote copy: $!"; } and Perl does what I expect :) --------------------------------------------------------------- Alan Stewart )-[]-( Electronics Engineer Code D621 ~ ~ Network Operations SPAWARSYSCEN ~ ~ \ Satellite Communications 53560 Hull St ( ~ ~ ) tel (619)524-3625 San Diego,CA __|___ /| fax (619)524-2607 92152-5001 ^\____/^^^^^^\ __| |_ astewart@spawar.navy.mil ------------^^^^^^^^^^^^^^^\__|______|_------------------------ ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From cabney at cyberpass.net Sat Mar 11 11:53:03 2000 From: cabney at cyberpass.net (C. Abney) Date: Thu Aug 5 00:19:58 2004 Subject: need a crutch, (was: precedence) In-Reply-To: Message-ID: ~sdpm~ > (2)[2136]$ cat or_unless.pl > #! /usr/bin/perl > $FOO = shift; > $ERR = shift; > $ERR or warn "gah!\n" unless $FOO; Hmm, I actually posted this to ask a question... guess I was too tired to continue. I tried to use braces/parens to make the evaluation order explicit or obvious, but kept getting syntax errors. I can do a: $opt_D ? ( $DEBUG=1 ) : ( $DEBUG=0 ); # better is "$DEBUG = $opt_D ? 1 : 0;" to force perl to my will, but when I try it with the above code I get syntax errors. What should I do to make it more obvious? Something like: $ERR or ( warn "gah!\n" unless $FOO ); Except it should work! CA -- Einstein himself said that God doesn't roll dice. But he was wrong. And in fact, anyone who has played role-playing games knows that God probably had to roll quite a few dice to come up with a character like Einstein. -- Larry Wall C. Abney ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From cabney at cyberpass.net Sat Mar 11 14:57:11 2000 From: cabney at cyberpass.net (C. Abney) Date: Thu Aug 5 00:19:58 2004 Subject: precedence In-Reply-To: <20000311174942.EDFR11144.lh2.rdc1.sdca.home.com@cx465707-a> Message-ID: ~sdpm~ [mailed and posted] On Sat, 11 Mar 2000, Alan Stewart wrote: > The unless doesn't bind left or right, it modifies the entire preceeding statement. > > $ERR or warn "gah!\n" unless $FOO; > > is the same as > > unless ($FOO) {$ERR or warn "gah!\n"} Ok, but then isn't the 'unless' subject to precedence? I suppose not if the compiler is just doing its best with a hacked up line. I'm going to start avoiding compound xxx unless yyy constructs then, they just screw up readability (for me.) > and Perl does what I expect :) so I need to do a little editing... and maybe rewrite the test so I can actually test if the flow even enters the critical part... CA -- Einstein himself said that God doesn't roll dice. But he was wrong. And in fact, anyone who has played role-playing games knows that God probably had to roll quite a few dice to come up with a character like Einstein. -- Larry Wall C. Abney ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From cabney at cyberpass.net Sat Mar 11 15:40:19 2000 From: cabney at cyberpass.net (C. Abney) Date: Thu Aug 5 00:19:58 2004 Subject: precedence In-Reply-To: <20000311174942.EDFR11144.lh2.rdc1.sdca.home.com@cx465707-a> Message-ID: ~sdpm~ On Sat, 11 Mar 2000, Alan Stewart wrote: > unless ($QUIET) { > system ( "$cmd" ) == 0 > or warn "failed remote copy: $!"; > } > > and Perl does what I expect :) That sure isn't what I wanted! I tried to write: system ( "$cmd" ) == 0 or warn ( unless ($QUIET) { warn "failed remote copy: $!";}); but perl doesn't like that. I have to do: if ( system("$cmd") ) { warn "failed remote copy: $!" unless $QUIET; } 'Spose I'm just being picky, now... I was trying to maintain style between different code sections. I guess I can't Why is unless so picky about where it is? CA -- Einstein himself said that God doesn't roll dice. But he was wrong. And in fact, anyone who has played role-playing games knows that God probably had to roll quite a few dice to come up with a character like Einstein. -- Larry Wall C. Abney ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From astewart at spawar.navy.mil Sat Mar 11 17:01:20 2000 From: astewart at spawar.navy.mil (Alan Stewart) Date: Thu Aug 5 00:19:58 2004 Subject: precedence In-Reply-To: References: <20000311174942.EDFR11144.lh2.rdc1.sdca.home.com@cx465707-a> Message-ID: <20000311230123.INND11144.lh2.rdc1.sdca.home.com@cx465707-a> ~sdpm~ On 11 Mar 00, at 13:40, C. Abney wrote: > On Sat, 11 Mar 2000, Alan Stewart wrote: > > > unless ($QUIET) { > > system ( "$cmd" ) == 0 > > or warn "failed remote copy: $!"; > > } > > > > and Perl does what I expect :) > > That sure isn't what I wanted! > > I tried to write: > > system ( "$cmd" ) == 0 > or warn ( unless ($QUIET) { warn "failed remote copy: $!";}); > > but perl doesn't like that. I have to do: > > if ( system("$cmd") ) { > warn "failed remote copy: $!" unless $QUIET; > } > > 'Spose I'm just being picky, now... I was trying to maintain style > between different code sections. I guess I can't > > Why is unless so picky about where it is? > Perhaps you were trying to get to something like: system("$cmd") == 0 or do {warn "failed remote copy: $!" unless $QUIET} in your above example. Then the unless only modifies the statement in th do block. Not sure why you had warn inside of warn. And unless does not have a precedence. Precedence is something that only applies to a string of operators. Unless is statement syntax, not an operator. BTW, please reply only to the group, not To me and Cc to group. I don't need two copies. --------------------------------------------------------------- Alan Stewart )-[]-( Electronics Engineer Code D621 ~ ~ Network Operations SPAWARSYSCEN ~ ~ \ Satellite Communications 53560 Hull St ( ~ ~ ) tel (619)524-3625 San Diego,CA __|___ /| fax (619)524-2607 92152-5001 ^\____/^^^^^^\ __| |_ astewart@spawar.navy.mil ------------^^^^^^^^^^^^^^^\__|______|_------------------------ ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From chris at velocigen.com Sun Mar 12 09:44:15 2000 From: chris at velocigen.com (Chris Radcliff) Date: Thu Aug 5 00:19:58 2004 Subject: Unstumpped! References: <001101bf8b7d$7b2a3600$3504f83f@fashcom.com> Message-ID: <38CBBB4F.DF6B277B@velocigen.com> ~sdpm~ Cash Perkins wrote: > I found the little bugger! It was the semi-colon I had at the end of the > sqlstatement. > Good! It's always what you least expect. Still, there are a few things in your function that you might want to look at in the future: > $dbh = DBI->connect(...); > $sth = $dbh->prepare($sqlstatement); > $sth->execute || die "Could not execute SQL statement ... maybe invalid?"; > $sth->finish; Have you considered setting the RaiseError or PrintError flags on connect? It might have helped in this case assuming mySQL produces syntax errors on prepare; I know Oracle does. It looks like this: $dbh = DBI->connect($dsn, $user, $password, { RaiseError => 1, AutoCommit => 0 }); ...or you can specify it when setting $dsn: $dsn = "dbi:Driver(RaiseError=>1,Taint=>1,AutoCommit=>0):dbname"; Also, $sth->execute returns a value; in this case it would return the number of rows affected or 0E0 if none. You might want to catch that and test whether it's what you expect. Your die would catch an error (which returns undef) but not a case where no rows updated. Last and most picky, $sth->finish isn't recommended unless the statement is a select. It's not going to throw an error or do anything weird, at least not at the moment, but it's one less statement to debug. ;) Cheers, ~chris ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From adms at cts.com Mon Mar 13 19:12:09 2000 From: adms at cts.com (adms@cts.com) Date: Thu Aug 5 00:19:58 2004 Subject: March Perl Mongers Message-ID: <200003140112.RAA53482@batman.cts.com> ~sdpm~ Our March Perl Mongers meeting is THIS WEDNESDAY @ 7:00PM. We will start the meeting with basic introductions and "get to know yas." Once everyone has arrived and are settled, Alex Shah of Binary Evolution will be giving a talk/seminar. The description of the seminar is as follows: "Many non-Perl developers balk at Perl's syntax for building CGI-based web sites. When comparing Perl to PHP, Cold Fusion, Microsoft ASP or even JSP, the equivalent Perl script appears complicated to newbies. Perl's web development features have evolved substantially since its initial use for simple CGI applications. The talk will focus on some simple innovations that greatly simplify building web pages with Perl." "We will introduce concepts for building HTML-based templates. The template system will allow web designers and layout experts to build and change the 'look and feel' of a web site without having to involve the back-end Perl experts." "The talk will be exclusively Perl code - not a bunch of bullet points and silly misinformation. I expect quite a bit of arguing and feedback from the other Perl Mongers out there. Should be fun." After the seminar, everyone will naturally break up and talk/network about Perl subjects in which they are interested. I hope you can attend! -Garrett Casey Location: Binary Evolution 8380 Miramar Mall, UPSTAIRS CONFRENCE ROOM San Diego, CA 92121 Take 805 to Miramar. East. Second traffic light: Miramar Mall, left. Go two blocks until you see sharp right turn, turn left into parking lot. You'll see large sign on left side: 8380 Miramar mall. http://SanDiego.pm.org ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From adms1 at cts.com Wed Mar 15 13:41:39 2000 From: adms1 at cts.com (adms1@cts.com) Date: Thu Aug 5 00:19:58 2004 Subject: March Perl Mongers Reminder Message-ID: <200003151941.LAA63480@batman.cts.com> ~sdpm~ Simply a reminder that TONIGHT is our Perl Mongers Meeting. We will start the meeting with basic introductions and "get to know yas." Once everyone has arrived and are settled, Alex Shah of Binary Evolution will be giving a talk/seminar. The description of the seminar is as follows: "Many non-Perl developers balk at Perl's syntax for building CGI-based web sites. When comparing Perl to PHP, Cold Fusion, Microsoft ASP or even JSP, the equivalent Perl script appears complicated to newbies. Perl's web development features have evolved substantially since its initial use for simple CGI applications. The talk will focus on some simple innovations that greatly simplify building web pages with Perl." "We will introduce concepts for building HTML-based templates. The template system will allow web designers and layout experts to build and change the 'look and feel' of a web site without having to involve the back-end Perl experts." "The talk will be exclusively Perl code - not a bunch of bullet points and silly misinformation. I expect quite a bit of arguing and feedback from the other Perl Mongers out there. Should be fun." After the seminar, everyone will naturally break up and talk/network about Perl subjects in which they are interested. -Garrett Location: Binary Evolution 8380 Miramar Mall, UPSTAIRS CONFRENCE ROOM San Diego, CA 92121 Take 805 to Miramar. East. Second traffic light: Miramar Mall, left. Go two blocks until you see sharp right turn, turn left into parking lot. You'll see large sign on left side: 8380 Miramar mall. ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From adms1 at cts.com Wed Mar 15 21:27:38 2000 From: adms1 at cts.com (adms1) Date: Thu Aug 5 00:19:58 2004 Subject: PERL MONGER UPDATE Message-ID: <200003151927380572.1B8F26E5@smtp.cts.com> ~sdpm~ NOTICE ABOUT TONIGHT'S MEETING: Alex was scheduled to give a seminar / tutorial tonight. Unfortunately, I just got a call informing me that he will not be able to make it to the meeting. He is stuck in Seattle! The meeting will still be held tonight. It will be a social meeting where people with similar Perl interests will be able to network with each other. Bring your code or Perl questions and you will get them looked at! There will be drinks (beer!) and maybe other goodies at the meeting. I am sorry for the inconvenience due to the change in plans, but we still will have a fun Perl night. See you at 7:00pm! -Garrett http://SanDiego.pm.org ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From chris at velocigen.com Thu Mar 16 16:08:59 2000 From: chris at velocigen.com (Chris Radcliff) Date: Thu Aug 5 00:19:58 2004 Subject: Internet World LA Message-ID: <38D15B7B.A3439F9F@velocigen.com> ~sdpm~ Hi folks, As I mentioned during the meeting, VelociGen has a ton of free passes to Internet World LA (see info below). If you would like a pass or two (or three) send me your snail-mail address and I'll get 'em out to you ASAP. The show (http://events.internet.com/spring2000/) is being held April 5-7 at the LA Convention Center. As mentioned during the meeting, it's easy to get there from here: just take Amtrak up to Union Station then take the Metro (red line I think) over to Pico Boulevard. LACC is across the street. If you go, be sure to check out the VelociGen booth (way in the back of the main hall, booth 1476) and say hi to the gang. ~chris ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From comeaujr at sd.conexant.com Wed Mar 22 14:18:24 2000 From: comeaujr at sd.conexant.com (John R. Comeau) Date: Thu Aug 5 00:19:58 2004 Subject: bug in File::Find.pm? Message-ID: <200003222018.MAA20874@pirr.sd.conexant.com> ~sdpm~ While looking at Alan Stewart's "Browse and Grep" program (thanks Alan), I think I may have found two bugs in File::Find.pm. The first problem involves the $File::Find::prune variable. The documentation for Find.pm states that your 'wanted' subroutine can set this variable to 1 to prevent Find.pm from recursing subdirectories. However, I found that in the Find::finddir subroutine, $prune is initalized to 0 before your 'wanted' subroutine is called. The result is that when you're searching 'by depth', the first subdirectory located is searched even if you're setting $prune to 1 in wanted(). Perhaps it doesn't make any sense to search 'by depth' when you're pruning? I'd still expect Find.pm to work with that combination. I've included a sample program (uuencoded below) to demonstrate this problem. I've also included my attempt at fixing these bugs, a new Find.pm. When my find.pl receives any command line argument, it uses my version of Find.pm. Otherwise it uses the standard one. You'll have to modify find.pl to push the location of my Find.pm into @INC if you try out these examples. My examples work with a directory structure as follows: tmp (current directory for running find.pl) file_0.1 dir1 file_1.1 file_1.2 dir file_2.1 file_2.2 This directory structure is also included in the uuencoded tar file below. The behavior of problem 1 can be seen from running in the tmp directory find.pl Here's an excerpt of the output: MYFIND 0, BY DEPTH 1, PRUNED 1 wanted_prune: checking ./dir1/file_1.1 shouldn't be checked when pruning wanted_prune: checking ./dir1/file_1.2 shouldn't be checked when pruning wanted_prune: checking ./dir1 wanted_prune: checking ./file_0.1 wanted_prune: checking . dir1 was recursed despite the fact that I'm setting $File::Find::prune to 1 in my wanted_prune subroutine. The second problem occurs when you're trying to prune but are not searching 'by depth'. In this case Find::find_opt () seems to unecessarily check for $prune and won't even find the files in the current directory if you set $File::Find::prune in your 'wanted'. Here's output that demonstrates this behavior: MYFIND 0, BY DEPTH 0, PRUNED 1 wanted_prune: checking . The version of Find.pm that I found these problems in is the one which came with perl 5.005_03. According to www.perl.com, that's the latest released version. You can see the results using my version of Find.pm by running find.pl 1 The results follow: MYFIND 1, BY DEPTH 0, PRUNED 0 wanted: checking . wanted: checking wanted: checking ./dir1 wanted: checking ./dir1/file_1.1 wanted: checking ./dir1/file_1.2 wanted: checking ./dir2 wanted: checking ./dir2/file_2.1 wanted: checking ./dir2/file_2.2 wanted: checking ./file_0.1 MYFIND 1, BY DEPTH 0, PRUNED 1 wanted_prune: checking . wanted_prune: checking wanted_prune: checking ./dir1 wanted_prune: checking ./dir2 wanted_prune: checking ./file_0.1 MYFIND 1, BY DEPTH 1, PRUNED 0 wanted: checking wanted: checking ./dir1/file_1.1 wanted: checking ./dir1/file_1.2 wanted: checking ./dir1 wanted: checking ./dir2/file_2.1 wanted: checking ./dir2/file_2.2 wanted: checking ./dir2 wanted: checking ./file_0.1 wanted: checking . MYFIND 1, BY DEPTH 1, PRUNED 1 wanted_prune: checking wanted_prune: checking ./file_0.1 wanted_prune: checking . One unfortunate side effect of my fixes is that the 'wanted' subroutine is called once only for setting $File::Find::prune. When it's called at this time, $File::Find::name is undefined. So any 'wanted' routine would have to check to see if $File::Find::name is defined. Hopefully I can fix this inconvenience, but I want to get your feedback first. -John begin 644 find.tar.gz M'XL("# GV3@ V9I;F0N=&%R .U:^7/:2!:>7]%?T7&H %DA#A^IPC;CC.U) MO+4Y*L[,;*I[DZSC6>SN=M^PL^L_=!\TMS;:[:VMW=: MZ&_M-%OM'W;OD2?3TCAQ(VPY""?237^/;IL7N,-Z/(]OI4-2M'>V^;G=W+X7 M7N^A)=K^(\^7O9;3NH<]FBU8?F?G\^R_32IL[;9;&+\'7E;:QOX%^[?O88\O MLK_R_XW]OU+;^/_&_AO__^[MW_Z?J?]VGZCZK[VI_[Y&,_9G_V]_^_B_NZ/\ MO[VS\?^OT);M_\WCO_+_W?9V]MZO^OT7ROW_@9]L<_P="93NYCC[OM#UMO[RG[M]OM/7W^W_C_5VE3 M=W#E7DI!&.AT" 3[5B3_2+U(BET'LN2OIQ^F893(*.\YGF&V=3B6[K E7CY] M<6I9(U 0=9%$[K6,8BE<0=$%[U*JP:&<)N/B#.0?.4C":"[B)$H'20K2/*T^ M\J(X,3N+1S T2.;1%I3$*PXI=:?3=J%)3 M4^*T+]2X^"@_72LMZ.I6"1A!M=IA,9 M)"()%=,UX<5">LE81M#(V(W'(I(C&.91VG$=8D_ISW#0/\ M"%E]<3IEH Z9&(:21C&0 !X4C,QA[TIS;W MKP1610:AGHQI=:[O!9A"HM,@ 8BGH0?#YMBI*05"%U$R2!/BR(JGH;>!\?$#;:0*;?Q0:A;V= )CV)$2*794(:SQ(- M46>3.,$HOG@LZI/$P]O?GH@+JU27'^1 1!-1'XF/-^)B7]1#_(Z3^12Q812+ M.FO-@O+"83J AF*D3P+!)7B\DAUK)2YR![7&^PO:TGE<;HA'CTQWM5H>RFN[ M[ 6A79X@*MCEP/>"*[N<>D.[?.D-:^)0^,C62;7(MTDIIAX8,).ET#R.ZH;-DB& M#T0[^6& 885H8)%#AEM(M[%TH\$8U)XC*% P4%\$<\GQ'NLTHQR'"P/_>NU\"C5?>A//*A+>DPCBJ%;_? R)=0'5YW5 M8'(1;!EM9MGVIU^>G7-PC#B5!"'HS\G?V!69-?A+7H:,0A_)Q+ *F0\1H2WK MZ.S\**-DW_2;F*^GU+L?L[Z;?-9@1DO-Y!^IYNIT1FZ<8 2QOZ,Z^$6M>BC^$2(. M>G]R4$-.0ZTPYG#E!L)'>.'!K):8< #IHPB@Q\,6<,,E=>C@-QS%4V0(79>7)2!5@P ME"-19E?97^GI(8!KDI+,^-<$*9Q2*90Q+:I'"! 6K7Z&>R+0ZM$7GP6]WY] M<0Z]*]=7I$CM?J&C5J/I%$B@QZ"Z=>P2W&F*WAX ?@#$UFP1R \)U%."4U?K M0Z&8XC"&#I7T#%D:*GVF$A^62F4=:%"VETJ(?C*.(42&'D6-I&(;]BBD&9-6 M'*IF:;C,:>%0,YYU&HRJ'S?U;I7GW]"^)!*QKZU'/'^&E4HE@OC(^Y!9J+#G M8O^_1&PWRK8MU@PT+AS\+#<:S("R%TU[Q-Y)RLQ*]WQ=;F?;N!8+0Q:X6ULY MC34*,X-_J;.2BEO\D#Z13WZ/*8BY$]NS&59 M-EVC 'G++C-X#YKB-+:$O(+L$-C6'-7V"R(L(#=?O 9'MVGD,[5Q MBRIX9PZ5.A_M?6)B-+2V'F$>]?31GX82SS+DM;.RN=#@]%F]-V MN5BQ $D(1>M9 &)-!)\=@J:1*N24Q5F0PEB6LJ^WJHKW_7Q4N%^*AZC&! M7ONW-O*2U^?9LZ8&/E*\SLHK[!>Y?&@B]Z(C$L]6_G6+LY96VT-UNE)' IV$ M:$NJ>(O>K=E"8O<"5$69' "F<27-YE(V6R#R>;GE3E2L$^T633+:C8F[T#AQ MNP;NQ-BYA/>Q/L^"P!R>DR3SPDS1#Z7;C+HQHCB>C8; M/@'O:A&9QONJ\[C6T'1,[A%E54J9S'-'<;"F.N!KCC5Y 9,5^3YT_/GU< &#VW M \3J95W3BX/'0NJ\@[X^YU07V#$;VLB%M0(EE7Y6R"TN9M*<=%:/0RJ.+.QJ MTK'>B&(TG77HWFB,DTR=[A75=6@0SFS13Q.^!IK0)2!L,_:R^RLX&SOX^U>L M)L"C4F-&M8]E6R_YC>K&QFOZ=8[4-,.X76'7R]Z'85QX=R?>I;O4]^+\-R_8 M;@-O%@45/C\7+@0"=4%DY,BN""*<9>-$3A .^?!!QWL@$D0B20=9CDM!.NGC M0(@ RJ=>(K9X">_2D1^=PRR68C&F%A=FJN. 9POI7#K,2MR8X,25R,")QZS\ M%WA]BY#8=MJ.9:+12O"T\AKV. Q&WN4M*E?!6$WI=-3S8Z4XKW*C( '[6)OS M_U^=__M>T!CQIS__WKXQT?>_._[_7VN[U=+?_YI[[3W^_LOS[HVCA?:=?_][ M^*"1QE&##SX- @/=#=.'OUV+OHC1EZ(!0&L1%B=SOA3G>HRCYM'3-\]^K5G( M?_D8%7QIP%@71V/'NY[.7)YIG6_ST3IRLWO[P\ M/=&$LCQ-E*/!;]IG]2X_"OT%L*>*TH[I6+@W.,D*6&:E]&CQPC*/.55#WQ;Z M#H$J RHE;EUZVZJ\+. QTD^F M71434F>?OZ^]/"JC(=51?:E(PP#\&8.VPS9;7!7EMF8QOK4C 3;=JF;=JF_9^U?P, 3OIV #P .JC end ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From astewart at spawar.navy.mil Wed Mar 22 20:04:53 2000 From: astewart at spawar.navy.mil (Alan Stewart) Date: Thu Aug 5 00:19:58 2004 Subject: Perl and APL / J Message-ID: <20000323020454.XIUZ17125.mail.rdc1.sdca.home.com@cx465707-a> ~sdpm~ Is there anyone in the group who is also an APL or J programmer? I am thinking about doing some Perl code to interface to the J .dll for heavy matrix / data reduction use. If there is another APL or J user around, I will feel a little more motivated. BTW, Forth and APL were two "cult" stops I passed thru on the way to Perl. --------------------------------------------------------------- Alan Stewart )-[]-( Electronics Engineer Code D621 ~ ~ Network Operations SPAWARSYSCEN ~ ~ \ Satellite Communications 53560 Hull St ( ~ ~ ) tel (619)524-3625 San Diego,CA __|___ /| fax (619)524-2607 92152-5001 ^\____/^^^^^^\ __| |_ astewart@spawar.navy.mil ------------^^^^^^^^^^^^^^^\__|______|_------------------------ ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From taa0 at cris.com Sat Mar 25 14:23:19 2000 From: taa0 at cris.com (taa0) Date: Thu Aug 5 00:19:58 2004 Subject: SourceForge: possible code repository? Message-ID: <38DD2037.120C@cris.com> ~sdpm~ San Diego Perl Mongers, SourceForge provides some good infrastructure for organizing group software development projects. They allow you to have your own domain, e.g., something.sandiego.pm.org. More info at http://sourceforge.net/docs/site/services.php Tom Adams taa0@cris.com ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From taa0 at cris.com Sat Mar 25 14:36:32 2000 From: taa0 at cris.com (taa0) Date: Thu Aug 5 00:19:58 2004 Subject: SourceForge: possible code repository? Message-ID: <38DD2350.122A@cris.com> ~sdpm~ San Diego Perl Mongers, SourceForge provides some good infrastructure for organizing group software development projects. They allow you to have your own domain, e.g., something.sandiego.pm.org. More info at http://sourceforge.net/docs/site/services.php Tom Adams taa0@cris.com ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From cabney at cyberpass.net Fri Mar 31 01:40:48 2000 From: cabney at cyberpass.net (C. Abney) Date: Thu Aug 5 00:19:58 2004 Subject: mapping dirlist to array Message-ID: ~sdpm~ Anyone have a nicer way to express this? @blastfiles = map { ! /^\./ && -f "$blastdir/$_" && $_ } readdir(DIR); I'm looking for plain old text files... but don't like this. CA -- Einstein himself said that God doesn't roll dice. But he was wrong. And in fact, anyone who has played role-playing games knows that God probably had to roll quite a few dice to come up with a character like Einstein. -- Larry Wall C. Abney ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human. From astewart at spawar.navy.mil Fri Mar 31 12:19:08 2000 From: astewart at spawar.navy.mil (Alan Stewart) Date: Thu Aug 5 00:19:58 2004 Subject: mapping dirlist to array In-Reply-To: Message-ID: <200003311814.KAA12168@droid.nosc.mil> ~sdpm~ On 30 Mar 00, at 23:40, C. Abney wrote: >~sdpm~ >Anyone have a nicer way to express this? > > @blastfiles = map { ! /^\./ && -f "$blastdir/$_" && $_ } readdir(DIR); > >I'm looking for plain old text files... but don't like this. > Map returns an array element for each original element (dir entry), even if it fails. Use grep to get just the ones that pass ( and then you don't need && $_ ). @blastfiles = grep { ! /^\./ && -f "$blastdir/$_" } readdir(DIR); or if you really just wanted text and not binary files @blastfiles = grep { ! /^\./ && -f "$blastdir/$_" && -T _ } readdir(DIR); If the !/^\./ is there to get rid of hidden files, OK. If it is there to get rid of . and .. then the -f covers that @blastfiles = grep { -f "$blastdir/$_" } readdir(DIR); --------------------------------------------------------------- Alan Stewart )-[]-( Electronics Engineer Code D621 ~ ~ Network Operations SPAWARSYSCEN ~ ~ \ Satellite Communications 53560 Hull St ( ~ ~ ) tel (619)524-3625 San Diego,CA __|___ /| fax (619)524-2607 92152-5001 ^\____/^^^^^^\ __| |_ astewart@spawar.navy.mil ------------^^^^^^^^^^^^^^^\__|______|_------------------------ ~sdpm~ The posting address is: san-diego-pm-list@hfb.pm.org List requests should be sent to: majordomo@hfb.pm.org If you ever want to remove yourself from this mailing list, you can send mail to with the following command in the body of your email message: unsubscribe san-diego-pm-list If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to . This is the general rule for most mailing lists when you need to contact a human.