[27404] in Perl-Users-Digest
Perl-Users Digest, Issue: 9066 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Mar 19 14:06:05 2006
Date: Sun, 19 Mar 2006 11:05:06 -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 Sun, 19 Mar 2006 Volume: 10 Number: 9066
Today's topics:
Re: A Problem With GD robic0
Re: A Problem With GD <rwxr-xr-x@gmx.de>
Re: Can perl check if executable exists <bart.lateur@pandora.be>
Re: Can perl check if executable exists <jurgenex@hotmail.com>
Re: Code that makes you say hmmm! <nospam-abuse@ilyaz.org>
Re: Code that makes you say hmmm! (Rick Scott)
ebayapi <nospam@home.com>
Re: ebayapi <Im.so.Huckin.Fappy@spamgourmet.com>
Re: ebayapi <tadmc@augustmail.com>
perl ssh with timeout? <markus.dehmann@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 18 Mar 2006 18:20:01 -0800
From: robic0
Subject: Re: A Problem With GD
Message-Id: <e8fp125em7ipv1r8ureqr7q1pb2rifnsib@4ax.com>
On Wed, 15 Mar 2006 10:37:30 +0100, "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de> wrote:
>Also sprach robic0:
>
>> But given the RGB function above, calling RGB(255,255,255) would be more appropriate.
>> The difference is evals are mostly used, if its your purpose, to dynamically
>> generate unknown code at runtime, then its evaluated. In the RGB case its a known form.
>> In C/C++, macros are used for "substitution" by the pre-compiler. All instances of the
>> macro are substituted for "real" code before compiling. Thats why there's always the
>> perviable, "Beware of Macro's sideaffects" by certain documentation, since many C/C++
>> constructs are macro's that are not intrinsics. For instance, long, short and byte
>> are macro's.
>
>As to all I know, this is utter nonsense. Do you have any documents
>backing up that 'short' and 'long' are macros?
>
>Tassilo
Really? What does a compiler know? It knows the smallest and the largest.
The smallest is always a "char", the largest is always an "int".
Int is the largest bit representation of a native compiler that it knows
about of the largest data register that it is designed to work with.
Albeit the data register must be "at least" as big.
So what is a "short", is it half the "int"? How many bits is that?
Is a "short" half of the "int"? Nope, its not!
In your mind, a "short" is 16 bits. Thats 1/4 of an "int" in a 64 bit
compiler. Thats why "short" is a macro as well as byte (which has been
a macro almost since it was named). Macros controlled by either differently
named "extra-short-short" or whatever.
Start a short C++ program in VC6 and use the type "short" and "byte"
and "long" then trace the definition. It leads to a MACRO!
There is only char and int, the min and max. All others are NOT TYPED
anymore for years!!! They translate into these two.
------------------------------
Date: Sun, 19 Mar 2006 13:21:22 +0100
From: "Lukas Mai" <rwxr-xr-x@gmx.de>
Subject: Re: A Problem With GD
Message-Id: <dvjic2$cnv$03$1@news.t-online.com>
robic0 schrob:
> On Wed, 15 Mar 2006 10:37:30 +0100,
> "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de> wrote:
>
>>Also sprach robic0:
>>
>>> For instance, long, short and byte are macro's.
>>
>>As to all I know, this is utter nonsense. Do you have any documents
>>backing up that 'short' and 'long' are macros?
>
> Really? What does a compiler know? It knows the smallest and the largest.
> The smallest is always a "char", the largest is always an "int".
Wrong. The smallest addressable unit is always a char, but long int or
long long int are often larger than int.
> Int is the largest bit representation of a native compiler that it knows
> about of the largest data register that it is designed to work with.
"Native compilers" are irrelevant. I'm talking about C. A C
implementation isn't required to use something called "registers".
> Albeit the data register must be "at least" as big.
> So what is a "short", is it half the "int"? How many bits is that?
> Is a "short" half of the "int"? Nope, its not!
Irrelevant.
> In your mind, a "short" is 16 bits.
No.
> Thats 1/4 of an "int" in a 64 bit
> compiler.
Wrong. Many 64-bit compilers have 32-bit ints (for backwards
compatibility with broken programs). This also disproves your claim that
"int" corresponds to the largest data register of the underlying
machine.
> Thats why "short" is a macro as well as byte (which has been
> a macro almost since it was named).
"short" can't be a macro, and "byte" isn't standard C(++). Oh, and typedefs
aren't macros ("short" can't be a typedef either).
> Macros controlled by either differently
> named "extra-short-short" or whatever.
I don't understand that part.
> Start a short C++ program in VC6 and use the type "short" and "byte"
> and "long" then trace the definition. It leads to a MACRO!
Impossible. VC6 isn't a C++ compiler; the language it translates shares
a common subset with C++, but that's all. Besides, how do you "trace the
definition" for things like
long x;
long int y;
int long z;
long double f;
double long g;
? They're all valid C++. I'd like to see a macro implementation of
"long" that supports this.
> There is only char and int, the min and max. All others are NOT TYPED
> anymore for years!!! They translate into these two.
Definitely wrong. void, signed char, unsigned char, char, short,
unsigned short, int, unsigned int, long, unsigned long, float, double
and long double are all distinct types.
HTH, Lukas
------------------------------
Date: Sun, 19 Mar 2006 09:15:14 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Can perl check if executable exists
Message-Id: <288q12dka27dlnsn9u46o792d22iegdkgj@4ax.com>
Jürgen Exner wrote:
>
>What about simply running
> $foo = `which make`;
>If it comes back empty, then you know that there is no program 'make' in
>your path.
>Otherwise you will get the path to the executable.
>
>jue
>
>PS: Yes, 'which' is available for Windows, too.
But it doesn't work... Cygwin which needs the command line
which make.exe
Portable? Hah!
--
Bart.
------------------------------
Date: Sun, 19 Mar 2006 11:47:17 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Can perl check if executable exists
Message-Id: <9xbTf.2919$vy.1118@trnddc01>
Bart Lateur wrote:
> Jürgen Exner wrote:
>> What about simply running
>> $foo = `which make`;
>> If it comes back empty, then you know that there is no program
>> 'make' in your path.
>> Otherwise you will get the path to the executable.
>>
>> PS: Yes, 'which' is available for Windows, too.
>
> But it doesn't work... Cygwin which needs the command line
>
> which make.exe
>
> Portable? Hah!
Well,then don't use Cygwin but 'which' from the SFU:
http://www.microsoft.com/technet/interopmigration/unix/sfu/default.mspx
That one does work:
C:\>which perl
D:\Program Files\Perl561\bin\perl.exe
C:\>
jue
------------------------------
Date: Sun, 19 Mar 2006 04:07:06 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Code that makes you say hmmm!
Message-Id: <dvilda$145g$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
John W. Krahn
<krahnj@telus.net>], who wrote in article <03SSf.2749$nQ6.1906@clgrps13>:
> I downloaded a Perl program recently and encountered this line:
> if(exists $_[0]->{"name"} and scalar($_[0]->{"name"}) eq $_[0]->{"name"}){
The intent is quite clear. This snippet of code will warn the user
when some dark force assigns undef to $_[0]->{"name"}.
Hope this helps,
Ilya
------------------------------
Date: Sun, 19 Mar 2006 04:18:53 -0000
From: rick@shadowspar.dyndns.org (Rick Scott)
Subject: Re: Code that makes you say hmmm!
Message-Id: <1142741020.Ae5E.30151@shadowspar>
(A. Sinan Unur <1usa@llenroc.ude.invalid> uttered:)
> "John W. Krahn" <someone@example.com> wrote:
>
> > I downloaded a Perl program recently and encountered this line:
> >
> > if(exists $_[0]->{"name"} and scalar($_[0]->{"name"}) eq
> > $_[0]->{"name"}){
>
> Maybe we need a
>
> alt.perl-maintainer.recovery
>
> newsgroup.
Sign me up. I get to interface with plenty of code that looks as
though it may predate Perl4. No strictures, no warnings, and every
package you import dumps a couple of dozen variable and function names
into main whether you like it or not. I really got a kick out of
seeing this in one of the libraries:
$SocAF_INET = 2;
$SocSTREAM = 1;
...
..and then reading in the Camel book:
# One problem with ancient socket code in Perl was that people
# would use hard-coded values for constants passed into socket
# functions, which destroys portability. ... If you ever see code
# that does anything like explicitly setting $AF_INET = 2, you
# know you're in for big trouble.
Rick
--
key CF8F8A75 / print C5C1 F87D 5056 D2C0 D5CE D58F 970F 04D1 CF8F 8A75
Always code as if the guy who ends up maintaining your code
will be a violent psychopath who knows where you live.
:Damian Conway
------------------------------
Date: Sun, 19 Mar 2006 05:03:20 GMT
From: "Nospam" <nospam@home.com>
Subject: ebayapi
Message-Id: <sC5Tf.2318$H%3.1949@newsfe5-gui.ntli.net>
I am looking for a code using the ebay api that enables multiple listings
for sellers
------------------------------
Date: Sat, 18 Mar 2006 22:25:11 -0700
From: Jeff <Im.so.Huckin.Fappy@spamgourmet.com>
Subject: Re: ebayapi
Message-Id: <dvipvo$as49@xco-news.xilinx.com>
Nospam wrote:
> I am looking for a code using the ebay api that enables multiple listings
> for sellers
Seems a silly request to me, but here you go:
gur ronl ncv gung ranoyrf zhygvcyr yvfgvatf sbe fryyref
HTH, HAND,
~Jeff
------------------------------
Date: Sun, 19 Mar 2006 07:07:52 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: ebayapi
Message-Id: <slrne1qlt8.h6c.tadmc@magna.augustmail.com>
Nospam <nospam@home.com> wrote:
> I am looking for a code
This is a discussion newsgroup, not a search engine.
We discuss _writing_ Perl code, not finding code written in Perl.
> using the ebay api
Type:
ebay
into the little box at:
http://search.cpan.org
This resource has been pointed out to you before.
Please make use of it *before* resorting to a newsgroup post.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 19 Mar 2006 11:50:00 -0500
From: Markus Dehmann <markus.dehmann@gmail.com>
Subject: perl ssh with timeout?
Message-Id: <485gdrFi956uU1@individual.net>
How can I use perl to connect to a remote computer via ssh with a timeout?
I saw the modules Net::SSH and Net::SSH::Perl, but didn't see timeout
options. The latter one I wasn't able to install anyway (the required
Crypt::DH never finishes its tests in CPAN shell).
Maybe just use the system command? But it also does not have a timeout?
BTW, all computers I want to connect to don't require my password, so
getting a connection should be straightforward.
Thanks!
Markus
------------------------------
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 9066
***************************************