[16577] in Perl-Users-Digest
Perl-Users Digest, Issue: 3989 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 11 14:15:35 2000
Date: Fri, 11 Aug 2000 11:15:24 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <966017724-v9-i3989@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 11 Aug 2000 Volume: 9 Number: 3989
Today's topics:
Re: Were are all the executibles? (Tony L. Svanstrom)
Re: Were are all the executibles? (Tony L. Svanstrom)
Re: What is "pack()" used for? <russ_jones@rac.ray.com>
Re: What is "pack()" used for? (Anno Siegel)
Re: What is "pack()" used for? <lr@hpl.hp.com>
Re: What is "pack()" used for? <lr@hpl.hp.com>
Re: Where can I find Basic Perl Definitions? <care227@attglobal.net>
Re: Where can I find Basic Perl Definitions? (Andreas Kahari)
Re: Where can I find Basic Perl Definitions? (Tony L. Svanstrom)
Re: Where can I find Basic Perl Definitions? <abe@ztreet.demon.nl>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 11 Aug 2000 17:49:07 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: Were are all the executibles?
Message-Id: <1ef7o0l.1wycog314auixbN%tony@svanstrom.com>
Michael Carman <mjcarman@home.com> wrote:
> john_s_brown@my-deja.com wrote:
> >
> > Why is Perl a scripting language? Why one can't make executibles (this
> > is, *.exe files)? Wouldn't compiling be much more intelligent than
> > interpreting? That way anybody could drive a perl program without
> > having perl interpreter!
>
> That way you'd have to compile your scripts for every platform you
> wanted to run them on!
But what if someone invented like a virtual machine, so you can run them
on a single platform, but at the same time on different platforms...
Hmmm... I think I better patent/copyright this before I send it... damn,
I've already pushed the send-button... Oh, well, I guess this great idea
is out now. ;-)
/Tony
--
/\___/\ Who would you like to read your messages today? /\___/\
\_@ @_/ Protect your privacy: <http://www.pgpi.com/> \_@ @_/
--oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
DSS: 0x9363F1DB, Fp: 6EA2 618F 6D21 91D3 2D82 78A6 647F F247 9363 F1DB
---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
\O/ \O/ ©1999 <http://www.svanstrom.com/?ref=news> \O/ \O/
------------------------------
Date: Fri, 11 Aug 2000 17:55:24 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: Were are all the executibles?
Message-Id: <1ef7oem.1nyia8jfjc7p9N%tony@svanstrom.com>
Tony L. Svanstrom <tony@svanstrom.com> wrote:
> Michael Carman <mjcarman@home.com> wrote:
>
> > john_s_brown@my-deja.com wrote:
> > >
> > > Why is Perl a scripting language? Why one can't make executibles (this
> > > is, *.exe files)? Wouldn't compiling be much more intelligent than
> > > interpreting? That way anybody could drive a perl program without
> > > having perl interpreter!
> >
> > That way you'd have to compile your scripts for every platform you
> > wanted to run them on!
>
> But what if someone invented like a virtual machine, so you can run them
> on a single platform, but at the same time on different platforms...
> Hmmm... I think I better patent/copyright this before I send it... damn,
> I've already pushed the send-button... Oh, well, I guess this great idea
> is out now. ;-)
BTW... I think I'm on to something, Java is nothing more than a lame way
to answer the "how do I hide the source"-question that people ask after
starting to learn Perl... ;-)
/Tony
--
/\___/\ Who would you like to read your messages today? /\___/\
\_@ @_/ Protect your privacy: <http://www.pgpi.com/> \_@ @_/
--oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
DSS: 0x9363F1DB, Fp: 6EA2 618F 6D21 91D3 2D82 78A6 647F F247 9363 F1DB
---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
\O/ \O/ ©1999 <http://www.svanstrom.com/?ref=news> \O/ \O/
------------------------------
Date: Fri, 11 Aug 2000 10:12:19 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: What is "pack()" used for?
Message-Id: <399417D3.6DB3E7E9@rac.ray.com>
Anno Siegel wrote:
>
> >
> >$ip = "127.0.0.1";
> >@octets = split('\.',$ip,4);
> >$dns_name = gethostbyaddr(pack('C4',@octets),2);
> >
> >($oct1,$oct2,$oct3,$oct4) =
> >unpack('C4',gethostbyname("my.server.com"));
> >$ip = "$oct1.$oct2.$oct3.$oct4"
>
> These particular transformations (and some more) are also available as
> ready-to-use functions inet_aton and inet_ntoa, which are in the Socket
> modules. Usually a tried and tested solution is preferable over
> an ad-hoc one.
>
I was simply presenting an example demonstrating a possible use for
"pack()," as the original poster requested.
But...
To quote from Programming Perl, 2nd Edition, Wall, Christiansen,
Schwartz, page 171:
gethostbyname NAME
This function does the same thing as gethostbyname(3): it translates a
network host name its corresponding addresses (and other names). The
return value in list context is:
($name,$aliases,$addrtype,$length,@addrs)
where @addrs is a list of raw addresses. In the Internet domain, each
address is four bytes long, and can be unpacked by saying something
like:
($a,$b,$c,$d) = unpack('C4',$addrs[0]);
In scalar context, gethostbyname returns only the host address. See
the section on "Sockets" in chapter 6 for another approach.
(end quote)
I presume that you've heard of that book, or at least of the authors.
I suggest that the methods I posted earlier are no different than the
method I quoted today, and that I DID present a "tried and tested"
solution.
--
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747
Quae narravi, nullo modo negabo. - Catullus
------------------------------
Date: 11 Aug 2000 16:26:23 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: What is "pack()" used for?
Message-Id: <8n19ff$93b$1@lublin.zrz.tu-berlin.de>
Russ Jones <russ_jones@rac.ray.com> wrote in comp.lang.perl.misc:
>Anno Siegel wrote:
>>
>> >
>> >$ip = "127.0.0.1";
>> >@octets = split('\.',$ip,4);
>> >$dns_name = gethostbyaddr(pack('C4',@octets),2);
>> >
>> >($oct1,$oct2,$oct3,$oct4) =
>> >unpack('C4',gethostbyname("my.server.com"));
>> >$ip = "$oct1.$oct2.$oct3.$oct4"
>>
>> These particular transformations (and some more) are also available as
>> ready-to-use functions inet_aton and inet_ntoa, which are in the Socket
>> modules. Usually a tried and tested solution is preferable over
>> an ad-hoc one.
>>
>
>I was simply presenting an example demonstrating a possible use for
>"pack()," as the original poster requested.
Yes, and it is a reasonable example, showing how Perl programmers
may come across situations where they have to unravel a raw data
structure. I just wanted to point out that, in this particular
case, someone has done the dirty work already.
>But...
>
>To quote from Programming Perl, 2nd Edition, Wall, Christiansen,
>Schwartz, page 171:
[snip part of quote]
>where @addrs is a list of raw addresses. In the Internet domain, each
>address is four bytes long, and can be unpacked by saying something
>like:
>
> ($a,$b,$c,$d) = unpack('C4',$addrs[0]);
>
>In scalar context, gethostbyname returns only the host address. See
>the section on "Sockets" in chapter 6 for another approach.
>
>(end quote)
>
>I presume that you've heard of that book, or at least of the authors.
Of course I have.
>I suggest that the methods I posted earlier are no different than the
>method I quoted today, and that I DID present a "tried and tested"
>solution.
Note the cautionary "something like" in the quotation above. I am
not at all sure how internet addresses are represented in different
architectures, but there just might be a difference in big-endian
and little-endian machines, causing portability problems that
are solved in inet_ntoa().
Anno
------------------------------
Date: Fri, 11 Aug 2000 09:55:46 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: What is "pack()" used for?
Message-Id: <MPG.13fdcff1cecf507798ac67@nntp.hpl.hp.com>
In article <u91yzwvx6g.fsf@wcl-l.bham.ac.uk> on 11 Aug 2000 12:45:11
+0100, nobull@mail.com <nobull@mail.com> says...
> Javier Hijas <jhijas@yahoo.es> writes:
>
> > Ok, I know what it does, but I wonder when may I need it.
>
> Binary files, networks, syscalls or libraries without an XS interface.
Also, the most efficient forms of the Guttman-Rosler Transform.
http://www.hpl.hp.com/personal/Larry_Rosler/sort/
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 11 Aug 2000 10:43:32 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: What is "pack()" used for?
Message-Id: <MPG.13fddb2162255efa98ac6b@nntp.hpl.hp.com>
In article <8n19ff$93b$1@lublin.zrz.tu-berlin.de> on 11 Aug 2000
16:26:23 -0000, Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> says...
...
> Note the cautionary "something like" in the quotation above. I am
> not at all sure how internet addresses are represented in different
> architectures, but there just might be a difference in big-endian
> and little-endian machines, causing portability problems that
> are solved in inet_ntoa().
Always 'network' order for the four bytes: high-order byte first (big-
endian). Hence the 'n' in inet_aton() (which is the function you mean);
the pack/unpack format for network order is 'N'.
What inet_aton() deals with that the pack C4 solution doesn't is valid
but pathological IP addresses such as 127.1 -- which pedants point to
here from time to time, but which I have yet to see in practice.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 11 Aug 2000 11:13:34 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Where can I find Basic Perl Definitions?
Message-Id: <3994181E.9F76A2B1@attglobal.net>
"Marr, Lincoln [HOOF:4713:EXCH]" wrote:
>
> I'm getting reasonable at programming perl/CGI stuff by now but I am
> still fairly new to Perl. I am enjoying the perl community and their
> willingness to help each other, but I haven't yet managed to find a
> website or any other documentation which defines clearly how to use the
> perldoc command,
From a unix system:
$ perldoc perldoc
> or which defines basic programming things such as
> classes, packages, modules etc and what ActivePerl is etc.
All of this is in the perldoc (cept the dreaded activestate stuff...
thats on their website.
> I don't expect everyone here to tell me about these things I was
> wondering whether you could tell us newbies where to find some
> documentation like this, I'm sure a lot of people would find it
> useful...
www.perl.com or perldoc
don't you remember what your first few weeks of programming
> Perl were like?? (well for me I've been thrown in the deep end ... my
> boss says to learn perl and make a huge database driven website within 3
> months...)
There is a fine book on programming the Perl DBI, pick it up.
------------------------------
Date: 11 Aug 2000 17:19:12 +0100
From: andkaha@hello.to.REMOVE (Andreas Kahari)
Subject: Re: Where can I find Basic Perl Definitions?
Message-Id: <39941970@merganser.its.uu.se>
In article <39941458.364CCEA8@europem01.nt.com>,
Marr, Lincoln [HOOF:4713:EXCH] <lincolnmarr@europem01.nt.com> wrote:
>I'm getting reasonable at programming perl/CGI stuff by now but I am
>still fairly new to Perl. I am enjoying the perl community and their
>willingness to help each other, but I haven't yet managed to find a
>website or any other documentation which defines clearly how to use the
>perldoc command, or which defines basic programming things such as
>classes, packages, modules etc and what ActivePerl is etc.
>
>I don't expect everyone here to tell me about these things I was
>wondering whether you could tell us newbies where to find some
>documentation like this, I'm sure a lot of people would find it
>useful... don't you remember what your first few weeks of programming
>Perl were like?? (well for me I've been thrown in the deep end ... my
>boss says to learn perl and make a huge database driven website within 3
>months...)
>
>Thanks, Lincoln.
>
Your [paper-]documentation ought to tell you how to use 'perldoc' to
view the rest of the documentation.
If everything else fails (including hints from other persons in this
post thread), the Perl web site (at <URL:http://www.perl.com/>) holds
all documentation and FAQs.
/A
--
# Andreas Kähäri, <URL:http://hello.to/andkaha/>.
# ...brought to you from Uppsala, Sweden.
# All junk e-mail is reported to the appropriate authorities.
# Criticism, cynicism and irony available free of charge.
------------------------------
Date: Fri, 11 Aug 2000 17:55:20 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: Where can I find Basic Perl Definitions?
Message-Id: <1ef7o7t.mfhgd4w5ys8N%tony@svanstrom.com>
Marr, Lincoln [HOOF:4713:EXCH] <lincolnmarr@europem01.nt.com> wrote:
> I'm getting reasonable at programming perl/CGI stuff by now but I am
> still fairly new to Perl. I am enjoying the perl community and their
> willingness to help each other,
*LMAO* Willingness to help newbies... This is your first visit into
c.l.p.misc, right? ;-)
> but I haven't yet managed to find a website or any other documentation
> which defines clearly how to use the perldoc command, or which defines
> basic programming things such as classes, packages, modules etc and what
> ActivePerl is etc.
Have you tried the stuff that comes with perl...?
> I don't expect everyone here to tell me about these things I was wondering
> whether you could tell us newbies where to find some documentation like
> this, I'm sure a lot of people would find it useful... don't you remember
> what your first few weeks of programming Perl were like?? (well for me
> I've been thrown in the deep end ... my boss says to learn perl and make a
> huge database driven website within 3 months...)
Don't worry, even if you fail at learning Perl you're still better at
your job than he is at his... When you look at cost vs what you get
there's no doubt about it that you should bring in someone that knows
what he's doing.
/Tony
--
/\___/\ Who would you like to read your messages today? /\___/\
\_@ @_/ Protect your privacy: <http://www.pgpi.com/> \_@ @_/
--oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
DSS: 0x9363F1DB, Fp: 6EA2 618F 6D21 91D3 2D82 78A6 647F F247 9363 F1DB
---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
\O/ \O/ ©1999 <http://www.svanstrom.com/?ref=news> \O/ \O/
------------------------------
Date: Fri, 11 Aug 2000 19:36:10 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: Where can I find Basic Perl Definitions?
Message-Id: <1od8psg4hg3ba0uda2p291a22p8k0o4n8f@4ax.com>
On Fri, 11 Aug 2000 11:13:34 -0400, Drew Simonis <care227@attglobal.net>
wrote:
> "Marr, Lincoln [HOOF:4713:EXCH]" wrote:
> >
> > I'm getting reasonable at programming perl/CGI stuff by now but I am
> > still fairly new to Perl. I am enjoying the perl community and their
> > willingness to help each other, but I haven't yet managed to find a
> > website or any other documentation which defines clearly how to use the
> > perldoc command,
>
> From a unix system:
>
> $ perldoc perldoc
It will work from a command prompt on Win32 (although you might want to
find a Win32 implementation of 'less')
>
> > or which defines basic programming things such as
> > classes, packages, modules etc and what ActivePerl is etc.
>
> All of this is in the perldoc (cept the dreaded activestate stuff...
> thats on their website.
I think you mean: perltoc
If you have AP installed on a Win32 box, all the documentation is also
available in HTML format (Start->Programs->ActivePerl->Documentation).
--
Good luck,
Abe
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 3989
**************************************