[30333] in Perl-Users-Digest
Perl-Users Digest, Issue: 1576 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 25 09:09:42 2008
Date: Sun, 25 May 2008 06:09:07 -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 Sun, 25 May 2008 Volume: 11 Number: 1576
Today's topics:
Re: Delay in program execution sheinrich@my-deja.com
HTML Parsing issues - Part II chadda@lonemerchant.com
Re: HTML Parsing issues - Part II <noreply@gunnar.cc>
Re: HTML Parsing issues - Part II <benkasminbullock@gmail.com>
Re: maintaining order in a hash (without Tie::IxHash) <ced@blv-sam-01.ca.boeing.com>
new CPAN modules on Sun May 25 2008 (Randal Schwartz)
Re: Out of memory! Yet ... sln@netherlands.co
problem upgrading Bundle::CPAN <smcbutler@hotmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 24 May 2008 15:32:43 -0700 (PDT)
From: sheinrich@my-deja.com
Subject: Re: Delay in program execution
Message-Id: <ef1412c8-f9fb-4096-8c81-ec814cfb68eb@z66g2000hsc.googlegroups.com>
On May 24, 12:26 pm, Bill H <b...@ts1000.us> wrote:
> I have a website where I use a shareware store written in Perl that
> contains 40+ modules. It runs very fast, but I have noticed over the
> years, if I make changes to a module's code and post it, there is a 3
> or 4 second delay in its execution the first time I run it, then every
> other time it runs with no delay. I know (or believe strongly) perl
> compiles the source for running the program, but does it keep this
> compiled version around for later use unless you change the code and
> then it will compile it again (that is the only reason I can think of
> for the delay).
>
> I am not running any mod_perl and this is running on an Apache server
> under linux.
>
> Bill H
There may be some caching involved.
Try appending some dummy parameter to your request (even if your
program takes none) and see if the response time varies.
Steffen
------------------------------
Date: Sat, 24 May 2008 23:20:05 -0700 (PDT)
From: chadda@lonemerchant.com
Subject: HTML Parsing issues - Part II
Message-Id: <625f0a9a-a480-4ca5-be4a-b10d65a28a6e@g16g2000pri.googlegroups.com>
I'm trying to have the following script parse
<table class="item_description">
<tr>
<td>Acer Aspire AS5610-2089 Notebook, Intel Pentium Dual Core
T2080, 1.6 GHz, 1024GB, 160GB, DVD+/-R DL/DVD+RW Drive, 15.4" TFT,
WebCam, 56K Modem, Wireless, NIC, Vista Home Premium, Refurbished with
90 Day Warranty</td>
</tr>
</table>
From the following url
http://www.doba.com/catalog/2988526.html
Basically, I want the product description between the tags. I tried to
modify the following script
more input
3308191
$ more fetch4.pl
#!/usr/bin/perl
use strict;
use warnings;
use HTML::TokeParser;
use LWP::Simple;
use LWP::UserAgent;
use HTML::LinkExtor;
#for privoxy
my $browser = LWP::UserAgent->new;
$browser->proxy( ['http', 'https' ], "http://localhost:8118");
my ($input_file) = @ARGV;
die "No input file specified\n" unless defined $input_file;
open my $INPUT, '<', $input_file
or die "Cannot open '$input_file': $!";
ID:
while ( my $id = <$INPUT> ) {
chomp $id;
my $url = make_url( $id );
my $html = get($url);
my $get_links = new HTML::LinkExtor;
$get_links->parse($html);
my @links = $get_links->links;
foreach (@links) {
# $_ contains [type, [name, value], ...]
#print "Type: ", shift @$_, "\n";
#Start to parse the images. I think using a pop() vs a shift is
better.
shift @$_;
while (my ($name, $value) = splice(@$_, 0, 2)) {
if($value =~ /images.doba.com/) {
print " $name -> $value\n";
}
}
}
unless ( defined $html ) {
warn "Error downloading from '$url'\n";
next ID;
}
my $parser = HTML::TokeParser->new( \$html );
TABLE:
while ( my $token = $parser->get_tag('table') ) {
if ( lc $token->[1]{id} eq 'item_description' ) {
my $td = $parser->get_tag('tr');
last TABLE unless $td;
my $cell = $parser->get_text('/tr');
my %data;
while ( $cell =~ /\s*([^:]+?):\s+(\d+)\s+/g ) {
$data{$1} = $2;
}
use Data::Dumper;
print Dumper \%data;
}
}
}
sub make_url {
return
sprintf q{http://www.doba.com/members/catalog/%s.html}, $_[0];
}
$ ./fetch4.pl input
src -> http://images.doba.com/products/327/images_aa_dell_d610_1.jpg?prod
But it doesn't work. I'm I using the wrong tags, is the regex
expression wrong, or both?
------------------------------
Date: Sun, 25 May 2008 14:15:41 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: HTML Parsing issues - Part II
Message-Id: <69t3fpF343glnU1@mid.individual.net>
chadda@lonemerchant.com wrote:
> I'm trying to have the following script parse
>
> <table class="item_description">
> <tr>
> <td>Acer Aspire AS5610-2089 Notebook, Intel Pentium Dual Core
> T2080, 1.6 GHz, 1024GB, 160GB, DVD+/-R DL/DVD+RW Drive, 15.4" TFT,
> WebCam, 56K Modem, Wireless, NIC, Vista Home Premium, Refurbished with
> 90 Day Warranty</td>
> </tr>
> </table>
>
>
> From the following url
>
> http://www.doba.com/catalog/2988526.html
use LWP::Simple;
use HTML::TokeParser;
my $html = get 'http://www.doba.com/catalog/2988526.html';
my $p = HTML::TokeParser->new( \$html );
while ( my $table = $p->get_tag('table') ) {
last if $table->[1]{class} and
$table->[1]{class} eq 'item_description';
}
print $p->get_trimmed_text('/td');
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Sun, 25 May 2008 12:32:37 +0000 (UTC)
From: Ben Bullock <benkasminbullock@gmail.com>
Subject: Re: HTML Parsing issues - Part II
Message-Id: <g1bm95$787$1@ml.accsnet.ne.jp>
On Sat, 24 May 2008 23:20:05 -0700, chadda wrote:
> <table class="item_description">
^^^^^
> Acer
> Aspire AS5610-2089 Notebook, Intel Pentium Dual Core
> T2080, 1.6 GHz, 1024GB, 160GB, DVD+/-R DL/DVD+RW Drive, 15.4" TFT,
> WebCam, 56K Modem, Wireless, NIC, Vista Home Premium, Refurbished with
> 90 Day Warranty</td>
Contains not even one colon.
> if ( lc $token->[1]{id} eq 'item_description' ) {
^^
> while ( $cell =~ /\s*([^:]+?):\s+(\d+)\s+/g ) {
^
------------------------------
Date: Sat, 24 May 2008 21:42:32 -0700 (PDT)
From: "comp.llang.perl.moderated" <ced@blv-sam-01.ca.boeing.com>
Subject: Re: maintaining order in a hash (without Tie::IxHash)
Message-Id: <234ab550-1c4b-4fff-9f66-8d0694841cf8@g16g2000pri.googlegroups.com>
On May 24, 9:42 am, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth "comp.llang.perl.moderated" <c...@blv-sam-01.ca.boeing.com>:
>
>
>
> [re: Tie::IxHash]
> > I agree mostly. But, even stretching the hash's natural model a bit,
> > an ordered hash is a convenient amenity at times. Also, with a big
> > array and lots of lookups, even a slow tied hash could be faster.
>
> Faster than...? Just an array, or an array and a hash in parallel? All
> Tie::IxHash does for you is maintain a parallel hash and array, so the
> tie overhead (not insignificant, if this is a performance-critical part
> of the application) is on top of that.
>
> Of course, attempting to emulate a hash by iterating through an array is
> just daft... :)
>
Quite. I wasn't sure if "hash purity" was turning down a daft
corridor or not :)
I have to admit I was once bitten by the
significant overhead of Tie::IxHash, but,
there are times when you need hash insertion order. Rolling your own
separate array in lieu
of Tie::IxHash may be worth looking at if you
need to squeeze out more speed though.
--
Charles DeRykus
--
Charles DeRykus
------------------------------
Date: Sun, 25 May 2008 04:42:19 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sun May 25 2008
Message-Id: <K1EqEJ.y1I@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
AI-NeuralNet-SOM-0.07
http://search.cpan.org/~drrho/AI-NeuralNet-SOM-0.07/
Perl extension for Kohonen Maps
----
Abstract-Meta-Class-0.05
http://search.cpan.org/~adrianwit/Abstract-Meta-Class-0.05/
Simple meta object protocol implementation.
----
AnyEvent-4.0
http://search.cpan.org/~mlehmann/AnyEvent-4.0/
----
AnyEvent-4.03
http://search.cpan.org/~mlehmann/AnyEvent-4.03/
----
App-SweeperBot-0.03
http://search.cpan.org/~pjf/App-SweeperBot-0.03/
Play windows minesweeper, automatically!
----
CGI-RSS-0.007001
http://search.cpan.org/~jettero/CGI-RSS-0.007001/
provides a CGI-like interface for making rss feeds
----
CPAN-CachingProxy-1.000000
http://search.cpan.org/~jettero/CPAN-CachingProxy-1.000000/
A very simple lightweight CGI based Caching Proxy
----
Carp-POE-0.03
http://search.cpan.org/~hinrik/Carp-POE-0.03/
Carp adapted to POE
----
Config-Model-Sshd-0.103
http://search.cpan.org/~ddumont/Config-Model-Sshd-0.103/
Sshd configuration editor and model
----
Coro-4.71
http://search.cpan.org/~mlehmann/Coro-4.71/
coroutine process abstraction
----
Crypt-Skip32-0.06
http://search.cpan.org/~esh/Crypt-Skip32-0.06/
32-bit block cipher based on Skipjack
----
DBIx-SchemaChecksum-0.05
http://search.cpan.org/~domm/DBIx-SchemaChecksum-0.05/
Generate and compare checksums of database schematas
----
DFA-Statemap-1.00
http://search.cpan.org/~perrad/DFA-Statemap-1.00/
----
Devel-FindBlessedRefs-1.000002
http://search.cpan.org/~jettero/Devel-FindBlessedRefs-1.000002/
find all refs blessed under a package
----
Devel-NYTProf-1.15
http://search.cpan.org/~akaplan/Devel-NYTProf-1.15/
line-by-line code profiler and report generator
----
Error-0.17014
http://search.cpan.org/~shlomif/Error-0.17014/
Error/exception handling in an OO-ish way
----
Finance-Currency-Convert-BChile-0.032
http://search.cpan.org/~huguei/Finance-Currency-Convert-BChile-0.032/
Currency conversion module between Chilean Pesos (CLP) and USA Dollars (USD).
----
Games-RolePlay-MapGen-1.002018
http://search.cpan.org/~jettero/Games-RolePlay-MapGen-1.002018/
The base object for generating dungeons and maps
----
HTML-FormWidgets-0.1.41
http://search.cpan.org/~pjfl/HTML-FormWidgets-0.1.41/
Create HTML form markup
----
HTTP-Server-Simple-Er-v0.0.1
http://search.cpan.org/~ewilhelm/HTTP-Server-Simple-Er-v0.0.1/
lightweight server and interface
----
I18N-Charset-1.389
http://search.cpan.org/~mthurn/I18N-Charset-1.389/
IANA Character Set Registry names and Unicode::MapUTF8 (et al.) conversion scheme names
----
IO-AIO-Util-0.06
http://search.cpan.org/~gray/IO-AIO-Util-0.06/
useful functions missing from IO::AIO
----
IO-Ppoll-0.08
http://search.cpan.org/~pevans/IO-Ppoll-0.08/
Object interface to Linux's ppoll() call
----
Mail-Convert-Mbox-ToEml-0.06
http://search.cpan.org/~rjbs/Mail-Convert-Mbox-ToEml-0.06/
convert mbox files to Outlook Express .eml files
----
Math-Random-MT-Perl-1.04
http://search.cpan.org/~jfreeman/Math-Random-MT-Perl-1.04/
Pure Perl Mersenne Twister Random Number Generator
----
MooseX-Singleton-0.08
http://search.cpan.org/~sartak/MooseX-Singleton-0.08/
turn your Moose class into a singleton
----
MooseX-Traits-0.01
http://search.cpan.org/~jrockway/MooseX-Traits-0.01/
automatically apply roles at object creation time
----
MySQL-Easy-2.000001
http://search.cpan.org/~jettero/MySQL-Easy-2.000001/
Perl extension to handle various mundane DBI session related things specific to mysql.
----
Net-BitTorrent-0.022
http://search.cpan.org/~sanko/Net-BitTorrent-0.022/
BitTorrent peer-to-peer protocol class
----
Net-FriendFeed-0.8
http://search.cpan.org/~kappa/Net-FriendFeed-0.8/
Perl interface to FriendFeed.com API
----
Net-SMTP-OneLiner-1.003000
http://search.cpan.org/~jettero/Net-SMTP-OneLiner-1.003000/
extension that polutes the local namespace with a send_mail() function.
----
POE-XUL-0.0405
http://search.cpan.org/~gwyn/POE-XUL-0.0405/
Framework for remote XUL application in POE
----
POSIX-Regex-0.090008
http://search.cpan.org/~jettero/POSIX-Regex-0.090008/
OO interface for the gnu regex engine
----
Perl-Critic-1.084
http://search.cpan.org/~elliotjs/Perl-Critic-1.084/
Critique Perl source code for best-practices.
----
Pod-Simple-Wiki-0.09
http://search.cpan.org/~jmcnamara/Pod-Simple-Wiki-0.09/
A class for creating Pod to Wiki filters.
----
Sub-Contract-0.06
http://search.cpan.org/~erwan/Sub-Contract-0.06/
Pragmatic contract programming for Perl
----
Term-GentooFunctions-1.002000
http://search.cpan.org/~jettero/Term-GentooFunctions-1.002000/
provides gentoo's einfo, ewarn, eerror, ebegin and eend.
----
Test-File-1.24_01
http://search.cpan.org/~bdfoy/Test-File-1.24_01/
test file attributes
----
Test-File-1.24_02
http://search.cpan.org/~bdfoy/Test-File-1.24_02/
test file attributes
----
Text-VisualWidth-0.02
http://search.cpan.org/~nanzou/Text-VisualWidth-0.02/
Perl extension for trimming text by the number of the columns of terminals and mobile phones.
----
Unix-Process-1.002000
http://search.cpan.org/~jettero/Unix-Process-1.002000/
Perl extension to get pid info from (/bin/ps).
----
Weather-YR-0.20
http://search.cpan.org/~hovenko/Weather-YR-0.20/
Perl extension for talking to yr.no
----
Win32-PowerPoint-0.08
http://search.cpan.org/~ishigaki/Win32-PowerPoint-0.08/
helps to convert texts to PP slides
----
ZConf-0.1.5
http://search.cpan.org/~vvelox/ZConf-0.1.5/
A configuration system allowing for either file or LDAP backed storage.
----
ZConf-0.1.6
http://search.cpan.org/~vvelox/ZConf-0.1.6/
A configuration system allowing for either file or LDAP backed storage.
----
ZConf-0.1.7
http://search.cpan.org/~vvelox/ZConf-0.1.7/
A configuration system allowing for either file or LDAP backed storage.
----
ZML-0.5.0
http://search.cpan.org/~vvelox/ZML-0.5.0/
A simple, fast, and easy to read binary data storage format.
----
ZML-0.5.1
http://search.cpan.org/~vvelox/ZML-0.5.1/
A simple, fast, and easy to read binary data storage format.
----
autobox-2.53
http://search.cpan.org/~chocolate/autobox-2.53/
call methods on native types
----
autobox-2.54
http://search.cpan.org/~chocolate/autobox-2.54/
call methods on native types
----
autobox-2.55
http://search.cpan.org/~chocolate/autobox-2.55/
call methods on native types
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
------------------------------
Date: Sat, 24 May 2008 16:58:40 -0700
From: sln@netherlands.co
Subject: Re: Out of memory! Yet ...
Message-Id: <eoah349r1k09rfccq9fq2t2202aqjrj3ju@4ax.com>
On Sat, 24 May 2008 13:44:51 -0700, sln@netherlands.co wrote:
>On Fri, 23 May 2008 00:03:30 -0700 (PDT), "alexxx.magni@gmail.com" <alexxx.magni@gmail.com> wrote:
>
>>thank you for your answer!
>>
>>On 22 Mag, 18:25, s...@netherlands.co wrote:
>>> On Wed, 21 May 2008 23:32:52 -0700 (PDT), "alexxx.ma...@gmail.com" <alexxx.ma...@gmail.com> wrote:
>>> >On 21 Mag, 18:11, "A. Sinan Unur" <1...@llenroc.ude.invalid> wrote:
>>> >> "alexxx.ma...@gmail.com" <alexxx.ma...@gmail.com> wrote innews:e84cae72-e396-40a6-beec-4bad5aa3d615@d77g2000hsb.googlegroups.com:
>>>
>>> --<snip>--
>>>
>>> >> > The memory-eating line is this:
>>> >> > for $i(1..$n)
>>> >> > {
>>> >> > for $y(1..$ny)
>>> >> > { for $x(1..$nx) { $AAA[$i][$x][$y]=$a[3+$nx*($y-1)+$x] } }
>>> >> > print("\n$i>\ttotal size: ",total_size($AAA));
>>> >> > }
>>>
>--<snip>--
>>>
>>> "..since I have"
>>> ">to process each pixel ($x,$y) along $i=1..$n "
>>>
>>> Although a little confused, I thought this was interresting.
>>>
>>> You made some statements along with including this code:
>>>
>>> for $i(1..$n)
>>> {
>>> for $y(1..$ny)
>>> {
>>> for $x(1..$nx)
>>> {
>>> $AAA[$i][$x][$y]=$a[3+$nx*($y-1)+$x]
>>> }
>>>
>>> }
>>>
>>> You said you are reading 100 gray scale images into @a,
>>> flat file. Since the indices of $AAA never touch the same
>>> element twice as an lvalue and since $AAA is never referenced
>>> as an rvalue. This merely rearranges the values of @a into @AAA.
>>> I am not sure this is a filter or even a conversion of say color to gray.
>>
>>
>>well, as I said before, I didnt want to post a script too large to the
>>group, so maybe I've been misunderstood: the images are read in
>>sequence in @a, so that @a is overwritten each time - no memory waste
>>there: it will just occupy between 2 and 15MB as you said. $AAA
>>instead will hold all of them, and I'm unable to avoid this.
>>
>>A little background: the images are a temporal sequence of
>>magnetooptical images representing the switching of magnetization, say
>>from black to white, along time. This meas.tech. is very noisy. The
>
>--<snip>-- I'll take your word on it ..
>>
>>Sorry if I didnt explain it before.
>>
>>>
>>> Lets do a little bitmap math.
>>>
>>> Assume memory conservation:
>>> 1600 x 1200 pixels x 1 byte/8-bit(plane's) gray scale = 1.9 MB
>>> 100 gray scale images x 1.9 MB/image = 190 MB
>>> Using 2 buffers = 380 MB
>>>
>>> Assume memory waste:
>>> 1600 x 1200 pixels x 8 byte/8-bit(plane's) gray scale = 15.36 MB
>>> 100 gray scale images x 15.36 MB/image = 1.536 GB
>>> Using 2 buffers = 3.072 GB
>>>
>>
>>I didnt understand well: memory conservation vs, waste, how can I be
>>sure in perl that I use in my matrices 1 byte per pixel? I believed
>>that perl automatically choose by itself, and it was impossible to
>>force "byte ($x,$y,$z)" in C-style.
>>
>>Thanks again!
>>
>> Alessandro
>>
>>
>
>
>In what your doing, memory conservation becomes important.
>According to perldoc's, the default scalar number is a float.
>And if you use bit-wise operations, the default integral type
>is unsigned int. If you include "use integer" the default becomes
>signed int. I don't know if or how that affects internal buffering of
>number arrays, since arrays can hold a mixture of any perl type,
>which would tend to use a large amount of memory resources.
>
>However that affects your program, it affects everybody's the same way
>and is uncontrollable. But the compiler does funny optimizations.
>
>So the only thing you can do is to try to maximize space ala C-style,
>and see what that gives you. If it doesen't work, no loss, try something
>else.
>
>I don't know how you are reading in the bitmap so I'm just guessing on this.
>After looking at this equation $AAA[$i][$x][$y] = $a[3+$nx*($y-1)+$x];
>it appears to be reading bytes, plus you mentioned 8-bit gray scale.
>A byte is 8 bits so that makes sense.
>
>And there does seem to be an ordering to it that resembles bit plane's,
>in the y direction, so I'll just leave it for what it is.
>
>This ordering can be seen in this series:
>for y=1..1600
>{
> for x=1..1200
> { AAA[x][y] = a[3 + 1200*(y-1) + x] }
>}
>
>x=1..1200, y=1
>-------------------
>AAA[1][1] = a[3 + 1200*(1-1) + 1] = a[4]
>AAA[2][1] = a[3 + 1200*(1-1) + 2] = a[5]
>AAA[3][1] = a[3 + 1200*(1-1) + 3] = a[6]
>AAA[1200][1] = a[3 + 1200*(1-1) + 1200] = a[1203]
>
>x=1..1200, y=2
>-------------------
>AAA[1][2] = a[3 + 1200*(2-1) + 1] = a[1204]
>AAA[2][2] = a[3 + 1200*(2-1) + 2] = a[1205]
>AAA[3][2] = a[3 + 1200*(2-1) + 3] = a[1206]
>AAA[1200][2] = a[3 + 1200*(2-1) + 1200] = a[2403]
>
>Back to bitmap math, assume memory conservation:
>1600 x 1200 pixels x 1 byte gray scale = 1.9 MB
>
>The ideal situation is if you could use a block of memory
>where every byte contained valid 8-bit color data.
>
>Right now, it appears you are using a 32-bit element to
>store an 8-bit color, wasting 3 bytes each time.
>This is alright though. Its the way it is stored in the frame buffer,
>and is enough room to hold a 24-bit color.
>
>Since your doing image processing though, it might be a
>good idea to use the remaining 3 byte's in each element.
>
>In the example above, using all 4 byte's of the element
>should only consume 1.9 MB.
>
>A byte array can be simulated in the untested example below.
>Note, that this can be done for 16-bit color as well.
>Nothing beyond that though.
>
>Acording to the perldoc's, bit manipulations should be fast
>as they are close to C at low level.
>
>sln
>robic0(at)adelphia.net
>
>
>Untested example:
>
>
>
>@a = ();
>@AAA = ();
>
>
>for $i(1..$n)
>{
> # ... read another bitmap into $a
> # ...
>
> for $y(1..$ny)
> {
> for $x(1..$nx)
> {
> setColor8(\@AAA, $i, $x, $y, $a[3 + $nx*($y-1) + $x]);
> ## $AAA[$i][$x][$y] = $a[3+$nx*($y-1)+$x];
> }
> }
>
> }
>
>sub setColor8
>{
> my ($refimgarray, $img, $xpixel, $ypixel, $color) = @_
> my $bitpos = ($ypixel & 3) * 8;
> my $yelement = (($ypixel & 0xFFFFFFFB) >> 2) + 1;
> my $refelement = \${$refimgarray}[$img][$xpixel][$yelement];
> $$refelement = (($$refelement & ~(0xFF << $bitpos)) | (($color & 0xFF) << $bitpos)));
>}
>
>sub getColor8
>{
> my ($refimgarray, $img, $xpixel, $ypixel) = @_
> my $bitpos = ($ypixel & 3) * 8;
> my $yelement = (($ypixel & 0xFFFFFFFB) >> 2) + 1;
> my $refelement = \${$refimgarray}[$img][$xpixel][$yelement];
> return (($$refelement & (0xFF << $bitpos)) >> $bitpos);
>}
>
sub setColor16
{
my ($refimgarray, $img, $xpixel, $ypixel, $color) = @_;
my $bitpos = ($ypixel & 1) * 16;
my $yelement = (($ypixel & 0xFFFFFFFE) >> 1) + 1;
my $refelement = \${$refimgarray}[$img][$xpixel][$yelement];
$$refelement = (($$refelement & ~(0xFFFF << $bitpos)) | (($color & 0xFFFF) << $bitpos)));
}
sub getColor16
{
my ($refimgarray, $img, $xpixel, $ypixel, $color) = @_;
my $bitpos = ($ypixel & 1) * 16;
my $yelement = (($ypixel & 0xFFFFFFFE) >> 1) + 1;
my $refelement = \${$refimgarray}[$img][$xpixel][$yelement];
return (($$refelement & (0xFFFF << $bitpos)) >> $bitpos);
}
===================================
alternate:
setColor8($AAA[$i][$x], $y, $a[3 + $nx*($y-1) + $x]);
sub setColor8
{
my ($refxpixel, $ypixel, $color) = @_;
my $bitpos = ($ypixel & 3) * 8;
my $yelement = (($ypixel & 0xFFFFFFFB) >> 2) + 1;
my $refelement = \${$refxpixel}[$yelement];
$$refelement = (($$refelement & ~(0xFF << $bitpos)) | (($color & 0xFF) << $bitpos)));
}
sub getColor8
{
my ($refxpixel, $ypixel) = @_;
my $bitpos = ($ypixel & 3) * 8;
my $yelement = (($ypixel & 0xFFFFFFFB) >> 2) + 1;
my $refelement = \${$refxpixel}[$yelement];
return (($$refelement & (0xFF << $bitpos)) >> $bitpos);
}
sub setColor16
{
my ($refxpixel, $ypixel, $color) = @_;
my $bitpos = ($ypixel & 1) * 16;
my $yelement = (($ypixel & 0xFFFFFFFE) >> 1) + 1;
my $refelement = \${$refxpixel}[$yelement];
$$refelement = (($$refelement & ~(0xFFFF << $bitpos)) | (($color & 0xFFFF) << $bitpos)));
}
sub getColor16
{
my ($refxpixel, $ypixel) = @_;
my $bitpos = ($ypixel & 1) * 16;
my $yelement = (($ypixel & 0xFFFFFFFE) >> 1) + 1;
my $refelement = \${$refxpixel}[$yelement];
return (($$refelement & (0xFFFF << $bitpos)) >> $bitpos);
}
------------------------------
Date: Sat, 24 May 2008 21:21:03 -0700 (PDT)
From: si <smcbutler@hotmail.com>
Subject: problem upgrading Bundle::CPAN
Message-Id: <57901e4d-5e24-451f-920e-56a469fea6ee@i18g2000prn.googlegroups.com>
hi, i've been using cpan for several years with very few problems, i
just tried to upgrate my Bundle::CPAN install and got a lot of
failures. I'm running FC6 on an AMD opteron machine. could someone
give me a hint how i might fix this?
thx in advance.
DIED. FAILED tests 1-29
Failed 29/29 tests, 0.00% okay
t/14gzopen......Use of uninitialized value in concatenation (.) or
string at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/Scalar/
Util.pm line 30.
t/14gzopen......NOK 1
# Failed test (t/14gzopen.t at line 25)
# Tried to use 'Compress::Zlib'.
# Error: is only avaliable with the XS version at /root/.cpan/
build/Compress-Zlib-2.011/blib/lib/Compress/Zlib.pm line 9
# BEGIN failed--compilation aborted at t/14gzopen.t line 25.
# Compilation failed in require at (eval 31) line 2.
# BEGIN failed--compilation aborted at (eval 31) line 2.
t/14gzopen......ok 2/250Global symbol "$gzerrno" requires explicit
package name at t/14gzopen.t line 49.
Global symbol "$gzerrno" requires explicit package name at t/
14gzopen.t line 53.
Global symbol "$gzerrno" requires explicit package name at t/
14gzopen.t line 56.
Global symbol "$gzerrno" requires explicit package name at t/
14gzopen.t line 59.
Global symbol "$gzerrno" requires explicit package name at t/
14gzopen.t line 66.
Global symbol "$gzerrno" requires explicit package name at t/
14gzopen.t line 94.
Global symbol "$gzerrno" requires explicit package name at t/
14gzopen.t line 97.
Global symbol "$gzerrno" requires explicit package name at t/
14gzopen.t line 100.
Global symbol "$gzerrno" requires explicit package name at t/
14gzopen.t line 104.
Global symbol "$gzerrno" requires explicit package name at t/
14gzopen.t line 111.
Global symbol "$gzerrno" requires explicit package name at t/
14gzopen.t line 111.
Global symbol "$gzerrno" requires explicit package name at t/
14gzopen.t line 117.
Global symbol "$gzerrno" requires explicit package name at t/
14gzopen.t line 118.
Global symbol "$gzerrno" requires explicit package name at t/
14gzopen.t line 480.
Global symbol "$gzerrno" requires explicit package name at t/
14gzopen.t line 481.
Global symbol "$gzerrno" requires explicit package name at t/
14gzopen.t line 499.
Global symbol "$gzerrno" requires explicit package name at t/
14gzopen.t line 502.
Bareword "Compress::Zlib::zlib_version" not allowed while "strict
subs" in use at t/14gzopen.t line 38.
Bareword "ZLIB_VERSION" not allowed while "strict subs" in use at t/
14gzopen.t line 38.
Bareword "Z_FINISH" not allowed while "strict subs" in use at t/
14gzopen.t line 98.
Bareword "Z_STREAM_END" not allowed while "strict subs" in use at t/
14gzopen.t line 110.
Bareword "Z_STREAM_END" not allowed while "strict subs" in use at t/
14gzopen.t line 111.
Bareword "Z_STREAM_ERROR" not allowed while "strict subs" in use at t/
14gzopen.t line 446.
Bareword "Z_STREAM_ERROR" not allowed while "strict subs" in use at t/
14gzopen.t line 461.
Execution of t/14gzopen.t aborted due to compilation errors.
# Looks like you planned 250 tests but only ran 2.
# Looks like your test died just after 2.
t/14gzopen......dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1, 3-250
Failed 249/250 tests, 0.40% okay
t/99pod.........ok
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/000prereq.t 4 1024 6 4 66.67% 2-4 6
t/01version.t 255 65280 2 3 150.00% 1-2
t/03zlib-v1.t 255 65280 401 797 198.75% 1 4-401
t/05examples.t 255 65280 ?? ?? % ??
t/06gzsetp.t 255 65280 ?? ?? % ??
t/08encoding.t 255 65280 29 57 196.55% 1-29
t/14gzopen.t 255 65280 250 497 198.80% 1 3-250
Failed 7/8 test scripts, 12.50% okay. 683/689 subtests failed, 0.87%
okay.
make: *** [test_dynamic] Error 255
/usr/bin/make test -- NOT OK
Running make install
make test had returned bad status, won't install without force
------------------------------
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 V11 Issue 1576
***************************************