[22604] in Perl-Users-Digest
Perl-Users Digest, Issue: 4825 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 8 03:08:54 2003
Date: Tue, 8 Apr 2003 00:05:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 8 Apr 2003 Volume: 10 Number: 4825
Today's topics:
Re: <script language=PerlScript> for Mozilla initiative <me@privacy.net>
Re: <script language=PerlScript> for Mozilla initiative (Helgi Briem)
Re: looking for duplicates (C Marshall)
LWP and Redirection (LeeM)
Re: open fails with filename starting with space <abigail@abigail.nl>
Re: trying to do date parsing <ericw@nospam.ku.edu>
Re: using $vars in regex - problems with $1, etc. <noreply@gunnar.cc>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 7 Apr 2003 23:41:42 +1000
From: "Tintin" <me@privacy.net>
Subject: Re: <script language=PerlScript> for Mozilla initiative
Message-Id: <b6rv6l$8atq9$1@ID-172104.news.dfncis.de>
"Roland Mösl" <founder@pege.org> wrote in message
news:3e9138c8$0$25326$91cee783@newsreader01.highway.telekom.at...
>
> > > JavaScript can not write to files
> >
> > Server side JavaScript can.
>
> Ever heared, that it's an advantage when there is not the
> long client server communication cycle?
>
> This is for software development on the own computer
????
I can't understand one single word you've said.
------------------------------
Date: Mon, 07 Apr 2003 14:17:49 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: <script language=PerlScript> for Mozilla initiative
Message-Id: <3e91883b.811790393@news.cis.dfn.de>
On Mon, 7 Apr 2003 23:41:42 +1000, "Tintin" <me@privacy.net>
wrote:
>
>"Roland Mösl" <founder@pege.org> wrote in message
>news:3e9138c8$0$25326$91cee783@newsreader01.highway.telekom.at...
>>
>> > > JavaScript can not write to files
>> >
>> > Server side JavaScript can.
>>
>> Ever heared, that it's an advantage when there is not the
>> long client server communication cycle?
>>
>> This is for software development on the own computer
>
>
>????
>
>I can't understand one single word you've said.
Whereas I can understand every individual word,
but I can make absolutely no sense at all out
of his sentences. I think Roland Mösl is a rogue
AI, sending random messages to Usenet as a
student project or something.
--
Regards, Helgi Briem
helgi DOT briem AT decode DOT is
------------------------------
Date: 7 Apr 2003 06:41:58 -0700
From: c_j_marshall@hotmail.com (C Marshall)
Subject: Re: looking for duplicates
Message-Id: <cb9c7b76.0304070541.775466ae@posting.google.com>
"Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de> wrote in message
> >> Interesting. Why '++$_' rather than '$_++'?
> >
> > my guess is that it is to follow the array positions i.e. to make sure
> > that the first element seen is still at position "0" and not "1".
>
> But there is no array in the above code. It's a hash-slice of %seen
> whose values are incremented. For the above code, it is irrelevant
> whether to use post- or preincrement.
>
ah - bad guess then. Sorry.
------------------------------
Date: 7 Apr 2003 06:49:58 -0700
From: lmondshein@bridgew.edu (LeeM)
Subject: LWP and Redirection
Message-Id: <3c9fb127.0304070549.e6fdcc@posting.google.com>
I am teaching a course in Bioinformatics, hoping to utilize EMBL-EBI,
and including use of Perl and LWP. Without enabling redirection
("requests_redirectable" below), I get a redirection error in the
following emboss/transeq-related Perl code (of course). Yet the the
following code causes an error 405. I have not seen any relevant
advice on the internet.
Do you have any suggestions?
Many thanks for your guidance,
Prof. Lee Mondshein
Mathematics and Computer Science
Bridgewater State College
Bridgewater, Massuchusetts USA
$ leeperl.ebi.30.pl
ERROR: 405 Method Not Allowed at ./leeperl.ebi.30.pl line 34,
<FILEHANDLEdnaseq> line 1.
#!/usr/bin/perl -w
#leeper.ebi.30.pl
#Calling emboss/transeq via EMBL-EBI
use LWP::UserAgent;
open FILEHANDLEdnaseq, "dnaseq.txt" or die "Can't open file: $!\n";
$dnaseq = <FILEHANDLEdnaseq>;
#for test purposes
print $dnaseq;
$browser = LWP::UserAgent->new;
push @{$browser->requests_redirectable}, 'POST';
$response = $browser->post('http://www.ebi.ac.uk/cgi-bin/emboss/transeq.pl',
['frame' => '1',
'table' => '1',
'regions' => 'START-END',
'trim' => 'no',
'reverse' => 'no',
'colour' => 'no',
'sequence' => $dnaseq,
],
);
#Check for possible errors (e.g., network-related errors)
die "ERROR: ", $response->status_line
unless $response->is_success;
print $response->content;
exit;
------------------------------
Date: 07 Apr 2003 13:17:12 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: open fails with filename starting with space
Message-Id: <slrnb92uio.pug.abigail@alexandra.abigail.nl>
Villy Kruse (vek@station02.ohout.pharmapartners.nl) wrote on MMMDVI
September MCMXCIII in <URL:news:slrnb92q77.kc3.vek@station02.ohout.pharmapartners.nl>:
.. On Sat, 05 Apr 2003 21:01:25 -0500,
.. Benjamin Goldberg <goldbb2@earthlink.net> wrote:
..
.. >I don't know whether perl's glob supports it, but using "**" instead of
.. >"*" means, for many shells, traverse as many directory levels as
.. >necessary.
..
.. Name one, please.
zsh.
But I wouldn't be able to name a second. I don't second the suggestion
that "**" is supported by "many shells".
Abigail
--
CHECK {print "another "}
INIT {print "Perl " }
BEGIN {print "Just " }
END {print "Hacker\n"}
------------------------------
Date: Mon, 07 Apr 2003 13:11:32 GMT
From: Eric Wilhelm <ericw@nospam.ku.edu>
Subject: Re: trying to do date parsing
Message-Id: <pan.2003.04.07.08.08.49.767309.2642@nospam.ku.edu>
On Sun, 06 Apr 2003 13:11:44 -0500, Eric Osman wrote:
> Hi,
>
> I'm trying to scan a large digest of emails with perl and parse the
> dates, and I'm hoping one of you readers can help me out here.
>
> The digest is a bunch of concatenated emails with headers looking sort
> of like this:
>
> Date: Sun, 30 Mar 2003 10:30:34 -0800 (PST) From: someone@somewhere.com
> To: someoneelse@somewhereelse.com
> Subject: some sort of subject
>
>
> The part I'm focussing on is the date line.
>
> Because the headers like the above SOMETIMES indicate a new email
> message and sometimes are actually a message forwarded within another
> message, I wanted to parse the dates.
>
> Then, if I detect a date that isn't monotonically increasing with the
> others, I can assume that that header is a forwarded message within
> another message.
>
> So far I've found DATE::PARSE which contains
>
> strptime(DATE [, ZONE])
>
> to which I can feed
>
> Sun, 30 Mar 2003 10:30:34 -0800 (PST)
>
> and it will return and array of
>
> ($ss,$mm,$hh,$day,$month,$year,$zone)
>
> I've also found TIME::LOCAL which contains
>
> timelocal($sec,$min,$hour,$mday,$mon,$year)
>
> to convert into a local arithmetic time value.
>
> But notice that there's not time zone on this last list.
>
> What would be a good thing to use instead of timelocal to convert the
> first of the two lists into a local arithmetic time value (so I can
> compare two of them easily) .
>
> Or is there a better way of you can think of that I can do this whole
> thing of comparing dates in the headers ?
Date::Manip has
$secs=&Date_SecsSince1970($m,$d,$y,$h,$mn,$s);
but it looks like you will need to convert the time zones
Might be easily done with a hash of adjustment factors (number of seconds
to shift?), but it gets tricky with daylight savings time (maybe another
hash ?)
--Eric
------------------------------
Date: Mon, 07 Apr 2003 15:21:05 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: using $vars in regex - problems with $1, etc.
Message-Id: <b6rufc$87a9k$1@ID-184292.news.dfncis.de>
Kevin Pfeiffer wrote:
> I have a "regex" file which contains two lines (example here):
>
> Text_to_match(.*) more text
> Replacement Text$1 More replacement text
>
> These are read into @regex and then used like this:
>
> $data =~ s/$regex[0]/$regex[1]/oms; #
>
> The capturing parentheses work fine; and if I enter $1 directly into the
> line above I get back what was captured. But if the $1 is brought in via
> $regex[1] as in the example above, it remains "$1" in the replacement text;
One solution could be:
Text_to_match(.*) more text
Replacement Text%capt% More replacement text
--------------------^^^^^^
$data =~ s/$regex[0]/
my $capt = $1;
$regex[1] =~ s!%capt%!$capt!;
$regex[1]
/e;
/ Gunnar
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 4825
***************************************