[23183] in Perl-Users-Digest
Perl-Users Digest, Issue: 5404 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 21 14:06:43 2003
Date: Thu, 21 Aug 2003 11:05:16 -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 Thu, 21 Aug 2003 Volume: 10 Number: 5404
Today's topics:
5.80, OS X, bizarre FTP weirdness <bgjohnson@note.amherst.edu>
Re: [OT] Is the perl review still active? <mothra@nowhereatall.com>
Re: [OT] Is the perl review still active? <dha@panix.com>
Re: and Randal L. Schwartz the hacker <ellem52@mac.com>
Approach to match segments, opinions welcome <spamfilter@cheiron-it.nl>
Re: Approach to match segments, opinions welcome <skuo@mtwhitney.nsc.com>
Re: Approach to match segments, opinions welcome <skuo@mtwhitney.nsc.com>
automation of web form queries <igm@liv.ac.uk>
comparison with functions ord and length (Bohne)
Copy constructors <mail@annuna.com>
Re: excel to csv <josh@nospam.pixael.com>
Re: How can I put my email address on my website withou <jurgenex@hotmail.com>
Re: How can I put my email address on my website withou <the_stan_brown@fastmail.fm>
Image::Magick jpeg compression <andrew_harton@agilent.com>
Re: Image::Magick jpeg compression <andrew_harton@agilent.com>
Re: Image::Magick jpeg compression (Randal L. Schwartz)
imagemagick composite problem <lam-no-spamm-thanks@nospam.org>
Re: IN SEARCH OF ELEGANT CODE: Setting a hash value to <nobull@mail.com>
Re: IN SEARCH OF ELEGANT CODE: Setting a hash value to (Randal L. Schwartz)
Is there an index to the perl man pages? (Yehuda Berlinger)
Re: Module::Build is yet more broken... <nospam-abuse@ilyaz.org>
Re: perl zombies <cwilbur@mithril.chromatico.net>
Problem with IO::Socket <branco@syners.org>
Re: Problem with IO::Socket <branco@syners.org>
Re: Problem with perl 5.6.1 on AIX 5.2 <massimiliano.adamoNOSPAM@renodemedici.it>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 21 Aug 2003 16:40:06 GMT
From: Brad Johnson <bgjohnson@note.amherst.edu>
Subject: 5.80, OS X, bizarre FTP weirdness
Message-Id: <3f44f5e3@amhnt2.amherst.edu>
I am running Mac OS X 10.2.7 and recently upgraded from 5.6.1 to 5.8.0
following the guidance at
http://developer.apple.com/internet/macosx/perl.html. It installed
happily, only complaining about the known Berkley DB problems. But
something is now very wrong with the network settings (or something).
I have DSL, connected behind a Linksys wireless router.
The following code
use Net::FTP;
$ftp = Net::FTP->new("ftp1.freebsd.org", Debug => 1);
$ftp->login("anonymous",'me@here.there');
$ftp->cwd("/pub/FreeBSD/");
print $ftp->dir();
$ftp->quit;
gives the following output:
Net::FTP: Net::FTP(2.65)
Net::FTP: Exporter(5.566)
Net::FTP: Net::Cmd(2.21)
Net::FTP: IO::Socket::INET(1.26)
Net::FTP: IO::Socket(1.27)
Net::FTP: IO::Handle(1.21)
Net::FTP=GLOB(0x12b60)<<< 220 Welcome to mirrors.secsup.org FTP service.
Net::FTP=GLOB(0x12b60)>>> user anonymous
Net::FTP=GLOB(0x12b60)<<< 331 Please specify the password.
Net::FTP=GLOB(0x12b60)>>> PASS ....
Net::FTP=GLOB(0x12b60)<<< 230 Login successful. Have fun.
Net::FTP=GLOB(0x12b60)>>> CWD /pub/FreeBSD/
Net::FTP=GLOB(0x12b60)<<< 250-If you're looking for one of the FreeBSD
releases, please look in the
Net::FTP=GLOB(0x12b60)<<< 250-releases/${ARCH}/${RELNAME} directory,
where ARCH = "i386" or "alpha"
Net::FTP=GLOB(0x12b60)<<< 250-for Intel and DEC Alpha architecture
machines and RELNAME = the release
Net::FTP=GLOB(0x12b60)<<< 250-you're interested in, e.g. "3.5.1-RELEASE"
or "4.2-RELEASE".
Net::FTP=GLOB(0x12b60)<<< 250-
Net::FTP=GLOB(0x12b60)<<< 250 Directory successfully changed.
Net::FTP=GLOB(0x12b60)>>> PORT 192,168,1,100,192,125
at which point it hangs, then kills the internet connection if I don't
interrupt the program.
In contrast at the terminal running the ftp commandline program I get
prompt% ftp mirrors.secsup.org
Connected to mirrors.secsup.org.
220 Welcome to mirrors.secsup.org FTP service.
Name (mirrors.secsup.org:bgjohnson): anonymous
331 Please specify the password.
Password:
230 Login successful. Have fun.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd /pub/FreeBSD/
250-If you're looking for one of the FreeBSD releases, please look in
the
250-releases/${ARCH}/${RELNAME} directory, where ARCH = "i386" or
"alpha"
250-for Intel and DEC Alpha architecture machines and RELNAME = the
release
250-you're interested in, e.g. "3.5.1-RELEASE" or "4.2-RELEASE".
250-
250 Directory successfully changed.
ftp> ls
500 Unknown command.
227 Entering Passive Mode (208,209,50,18,22,139)
150 Here comes the directory listing.
drwxrwxr-x 6 758 497 4096 Jan 06 2003 CERT
etc.
Any idea what's going on?
Thanks,
Brad
bgjohnson@note.amherst.edu
------------------------------
Date: Thu, 21 Aug 2003 06:32:53 -0700
From: "Mothra" <mothra@nowhereatall.com>
Subject: Re: [OT] Is the perl review still active?
Message-Id: <3f44bfa5@usenet.ugs.com>
Hi Randal,
"Randal L. Schwartz" <merlyn@stonehenge.com> wrote in message
> "Mothra" == Mothra <mothra@nowhereatall.com> writes:
>
> Mothra> Does anyone know if the perl review is still active? The last
> Mothra> issue is Jan of this year. I was thinking of submitting an
> Mothra> article and noticed it has been a while since the last pub.
>
> Randal>Perl Review was run by "brian d foy", who is currently in Iraq
serving
> Randal>with the rest of the US Armed Forces.
>
Thanks for the info! I hope for his save return.
> Randal> It's probably suspended until further notice. I took over brian's
TPJ
> Randal>column, and have access to brian's sourceforge files for emergency
> Randal>purposes.
Hmn, well then yesterday I submitted a proposal
[TPR Submission] Getting Started with DateTime
Is there any way to get this removed? (or should I)
I was hoping to write something to get people to start using
the DateTime Suite (beginners/newbie's).
The basic idea was getting things into/out of DateTime
and some basic parsing this, would lead to other articles
being written by the more senior programmers conserning
sets and setspans, dealing with durations things like that.
Any ideas where else I could publish an article?(IF they will publish
it)
> Randal>When brian comes back into civilian life, I'll be able to give him
> Randal>training assignments for Stonehenge again, just like the old days.
:)
Thanks
Mothra
------------------------------
Date: Thu, 21 Aug 2003 17:52:15 +0000 (UTC)
From: "David H. Adler" <dha@panix.com>
Subject: Re: [OT] Is the perl review still active?
Message-Id: <slrnbka1mf.37.dha@panix2.panix.com>
In article <a023fed91b62ab4bd07d507df5c2ec6b@news.teranews.com>, Randal
L. Schwartz wrote:
> Perl Review was run by "brian d foy"
The style guide does not indicate the use of quotes.
:-)
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"Well, to make this story the way it should be done we will
[need] technology that won't invented for 30 years and a budget that
could pay for a large south american country." "What have we got?" "25
cents and a block of wood." - Possible Dr. Who budget conference
------------------------------
Date: Thu, 21 Aug 2003 07:44:32 -0400
From: Lou Moran <ellem52@mac.com>
Subject: Re: and Randal L. Schwartz the hacker
Message-Id: <p3c9kvss98qla46s2dj2lh6cqlr82k7fk0@4ax.com>
On Wed, 20 Aug 2003 19:52:07 -0700, Keith Keller
<kkeller-spammmm@wombat.san-francisco.ca.us> wrote wonderful things
about me:
>
>Wow, you're bitter. Did he crack your password of 12345?
>
DUDE! How could you post my root password. Great now I have to
change it. Thanks a lot!
--
Mac OS X: Because it was easier to make UNIX user friendly than fix Windows.
------------------------------
Date: Thu, 21 Aug 2003 15:23:20 +0200
From: "Frank Maas" <spamfilter@cheiron-it.nl>
Subject: Approach to match segments, opinions welcome
Message-Id: <3f44c7c5$0$29073$e4fe514c@dreader6.news.xs4all.nl>
Hi Perl Group,
I am fussing about a problem and I would very much like some input of
others. I'll explain the problem:
given a list of numbers 1,2,3,15,13,19,5,6
and a set of data triples (1,15,9),(15,13,2),(13,6,4),(20,23,99)
I am looking for a fast algorithm that would convert the list into
the sum of 9, 2 and 4. To explain some more: the triples in effect
are the begin and endpoint in the list and the data that is valid
for that subsegment. No triple contains overlap, but for the begin
and end. There are more triples than subsegments and it is possible
that a subsegment cannot be found. In that case something special
must be done.
I have tried two approaches:
(1) use a series of regexp created out of the triple list (+/ 1000)
and match this with the list:
$list="1:2:3:15:13:19:5:6"; $d=0;
for (@triples) {
if ($list =~ s/(?:^|:)($_->[0]):(?:.+:)?($_->[1])(?::|$)/:$1:-:$2:/g)
{
$d+=$_->[2]
}
}
$list=~s/:\d+:(-|$)//;
print "success $d\n" unless $link
(2) walk through the list (converted to an array) and find matches
%triples=( '1:15'=>9, ...);
@list=qw(1 2 3 15 13 19 5 6 X); $d=0;
for $i (shift @list) {
for $j (shift @list) {
exit if $j eq 'X';
$d+=$triples{"$i:$j"}, last if exists $triples{"$i:$j"};
}
}
print "success $d\n";
Both work (perhaps I have oversighted an error in the sample code
above), but a tad bit slow. Since this is must once be part of a
heavy webserver any time optimisation is very helpful. Any ideas?
--Frank
------------------------------
Date: Thu, 21 Aug 2003 10:05:06 -0700
From: Steven Kuo <skuo@mtwhitney.nsc.com>
Subject: Re: Approach to match segments, opinions welcome
Message-Id: <Pine.GSO.4.21.0308210958120.25629-100000@mtwhitney.nsc.com>
On Thu, 21 Aug 2003, Frank Maas wrote:
> Hi Perl Group,
>
> I am fussing about a problem and I would very much like some input of
> others. I'll explain the problem:
>
> given a list of numbers 1,2,3,15,13,19,5,6
> and a set of data triples (1,15,9),(15,13,2),(13,6,4),(20,23,99)
>
> I am looking for a fast algorithm that would convert the list into
> the sum of 9, 2 and 4. To explain some more: the triples in effect
> are the begin and endpoint in the list and the data that is valid
> for that subsegment. No triple contains overlap, but for the begin
> and end. There are more triples than subsegments and it is possible
> that a subsegment cannot be found. In that case something special
> must be done.
You're using certain numbers to delimit a list of numbers?
> I have tried two approaches:
> (1) use a series of regexp created out of the triple list (+/ 1000)
> and match this with the list:
>
> $list="1:2:3:15:13:19:5:6"; $d=0;
> for (@triples) {
> if ($list =~ s/(?:^|:)($_->[0]):(?:.+:)?($_->[1])(?::|$)/:$1:-:$2:/g)
> {
> $d+=$_->[2]
> }
> }
> $list=~s/:\d+:(-|$)//;
> print "success $d\n" unless $link
>
> (2) walk through the list (converted to an array) and find matches
>
> %triples=( '1:15'=>9, ...);
> @list=qw(1 2 3 15 13 19 5 6 X); $d=0;
> for $i (shift @list) {
> for $j (shift @list) {
> exit if $j eq 'X';
> $d+=$triples{"$i:$j"}, last if exists $triples{"$i:$j"};
> }
> }
> print "success $d\n";
>
> Both work (perhaps I have oversighted an error in the sample code
> above), but a tad bit slow. Since this is must once be part of a
> heavy webserver any time optimisation is very helpful. Any ideas?
>
> --Frank
I think the second approach is better. You've not mentioned what
should be done if the first number in the list has no stopping
delimiter. Do you stop? Or do you attempt to find a valid starting
point? Assuming the former, here's what I'd do:
#!/usr/local/bin/perl
use strict;
use warnings;
my @triples = ( [1,15,9],[15,13,2],[13,6,4],[20,23,99]);
my %find;
for (@triples) {
$find{$_->[0]} = {
stop => $_->[1],
add => $_->[2],
};
}
my @list = qw(1 2 3 15 13 19 5 6);
my $save = my $start = shift @list;
my $stop;
unless ($start and exists $find{$start}->{stop}) {
die "No valid stopping point for $start\n";
} else {
$stop = $find{$start}->{stop}
}
my $sum = 0;
for (@list) {
if ($_ == $stop) {
$sum += $find{$start}->{add};
last unless exists $find{$_}->{stop};
$start = $_; # restart
$stop = $find{$_}->{stop};
}
}
print "SUM is $sum\n";
unshift(@list,$save); # restore list if needed
# Loop once and exit as soon as possible -- should be faster than
# what you had previously written.
--
Hope this helps,
Steven
------------------------------
Date: Thu, 21 Aug 2003 10:10:00 -0700
From: Steven Kuo <skuo@mtwhitney.nsc.com>
Subject: Re: Approach to match segments, opinions welcome
Message-Id: <Pine.GSO.4.21.0308211007570.25629-100000@mtwhitney.nsc.com>
On Thu, 21 Aug 2003, Steven Kuo wrote:
(snippped)
> I think the second approach is better. You've not mentioned what
> should be done if the first number in the list has no stopping
> delimiter. Do you stop? Or do you attempt to find a valid starting
> point? Assuming the former, here's what I'd do:
>
> #!/usr/local/bin/perl
>
> use strict;
> use warnings;
> my @triples = ( [1,15,9],[15,13,2],[13,6,4],[20,23,99]);
> my %find;
>
> for (@triples) {
> $find{$_->[0]} = {
> stop => $_->[1],
> add => $_->[2],
> };
> }
>
> my @list = qw(1 2 3 15 13 19 5 6);
> my $save = my $start = shift @list;
> my $stop;
>
> unless ($start and exists $find{$start}->{stop}) {
^^^^^^^
I suppose this should be
unless (defined ($start) and exists $find{$start}->{stop}) {
--
Cheers,
Steven
------------------------------
Date: Thu, 21 Aug 2003 17:05:15 +0100
From: Ian Morton <igm@liv.ac.uk>
Subject: automation of web form queries
Message-Id: <bi2qlm$gm4$1@news.liv.ac.uk>
Hi, I'm brand new to Perl so please forgive me if this question appears
simple (also I have tried to subscribe to the beginners news server 5
times so I apologise if this is the wrong place for this question).
I have written a Perl programme that strips data from a file,
this data is then placed into the correct boxes on a organisations web
form (by the user currently) and then the form submitted, the returned
result is then used for a further programme to parse (once again cut and
pasted by the user).
Could you tell me what howto's to read or where to go for examples that
allow you to automatically insert data into a url and submitt the form
(without user intervention).
Then retrieve the result for another programme to use.
any help would be great.
thanks Ian.
------------------------------
Date: 21 Aug 2003 05:41:33 -0700
From: simjesse@aol.com (Bohne)
Subject: comparison with functions ord and length
Message-Id: <bfedec4.0308210441.12103bf6@posting.google.com>
Can somebody explain the following to me?
if (int ((((ord($STRING) - 32) & 077) + 2) / 3) == int(length($STRING) / 4))
This case seems to be true if $STRING has been uuencoded, false otherwise.
I just don't seen to be able to figure out why!
------------------------------
Date: Thu, 21 Aug 2003 16:21:44 GMT
From: Joe Creaney <mail@annuna.com>
Subject: Copy constructors
Message-Id: <3F44F19E.4070000@annuna.com>
I have been reading up in C++ about copy constructors, is it possable to
use them in perl. I want to delete an object from one array and put it
in another array. When I delete the object the object in the other
array goes away too.
------------------------------
Date: Thu, 21 Aug 2003 13:00:59 +0200
From: "Josh" <josh@nospam.pixael.com>
Subject: Re: excel to csv
Message-Id: <bi28me$42i44$1@ID-203386.news.uni-berlin.de>
"Garry Short" <g4rry.sh0rt@zw4llet.com> ha scritto nel messaggio
news:3f4241d7$0$46015$65c69314@mercury.nildram.net...
> Josh wrote:
> >
> > tnx but unfortunately i'm working on a linux server...
>
> So what? So am I.
>
> This script was written on my laptop, which runs SuSE 8.1. One of the main
> ideas behind Perl is that it's supposed to be *PORTABLE!*
>
> In fact, I just went back and read the link I posted - it specifically
says
> I'm running Linux, and the OP specifically said in response that she was
> running RedHat 8.
> If you're going to ask for help, how about at least reading the
information
> you're pointed at?
i'm sorry i've read another message.. your link point to another post :)
i think you talk about this:
#!/usr/bin/perl -w
use strict;
use Spreadsheet::ParseExcel;
my ($file) = (@ARGV);
my $dest = $file;
my $xls = Spreadsheet::ParseExcel::Workbook->Parse("$file");
foreach my $sheet (@{$xls->{Worksheet}}) {
my $name = $sheet->{Name};
my $dest =~ s/\.xls$/_sheet$name\.cvs/;
open OUT, ">$dest" or die "Can't write to $dest: $!\n";
my ($col, $row);
for ($row = $sheet->{MinRow};
defined $sheet->{MaxRow} && $row <= $sheet->{MaxRow};
$row++) {
for ($col = $sheet->{MinCol};
defined $sheet->{MaxCol} && $col <= $sheet->{MaxCol};
$col++){
my $cell = $sheet->{Cells}[$row][$col]->Value;
print OUT "$cell,";
} print OUT "\n";
} close OUT;
}
thank you very mutch this can work very good
------------------------------
Date: Thu, 21 Aug 2003 13:23:21 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: How can I put my email address on my website without attracting Spam?
Message-Id: <dJ31b.20437$_P1.15350@nwrddc01.gnilink.net>
Jukka K. Korpela wrote:
> "Jürgen Exner" <jurgenex@hotmail.com> wrote:
>
>> Just create a bitmap/gif/jpeg that contains the information.
>> There are not many spammers out there who would go through the
>> trouble of running an OCR program on every graphic or image, hoping
>> to decipher an email address.
>
> And many blind people, too, and people who will just regard such a
> nuisance method as a bogosity indicator and refrain from doing
> business with the author.
>
>> However, what does that have to do with Perl?
>
> Or HTML, for that matter? The whole thread is off-topic in both
> groups, but so are most other crossposted threads on Usenet. This
> does not imply that you should feel compelled to give very bad advice.
You are raising very good points, indeed.
I guess that is the quality of advice you get when asking your barber about
how to fix your car.
jue
------------------------------
Date: Thu, 21 Aug 2003 13:33:48 -0400
From: Stan Brown <the_stan_brown@fastmail.fm>
Subject: Re: How can I put my email address on my website without attracting Spam?
Message-Id: <MPG.19aecc88968127c298b1d4@news.odyssey.net>
In article <ESY0b.18431$_P1.9509@nwrddc01.gnilink.net> in=20
comp.infosystems.www.authoring.html, J=FCrgen Exner=20
<jurgenex@hotmail.com> wrote:
>Just create a bitmap/gif/jpeg that contains the information.
>There are not many spammers out there who would go through the trouble of
>running an OCR program on every graphic or image, hoping to decipher an
>email address.
Not many blind people would go through that trouble either, however=20
much they might wish to.
There is something _really_ wrong with the idea of definitely=20
inconveniencing legitimate users in the hope of perhaps=20
inconveniencing illegitimate users. (This is the logical flaw behind=20
challenge-response email systems, too. Well, it's _one_ of the=20
logical flaws.)
--=20
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
validator: http://jigsaw.w3.org/css-validator/
------------------------------
Date: Thu, 21 Aug 2003 12:01:56 +0100
From: "Andrew Harton" <andrew_harton@agilent.com>
Subject: Image::Magick jpeg compression
Message-Id: <1061463641.968931@cswreg.cos.agilent.com>
Hi all,
I've been banging my head against a wall trying to use Image::Magick
to generate jpeg compressed thumbnails.
Here's latest iteration of the code I've been using;
my $image = Image::Magick->new;
$image->Read(filename=>$source);
$image->Resize(width=>400, height=>300);
$image->Write(filename=>$output);
$image->Resize(width=>100, height=>75);
$image->Set(Quality=>10);
$image->Write(filename=>$thumb, compression=>'JPEG');
undef $image;
Basically, I'm trying to read a source image, resize to 400x300 and
write that, then resize to 100x75 and then write that. I notice that
the typical filesize I get for the 400x300 image is between 50-60k,
however the filesize for the thumbnail is roughly 25k. Using
Paintshop Pro I can produce compressed images of around 5k.
Any pointers as to what I'm doing wrong would be great, as I find the
documentation on the Image::Magick website a bit short on detail.
thanks,
Andrew
------------------------------
Date: Thu, 21 Aug 2003 12:14:23 +0100
From: "Andrew Harton" <andrew_harton@agilent.com>
Subject: Re: Image::Magick jpeg compression
Message-Id: <1061464389.339527@cswreg.cos.agilent.com>
Andrew Harton wrote:
> Hi all,
>
> I've been banging my head against a wall trying to use Image::Magick
> to generate jpeg compressed thumbnails.
>
> Here's latest iteration of the code I've been using;
> my $image = Image::Magick->new;
> $image->Read(filename=>$source);
> $image->Resize(width=>400, height=>300);
> $image->Write(filename=>$output);
> $image->Resize(width=>100, height=>75);
> $image->Set(Quality=>10);
> $image->Write(filename=>$thumb, compression=>'JPEG');
> undef $image;
>
> Basically, I'm trying to read a source image, resize to 400x300 and
> write that, then resize to 100x75 and then write that. I notice that
> the typical filesize I get for the 400x300 image is between 50-60k,
> however the filesize for the thumbnail is roughly 25k. Using
> Paintshop Pro I can produce compressed images of around 5k.
>
> Any pointers as to what I'm doing wrong would be great, as I find the
> documentation on the Image::Magick website a bit short on detail.
>
> thanks,
> Andrew
I've since realised that 'Quality' should have been 'quality', and I've
tried
my $image = Image::Magick->new;
$image->Read(filename=>$source);
$image->Resize(width=>400, height=>300);
$image->Write(filename=>$output);
$image->Resize(width=>100, height=>75);
$image->Set(compression=>'JPEG');
$image->Set(quality=>90);
$image->Write(filename=>$thumb);
undef $image;
to see if that made a difference, but with no luck - the output filesize
remains
unchanged, no matter what value I put in for the quality.
Andrew
------------------------------
Date: Thu, 21 Aug 2003 12:03:36 GMT
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Image::Magick jpeg compression
Message-Id: <8ee0d54504635f094e39e07a326a3b1e@news.teranews.com>
>>>>> "Andrew" == Andrew Harton <andrew_harton@agilent.com> writes:
Andrew> I've since realised that 'Quality' should have been 'quality',
Given the arcane interface of ImageMagick, I wouldn't be surprised
if it wasn't "uality".
:-)
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Thu, 21 Aug 2003 19:33:38 +0200
From: Lam <lam-no-spamm-thanks@nospam.org>
Subject: imagemagick composite problem
Message-Id: <tcd6eyc3v1.fsf@lam.dev33.cvf>
hi
i have a problem to compose 2 images :
the code :
my $effect_image = new Image::Magick;
my $status = $effect_image->Read($image_before);
die "Couldn't open file! $status" if $status;
my $background = new Image::Magick;
$background->Set(size => $x . "x" . $y);
$background->ReadImage('xc:grayscale');
$background->Set(colorspace=> "RGB");
$background->Write(filename => $dir . "/" . "back.png");
$effect_image->Composite(image => $background, gravity => "SouthEast", compose => "Out");
and the error :
Exception 410: Reference is not my type (Image::Magick) at ...
any idea ?
i don't really understand what is wrong
--
(concatenate 'string "lam" (reverse "gro.ylimafxut@"))
------------------------------
Date: 21 Aug 2003 12:38:36 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: IN SEARCH OF ELEGANT CODE: Setting a hash value to a chomp'ed thing
Message-Id: <u9u18bxmtf.fsf@wcl-l.bham.ac.uk>
"John W. Krahn" <krahnj@acm.org> writes:
> Well this will work, if that's what you want.
>
> %hash = ( key => grep [ chomp ], `which ps` );
Wow, that's a neat trick.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Thu, 21 Aug 2003 12:03:35 GMT
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: IN SEARCH OF ELEGANT CODE: Setting a hash value to a chomp'ed thing
Message-Id: <c3fee47f0d56cc3d1c77688650386c5d@news.teranews.com>
>>>>> "David" == David Filmer <IneverReadAnythingSentToMe@hotmail.com> writes:
David> I can do this:
David> chomp($ps = `which ps`); #chomp that system-call linefeed!
David> %hash = ('key' => $ps);
David> but what I really want to do is something like this:
David> %hash = ('key' => chomp `which ps`);
I've used this in the past:
%hash = (key => `which ps` =~ /(.*)/);
A faster variation of that with a bit more typing and risk:
%hash = (key => substr(`which ps`, 0, -1));
And if you're really into chomp:
%hash = (key => do { chomp(my $x = `which ps`); $x });
print "Just another Perl hacker,";
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: 21 Aug 2003 08:39:32 -0700
From: jon@actcom.co.il (Yehuda Berlinger)
Subject: Is there an index to the perl man pages?
Message-Id: <75e50dfd.0308210739.41076254@posting.google.com>
Has anyone done a comprehensive index to the perl man pages? perldoc
is sort of an index to perlfunc and perlfaq, and perlindex is a regex
match over all of the docs, but not an index. I'm looking for a tool
to look up "array" or "@" and get to the right place(s), sort of like
what the O'reilly safari does for their books.
Yehuda
------------------------------
Date: Thu, 21 Aug 2003 17:01:35 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Module::Build is yet more broken...
Message-Id: <bi2ttf$pi6$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Sam Holden
<sholden@cs.usyd.edu.au>], who wrote in article <slrnbk82lp.6sp.sholden@flexal.cs.usyd.edu.au>:
> >> If there are such systems then replace "Build.PL" with "Setup.PL" and
> >> "Build" with "Build.PL" or whatever. The actual names of the files
> >> are pretty much irrelevant to me.
> >
> > Same for me - as far the files differ by more than extension. But
> > Module::Build does exactly this.
> The filenames used are a pretty trivial thing to change.
AFAIU, This would lead to a need to update the READMEs in all the
packages relying on M::B.
> > This is not acceptable. I do not want my users to read 20-page README
> > just to find out how to install things on a non-broken system. Too
> > many Perl installations are broken; if non-broken ones give troubles
> > too, the whole idea of supporting modules becomes a nightmare...
>
> perl Setup.PL
> perl Build.PL test
> perl Build.PL install
>
> is hardly 20 pages.
Would this be the case, great. However, I still have no idea why the
second line is needed... IMO, the default should be to do
config/build/test cycle; and it is better to keep install a different
command.
Hope this helps,
Ilya
------------------------------
Date: Thu, 21 Aug 2003 16:38:41 GMT
From: Charlton Wilbur <cwilbur@mithril.chromatico.net>
Subject: Re: perl zombies
Message-Id: <8765kr55yq.fsf@mithril.chromatico.net>
>>>>> "Xho" == ctcgag <ctcgag@hotmail.com> writes:
Xho> By the way, you avoid perl zombies by either waiting for them
Xho> or by doing a double fork.
And one that would be fit for the humor file, except it depends on context....
Charlton
--
cwilbur at chromatico dot net
cwilbur at mac dot com
------------------------------
Date: Thu, 21 Aug 2003 16:28:35 +0100
From: Nuno Branco <branco@syners.org>
Subject: Problem with IO::Socket
Message-Id: <ty51b.900$ZE6.582766@newsserver.ip.pt>
I am trying reading data with a TCP Socket defined like this:
$socket = IO::Socket::INET->new(
LocalAddr => '194.235.139.77' ,
LocalPort => '1234',
Listen => '10' ,
Proto => 'tcp' ,
Type => SOCK_STREAM ,
Reuse => 1
) or die "IO::Socket: $@" ;
Then i have:
while (1) {
$client = $socket->accept ;
print $client "What is your name?\n " ;
$socket->recv($name, 1024) or die "Error... $!" ;
print $client "Hello $name" ;
close $client ;
}
When i connect, it prints "What is your name?" and it gives an error
"Transport endpoint is not connected". If i remove the "or die" it just
stands there after printing "Hello" without waiting for my input.
Can someone tell me what i'm doing wrong?
Thanks.
--
Best Regards,
Nuno Branco
------------------------------
Date: Thu, 21 Aug 2003 16:33:33 +0100
From: Nuno Branco <branco@syners.org>
Subject: Re: Problem with IO::Socket
Message-Id: <7D51b.901$4B7.658464@newsserver.ip.pt>
If only i could have waited some more minutes before posting i wouldn't have
bored the newsgroup.
The solution is to change $socket->recv($name, 1024) or die "Error... $!" ;
for
$client->recv($name, 1024) or die "Error... $!" ;
Sorry for lost bandwidth.
Nuno Branco wrote:
>
>
> I am trying reading data with a TCP Socket defined like this:
>
> $socket = IO::Socket::INET->new(
> LocalAddr => '194.235.139.77' ,
> LocalPort => '1234',
> Listen => '10' ,
> Proto => 'tcp' ,
> Type => SOCK_STREAM ,
> Reuse => 1
> ) or die "IO::Socket: $@" ;
>
> Then i have:
>
> while (1) {
> $client = $socket->accept ;
> print $client "What is your name?\n " ;
> $socket->recv($name, 1024) or die "Error... $!" ;
> print $client "Hello $name" ;
>
> close $client ;
> }
>
>
> When i connect, it prints "What is your name?" and it gives an error
> "Transport endpoint is not connected". If i remove the "or die" it just
> stands there after printing "Hello" without waiting for my input.
>
> Can someone tell me what i'm doing wrong?
>
> Thanks.
>
--
Best Regards,
Nuno Branco
------------------------------
Date: Thu, 21 Aug 2003 12:19:28 +0200
From: "Massimiliano Adamo" <massimiliano.adamoNOSPAM@renodemedici.it>
Subject: Re: Problem with perl 5.6.1 on AIX 5.2
Message-Id: <pan.2003.08.21.10.19.28.578584@renodemedici.it>
On Thu, 21 Aug 2003 11:27:38 +0200, Hans-Joachim Ehlers wrote:
>>
> Why not use Perl 5.8 which is deliverd by IBM and normaly installed by the
> standard os installation
or also perl in rpm format, from CD tool box (also downloadable from IBM
site) ..
--
Massimiliano.
------------------------------
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 5404
***************************************