[27201] in Perl-Users-Digest
Perl-Users Digest, Issue: 9011 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 2 11:05:34 2006
Date: Thu, 2 Mar 2006 08:05:03 -0800 (PST)
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, 2 Mar 2006 Volume: 10 Number: 9011
Today's topics:
Re: A Problem With GD <markem@airmail.net>
Re: A Problem With GD <1usa@llenroc.ude.invalid>
Different results parsing a XML file with XML::Simple ( (Erik Wasser)
Re: Different results parsing a XML file with XML::Simp <1usa@llenroc.ude.invalid>
Problems after updating Net::SSH:Perl <news@chaos-net.de>
Re: Remote.pm (File::Remote) problem <tkoedge@comcast.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 02 Mar 2006 08:47:27 -0600
From: Mark Manning <markem@airmail.net>
Subject: Re: A Problem With GD
Message-Id: <120e19qkevrl799@corp.supernews.com>
Tad McClellan wrote:
> Mark Manning <markem@airmail.net> wrote:
>
> Yes you did.
We could play this yes/no game all day. You think I did - but only I know whether or not I actually
did. You are not me, therefore - I did not.
> You snipped the "it" that is the object of your sentence. The it was:
>
> It was never meant to be some super-duper, ass kissing,
> way of doing something.
Since it is you and I talking here - you should be able to know what the "it" is. Others, if they
want to know what "it" is should read the previous posts. Therefore, the "it" is unnecessary.
>>>Observing the basics such as pragmas and indenting is hardly
>>>super-duperizing things.
> You claimed that pragmas and indenting are super-duperizing things
> when they are nothing more than common courtesty.
>
> Hence, being disingenuous.
The only thing that needed to be posted was:
$rgb = (r<<16)|(g<<8)|b;
should replace all of the colorAllocations.
The rest - is disingenuous. After all, disingenuous means "giving a false appearance of simple
frankness" and the above is simple frankness, first telling me how bad I am for not using strict or
warnings isn't simple frankness. Think about it.
> You again snipped what it was that we could all tell, what
> we could all tell was:
>
> It was just some thrown together code.
I thought you'd be smart enough to remember - but see my previous post on this.
> Obviously so, by your own admission (the one you snipped).
Obviously not still. And just as obviously - you still are not doing what you originally said you
would do. Or have you forgotten what you originally posted?
>>Otherwise - why all of the fuss?
> Because it was, as you said, just thrown together.
And that - you see - is a part of the whole problem. You see it that everyone should march in one
way - I see it that everyone should do their own thing and others should be tolerant of their
actions. Not beat them to death.
>>I guess your mom never taught you the basics of kindness and
>>consideration - did she?
> My mother passed away just two weeks ago.
>
> Thanks for that.
You're welcome. Sorry to hear she pased away - but the sentence sticks and has nothing to do with
your mom passing away at all. You (as well as others) have obviously forgotten when your mom said
such things as "play together nicely" or other such things because these postings show just how
inflexible you-all have become.
>>>If you are not willing to invest a little bit in making it
>>>easier to help you solve your problem, then it is unreasonable
>>>to expect volunteers to invest in it.
>>
>>No.
> Yes.
No.
>>It is unreasonable for volunteers to try to force their view on the
>>rest of the world.
> No it isn't. They are _volunteers_.
That's right! So if you DON'T want to VOLUNTEER to help out - then DON'T! But DON'T try to make
others conform to YOUR way of doing things! That's like going over to Louisiana, bringing food and
water to those people who need it - and then telling them they have to pay you for your services!
And your excuse would be "HEY! I'M JUST A VOLUNTEER! YOU HAVE TO DO WHAT I SAY!" What a load of bunk!
> They can put any preconditions they care to on getting some of their time.
Wrong-o boy-o! You get absolutely NOTHING. You don't get paid. You don't get anything except
maybe a thank-you. And only that - if you are lucky sometimes or the other person is at least
somewhat grateful for what you've done.
>>Do you truly believe that anyone wants to post here
>>and get the response you are giving me?
> Of course not.
>
> That is exactly why the group collected together a list of
> things to do that help avoid getting such responses.
Talk about twisted logic. The outlook should just be help - don't hurt. Instead it is hurt-then
help. If you want a moderated version of comp.lang.perl - then go to comp.lang.perl.moderated.
This is comp.lang.perl.misc - a different beast altogether. That's why it is misc. Not
comp.lang.perl.help. Because you get all sorts of things here. That's why you have to be tolerant
of what someone posts.
>>>This newsgroup is NOT A HELP DESK!
>>
>>You are mis-quoting. I did not say it WAS a help desk. I said IF it
>>was a help desk. That is what this is like.
>
> ^^^^^^^^^^^^
>
> This newsgroup is NOT like a help desk.
Yes - it is. Not a "Look! I have a desk and a phone and people call me and I answer questions and
I think they are all stupid and I am god" kind of help desk. But the kind of help desk I used to
work at, in an open area by the computer room. Where hundreds of people would come by and ask all
sorts of questions. It was volunteer work then. It is volunteer work now.
>>>The social dynamic is very different from a help desk.
>>
>>By "social dynamic" I take it to mean it's more like a gang meeting
>>where the toughest acting person gets their way?
> No, it's more like a society where folks that follow the social
> mores are accepted into the society while those that don't
> are ostracised.
>
> Just like every other society.
Oh. I see. So now you are saying that you like to pressure people into doing what you want. It's
not that you are going to physically go over and beat them up - you're just going to act like say -
Hitler and put up a set of rules and regulations and then try to enforce those rules and regulations
by ostracizing those who are different. (See! I can use big words too!)
>> I can see that.
> No you can't.
Yes I can. (Boy I just love playing this game of yes I can - no you can't! It gets us no whwere
but has a certain....mmmmmm....circular logic to it.)
>>>It is *you* who are acting as if you own Usenet by flat-out
>>>refusing to do things in a socially acceptable manner, and
>>>attempting to change all of us to conform to "your way".
>>
>>Ah! The "you must conform" statement again. Beehive mentality.
> No, "human interaction" mentality.
No - beehive mentality is correct. True humans do random things. Bees all work towards a single
goal. True humans build airplanes, rockets, lasers. Bees just drone on.
>>I've disrupted the hive and now the bees are all angry.
> If you fart at the dinner table, you are not likely to
> be invited to dinner in the future.
And you know this is true because....
>>>Just format code for human consumption, and ask the machine for
>>>help before asking hundreds of live humans for help. It isn't
>>>much to ask.
>>
>>I didn't ask for help.
> Yes you did.
>
> You asked for help with finding someone to report your "bug" to.
Nope. I said:
"To whomever works on GD:
I believe I may have uncovered a problem with the GIF renderer under GD. I can reproduce the error
and send you both the code that is causing the error as well as a GIF example of the error. I can
also send a PNG file showing what it should look like."
Hmmmmm...... I don't see it saying "Can someone help me find someone to report my bug to?" I don't
see it saying "Can someone come along and bash me for trying to reach someone?" I don't see any of
that. Now, if you want to VOLUNTEER to contact one of the people who work ON GD. (Notice it
doesn't say "WITH GD" which would mean someone who is proficient in using GD. But rather someone
who works "ON GD" as in a maintainer or someone who applies patches to GD.)
>>No - it is me asserting my right to do as I please.
> If it pleases you to fart at the dinner table, then you must
> be prepared to take the consequences like a man rather than
> arguing that farting should be OK instead of frowned upon.
Hey! You're repeating yourself. Too bad - must be Alzheimer's. So sad....
>>>If you take cuts in line, then don't whine when someone
>>>calls you on it.
>>
>>Eh? Can you maybe explain this?
> Yes I can.
Obviously not - your message just ended right there. If you had of said "if you take cuts" and not
"cuts in line"; then the statement would make sense. But as is - it doesn't. Which is why I
believe you did not respond.
But let's recap:
First I post that if you don't like what I am saying or doing to just not respond.
Then you pipe-up and respond saying that you will do as I've asked.
So I tell you "Obviously not" since you posted.
So then things begin to deteriorate quickly.
Have I got it correct?
------------------------------
Date: Thu, 02 Mar 2006 15:20:27 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: A Problem With GD
Message-Id: <Xns977A694AD673Easu1cornelledu@127.0.0.1>
Mark Manning <markem@airmail.net> wrote in
news:120e19qkevrl799@corp.supernews.com:
> Tad McClellan wrote:
>
>> Mark Manning <markem@airmail.net> wrote:
>>
...
> Since it is you and I talking here - you should be able to know what
> the "it" is. Others, if they want to know what "it" is should read
> the previous posts. Therefore, the "it" is unnecessary.
Quoting properly is necessary.
>>>>Observing the basics such as pragmas and indenting is hardly
>>>>super-duperizing things.
>> You claimed that pragmas and indenting are super-duperizing things
>> when they are nothing more than common courtesty.
>>
>> Hence, being disingenuous.
>
> The only thing that needed to be posted was:
>
> $rgb = (r<<16)|(g<<8)|b;
>
> should replace all of the colorAllocations.
So, you are telling everyone that the whole GD::Image interface is
wrong. Talk about arrogance. How about the thousands of people who are
able to write correct code?
...
>>>It is unreasonable for volunteers to try to force their view on the
>>>rest of the world.
>> No it isn't. They are _volunteers_.
>
> That's right! So if you DON'T want to VOLUNTEER to help out - then
> DON'T! But DON'T try to make others conform to YOUR way of doing
> things! That's like going over to Louisiana, bringing food and water
> to those people who need it - and then telling them they have to pay
> you for your services! And your excuse would be "HEY! I'M JUST A
> VOLUNTEER! YOU HAVE TO DO WHAT I SAY!" What a load of bunk!
Let's see: So, I am handing out food and blankets after a natural
disaster (although I am not presumptuous enough to think that the help
we provide here is *that* important).
While I am handing out stuff, I see a strong person push away the meek
to get to the front of the line. According to you, I am supposed to say
"here, take as much as you want".
In fact, take a look at how the Red Cross operates: You have to do as
they say to get the help. You cannot go to a shelter, and start a fight.
You cannot cut to the front of the line.
Volunteers are people who provide help to other people for the
satisfaction they feel afterwards of helping people whom, they feel,
deserve it. They are not slaves. They have every right to choose whom
they help, and other what conditions.
>>> That is exactly why the group collected together a list of
>>> things to do that help avoid getting such responses.
>>
>> Talk about twisted logic. The outlook should just be help - don't
>> hurt. Instead it is hurt-then help. If you want a moderated version
>> of comp.lang.perl - then go to comp.lang.perl.moderated. This is
>> comp.lang.perl.misc - a different beast altogether. That's why it is
>> misc. Not comp.lang.perl.help. Because you get all sorts of things
>> here. That's why you have to be tolerant of what someone posts.
No one *has to be* tolerant of anything. I mean, if anything goes, why
even have a hierarchy of groups. Why not have just one group where
everyone asks whatever question he feels like asking, and those helpful
volunteers can slave away trying to figure out which questions they can
answer.
Having a hierarchy of groups with specialized topics and customs allow
those helpful people to do the most good with the least effort.
You are proposing to make it hard for us to do good.
You are trying to bully us into accepting that the interface to a whole
module which thousands of other people have successfully used ought to
be changed because of your own incompetence. Do you really think that
the colorAllocate method has been deficient all this time and you are
the one genius who stumbled upon it?
Don't answer that: We now know your arrogance does not know any limits.
Oh, by the way:
> go over and beat them up - you're just going to act like say - Hitler
> and put up a set of rules and regulations and then try to enforce
> those rules and regulations by ostracizing those who are different.
Apparently you do not understand what Hitler and the Nazi's did.
Only someone with great insensitivity can equate the holocaust with a
response to one's own rudeness. What an inappropriate comparison!
http://en.wikipedia.org/wiki/Godwin's_law
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Thu, 2 Mar 2006 16:17:12 +0100
From: fuzz@uni-paderborn.de (Erik Wasser)
Subject: Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser)
Message-Id: <nsejd3-rep.ln1@wasser-7359.user.cis.dfn.de>
Hello Usenet.
I'm subject to some confusion with XML and UTF8. I'm working with
XML-Simple and I try to decode some XML with with german umlauts
(ISO-8859-1). The first XML line declared the encoding correct (see code
below). But I'm getting different results using XML-Simple with the
default XML parser named XML::Sax and a second parser named XML::Parser.
The following code tries to decode the mini XML file and prints the UTF8
flags of the resulting strings.
Can someone run this code on his machine and post the results? Thanks.
The results on my machine are this:
ÃÃÃäöüà (0) cmp ÄÖÜäöüß (0) = -1
ÄÖÜäöüß (1) cmp ÄÖÜäöüß (0) = 0
The first line was parsed by XML::Sax and the second line was parsed by
XML::Parser. My conclusions:
1) Line 1 is wrong, line 2 is correct
2) The output should be line 2 two times.
3) There is a bug in XML::Sax
Your opinion?
The code (written in ISO-8859-1 on disc):
#!/usr/bin/perl -w
use strict;
use warnings;
use XML::Simple;
use Encode;
foreach (1..2)
{
my $q1 = XMLin("<?xml version='1.0' encoding='iso-8859-1'?>\n<a>ÄÖÜäöüß</a>");
my $q2 = "ÄÖÜäöüß";
printf "%s (%d) cmp %s (%d) = %d\n"
, $q1, Encode::is_utf8($q1)
, $q2, Encode::is_utf8($q2)
, $q1 cmp $q2;
# and again with the non default parser
$XML::Simple::PREFERRED_PARSER = 'XML::Parser';
}
PS: I'm using perl v5.8.7, XML-SAX-0.13, XML-Parser-2.34 and
expat-1.95.8.
--
So long... Fuzz
------------------------------
Date: Thu, 02 Mar 2006 15:57:53 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser)
Message-Id: <Xns977A6FA2E6F1Aasu1cornelledu@127.0.0.1>
fuzz@uni-paderborn.de (Erik Wasser) wrote in
news:nsejd3-rep.ln1@wasser-7359.user.cis.dfn.de:
> I'm subject to some confusion with XML and UTF8. I'm working with
> XML-Simple and I try to decode some XML with with german umlauts
> (ISO-8859-1). The first XML line declared the encoding correct (see
> code below). But I'm getting different results using XML-Simple with
> the default XML parser named XML::Sax and a second parser named
> XML::Parser. The following code tries to decode the mini XML file and
> prints the UTF8 flags of the resulting strings.
>
> Can someone run this code on his machine and post the results? Thanks.
> The results on my machine are this:
>
> ÃÃÃäöüà (0) cmp ÄÖÜäöüß (0) = -1
> ÄÖÜäöüß (1) cmp ÄÖÜäöüß (0) = 0
>
> The first line was parsed by XML::Sax and the second line was parsed
> by XML::Parser. My conclusions:
>
> 1) Line 1 is wrong, line 2 is correct
> 2) The output should be line 2 two times.
> 3) There is a bug in XML::Sax
>
> Your opinion?
>
> The code (written in ISO-8859-1 on disc):
>
> #!/usr/bin/perl -w
>
> use strict;
> use warnings;
>
> use XML::Simple;
> use Encode;
>
> foreach (1..2)
> {
> my $q1 = XMLin("<?xml version='1.0'
> encoding='iso-8859-1'?>\n<a>ÄÖÜäöüß</a>"); my $q2 = "ÄÖÜäöüß";
>
> printf "%s (%d) cmp %s (%d) = %d\n"
> , $q1, Encode::is_utf8($q1)
> , $q2, Encode::is_utf8($q2)
> , $q1 cmp $q2;
> # and again with the non default parser
> $XML::Simple::PREFERRED_PARSER = 'XML::Parser';
> }
>
> PS: I'm using perl v5.8.7, XML-SAX-0.13, XML-Parser-2.34 and
> expat-1.95.8.
First off, let me say I don't know much about this stuff. I am on the US
English version of XP. I copied and pasted the code above into Gvim, and
then ran it. I got:
D:\Home\asu1\UseNet\clpmisc> r > results.txt
D:\Home\asu1\UseNet\clpmisc> cat results.txt
ÄÖÜäöüß (1) cmp ÄÖÜäöüß (0) = 0
ÄÖÜäöüß (1) cmp ÄÖÜäöüß (0) = 0
I would be inclined to look at what changed in XML-SAX between versions
0.12 and 0.13, but then, as I said, I don't know much about encodings
etc.
I have XML-SAX-0.12 and XML-Parser-2.34 and
D:\Home\asu1\UseNet\clpmisc> perl -v
This is perl, v5.8.7 built for MSWin32-x86-multi-thread
(with 14 registered patches, see perl -V for more detail)
Copyright 1987-2005, Larry Wall
Binary build 815 [211909] provided by ActiveState
http://www.ActiveState.com
ActiveState is a division of Sophos.
Built Nov 2 2005 08:44:52
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Thu, 2 Mar 2006 16:56:17 +0100
From: Martin Kissner <news@chaos-net.de>
Subject: Problems after updating Net::SSH:Perl
Message-Id: <slrne0e5d1.14b.news@maki.homeunix.net>
hello together,
I have recently updated my installation of Net::SSH:Perl from version
1.28 to 1.29 via the cpan shell.
After that a script which uses this modul gives me this error:
---
Can't locate object method "blocking" via package "IO::Handle" at
/System/Library/Perl/5.8.6/Net/SSH/Perl.pm line 212, <GEN0> line 1.
---
I commented out the following two lines in
/System/Library/Perl/5.8.6/Net/SSH/Perl.pm
---
212 # defined($sock->blocking(0))
213 # or die "Can't set socket non-blocking: $!";
---
This makes my script work again, but it might not be the best solution
to the problem.
Is there anything else I could do?
Would it help to update IO::Handle or is this a waste of time or might
it lead to farther problems?
Any help will be appreciated.
Best regards
Martin
perl -v
This is perl, v5.8.6 built for darwin-thread-multi-2level
(with 2 registered patches, see perl -V for more detail)
--
perl -e '$S=[[73,116,114,115,31,96],[108,109,114,102,99,112],
[29,77,98,111,105,29],[100,93,95,103,97,110]];
for(0..3){for$s(0..5){print(chr($S->[$_]->[$s]+$_+1))}}'
------------------------------
Date: Thu, 02 Mar 2006 07:51:37 -0800
From: Dayton Jones <tkoedge@comcast.net>
Subject: Re: Remote.pm (File::Remote) problem
Message-Id: <4N-dnaBMS9EUiZrZRVn-og@comcast.com>
A. Sinan Unur wrote:
> Dayton Jones <tkoedge@comcast.net> wrote in
> news:b7WdnSuPq7BLgZjZnZ2dnUVZ_sadnZ2d@comcast.com:
>
> Dayton, *please* do not top-post.
>
>
>>A. Sinan Unur wrote:
>>
>>>Dayton Jones <tkoedge@comcast.net> wrote in
>>>news:CfOdnXLeZoy5hJjZRVn-uA@comcast.com:
>>>
>>>
>>>
>>>>A. Sinan Unur wrote:
>>>>
>>>>
>>>>>Dayton Jones <tkoedge@comcast.net> wrote in
>>>>>news:tZKdnQtkzPuPkZjZnZ2dnUVZ_sGdnZ2d@comcast.com:
>>>>>
>>>>>
>>>>>
>>>>>>I've got a very simple script (see below) that uses the
>>>>>>File::Remote module. I've set up the script to use ssh/scp
>>>>>>and there is no problem for the user to ssh to the hosts -
>>>>>>but the script fails with a "permission denied" error on the
>>>>>>
>>>>>>>copy command.
>>>>>>
>>>>>>-- begin script
>>>>>>
>>>>>>#!/usr/bin/perl
>>>>>
>>>>>
>>>>>use strict;
>>>>>use warnings;
>>>>>
>>>>>missing.
>>>>>
>>>>>
>>>>>
>>>>>>use File::Remote qw(:replace);
>>>>>>
>>>>>>setrsh('/usr/bin/ssh');
>>>>>>serrcp('/usr/bin/scp');
>>>
>>>^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>...
>>>
>>>
>>>
>>>>I added the strict/warnings but had the same result -- with no extra
>>>>information.
>>>
>>>
>>>Well, did you fix the typo above?
>>>
>>>I don't have File-Remote installed, by I doubt serrcp is correct.
>>
>>Yes, I noticed that when reading your original response -- changed it
>>to "setrcp="
>
>
> Well, apologoies, I misdiagnosed the problem. I looked at the source
> code of File::Remote, and the problem simply is that /dev/null has a
> different name on Windows, i.e. NUL.
>
> The dirty fix would involve replacing File::Remote::_system.
>
> You could also just go in and edit out the 1 > /dev/null out of the
> backticked string. But then, you'd be modifiying a module, and it might
> get overwritten when you upgrade to a new version etc.
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> use File::Remote qw(:replace);
> use File::Spec::Functions qw( canonpath );
>
> setrsh(canonpath 'C:/opt/cygwin/bin/ssh.exe');
> setrcp(canonpath 'C:/opt/cygwin/bin/scp.exe');
> settmp(canonpath $ENV{TEMP});
>
> {
> no warnings 'redefine';
> *File::Remote::_system = sub {
> my($self, @cmd) = File::Remote::_self_or_default(@_);
>
> # return "Broken pipe" if cmd invalid
> # chomp(my $return = `@cmd 2>&1 1>/dev/null || echo 32`);
> chomp(my $return = `@cmd 2>&1 1>NUL || echo 32`);
> File::Remote::_debug("_system(@cmd) = $return");
>
> if ($return) {
> # if echo'ed an int (internal tests), use it,
> # else use "Permission denied" (13)
> $return =~ m/^(\d+)$/;
> $! = $1 || 13;
> return undef;
> }
> return 1;
> };
> }
>
> copy('localfile', 'remotefile')
> or die "\$\@ = $@\n\$! = $!\n";
>
> __END__
>
> Sinan
>
OK, now I'm confused -- I'm not running on a windows platform so the
/dev/null reference is correct. I'm running RedHat EL3 and EL4 -- my
apologies for not specifying that earlier.
------------------------------
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 9011
***************************************