[24814] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 6967 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 6 21:06:17 2004

Date: Mon, 6 Sep 2004 18:05:06 -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           Mon, 6 Sep 2004     Volume: 10 Number: 6967

Today's topics:
        ActivePerl Can't locate auto/Compress/Zlib/autosplit.ix (Horst Walter)
        ANNOUNCE: Zoidberg 0.90 && Term::ReadLine::Zoid 0.05 <j.g.karssenberg@student.utwente.nl>
        Asynchronous readline? (Philip Mak)
    Re: Asynchronous readline? <troc@pobox.com>
    Re: Burned using the .. operator (J. Romano)
        Delete nonprinting chars <BLOCKSPAMfishfry@your-mailbox.com>
    Re: Delete nonprinting chars <jurgenex@hotmail.com>
    Re: Desparate, tired programmer -- bug in perl5.6.1/apa <rls@tamu.edu>
    Re: Desparate, tired programmer -- bug in perl5.6.1/apa <noreply@gunnar.cc>
    Re: Desparate, tired programmer -- bug in perl5.6.1/apa <rls@tamu.edu>
    Re: Easiest way to do FTP without the module? <ceo@nospam.on.net>
    Re: Formmail.pl - Sendmail vs. Smtp <ceo@nospam.on.net>
    Re: net::ftp errors <tadmc@augustmail.com>
    Re: net::ftp errors <noreply@nowhere.com>
    Re: net::ftp errors <mritty@gmail.com>
    Re: Object Oriented Perl : Query <notvalid@email.com>
    Re: Object Oriented Perl : Query (Anno Siegel)
    Re: Object Oriented Perl : Query (Randal L. Schwartz)
    Re: redirect incoming data to port 21 with perl <Joe.Smith@inwap.com>
    Re: Sipering with javascript. <olczyk2002@yahoo.com>
    Re: Temporarily redirecting STDOUT <usenet@morrow.me.uk>
    Re: two's compliment? <Joe.Smith@inwap.com>
    Re: Xah Lee's Unixism <firstname@lastname.pr1v.n0>
    Re: Xah Lee's Unixism (Brian {Hamilton Kelly})
    Re: Xah Lee's Unixism <john.thingstad@chello.no>
    Re: Xah Lee's Unixism <flavell@ph.gla.ac.uk>
    Re: Xah Lee's Unixism <barbr-en_delete_@online.no.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 6 Sep 2004 12:37:27 -0700
From: unkwb@web.de (Horst Walter)
Subject: ActivePerl Can't locate auto/Compress/Zlib/autosplit.ix
Message-Id: <53867fbe.0409061137.692eda4a@posting.google.com>

I am using Active Perl 5.61. on Solaris 8 (2/02 s28s_u7wos_08a SPARC).
Sometimes I get the error auto/Compress/Zlib/autosplit.ix

I had some trouble in installing the ActivePerl, because the tar gave
me a checksum error. However, I got it working except for the above
error.

Any hint which module I have to reinstall, so this might gets fixed. I
tried to install Compress-Zlib again with ppm =>
Error: no suitable installation target found for package
Compress-Zlib.

Any hints?
Thanks a lot


------------------------------

Date: Mon, 6 Sep 2004 18:03:42 GMT
From: Jaap Karssenberg <j.g.karssenberg@student.utwente.nl>
Subject: ANNOUNCE: Zoidberg 0.90 && Term::ReadLine::Zoid 0.05
Message-Id: <I3Mzsz.1L8x@zorch.sf-bay.org>

Today I released onto the CPAN
* Zoidberg 0.90
* Term::ReadLine::Zoid 0.05

Zoidberg (a.k.a. zoid) is a modular Perl shell written, configured, and
operated entirely in Perl. It aspires to be a fully operational login
shell with all the features one normally expects. But it also gives
direct access to Perl objects and data structures from the command line,
and allows you to run Perl code within the scope of your command line.

This release can be considered the first release candidate towards a
stable version. There are many changes in the internal api's and data
structures; these are supposed to remain stable for now. Feature
improvements include complete support for redirection, sub-shells,
command substitution and our own GetOpt library.

For more information see http://zoidberg.sf.net

-- 
   )   (     Jaap Karssenberg || Pardus [Larus]                | |0| |
   :   :     http://pardus-larus.student.utwente.nl/~pardus    | | |0|
 )  \ /  (                                                     |0|0|0|
 ",.*'*.,"   Proud owner of "Perl6 Essentials" 1st edition :)  wannabe




------------------------------

Date: 6 Sep 2004 08:27:23 -0700
From: pmak@aaanime.net (Philip Mak)
Subject: Asynchronous readline?
Message-Id: <61b3152a.0409060727.38760afc@posting.google.com>

I am developing a console application that accepts typed commands from
the user. At the same time, it must display incoming data about events
that occur. Events can occur at any time, not just as a result of a
command the user typed, so I need asynchronous input/output. (Think
like in a MUD client, for example.)

Is there an existing Perl module I can use that will handle input and
output for me, making it so that the input line doesn't get mixed with
the output if new output comes while the user is typing, allowing
up-arrow to be pressed to recall previous commands (like with
"readline", except that readline doesn't work asynchronously AFAIK)?
This seems like a problem that should already be solved, so I'd rather
not re-invent the wheel...


------------------------------

Date: Mon, 06 Sep 2004 21:02:10 GMT
From: Rocco Caputo <troc@pobox.com>
Subject: Re: Asynchronous readline?
Message-Id: <slrncjpk4p.hdf.troc@eyrie.homenet>

On 6 Sep 2004 08:27:23 -0700, Philip Mak wrote:
> I am developing a console application that accepts typed commands from
> the user. At the same time, it must display incoming data about events
> that occur. Events can occur at any time, not just as a result of a
> command the user typed, so I need asynchronous input/output. (Think
> like in a MUD client, for example.)
>
> Is there an existing Perl module I can use that will handle input and
> output for me, making it so that the input line doesn't get mixed with
> the output if new output comes while the user is typing, allowing
> up-arrow to be pressed to recall previous commands (like with
> "readline", except that readline doesn't work asynchronously AFAIK)?
> This seems like a problem that should already be solved, so I'd rather
> not re-invent the wheel...

POE::Wheel::ReadLine does this, although the current version on the CPAN
isn't nearly as good as the one in development.  The next release
(already in CVS) will be a lot more compatible with gnu readline.

Term::Visual is another way to write clients.  It's full-screen like
tinyfugue's visual mode.  I already wrote a simple chat client with it,
at http://poe.perl.org/poedown/oscon2004/chat-client.perl .  The code is
released under the same terms as Perl itself.  You're free to use it as
the basis for your application.

A disclaimer is in order:  POE is an event driven system (it implements
the "Reactor" pattern).  Any existing code you have may need to be
restructured to be compatible with the modules I've mentioned.

Several other examples are in the same directory as chat-client.perl,
including the chat server to go along with it.

-- 
Rocco Caputo - http://poe.perl.org/


------------------------------

Date: 6 Sep 2004 08:12:43 -0700
From: jl_post@hotmail.com (J. Romano)
Subject: Re: Burned using the .. operator
Message-Id: <b893f5d4.0409060712.3a59f225@posting.google.com>

> J. Romano wrote:
> 
> >>	print "True" if /BEGIN/ .. /END/;
> >>	print "True" if /BEGIN/;
> > 
> >    That's part of my point.  They certainly look different, but they
> > behave the same WHEN TYPED INTO THE DEBUGGER.

Joe Smith <Joe.Smith@inwap.com> wrote in message news:<pcS_c.113621$9d6.76631@attbi_s54>...
>
> You mean, they act differently when one of them is a string eval().
[instead of part of a compiled statement]

   Sure, that sounds about right.  It never really crossed my mind
that the debugger was doing a string eval(), but if that's what it's
doing, that would explain that particular behavior.

   Thanks for pointing that out, Joe.

   -- Jean-Luc


------------------------------

Date: Mon, 06 Sep 2004 21:04:36 GMT
From: fishfry <BLOCKSPAMfishfry@your-mailbox.com>
Subject: Delete nonprinting chars
Message-Id: <BLOCKSPAMfishfry-CFD87C.14043606092004@netnews.comcast.net>

I know this is in the book but I can't find it at the moment ...

what's the clever way to remove all nonprinting characters from a string?


------------------------------

Date: Mon, 06 Sep 2004 22:32:40 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Delete nonprinting chars
Message-Id: <cA5%c.3440$Va5.253@trnddc01>

fishfry wrote:
> I know this is in the book but I can't find it at the moment ...
>
> what's the clever way to remove all nonprinting characters from a
> string?

From "perldoc perlre":

    The POSIX character class syntax

        [:class:]

    is also available. The available classes and their backslash equivalents
    (if available) are as follows:
[...]
        print
[...]

jue 




------------------------------

Date: Mon, 06 Sep 2004 10:55:51 -0500
From: Ryan Saunders <rls@tamu.edu>
Subject: Re: Desparate, tired programmer -- bug in perl5.6.1/apache1.3.31 ?
Message-Id: <chi1a8$cud$1@news.tamu.edu>

Joe Smith wrote:
> Ryan Saunders wrote:
>  >bug in perl5.6.1/apache1.3.31 ?
> 
> No, it's not a bug.  It's related to the reason why a process running
> as userid "nobody" is not allowed to write to locations like /home/rls.
>     -Joe

I was kind of "out of it" when I wrote that and forgot to mention -- the 
script also runs correctly when called as a perl CGI script from Apache. 
It only fails when called indirectly through PHP. So it seems to me that 
this is not permissions related, since both Perl and PHP should be 
running with identical permissions, as 'nobody', under Apache.

My fix was to rewrite the bloody thing in PHP and just call it as a PHP 
function from my page. So it's no longer an emergency.

Just the same, it would be nice to know what it was that happened, so I 
can avoid this in the future. Anyone have any insight?

Ryan


------------------------------

Date: Mon, 06 Sep 2004 18:19:59 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Desparate, tired programmer -- bug in perl5.6.1/apache1.3.31 ?
Message-Id: <2q3h0kFqcct8U1@uni-berlin.de>

Ryan Saunders wrote:
> I was kind of "out of it" when I wrote that and forgot to mention
> -- the script also runs correctly when called as a perl CGI script
> from Apache. It only fails when called indirectly through PHP. So
> it seems to me that this is not permissions related, since both
> Perl and PHP should be running with identical permissions, as
> 'nobody', under Apache.

<snip>

> Just the same, it would be nice to know what it was that happened,
> so I can avoid this in the future. Anyone have any insight?

Can it be that PHP is configured to run in "Safe Mode"?

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Mon, 06 Sep 2004 15:34:08 -0500
From: Ryan Saunders <rls@tamu.edu>
Subject: Re: Desparate, tired programmer -- bug in perl5.6.1/apache1.3.31 ?
Message-Id: <chihk0$olk$1@news.tamu.edu>

Gunnar Hjalmarsson wrote:
 > Can it be that PHP is configured to run in "Safe Mode"?
 >

Perhaps...but PHP is able to write the file just fine...why/how would 
"safe mode" cause a program invoked via system() to otherwise run 
correctly but be unable to open a file for writing? That seems like more 
sophistication than system() should be able to pull off...

Ryan


------------------------------

Date: Mon, 06 Sep 2004 17:46:12 GMT
From: ChrisO <ceo@nospam.on.net>
Subject: Re: Easiest way to do FTP without the module?
Message-Id: <En1%c.14558$Y94.14051@newssvr33.news.prodigy.com>

John Doe wrote:

> I am actually doing sftp (secure FTP) and have given up trying to
> build the sftp perl module on AIX; it is a lost cause.  Net-FTP would
> be a breeze, but no unencrypted connection is allowed.  :-(
> 
> I can open an sftp session manually, so that is working.  I am
> wondering what would be the easiest way to run it from perl. 
> (Expect.pm? <--have never used.  R. Schwartz has said that Expect.pm
> is often doing it the hard way.) Does anyone know another CPAN module
> that could apply?
> 
> I want to be able to list files in the sftp session, store that list
> o' files in an array for processing, fetch and remove some of the
> files, etc.
> 
> Any suggestions?
> 
> Off topic, but related:  Does anyone know where to find more info on
> using the "-b batchfile" option of sftp mentioned on the sftp man
> page?

I once had to write a large Perl script running on Windows NT 4.0 that 
did A LOT of FTP'ing using a Perl that didn't have Net::FTP available. 
I ended up writing my own FTP module (called NTFTP.pm) that duplicated 
most of the methods in Net::FTP, providing a consistent interface.

The underpinnings were highly inefficient, but it worked (using "manual 
FTP command line"; I hoped the inefficiencies would highlight my demand 
to the company at the time that we get on a more recent and better 
version of ASPN.)  You are welcome to a copy if you think it would 
provide you with any ideas for something similar (eg. SFTP.pm).  Reply 
here with a spam-proof, obsfucated email address and I can send it to you.

-ceo


------------------------------

Date: Mon, 06 Sep 2004 17:12:32 GMT
From: ChrisO <ceo@nospam.on.net>
Subject: Re: Formmail.pl - Sendmail vs. Smtp
Message-Id: <4U0%c.14542$Y94.1575@newssvr33.news.prodigy.com>

chris-usenet@roaima.co.uk wrote:
> Chris <ceo@nospan.on.net> wrote:
> 
>>If these are really your friends, and you are really trying to help 
>>them, then DON'T use formmail.pl to process their mail.  Just DON'T. 
>>Especially if it's Matt Wright's formmail.pl.
> 
> 
>>Write a real (secure) script that uses Net::SMTP or the many other variants.
> 
> 
> If they don't know (or understand) what's wrong with formmail.pl then
> the chances are that if they roll their own, they'll repeat all the
> mistakes anyway. Use the nms scripts at sourceforge instead.
> 

A very good point.

-ceo


------------------------------

Date: Mon, 6 Sep 2004 11:32:22 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: net::ftp errors
Message-Id: <slrncjp48m.hc.tadmc@magna.augustmail.com>

Shailesh Humbad <noreply@nowhere.com> wrote:


> But I can say one thing, using perldoc from a command-line is like 
> driving down the highway on a tricycle.


Right.

Notice that I didn't say anything about _how_ to access the docs,
just where the best ones are.

The best way to access the docs IMO, is using "grep" and "vi"
on the *.pod files themselves.

Saying "perldoc blah" is just a shorthand for saying
"lookup 'blah' in the std docs".


> but I can't think of a slower or more antiquated way to 
> lookup documentation on an PC with a GUI.


I'd find what I was looking for more slowly if there was a GUI
in my way, but maybe that's just me.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Mon, 06 Sep 2004 22:35:29 GMT
From: Shailesh Humbad <noreply@nowhere.com>
Subject: Re: net::ftp errors
Message-Id: <RC5%c.80412$cT6.52873@fe2.columbus.rr.com>

Joe Smith wrote:
> Shailesh Humbad wrote:
> 
>> I wish there was a neat, indexed, free Windows help file for Perl 
>> documentation.
> 
> 
> Why don't you use the one that gets installed on your PC?
> 
> Start -> Programs -> ActiveState ActivePerl 5.8 -> Documentation
>     -Joe

I didn't notice that before.  Well, it is in HTML format, not Windows 
help format.  The main thing I like about .chm is the index on the 
left that refreshes to show matches as I type, making it really easy 
to find topics.  I also routinely use the search.  Scrolling is a 
really inefficient way to find things compared to typing.


------------------------------

Date: Mon, 06 Sep 2004 21:04:11 -0400
From: Paul Lalli <mritty@gmail.com>
Subject: Re: net::ftp errors
Message-Id: <chj1eg$cas$1@misc-cct.server.rpi.edu>

Shailesh Humbad wrote:
> Joe Smith wrote:
>> Shailesh Humbad wrote:
>>
>>> I wish there was a neat, indexed, free Windows help file for Perl 
>>> documentation.
>>
>> Why don't you use the one that gets installed on your PC?
>> Start -> Programs -> ActiveState ActivePerl 5.8 -> Documentation
> 
> I didn't notice that before.  Well, it is in HTML format, not Windows 
> help format.  The main thing I like about .chm is the index on the left 
> that refreshes to show matches as I type, making it really easy to find 
> topics.  I also routinely use the search.  Scrolling is a really 
> inefficient way to find things compared to typing.

I've never used it before, but perhaps you might find 
http://search.cpan.org/~autrijus/Pod-HtmlHelp-1.1/bin/pod2chm helpful?

Paul Lalli


------------------------------

Date: Mon, 06 Sep 2004 15:40:14 GMT
From: Ala Qumsieh <notvalid@email.com>
Subject: Re: Object Oriented Perl : Query
Message-Id: <yx%_c.12321$QJ3.6521@newssvr21.news.prodigy.com>

Thens wrote:

> This is my attempt  at a Perl code  that does this.  Is this the right
> way to do this. Any pointers will be of help.

There is a subtle mistake in your code. Have a look at the following 
pods for more info on Perl's OO mechanisms:

	perlboot
	perltoot
	perlobj

Also, if you're serious about using Perl's OO, then reading Damian 
Conway's "Object Oriented Perl" is a must.

> #! /usr/local/bin/perl -w
> 
> package Weapon;
> 
> use strict;
> 
> sub new {
>   my ( $self ) = @_;
>   my $class = ref($self) || $self;
>   return  bless {  }, $class;
> }
> 
> sub hitPoints {
>   my ( $self ) = @_;
>   return $self->{hitpoints};
> }
> 
> sub fire { 
>   my ( $self, $target ) = @_;
>   print "Destroyed the target !! ", $self->hitPoints;
>   #$target->hurt($self->hitPoints);
> }
> 
> package Gun;
> use strict;
> use base 'Weapon';
> 
> sub new {
>   my ( $self ) = @_;
>   my $class = ref($self) || $self;
>   $self = new Weapon();

Here, $self is an instance of the Weapon class. It is NOT a Gun object. 
If you add the following:

	print ref $self;

You will get Weapon, not Gun. Depending on your application, that could 
not be a problem, but you're not getting true inheritance here. As long 
as your Gun package does not have any distinct methods of its own (or 
override any methods in Weapon, other than new()), then you are fine. 
But if you require true inheritance, then you need to make $self an 
instance of Gun. You do that by using SUPER:: like this:

	$self = $class->SUPER::new;

This will look for the first new() method defined in the base class(es) 
of Gun and will invoke it with $class as the parameter. So, it will call 
the new() method in Weapon, which will return a hash ref blessed into 
the Gun class.

>   $self->{type} = 'GUN';
>   $self->{hitpoints} = 10;
>   
>   return $self;
> }

Ditto for RocketLauncher.

--Ala



------------------------------

Date: 6 Sep 2004 19:05:14 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Object Oriented Perl : Query
Message-Id: <chicda$es7$1@mamenchi.zrz.TU-Berlin.DE>

Ala Qumsieh  <notvalid@email.com> wrote in comp.lang.perl.misc:
> Thens wrote:
> 
> > This is my attempt  at a Perl code  that does this.  Is this the right
> > way to do this. Any pointers will be of help.
> 
> There is a subtle mistake in your code. Have a look at the following 

[snippage]

> > sub new {
> >   my ( $self ) = @_;
> >   my $class = ref($self) || $self;
> >   $self = new Weapon();
> 
> Here, $self is an instance of the Weapon class. It is NOT a Gun object. 

Ah, I hadn't noticed when I certified this code as "free of gross errors"
in another followup.  This is a gross error in classes that do inheritance.

Anno


------------------------------

Date: 06 Sep 2004 15:05:20 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Object Oriented Perl : Query
Message-Id: <86sm9vxdcv.fsf@blue.stonehenge.com>

*** post for FREE via your newsreader at post.newsfeed.com ***

>>>>> "Thens" == Thens  <thens@NOSPAMti.com> writes:

Thens> sub new {
Thens>   my ( $self ) = @_;
Thens>   my $class = ref($self) || $self;
Thens>   return  bless {  }, $class;
Thens> }

Please see <http://www.stonehenge.com/merlyn/UnixReview/col52.html>
about why that ref($self) thing is bad.

-- 
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!


 -----= Posted via Newsfeed.Com, Uncensored Usenet News =-----
http://www.newsfeed.com - The #1 Newsgroup Service in the World!
-----== 100,000 Groups! - 19 Servers! - Unlimited Download! =-----
                  


------------------------------

Date: Mon, 06 Sep 2004 23:35:43 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: redirect incoming data to port 21 with perl
Message-Id: <jv6%c.122124$9d6.41605@attbi_s54>

saeed wrote:

> Is there a sample .perl to redirect data to another computer or another port ?

Such as acting as a proxy?  I have an old program for that. 
http://www.inwap.com/mybin/miscunix/list-files.pl?tcp-proxy
	-Joe


------------------------------

Date: Mon, 06 Sep 2004 14:05:31 -0500
From: TLOlczyk <olczyk2002@yahoo.com>
Subject: Re: Sipering with javascript.
Message-Id: <s6dpj09av1mpv5pqk7q94lvklf8vkffvq3@4ax.com>

On Mon, 06 Sep 2004 01:42:23 GMT, "John W. Kennedy"
<jwkenne@attglobal.net> wrote:

>I suspect that solving the problem may, in the end, not be worth the effort.
Thanks. I suspect won't be worth the effort the first time, but the
second third fourth...


The reply-to email address is olczyk2002@yahoo.com.
This is an address I ignore.
To reply via email, remove 2002 and change yahoo to
interaccess,

**
Thaddeus L. Olczyk, PhD

There is a difference between
*thinking* you know something,
and *knowing* you know something.


------------------------------

Date: Mon, 6 Sep 2004 19:43:22 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Temporarily redirecting STDOUT
Message-Id: <annu02-rr4.ln1@osiris.mauzo.dyndns.org>


Quoth Fil <fil@nospam.thanks>:
> Hi,
> 
> I'm writing some Perl (5.8.2) routines on Windows 2000. One of these
> routines calls RCS functions like this:
> 
> $command = "rcs -x${rcssfx} -l $rcsname";
> $rc = system($command);
> 
> I'm logging and printing my own error diagnostics, so I'm a little annoyed
> that RCS prints to screen what it's doing. I'd like to redirect STDOUT
> just for this command.
> 
> I understand that I can use open2 or open3 and collect separately the
> STDOUT, STDERR and the return code and solve the problem. I'm really
> interested here in learning to redirect STDOUT and of course recover it
> afterwards. On Unix I'd redirect it to /dev/null... is there anything like
> it for Perl on Windows?

cmd under Win2k has Bourne-ish redirections, so you can use

my $command = "rcs -x$rcssfx -l $rcsname > nul";  # [1]

or (for portability Win2k/Unix)

use File::Spec::Functions qw/devnull/;

my $command = "... > " . devnull;

Ben

[1] No, you really can't create a file called 'nul' under windows... (!!)

-- 
'Deserve [death]? I daresay he did. Many live that deserve death. And some die
that deserve life. Can you give it to them? Then do not be too eager to deal
out death in judgement. For even the very wise cannot see all ends.'
                                                               ben@morrow.me.uk


------------------------------

Date: Mon, 06 Sep 2004 23:27:01 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: two's compliment?
Message-Id: <9n6%c.137119$Fg5.78967@attbi_s53>

187 wrote:

  Thank you for your reply. I udnerstand how it became overloaded, but
> then why does this happen?
> 
>      print ~-31, "\n", ~30
> 
> Output:
> 
>      30
>      4294967265
> 
> Why does the 2nd statement not return -31? Is it Perl not wanting to
> return a signed number? This seems rather incorrect, mathimatically.

In the first one, a signed 32-bit integer is treated as an unsigned
32-bit number, complemented, and displayed as an unsigned 32-bit number.
In the second one, a positive signed 32-bit integer is already in
the unsigned form, complemented, and displayed as an unsigned 32-bit
number.  Both are consistent in converting the input argument to
a set of 32 bits and returning a set of 32 bits.
	-Joe


------------------------------

Date: Mon, 6 Sep 2004 18:56:33 +0200
From: Morten Reistad <firstname@lastname.pr1v.n0>
Subject: Re: Xah Lee's Unixism
Message-Id: <1s4ihc.4i4.ln@via.reistad.priv.no>

In article <413c5b9c$0$19705$61fed72c@news.rcn.com>,
 <jmfbahciv@aol.com> wrote:
>In article <rv1hhc.mtv2.ln@via.reistad.priv.no>,
>   Morten Reistad <firstname@lastname.pr1v.n0> wrote:
>>In article <413af268$0$19706$61fed72c@news.rcn.com>,
>> <jmfbahciv@aol.com> wrote:
>>>In article <20040904.2231.57679snz@dsl.co.uk>,
>>>   bhk@dsl.co.uk (Brian {Hamilton Kelly}) wrote:
>>>>On Thursday, in article
>>>>     <41371e5c$0$19723$61fed72c@news.rcn.com> jmfbahciv@aol.com
>>>>     wrote:

>>VMS was too early, and was made too politically correct.
>>
>>TCP/IP was NOT politically correct until around 1996 or so. 
>>TPTB wanted OSI, GOSIP/Decnet Phase 5 and all that crud, until we
>>Internet people hammered them. 
>>
>>>>Indeed, it took many years before DEC [sorry, by then it was already
>>>>d|i|g|i|t|a|l] had a TCP/IP stack available for VMS --- the dreaded heap
>>>>of quivering jelly created by the Eunice idiots.
>>>>
>>>>Before that, people who needed TCP/IP on a Vax used various third-party
>>>>solutions, such as the implementations from Carnegie-Mellon (CMU) 
>>>
>>>Sigh!  If CMU had it, I would have assumed it got hornshoed into
>>>VMS.
>>
>>Wrong mindset. TCP/IP was never a DEC invention, much less a D I G I T A L 
>>one. 
>
>It didn't have to be a DEC invention.  If it was CMU, we got it
>shoved down our throats and up our asses.  However, I see
>that the dates explain why TCP/IP didn't get into VMS.  
>Apparently the protocol got good after Gordon Bell left DEC.

1995 was the year everyone and Bill Gates discovered the Internet
existed; and wanted in on the deal. Suddenly everyone needed Internet
solutions. 

>Since TCP/IP was in the 90s, I couldn't have heard about it
>over the wall (I think I stopped working in 1987).  I could
>swear that cybercurd meant something.
>
>ISTR, the -20 types yakking about it.

TCP/IP was launched in 1982, and the Internet (or the Arpanet, rather)
converted Jan 1st 1983; with final NCP service turned off everywhere
by mid march 1983. 

Tops20 has an IP package; but it was pretty rudimentary in version 4, 
and not quite complete even by those standards even in version 7.

 .. mrr




------------------------------

Date: Mon, 06 Sep 2004 18:58:29 +0100 (BST)
From: bhk@dsl.co.uk (Brian {Hamilton Kelly})
Subject: Re: Xah Lee's Unixism
Message-Id: <20040906.1758.57695snz@dsl.co.uk>

On Sunday, in article
     <413af268$0$19706$61fed72c@news.rcn.com> jmfbahciv@aol.com
     wrote:

> In article <20040904.2231.57679snz@dsl.co.uk>,
>    bhk@dsl.co.uk (Brian {Hamilton Kelly}) wrote:
> >
> >VMS (originally) most decidedly did NOT have either TCP/IP or NFS.
> 
> I thought VMS did get TCP/IP into it.  I don't know anything about
> NFS.
> 
> >Indeed, it took many years before DEC [sorry, by then it was already
> >d|i|g|i|t|a|l] had a TCP/IP stack available for VMS --- the dreaded heap
> >of quivering jelly created by the Eunice idiots.
> >
> >Before that, people who needed TCP/IP on a Vax used various third-party
> >solutions, such as the implementations from Carnegie-Mellon (CMU) 
> 
> Sigh!  If CMU had it, I would have assumed it got hornshoed into
> VMS.

CMU's implementation did not get added to VMS.  It was, however, widely
used, because (IIRC) academic sites could get it at a very low cost.

Digital themselves didn't have any TCP/IP support until the release of
"TCP/IP Services for Vax/VMS", which was written by the Unix-end of
Digital, and was *really* cruddy.  This didn't happen until the
mid-1990s, anyway.

Hence why most folks, if they could afford it (it was by no means cheap),
bought MultiNet.

-- 
Brian {Hamilton Kelly}                                     bhk@dsl.co.uk
   "I don't use Linux. I prefer to use an OS supported by a large multi-
   national vendor, with a good office suite, excellent network/internet
   software and decent hardware support."


------------------------------

Date: Tue, 07 Sep 2004 00:06:06 +0200
From: "John Thingstad" <john.thingstad@chello.no>
Subject: Re: Xah Lee's Unixism
Message-Id: <opsdxecgt8pqzri1@mjolner.upc.no>

On Mon, 6 Sep 2004 18:56:33 +0200, Morten Reistad  
<firstname@lastname.pr1v.n0> wrote:

> In article <413c5b9c$0$19705$61fed72c@news.rcn.com>,
>  <jmfbahciv@aol.com> wrote:
> TCP/IP was launched in 1982, and the Internet (or the Arpanet, rather)
> converted Jan 1st 1983; with final NCP service turned off everywhere
> by mid march 1983.
>
> Tops20 has an IP package; but it was pretty rudimentary in version 4,
> and not quite complete even by those standards even in version 7.
>
> .. mrr
>
>

Internet was discovered long before this.
(In 1965 a research project, by the Rand cooperation, for a network that
could survive a nuclear attack. Sponsored by DARPA.
These is the real creators of the Internet technology. Not Unix hackers.)
It was the realization of www (CERN) that spawned the movement toward the  
Internet.
So the year in question is about 1987.

-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/


------------------------------

Date: Mon, 6 Sep 2004 23:55:28 +0100
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: Xah Lee's Unixism
Message-Id: <Pine.LNX.4.61.0409062355010.20478@ppepc56.ph.gla.ac.uk>

On Tue, 7 Sep 2004, John Thingstad wrote:

> It was the realization of www (CERN) that spawned the movement toward the
> Internet.

Eh?



------------------------------

Date: Tue, 07 Sep 2004 01:35:23 +0200
From: Kåre Olai Lindbach <barbr-en_delete_@online.no.invalid>
Subject: Re: Xah Lee's Unixism
Message-Id: <cqspj0h044pidk4c6an3egnbaca0h8r1im@4ax.com>

On Mon, 6 Sep 2004 23:55:28 +0100, "Alan J. Flavell"
<flavell@ph.gla.ac.uk> wrote:

>On Tue, 7 Sep 2004, John Thingstad wrote:
>
>> It was the realization of www (CERN) that spawned the movement toward the
>> Internet.
>
>Eh?

http://www.hitmill.com/internet/web_history.asp

Or rather the history of Tim Berners-Lee.

(I even believeI have read it Berners-Lee first tried to implement
this on a norwegian Nord machine - Norsk Data :)

-- 
mvh/Regards Kåre Olai Lindbach
(News: Remove '_delete_' and '.invalid')
(HTML-written email from unknown will be discarded)


------------------------------

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 6967
***************************************


home help back first fref pref prev next nref lref last post