[24503] in Perl-Users-Digest
Perl-Users Digest, Issue: 6683 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 12 06:05:47 2004
Date: Sat, 12 Jun 2004 03: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 Sat, 12 Jun 2004 Volume: 10 Number: 6683
Today's topics:
Re: 'my' doesn't totally isolate <sbryce@scottbryce.com>
Re: Extracting Text <tadmc@augustmail.com>
loop in loop takes too much time (FMAS)
Re: loop in loop takes too much time <spamtrap@deepsea.force9.co.uk>
MIDI streaming (Alx)
Re: Pattern matching problem ctcgag@hotmail.com
Re: Pattern matching problem <tadmc@augustmail.com>
Re: Pattern matching problem (paul nutteing)
Re: Pattern matching problem (paul nutteing)
Re: Pattern matching problem <nutteing@quickfindit.com>
Re: Perl text-handling help <ignoromnibus@cochon.fr>
Re: Perl text-handling help <invalid-email@rochester.rr.com>
Rounding numbers with sprintf <ducott_99@yahoo.com>
Re: Rounding numbers with sprintf (Sam Holden)
Re: Rounding numbers with sprintf <ittyspam@yahoo.com>
Re: Rounding numbers with sprintf <noreply@gunnar.cc>
Re: SOAP::Lite using HTTPS as a transport? (josh)
Re: Taint mode and PERL5LIB <usenet@morrow.me.uk>
Re: What does this mean? <usenet@morrow.me.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 11 Jun 2004 22:29:17 -0600
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: 'my' doesn't totally isolate
Message-Id: <10cl1kt6ep6ai9c@corp.supernews.com>
Uri Guttman wrote:
> you still haven't explained a real use for this.
I don't think the OP had a "real use" for this. I think he was just
exploring the nuances of the language and came across something that
behaved differently than he expected it to.
------------------------------
Date: Fri, 11 Jun 2004 23:40:09 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Extracting Text
Message-Id: <slrnccl299.hor.tadmc@magna.augustmail.com>
John Bokma <postmaster@castleamber.com> wrote:
> J. Romano wrote:
>
>> If all you want is to print out the lines that contain
>> "GO:0009986", you can just use the "grep" command (if you happen to be
>> on UNIX):
>>
>> grep "GO:0009986" file.txt
>
> the grep family is available on Windows, and many more OSes.
Perl runs lots of places.
Do grep(1) in perl.
perl -ne 'print if /GO:0009986/' file.txt
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 11 Jun 2004 23:39:20 -0700
From: massion@gmx.de (FMAS)
Subject: loop in loop takes too much time
Message-Id: <f0b3f4c9.0406112239.7c53b9c4@posting.google.com>
I am comparing 2 lists of words and want to output the words in list 1
which are not available in list 2. Both lists have a different number
of entries.
Basically the script below works, but if the lists are large it takes
ages. I tested it on 2 lists of approx 15,000 entries each and after
25 min I had processed only 316 entries!
Here the script:
open(WORDLIST1,'C:\temp\a.txt') || die("cannot open file1!\n");
@list1 = <WORDLIST1>;
open(WORDLIST2,'C:\temp\b.txt') || die("cannot open file2!\n");
@list2 = <WORDLIST2>;
# loop in loop
foreach $list1 (@list1) {
foreach $list2 (@list2) {
chomp $list1;
chomp $list2;
last if ($list1 =~ m/$list2/i) ; # if match found look for next $list1
$lastentry = $list2[$#list2]; # in order to print entry only once when
no match found
if ($list2 =~ m/$lastentry/i) {
print "$list1\n";
}}}
Any suggestions?
I have heard that it would be much faster to build a search tree, but
I don't know how to do it (probably too complicated for a newbee like
me).
Thanks for your help!
Francois
------------------------------
Date: 12 Jun 2004 07:25:16 GMT
From: Iain <spamtrap@deepsea.force9.co.uk>
Subject: Re: loop in loop takes too much time
Message-Id: <Xns95065586252FEcoraldeepsea@212.159.2.86>
massion@gmx.de (FMAS) wrote in news:f0b3f4c9.0406112239.7c53b9c4
@posting.google.com:
> I am comparing 2 lists of words and want to output the words in list 1
> which are not available in list 2. Both lists have a different number
> of entries.
>
> Basically the script below works, but if the lists are large it takes
> ages. I tested it on 2 lists of approx 15,000 entries each and after
> 25 min I had processed only 316 entries!
If you're merely trying to find words in file1 that aren't in file2 I
wouldn't bother with arrays at all. Hashes are usually much more
convenient for this kind of thing. Your other big problem was using a
regular expression match construct to see if the two words are
identical. Don't do that! If you simply want to test two strings for
equality use the 'eq' string comparison operator.
#!/usr/bin/perl
use strict;
use warnings;
# Firstly get a unique list of all words found in file2 as the set of
# keys of a hash
my %file2words;
open( F2WORDS, '<', 'c:\temp\b.txt' )
or die "open failed: $!";
while ( <F2WORDS> ) {
chomp;
$file2words{$_}++;
# the above line has the useful side-effect of counting the number
# of occurrences of each word
}
close( F2WORDS ) or die "close failed: $!";
# Now we can go through file1 and check whether each word in turn
# has been previously seen in file2. Similar technique:
open( F1WORDS, '<', 'c:\temp\a.txt' )
or die "open failed: $!";
while( <F1WORDS> ) {
chomp;
next if $file2words{$_};
print "$_\n";
}
close( F1WORDS ) or die "close failed: $!";
__END__
Note that as long as the very last line in your file has a \n at the end
of it, you can get rid of the two "chomp" lines and change the print
statement to simply 'print;' -- and once you've done that you can
further chop this script down by using various common Perl idioms:
#!/usr/bin/perl
use strict;
use warnings;
open( F2WORDS, '<', 'c:\temp\b.txt' )
or die "open failed: $!";
my %file2words = map { $_, 1 } <F2WORDS>;
close( F2WORDS ) or die "close failed: $!";
open( F1WORDS, '<', 'c:\temp\a.txt' )
or die "open failed: $!";
$file2words{$_} or print while <F1WORDS>;
close( F1WORDS ) or die "close failed: $!";
__END__
The moral of all this? Basically, you have to start doing a bit of
lateral thinking with Perl. Instead of the naive algorithm (two arrays
and nested loops), there's usually a more subtle and usually simpler way
to do things. Good luck!
--
Iain | PGP mail preferred: pubkey @ www.deepsea.f9.co.uk/misc/iain.asc
($=,$,)=split m$"13/$,qq;13"13/tl\.rnh r HITtahkPctacriAneeeusaoJ;;
for(@==sort@$=split m,,,$,){$..=$$[$=];$$=$=[$=];$@=1;$@++while$=[--$=
]eq$$&&$=>=$?;$==$?;for(@$){$@--if$$ eq$_;;last if!$@;$=++}}print$..$/
------------------------------
Date: 12 Jun 2004 00:13:12 -0700
From: nenamiele@libero.it (Alx)
Subject: MIDI streaming
Message-Id: <38d4c7d4.0406112313.5e8c2188@posting.google.com>
I'm trying to use the fine MIDI::simple module, but I'd like its
output not to be saved to a file, but streamed out.
(it is a "singing" cellular automata, and I'd like to listen to its
hisses and noises in the background).
Somebody here knows if it is possible?
Thanks!
Alessandro Magni
------------------------------
Date: 12 Jun 2004 01:09:18 GMT
From: ctcgag@hotmail.com
Subject: Re: Pattern matching problem
Message-Id: <20040611210918.277$9s@newsreader.com>
Bryan <bryan@akanta.com> wrote:
> Hi,
>
> I have a large dna sequence (about 200000 bases) in a file, and in
> another file with 23 smallish sub (about 100 bases) sequences that I
> want to match in the large sequence.
>
> The large sequence file is in fasta format, and I read it in without a
> problem.
Maybe!
...
> Here's where the problem starts... 18 out of 23 subsets match. But ALL
> match if I do a search for the subsequence in any text editor (like vi)!
Do all of the 5 that fail span line boundaries on the original FASTA file?
Do any of the 18 that match span line boundaries? (Well, they would have
to if it were strictly FASTA, i.e. less than 80 char lines, but it may not
be.)
> I have verified that everything is uppercased, and double checked that
> all 23 subsequences are indeed correct in the main sequence. A lot of
> testing and debugging shows that if I copy and paste any sequence or
> subsequence then matches are okay. So Im thinking there is some hidden
> characters messing things up that were missed.
>
> But in vi, I use :set list to show all command characters. Nothing
> unusual is there.
>
> I read in the sequence file like this:
> my $seq;
> open (INFILE, "< $ARGV[0]") or die "Cannot open $ARGV[0] for
> read\n\n"; my @data = <INFILE>;
> close INFILE;
>
> foreach my $line (@data) {
> # Strip off newlines
> chomp $line;
> # do some checks for other lines
> $seq .= uc($line);
> }
> }
It could be that your FASTA file has \r\n line endings, and your chomp is
only stripping the \n. vi might autodetect that you are editing a dos-type
file, and not consider the \r to be a control character, and hence not show
it. So you might want to do "$seq =~ s/\r//g" when you are done reading
it.
Or, just read in $seq exactly like you do now, then just print it out to a
file. Inspect that file, rather than the original, with vi or od to see
what you can see.
If that didn't do it, I'd take one of the things that doesn't match, and
keep chopping off a character until it does match. Once it does match,
report what was blocking the match:
while ($failing) {
$seq =~ /$failing(.)(.{0,20})/ or next;
print "Character preventing match is ", ord($1),
" several characters after that are $2\n";
exit;
} continue {
chop $failing;
};
die "Never did match!"
Of course, you have to make sure you didn't chop it down so much that it
started matching in other places--that's why I told it print 20 more char
of context.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Fri, 11 Jun 2004 23:34:18 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Pattern matching problem
Message-Id: <slrnccl1ua.hor.tadmc@magna.augustmail.com>
Bryan <bryan@akanta.com> wrote:
> if ($sequence =~ m/$subseq/g) {
What do you think the m//g option is doing for you there?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 12 Jun 2004 00:02:34 -0700
From: nutteing@quickfindit.com (paul nutteing)
Subject: Re: Pattern matching problem
Message-Id: <1622f08.0406112302.1a99b92c@posting.google.com>
Bryan <bryan@akanta.com> wrote in message news:<lfsyc.69992$4j2.8621@newssvr29.news.prodigy.com>...
> Hi,
>
> I have a large dna sequence (about 200000 bases) in a file, and in
> another file with 23 smallish sub (about 100 bases) sequences that I
> want to match in the large sequence.
>
> The large sequence file is in fasta format, and I read it in without a
> problem.
>
> The subsequence file is a table, which I read in using the Data::Table
> module:
> my $subseqs= Data::Table::fromTSV("subseq.txt");
>
> Then I loop through the $subseq table and do a pattern match for my
> sequence like this:
> if ($sequence =~ m/$subseq/g) {
> # Match!
> }
>
> Here's where the problem starts... 18 out of 23 subsets match. But ALL
> match if I do a search for the subsequence in any text editor (like vi)!
> I have verified that everything is uppercased, and double checked that
> all 23 subsequences are indeed correct in the main sequence. A lot of
> testing and debugging shows that if I copy and paste any sequence or
> subsequence then matches are okay. So Im thinking there is some hidden
> characters messing things up that were missed.
>
> But in vi, I use :set list to show all command characters. Nothing
> unusual is there.
>
> I read in the sequence file like this:
> my $seq;
> open (INFILE, "< $ARGV[0]") or die "Cannot open $ARGV[0] for read\n\n";
> my @data = <INFILE>;
> close INFILE;
>
>
> foreach my $line (@data) {
> # Strip off newlines
> chomp $line;
> # do some checks for other lines
> $seq .= uc($line);
> }
> }
>
>
> Does anyone see anything wrong with this, or my pattern match that may
> explain the unexplainable?
>
> Thanks,
> Bryan
I have been investigating matches in DNA profile
databases for a year or so.
I have a method for checking a 4 million profile
file for matches written up on
http://www.nutteing2.freeservers.com/dnapr.htm
I am not a programmer so have used macros
etc that are readily available.
What they aren't telling you about DNA profiles
and what Special Branch don't want you to know.
http://www.nutteing2.freeservers.com/dnapr.htm
or nutteingd in a search engine
email nonarevers@yahoo.co.....uk (remove 4 of 5 dots)
------------------------------
Date: 12 Jun 2004 00:09:40 -0700
From: nutteing@quickfindit.com (paul nutteing)
Subject: Re: Pattern matching problem
Message-Id: <1622f08.0406112309.4ceee8ae@posting.google.com>
Sorry, i forgot to change the file name in the URL
http://www.nutteing2.freeservers.com/dnas5.htm
for macros etc
------------------------------
Date: Sat, 12 Jun 2004 08:42:25 +0100
From: "Paul Nutteing" <nutteing@quickfindit.com>
Subject: Re: Pattern matching problem
Message-Id: <2ivq7sFrv9c5U1@uni-berlin.de>
"paul nutteing" <nutteing@quickfindit.com> wrote in message
news:1622f08.0406112309.4ceee8ae@posting.google.com...
> Sorry, i forgot to change the file name in the URL
>
> http://www.nutteing2.freeservers.com/dnas5.htm
>
> for macros etc
ignore my previous - I misread the OP article.
I tried using Google posting removal tool and
it came up in French version and I gave up.
------------------------------
Date: Fri, 11 Jun 2004 19:45:29 -0500
From: Camelback Jones <ignoromnibus@cochon.fr>
Subject: Re: Perl text-handling help
Message-Id: <cadkfu0c6v@news3.newsguy.com>
Paul Lalli wrote:
> On Fri, 11 Jun 2004, Camelback Jones wrote:
>
>> Ben Morrow wrote:
>>
>> > Quoth Camelback Jones <ignoromnibus@cochon.fr>:
>> >
>> >> Paul Lalli wrote:
>> >>
>> >> > On Fri, 11 Jun 2004, Paul Lalli wrote:
>> >> >
>> >> >> On Fri, 11 Jun 2004, Camelback Jones wrote:
>> >> >>
>> >> >> > In the xBase languages (Clipper, FoxPro, *Harbour, etc) there is
>> >> >> > a set of functions for handling "memo" files of text. Basically,
>> >> >> > a memo is a chunk of text of any size whatever, and the functions
>> >> >> > include the ability to set
>> >> >> > the desired width of output text, find the number of lines of
>> >> >> > text in the memo (given the desired width), and get any given
>> >> >> > line of text
>> >>
>> >> Text::Wrap formats the text for output nicely, but leaves a bit to be
>> >> desired with regard to being able to retrieve a specific line. The
>> >> problem is that the formatted output is not consistent in length, so
>> >> that direct access by offset doesn't work reliably... I'm looking for
>> >> a way to put the output text in an array (list?) so that a desired
>> >> line is found simply by the array index.
>> >>
>> >> use Text::Wrap;
>> >> $linelen = 53;
>> >> Text::Wrap::columns = $linelen;
>> >>
>> >> $text = magic();
>> >>
>> >> print wrap('','',$text);
>> >> print "\n\nso far, so good...";
>> >
>> > my @wrapped = wrap '', '', $text;
>> > print "line 6 is $wrapped[5]\n";
>>
>> Thanks, Ben, but it didn't work - came out empty ($text is about 12 lines
>> long at 50 char per line, so line 6 does exist).
>
> Like I said in my original post, I hadn't played with this module very
> often. I did just run a few tests, however. It seems like wrap() always
> returns the formatted data as scalar. I don't know why the documentation
> shows the return value being assigned to an array. That being the case,
> if you want to find the 6th line, there are a variety of ways you could do
> it. Here's one. I'm willing to bet others will suggest more.
>
> my $formatted = wrap('','', @orig);
> my ($line) = $formatted =~ m|(?:.*$/){5}(.*)|;
>
> (Note that I used $/ in the pattern instead of just \n just in case you've
> decided to change your output record seperator, or in case your OS uses a
> different definition. This may or may not be necessary for your
> situation).
>
> Paul Lalli
Ah, well... here's an ugly little snippet that works - I'm fixin' to turn
it into a subroutine to return the nlineth bit of text
# and what about plain ol' format???
$fext = Text::Format->new();
$fext->firstIndent(0); # no indent first line
$fext->columns($textlen); #break into give length
$fext->rightFill(1); # right pad with blanks
$lines=$fext->format($text); # git it
print "\n\n\n";
print " 123456789012345678901234567890123456789012345678901234567890\n";
# pull out the first ten or so lines...
for ($nline=1;$nline<10;$nline++)
{
# extract the nlineth bit of text
$start = ($textlen+1)*($nline-1);
$newline = substr($lines, $start, $textlen);
print "\"$newline\" was line $nline\n\n";
}
--
The greatest unsolved probem in mathematics is why some people are
better at it than others.
------------------------------
Date: Sat, 12 Jun 2004 01:27:03 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: Perl text-handling help
Message-Id: <40CA5BCA.5050204@rochester.rr.com>
Camelback Jones wrote:
> Ben Morrow wrote:
>
>
>>Quoth Camelback Jones <ignoromnibus@cochon.fr>:
>>
>>>Paul Lalli wrote:
>>>
>>>
>>>>On Fri, 11 Jun 2004, Paul Lalli wrote:
>>>>
>>>>
>>>>>On Fri, 11 Jun 2004, Camelback Jones wrote:
> my @$wrapped = wrap '','',$text;
> print "line 6 is $wrapped[5]\n";
If you're going to use $wrapped as an array reference, you have to be
consistent -- the print should be:
print "line 6 is $$wrapped[5]\n";
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: Sat, 12 Jun 2004 02:17:10 GMT
From: "Robert TV" <ducott_99@yahoo.com>
Subject: Rounding numbers with sprintf
Message-Id: <GItyc.695037$Pk3.166287@pd7tw1no>
Hi,
A portion of my script uses 'sprintf' to round some of my taxed currency
vaiables to 2 decimal places. I am having a problem when the rounding does
not produce 2 full decimal places. My formula EG:
$price = 12.99; #product price of $12.99
$taxrate = 7.0; #tax rate of 7%
$taxtotal = $price / 100; #divides price by 100
$taxtotal = $taxtotal * $taxrate; #multiply divided price times tax rate
$taxtotal = sprintf("%.02f",$taxtotal); #round the tax total - 2 decimal
places
$finalprice = $price + $taxtotal; #add the tax total to the original
price
print "$finalprice";
This method produces: 13.9
I would like it to produce: 13.90
Most of the prices this script crunches produces 2 decimal place final
totals, it's only when the tax total round evenly to 10/100'ths. How can I
modify this script to add a "0" (zero) to the end of any total that does not
have 2 decimal places? Also, if the above method for calculating the taxed
total is inefficient, I welcome alternative suggestions. TIA!
Robert
------------------------------
Date: 12 Jun 2004 02:32:00 GMT
From: sholden@flexal.cs.usyd.edu.au (Sam Holden)
Subject: Re: Rounding numbers with sprintf
Message-Id: <slrncckqp0.8b7.sholden@flexal.cs.usyd.edu.au>
On Sat, 12 Jun 2004 02:17:10 GMT, Robert TV <ducott_99@yahoo.com> wrote:
> Hi,
>
> A portion of my script uses 'sprintf' to round some of my taxed currency
> vaiables to 2 decimal places. I am having a problem when the rounding does
> not produce 2 full decimal places. My formula EG:
>
> $price = 12.99; #product price of $12.99
> $taxrate = 7.0; #tax rate of 7%
> $taxtotal = $price / 100; #divides price by 100
> $taxtotal = $taxtotal * $taxrate; #multiply divided price times tax rate
> $taxtotal = sprintf("%.02f",$taxtotal); #round the tax total - 2 decimal
> places
> $finalprice = $price + $taxtotal; #add the tax total to the original
> price
> print "$finalprice";
Don't quote things which don't need to be quoted.
>
> This method produces: 13.9
> I would like it to produce: 13.90
>
> Most of the prices this script crunches produces 2 decimal place final
> totals, it's only when the tax total round evenly to 10/100'ths. How can I
> modify this script to add a "0" (zero) to the end of any total that does not
> have 2 decimal places? Also, if the above method for calculating the taxed
> total is inefficient, I welcome alternative suggestions. TIA!
See "perldoc -q round" for details on why using sprintf for rounding
financial values is usually not a wise choice (chances are the tax laws
don't use the IEEE floating point rounding conventions used by perl)
The trailing 0 is being lost when producing the numeric result of
$price + $taxtotal.
If you want a trailing zero you need a string, not a number so replace:
print "$finalprice";
with:
printf "%.2f", $finalprice
--
Sam Holden
------------------------------
Date: Fri, 11 Jun 2004 22:38:54 -0400
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: Rounding numbers with sprintf
Message-Id: <20040611223636.U20623@dishwasher.cs.rpi.edu>
On Sat, 12 Jun 2004, Robert TV wrote:
> Hi,
>
> A portion of my script uses 'sprintf' to round some of my taxed currency
> vaiables to 2 decimal places. I am having a problem when the rounding does
> not produce 2 full decimal places. My formula EG:
>
> $price = 12.99; #product price of $12.99
> $taxrate = 7.0; #tax rate of 7%
> $taxtotal = $price / 100; #divides price by 100
> $taxtotal = $taxtotal * $taxrate; #multiply divided price times tax rate
> $taxtotal = sprintf("%.02f",$taxtotal); #round the tax total - 2 decimal
> places
> $finalprice = $price + $taxtotal; #add the tax total to the original
> price
> print "$finalprice";
>
> This method produces: 13.9
> I would like it to produce: 13.90
You created the proper format with $taxtotal, but then used it as a number
again and printed out $finalprice. You need to create the proper format
on $finalprice if that's what you're printing.
$taxtotal = $taxtotal * $taxrate;
$finalprice = $price + $taxtotal;
printf ("%.02f\n", $finalprice);
By the way, the line
print "$finalprice";
is uselessly using double quotes. Read the perlfaq for "What's wrong with
always quoting".
Paul Lalli
------------------------------
Date: Sat, 12 Jun 2004 05:04:49 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Rounding numbers with sprintf
Message-Id: <2iva5fFpkegmU1@uni-berlin.de>
Robert TV wrote:
> A portion of my script uses 'sprintf' to round some of my taxed
> currency vaiables to 2 decimal places. I am having a problem when
> the rounding does not produce 2 full decimal places. My formula EG:
>
> $price = 12.99; #product price of $12.99
> $taxrate = 7.0; #tax rate of 7%
That assigns a number to $taxrate. Assign a string if you want to
preserve the decimal point:
$taxrate = '7.0';
> $taxtotal = $price / 100; #divides price by 100
> $taxtotal = $taxtotal * $taxrate; #multiply divided price times
> tax rate
> $taxtotal = sprintf("%.02f",$taxtotal); #round the tax total - 2
> decimal places
Why not just:
$taxtotal = sprintf '%.02f', $price * $taxrate / 100;
> $finalprice = $price + $taxtotal; #add the tax total to the
> original price
An addition of two numbers returns a number. If you want to assign a
string to $finalprice, you need to say so:
$finalprice = sprintf '%.02f', $price + $taxtotal;
> How can I modify this script to add a "0" (zero) to the end of any
> total that does not have 2 decimal places?
You can't. You need to convert those numbers to strings before
printing them.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 11 Jun 2004 18:24:52 -0700
From: josh.kuo@prioritynetworks.net (josh)
Subject: Re: SOAP::Lite using HTTPS as a transport?
Message-Id: <66001607.0406111724.48bb6203@posting.google.com>
Thanks guys, indeed, I was missing both Net::SSLeay and Crypt::SSLeay.
I could have sworn that I installed at least one of them.
$ urpmi perl-Crypt-SSLeay
then I get these:
$ perl -MCrypt::SSLeay -le'print $Crypt::SSLeay::VERSION'
0.51
$ perl -MLWP::Protocol::https -le'print
LWP::Protocol::https::Socket->can("new")'
CODE(0x82634f4)
$ perl -MLWP -le'print $LWP::VERSION'
5.76
And everything works fine now.
Thanks a bunch :)
> $ perl -MLWP -le'print $LWP::VERSION'
> 5.69
>
> That version also works with SOAP::Lite. The SSLeay module version may also
> be important.
>
> $ perl -MNet::SSLeay -le'print $Net::SSLeay::VERSION'
> 1.25
> $ perl -MCrypt::SSLeay -le'print $Crypt::SSLeay::VERSION'
> 0.51
>
> Either one of the SSLeay modules should work, but only one of
> them supports proxy servers using the CONNECT protocol. I beleive
> Crypt::SSLeay is required for proxy support.
>
>
> Villy
------------------------------
Date: Sat, 12 Jun 2004 02:46:45 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Taint mode and PERL5LIB
Message-Id: <cadqql$j86$1@wisteria.csv.warwick.ac.uk>
Quoth Gunnar Strand <MyFirstnameHere.News1@gustra.org>:
> Ben Morrow wrote:
> > Quoth kj <socyl@987jk.com>:
> >
> >>When running under taint mode (-T switch), $ENV{PERL5LIB} is ignored.
> >>This presents a problem to CGI scripts that want to run in taint
> >>mode but need libraries installed in directories not mentioned in
> >>the default value of @INC [1].
> >>
> >>Then again, is running under taint mode really necessary past the
> >>development and testing phase? In other words, is taint mode
> >>anything more than an additional check that the developer can make
> >>prior to releasing the code to make sure that there are no security
> >>gaps in the code, but once the code passes, taint mode can be safely
> >>turned off?
> >
> >
> > No.
>
> That is interesting. According to the Perl taint faq i found
> (http://gunther.web66.com/FAQS/taintmode.html):
>
> Run-time checking means that you need to test all logical paths of
> execution your script might take so that "legal operations" do not
> get halted because of taint mode.
>
> I get the impression that if the testing is thorough enough, taint
> mode could be turned off for release code.
In theory, if you were sufficiently confident that you had tested every
code path, you could turn it off with no loss of safety: as you say, if
tainting is never going to fail, there is no need for it.
However, defensive programming practices would recommend assumming that
there *might* be cases you've overlooked (even with coverage testing
tools such as Devel::Cover, you can't necesarily be sure you've tested
all possible sources of tainted data), and leaving tainting on as a
production app that halts with a taint failure, although not acceptable,
is better than one which has a security hole.
> I do *not* argue that it *should* be turned off, I am just curious to
> know if there are situations after testing which could cause taint to
> fail, for instance that it would object to the contents of input,
> despite untainting?
No, the only case is where some tainted data arrives from somewhere you
weren't expecting and thus isn't untainted (or checked).
Ben
--
Musica Dei donum optimi, trahit homines, trahit deos. |
Musica truces molit animos, tristesque mentes erigit. | ben@morrow.me.uk
Musica vel ipsas arbores et horridas movet feras. |
------------------------------
Date: Sat, 12 Jun 2004 02:52:41 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: What does this mean?
Message-Id: <cadr5p$j86$2@wisteria.csv.warwick.ac.uk>
Quoth joliver@john-oliver.net (John Oliver):
> Jun 11 16:36:34 mail kernel: application bug: perl5.8.0(4468) has
> SIGCHLD set to SIG_IGN but calls wait().
> Jun 11 16:36:34 mail kernel: (see the NOTES section of 'man 2 wait').
> Workaround activated.
>
> Google isn't turning anything up.
Err... it means what it says. You have a perl program which does
$SIG{CHLD} = 'IGNORE';
and then calls wait or waitpid. Your OS considers this to be an error
(as any child processes will be cleaned up straight away automatically,
and the status byte will no longer be around for wait to return).
If this is a linux system then the NOTES section of wait(2) basically
says that linux doesn't do what SUSv2 says it should in this case.
Ben
--
don't get my sympathy hanging out the 15th floor. you've changed the locks 3
times, he still comes reeling though the door, and soon he'll get to you, teach
you how to get to purest hell. you do it to yourself and that's what really
hurts is you do it to yourself just you, you and noone else ** ben@morrow.me.uk
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 6683
***************************************