[10403] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3996 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 16 21:07:19 1998

Date: Fri, 16 Oct 98 18:00:16 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 16 Oct 1998     Volume: 8 Number: 3996

Today's topics:
    Re: Are there any "perl.newbie" group or forum? <eashton@bbnplanet.com>
    Re: Are there any "perl.newbie" group or forum? <dhsmith@hpeals7.mayfield.hp.com>
    Re: Chat server? (Please Reply to Newsgroup)
    Re: count files.... <r28629@email.sps.mot.com>
        Help! named will not start... jenmcnitt@yahoo.com
    Re: Implementing 'union's in Perl to C extensions (Tye McQueen)
        make test fails at /lib/odbm, 5.005_02, sco_sv <knutens@masi.com>
        mremap in Linux perl (ClarkKee)
    Re: newbie: getting the wrong month out of localtime() (Alan Barclay)
        Off topic: is he that Larry Wall? <j9feng@hotmail.com>
    Re: Off topic: is he that Larry Wall? (Larry Rosler)
    Re: Off topic: is he that Larry Wall? (Larry Wall)
        Passing Filehandle as parameters to function <julius@clara.net>
        Password stuff <opieweb@hotmail.com>
    Re: Password stuff <eashton@bbnplanet.com>
    Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has regi <eashton@bbnplanet.com>
        Recover ref from string (Thomas Rock)
    Re: Slow Sort? <r28629@email.sps.mot.com>
    Re: The space deletion woes... <r28629@email.sps.mot.com>
    Re: Too stupid <shawn@magma.ca>
    Re: Too stupid <tim.hicks@lineone.net>
        Unzip with Perl <alex@digi-q.com>
    Re: Win32::OLE and Netscape <fbesnier@home.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Fri, 16 Oct 1998 22:08:30 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <3627C15B.C9F1712B@bbnplanet.com>

Adam Turoff wrote:

> Perl has often been pigeonholed into these two areas of strength.
> Unfortunately, as the visibility of perl increases, it becomes more
> important to spin it properly.

Spin is perhaps the wrong word here as spin implies manipulation, maybe
enlighten the masses properly is more a propos. Perl has many uses and
strengths, which, once known, sell themselves. Except to some of the
Cobal dinos. ;)

> Perl is _not_ just for breakfast anymore!

Yes, and the day it makes dinner for me my life will be complete. :)

e.

After all, the cultivated person's first duty is to
always be prepared to rewrite the encyclopedia.  - U. Eco -


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

Date: Fri, 16 Oct 1998 15:51:14 -0700
From: Dave Smith <dhsmith@hpeals7.mayfield.hp.com>
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <3627CDE2.36238637@hpeals7.mayfield.hp.com>

Randal Schwartz wrote:

> >>>>> "Casper" == Casper Kvan Clausen <ckc@dmi.dk> writes:
>
> Casper> A Perl book for non-programmers, which takes its audience seriously.
>
> Casper> This would seem to fit the Llama book. [Disclaimer: I did not
> Casper> learn Perl via the Llama book, so this is based on hearsay].
>
> No.  The Llama is not designed for non-programmers.  I specifically
> presume at least an understanding of basic concepts (variable, array,
> subroutine, algorithms).  Otherwise, the book would have been about
> twice as long (I've written programming for non-programmers before...
> and it gets more wordy :).
>
> Having said that, I've heard of a number of people that have
> successfully used the llama to learn Perl as their first programming
> language.  I can only presume that they were naturally talented or
> perhaps a programmer in a previous lifetime or something.  :-)
>

Or perhaps the author just did an exceptional job of writing this book.  I once noted
something negative about your class after taking it, but I have to give credit where
credit is due.  Your book has been a lifesaver more than a few times.  All of the
O'Reilly Perl books are.

Dave


>
> --
> Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
> Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
> Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
> Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
> Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me



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

Date: Sat, 17 Oct 1998 03:00:06 GMT
From: reply@newsgroup.please (Please Reply to Newsgroup)
Subject: Re: Chat server?
Message-Id: <362a0756.10508312@enews.newsguy.com>

Most cgi chat scripts are really awkward -- due to the screen
refreshes that are required.

There are two cgi chat scripts, however, that use frames in a way that
makes the refreshing almost invisible.

Go to http://www.cgi-resources.com/Programs_and_Scripts/Perl/Chat/
and look at EveryChat and c-Chat.  Everychat is freeware and works
great, but has no administrator functions (like banning trouble
makers' IPs).  E-Chat is a modification of EveryChat (I think) and
adds the administrator functions.  E-Chat sells for $19.95 -- but
that's almost free, and the administrator functions are really
important if you run a public chat room.

Let us know what you do.  Good Luck!

On Sat, 17 Oct 1998 02:03:42 +0800, Shanx <mkshanx@uxmail.ust.hk>
wrote:

>Hi, 
>
>I need a chat server to put on the web site of a client. Okay I scoured
>the web and found several of them in Java, but they are either incomplete
>and you have to pay for the fully functional version or are so shabby and
>useless that you cannot use them on a popular business site. 
>
>I would really appreciate if someone in this newsgroup could recomment me
>some FREE chat server (and if possible something that does not need the
>users of my site to download a client, for instance, something that can
>be embedded in my web page). 
>
>Thanks very much in advance. If possible, please reply to me directly as
>well. 
>
>Best regards,
>Shashank



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

Date: Fri, 16 Oct 1998 17:20:46 -0500
From: Tk Soh <r28629@email.sps.mot.com>
Subject: Re: count files....
Message-Id: <3627C6BE.32ADBBA2@email.sps.mot.com>

Mark-Jason Dominus wrote:

[...]

>   @files - 2;  # Ignore the files . and .. which are always present

True for Unix and DOS (and 'family'), but not for Mac. Poor Apple...,
any other systems?


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

Date: Fri, 16 Oct 1998 23:31:04 GMT
From: jenmcnitt@yahoo.com
Subject: Help! named will not start...
Message-Id: <708kvo$47a$1@nnrp1.dejanews.com>

Last week, named stopped working for a reason that I can not figure out.

I have tried to restart it without any luck.

Everytime I issue named stop/named start I see the following in my messages
file:

Oct 16 18:31:02 spot named[512]: starting.  named 4.9.6-REL Thu Nov  6
23:29:57 EST 1997 ^Iroot@porky.redhat.com:/usr/src/bs/BUILD/bind-4.9.6/named
Oct 16 18:31:18 spot named[512]: There may be a name server already running
Oct 16 18:31:18 spot named[512]: exiting

I have done a ps aux |grep named and nothing appears.  I have deleted the
named.pid file in the /var/run directory and tried to start named after this
and I still get the same error.

Help!

So far no one that I have talked to can figure out what the problem is.  I
need to get this fixed so that my web servers are working again.

Thanks,

Jen McNitt
Haven Online Services
nenmcnitt@yahoo.com

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 16 Oct 1998 19:06:40 -0500
From: tye@fohnix.metronet.com (Tye McQueen)
Subject: Re: Implementing 'union's in Perl to C extensions
Message-Id: <708n2g$6ot@fohnix.metronet.com>

hjeeves@ppsclnt10.pok.ibm.com (Helena Jeeves) writes:
) I am working trying to create a Perl to C extension 
) that involves a union.
[...]
) typedef union {
) 	int	value;
) 	char *	string;
) 	float	value2;
) 	double	value3;
) } my_union;

Associated with such a union must be other data that tells
you which part of the union currently contains valid data.
You must use that to control how the union is read/written.
Include those details and perhaps we can help.
-- 
Tye McQueen    Nothing is obvious unless you are overlooking something
         http://www.metronet.com/~tye/ (scripts, links, nothing fancy)


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

Date: Fri, 16 Oct 1998 15:48:52 -0700
From: "Knute Snortum" <knutens@masi.com>
Subject: make test fails at /lib/odbm, 5.005_02, sco_sv
Message-Id: <708i47$n69$1@supernews.com>

make test is reporting a problem with /lib/odbm.  I'm completely out of my
depth, so any help would apreciated.

***** Begin output of /lib/odbm.t

# ./lib/odbm.t
1..18
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
ok 8
ok 9
Memory fault - core dumped

***** Begin ./myconfig output

Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration:
  Platform:
    osname=sco_sv, osvers=3.2, archname=i386-sco_sv
    uname='sco_sv aon2 3.2 2 i386 '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize=' ', gccversion=
    cppflags='-w0 -U M_XENIX -DPERL_SCO5'
    ccflags ='-w0 -U M_XENIX -DPERL_SCO5'
    stdchar='unsigned char', d_stdstdio=undef, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=undef, longlongsize=, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='ld', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /shlib /lib /usr/lib /usr/ccs/lib
    libs=-lintl -lsocket -lnsl -lndbm -ldbm -lld -lm -lc -lcrypt -lPW -lx
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_none.xs, dlext=none, d_dlsymun=undef, ccdlflags=''
    cccdlflags='', lddlflags=''

***** OS stuff for any SCO experts

# uname -X

System = SCO_SV
Node = aon2
Release = 3.2v5.0.4
KernelID = 97/05/07
Machine = Pentium Pro
BusType = EISA
Serial = 2EH020731
Users = 26-user
OEM# = 0
Origin# = 1
NumCPU = 1

--- Knute Snortum
knutens@masi.com (remove the "ns" from the address when replying by e-mail)
"The three principle virtues of a programmer are: laziness, impatience, and
hubris."




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

Date: 16 Oct 1998 22:50:12 GMT
From: clarkkee@aol.com (ClarkKee)
Subject: mremap in Linux perl
Message-Id: <19981016185012.06393.00002219@ng-fi1.aol.com>

I'm using perl 5.004_01 under Linux 2.0.31. A script periodically stats a file
and uses syswrite to send any new data over a socket created with IO::socket.
It keeps track of position in the file using a DB_File. The script occasionally
dies, and strace reveals that it is getting ENOMEM from an mremap call.

I'm guessing this is happening in the DB_File implementation, but I'd
appreciate advice from anyone familiar with the Linux perl implementation,
since mremap is (according to Linux man) a Linux-specific call.

Clark Kee
ckee@acm.org
ClarkKee@aol.com




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

Date: 17 Oct 1998 00:11:08 GMT
From: gorilla@elaine.drink.com (Alan Barclay)
Subject: Re: newbie: getting the wrong month out of localtime()
Message-Id: <908583065.67432@elaine.drink.com>

In article <36277364.0@news.new-era.net>,  <scott@softbase.com> wrote:
>Tony Curtis (Tony.Curtis+usenet@vcpc.univie.ac.at) wrote:
>> The month field goes from 0 .. 11 (presumably for the
>> historic reason that C subscripts start at 0).
>
>I wonder if this is the reason. The struct tm is not consistent
>if it is -- days of the month is 1..31, not 0..30. Day of the
>week is utterly, hopelessly confused. It goes from 0..7 on

I think it's reasonably consistant:

Those things that are normally expressed only in numbers, go
their natural ranges (0-23 for hours, 1-31 for days)
	
Those things that are often expressed in strings, go from
0 to max (month, weekday)




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

Date: Fri, 16 Oct 1998 17:37:50 +0000
From: feng <j9feng@hotmail.com>
Subject: Off topic: is he that Larry Wall?
Message-Id: <3627846E.DDE5D443@hotmail.com>

I am new to perl. Reading through the postings, I found several of them
were writen by Larry Wall.  Is he the Larry Wall who fathered Perl?
Just curious.

thx.



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

Date: Fri, 16 Oct 1998 15:49:30 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Off topic: is he that Larry Wall?
Message-Id: <MPG.10916d59fb817018989824@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <3627846E.DDE5D443@hotmail.com> on Fri, 16 Oct 1998 17:37:50 
+0000, feng <j9feng@hotmail.com> says...
> I am new to perl. Reading through the postings, I found several of them
> were writen by Larry Wall.  Is he the Larry Wall who fathered Perl?
> Just curious.

There are several Larry persons around here, but only the *one* Larry 
Wall.  He seems to have returned recently to activity in this newsgroup 
after a sabbatical of sorts.

Read my .sig :-).

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 16 Oct 1998 17:01:53 -0700
From: larry@kiev.wall.org (Larry Wall)
Subject: Re: Off topic: is he that Larry Wall?
Message-Id: <708mph$836@kiev.wall.org>

In article <3627846E.DDE5D443@hotmail.com>, feng  <j9feng@hotmail.com> wrote:
> Is he the Larry Wall who fathered Perl?

That's the polite way to put it.  :-)

Larry


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

Date: Sat, 17 Oct 1998 01:16:44 +0100
From: "Jules" <julius@clara.net>
Subject: Passing Filehandle as parameters to function
Message-Id: <708o3t$7om$1@eros.clara.net>

Dear all, newbie question: how do I pass a filehandle as a parameter to a
function which can then make use of them? An example use:

OpenFile (FILEHANDLE, "filename.out");
PrintLine (FILEHANDLE, "Hello World");
CloseFile (FILEHANDLE);

When PrintLine() would contain other operations, not just printing. So
inside PrintLine() I would probably have for instance something like:

PrintLine {
    print $_[0] $_[1];
    $line++;
}

I tried something similar but the filehandle $_[0] obviously was not
FILEHANDLE. And $_[1] was not "Hello World" either I think. Apparently if I
used $_[2] instead of $_[1], it gave "Hello World" when I omitted the
filehandle bit in the print operation. Is it that if I pass parameters to a
function, the first argument would be $_[1] instead and there's no $_[0]???
I'm gettng confused. And how do I pass the FILEHANDLE to PrintLine() and
making which print the output to the same filehandle as OpenFile and
CloseFile?


Please help.

Thanx,
        Jules

***There is not enough darkness in the whole world to extinguish the light
of a small candle***






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

Date: Fri, 16 Oct 1998 16:25:01 -0500
From: Bryn Bellomy <opieweb@hotmail.com>
Subject: Password stuff
Message-Id: <3627B9AD.5902F3FA@hotmail.com>

I have a little problem, maybe unsolvable because of Perl's lack of a
compiler (Whatever...).  I'm trying to implement a password feature into
a script I made, but I want each password to be settable by the sysadmin
(I'll just write their password into a file or something).  If anyone
can do this, please contact me at opieweb@hotmail.com
Oh, the source of my script; you can omit the usr2pass hash if
necessary:

%usr2pass = (
        "user1" => "passw1",
        "user2" => "passw2",
        "user3" => "passw3",
);

#for displaying users real name:
%usr2name = (
        "user1" => "guy",
        "user2" => "lady",
        "user3" => "it",
);
%whatnews = (
        "computer" => "0",
        "home"     => "0",
        "education"=> "0",
        "web"      => "0",
        "starcraft"=> "0",
);
%upcase = (
        "computer" => "Computer",
        "home"     => "Home",
        "education"=> "Education",
        "web"      => "Web",
        "starcraft"=> "Starcraft",
);
&pass;

sub pass
{
        print "\n" x 25;
        print "rn - Read News\n";
        print "Login: ";
        chomp ( $usrguess = <STDIN> );
        print "Password: ";
        chomp ( $guess    = <STDIN> );

        if ( $guess ne $usr2pass{ $usrguess } )
        {
                print "User: $usrguess doesn't equal $guess. 
Aborting.\n";
                exit 1;
        }
        else
        {
                &menu;
        }
}
sub menu
{
START:
        print "\n" x 25;
        print "Hello, $usr2name{ $usrguess }!\n";
        print <<EOM;
-------------------------
| 1. Read News          |
| 2. Change Preferences |
| 3. Log off            |
-------------------------
EOM
        print "Command: ";
        chomp ( $choice = <STDIN> );

        if    ( $choice == 1 )
                { &findtype; }
        elsif ( $choice == 2 )
                { &newsprefs; }
        elsif ( $choice == 3 )
                { &pass; }
        else
        {
                print "I don't know that command.";
                goto START;
        }

}
sub findtype
{
        open ( THEFILE, "$usrguess.ndf" );
        while ( chomp ( $linepref = <THEFILE> ) )
        {
                if    ( $linepref eq "comp" )
                {
                        $whatnews{ "computer" } = 1;
                }
                elsif ( $linepref eq "home" )
                {
                        $whatnews{ "home" } = 1;
                }
                elsif ( $linepref eq "edu" )
                {
                        $whatnews{ "education" } = 1;
                }
                elsif ( $linepref eq "sc" )
                {
                        $whatnews{ "starcraft" } = 1;
                }
                elsif ( $linepref eq "web" )
                {
                        $whatnews{ "web" } = 1;
                }
                else
                {
                        &newsprefs;
                }
        }
        &read;
}
sub read
{
STARTER:
        if    ( $whatnews{ "computer" } == 1 )
        {
                $stuff = "computer";
                $ntype = "comp";
                goto READIT;
        }
        elsif ( $whatnews{ "home" }     == 1 )
        {
                $stuff = "home";
                $ntype = "home";
                goto READIT;
        }
        elsif ( $whatnews{ "education" }     == 1 )
        {
                $stuff = "education";
                $ntype = "edu";
                goto READIT;
        }
        elsif ( $whatnews{ "starcraft" }     == 1 )
        {
                $stuff = "starcraft";
                $ntype = "sc";
                goto READIT;
        }
        elsif ( $whatnews{ "web" }     == 1 )
        {
                $stuff = "web";
                $ntype = "web";
                goto READIT;
        }
        else
        {
                print "\nAll news read.\nPress enter to proceed...\n";
                $stupidwaste = <STDIN>;
                $stupidwaste = "";
                &menu;
        }

READIT:
        $ext = ".nws";
        chomp ( $ntype );
        chomp ( $ext );
        $nname = join '', $ntype, $ext;
        open ( READNEWS, $nname );

        $topic = $upcase{ $stuff };
        chomp ( $topic );
        $nws = "News";
        chomp ( $nws );

        $newstitle = join ' ', $topic, $nws;

        print "\n\n";
        print "\n\n";

        print "     $newstitle\n";
        print "--------------------------\n";

        format STDOUT =
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$newsline
 .

        while ( $newsline = <READNEWS> )
        {
                write;
        }

        $whatnews{ $stuff } = 0;
        $stuff = "";
        $ntype = "";
        print "Press enter to proceed...";
        $enterkey = <STDIN>;
        $enterkey = "";
        $newsline = "";
        close READNEWS;
        $newstitle = "";
        $topic = "";
        $nws = "";
        goto STARTER;
}
sub newsprefs
{
        open ( NEWPREFS, ">$usrguess.ndf" );
        print <<EOT;
Type the kinds of news you would
like, each followed by a carriage
return (Represented by <cr> ).
When you are done, use the END
command.  The example shows all
available types of news.

e.g.:
computer<cr>
web<cr>
home<cr>
education<cr>
starcraft<cr>
END<cr>
 ------------------------------
News:
EOT
        while ( chomp ( $getnews = <STDIN> ) )
        {
                if    ( $getnews eq "home" )
                {
                        print NEWPREFS "home\n";
                }
                elsif ( $getnews eq "education" )
                {
                        print NEWPREFS "edu\n";
                }
                elsif ( $getnews eq "starcraft" )
                {
                        print NEWPREFS "sc\n";
                }
                elsif ( $getnews eq "web" )
                {
                        print NEWPREFS "web\n";
                }
                elsif ( $getnews eq "computer" )
                {
                        print NEWPREFS "comp\n";
                }
                elsif ( $getnews eq "END" )
                {
                        goto ENDOFTHISSUB;
                }
        }
ENDOFTHISSUB:
        close NEWPREFS;

        &menu;
}

Thanx!  
Bryn Bellomy


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

Date: Fri, 16 Oct 1998 22:54:31 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Password stuff
Message-Id: <3627CC24.5FF2DEDA@bbnplanet.com>

Bryn Bellomy wrote:

> I have a little problem, maybe unsolvable because of Perl's lack of a
> compiler (Whatever...).  I'm trying to implement a password feature into
> a script I made, but I want each password to be settable by the sysadmin
> (I'll just write their password into a file or something).  If anyone
> can do this, please contact me at opieweb@hotmail.com

1. What does compiling have to do with this?
2. Your question makes no sense, at least to me. What are you trying to
do here?  System level auth or web based auth?

As I recall, the Llama book had a fun little password exercise in the
first chapter. 

e.

After all, the cultivated person's first duty is to
always be prepared to rewrite the encyclopedia.  - U. Eco -


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

Date: Fri, 16 Oct 1998 22:11:55 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
Message-Id: <3627C228.8B8B7247@bbnplanet.com>

Adam Turoff wrote:

>         Then the llama was ported to windows.  What do we get?
>         A cold blooded lizard called a gecko.
> 
> Roast gecko stays on the menu.  I wouldn't mind armadillos crawling
> around the room or barbequed moose, grilled squid, marinated horseshoe
> crabs, etc.  (I draw the line at any of the Oracle bugs, or the canine/feline
> Windows animals.)

Hmmm. I can see it now, I'll hire a friend of mine who is a gourmet chef
in vail, have a menu where each entree' is an O'Reilly animal, save for
the few not quite so appetizing ones. Hmmmm. I'm going to have to pitch
this to a biz friend this weekend and see if it would fly. I've always
wanted my own pub. :)

e.

After all, the cultivated person's first duty is to
always be prepared to rewrite the encyclopedia.  - U. Eco -


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

Date: Fri, 16 Oct 1998 18:48:56 -0500
From: thomas@x-tekcorp.com (Thomas Rock)
Subject: Recover ref from string
Message-Id: <MPG.109197601a59e43f989696@news.anet-chi.com>

Given the code:

my $a = [10, 11, 12];
my $b = sprintf("%s", $a);

Is there any way to recover the reference to the
array from the string contained in $b?

Thanks,

-- 
Thomas Rock
thomas@x-tekcorp.com


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

Date: Fri, 16 Oct 1998 16:54:23 -0500
From: Tk Soh <r28629@email.sps.mot.com>
Subject: Re: Slow Sort?
Message-Id: <3627C08F.F3528272@email.sps.mot.com>

Matt Pryor wrote:
> 
> The sort function in this code:
> 
> srand;
> foreach(0..102000) {
>         $x[$_]=int(rand(time)*100);
>          print "." if ($_/1000 eq int($_/1000));
> }
> print "\nSorting...\n";
> $t = time;
> @sorted = sort {$b<=>$a} @x;      # There's the culprit!
> $t = time-$t;
> print "Done in $t seconds.\n";
> exit(0);
> 
> Took just 9 seconds under Win95 with a Cyrix 200mhz processor with 32
> meg ram...
> 

15 seconds on SPARCstation 5 with 32MB (70MB virtual).

How to get 40 minutes???


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

Date: Fri, 16 Oct 1998 16:40:20 -0500
From: Tk Soh <r28629@email.sps.mot.com>
Subject: Re: The space deletion woes...
Message-Id: <3627BD44.52D13A46@email.sps.mot.com>

Larry Rosler wrote:
> 
> > Leaving aside -w's nattering, how come Tk Soh can benchmark a sub
> > reference and I can only benchmark a string?  Do we have an out of
> > date Benchmark.pm here, or something?
> 
> No, you have an out of date perl processor.  The symptom you report
> occurs with 5.002 but not with 5.004 (or 5.005, of course).  I don't
> know about 5.003, but who cares?
> 

It works on Perl5.005 (running on Sun), but would fail with this message
on 5.003:

% perl trial.pl
Ambiguous use of tr => resolved to "tr" => at trial.pl line 9.
Benchmark: timing 50000 iterations of All, One, tr...
Undefined subroutine &main::CODE called at (eval 2) line 1.

% perl -v

This is perl, version 5.003 with EMBED
        built under hpux at Oct 29 1996 11:50:49
        + suidperl security patch


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

Date: Fri, 16 Oct 1998 22:00:08 GMT
From: Shawn Corey <shawn@magma.ca>
Subject: Re: Too stupid
Message-Id: <3627C1B3.5681F340@magma.ca>

This is a multi-part message in MIME format.
--------------83639293D8F8FFB58C461F3C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi David,

I not sure what you're talking about but my experience with xterm is as
follows:

xterm <options> [<program> [<argument>] ... ]

I was work with HP-UX 9.* and every time I ran a shell or perl with
this, it exited when the program was done. Maybe things have changed
since then. If you envoke perl from within xterm from the command
prompt, it will not terminate. If you give it a program from the command
line, it will exit when the program is finish. I think you are talking
about this difference.


David Alan Black wrote:
> 
> Hello -
> 
> Shawn Corey <shawn@magma.ca> writes:
> 
> >This is a multi-part message in MIME format.
> >--------------1047CE8AB199BC52781F7E33
> >Content-Type: text/plain; charset=us-ascii
> >Content-Transfer-Encoding: 7bit
> 
> >Hi Tim,
> 
> >Add the following lines to the end of you program.
> 
> >print "\nPress ENTER to exit: ";
> >my $tmp = <STDIN>;
> 
> >This waits for the user to enter a line. The problem you encountered is
> >a MS-DOS one. There is a way of changing this by fooling with the
> >Properties of the MS DOS Prompt but I found that if I change it once, it
> >changes for all my MS DOS Prompts. I must be doing something wrong.
> >Therefore I add the above code when I want a program to wait. Crude but
> >effective. BTW xterm does the same thing. Again, there are options to
> >prevent this but the above code is an universal solution.
> 
> xterm doesn't do what Tim described:
> 
> orpheus:~/perl$ cat circum
> #!/usr/bin/perl -w
> print ("Enter the radius of the circle.  ");
> $radius = <STDIN>;
> chomp ($radius);
> $circumference = ((2 * 3.1415)* $radius);
> print ("$circumference");
> 
> orpheus:~/perl$ perl circum
> Enter the radius of the circle.  10
> 62.83orpheus:~/perl$
> orpheus:~/perl$
> orpheus:~/perl$ # xterm still running!
> 
> Why would the xterm process exit?  (I don't ask the question with
> the same ardency in the case of DOS, because it seems to me that
> such behavior comports with the general Micros**t ethos entirely.)
> 
> David Black
> dblack@pilot.njin.net

-- 
Shawn Corey

s  @m  .c
 h   a   a
  a   g
   w   m
    n   a
--------------83639293D8F8FFB58C461F3C
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Corey, Shawn
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Shawn Corey
n:              Corey;Shawn
org:            Corey Consultants
adr:            51 Wessex Road;;;Ottawa;Ontario;K2J 1X3;Canada
email;internet: shawn@magma.ca
title:          President
tel;work:       823-4132
tel;home:       823-4132
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard


--------------83639293D8F8FFB58C461F3C--



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

Date: Sat, 17 Oct 1998 00:46:52 +0100
From: "Tim Hicks" <tim.hicks@lineone.net>
Subject: Re: Too stupid
Message-Id: <TYQV1.19903$tF.498@news-reader.bt.net>

Thanks again guys for all the help.


Tim




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

Date: Fri, 16 Oct 1998 16:03:25 -0700
From: Alex Guberman <alex@digi-q.com>
Subject: Unzip with Perl
Message-Id: <3627D0BD.3DE8@digi-q.com>

Hi,

Does anybody know how I can unzip a file and put the unziped files in a
directory using Perl script, but NOT using system call.  Please help.

Thank you,
Alex


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

Date: Sat, 17 Oct 1998 00:19:26 GMT
From: Francois Besnier <fbesnier@home.com>
Subject: Re: Win32::OLE and Netscape
Message-Id: <3627E22C.CA2F0433@home.com>

Matt Sergeant wrote:
> 
> Francois Besnier wrote:
> 
> [snip]
> >         $web->Read($content, $contentlen)
> >         or die "Could not READ URL: $! \n";
> >
> >         print "content=$content\n";
> >
> >         $web->Close();
> >
> > This script returns:
> >
> > contentlen=9120
> > Could not READ URL:
> >
> > It seems that "$web->Read($content, $contentlen);" does not work.
> >
> > Why did i get this error?
> 
> Because you didn't read the docs. Read returns 0 if there is no data
> currently. It looks like you have to loop around while
> (!$web->IsFinished()) {} and read the data. Read returns 0 if there is
> no data _currently_. There may be more later.
> 
> --
> <Matt/>

Okay, but there is more : Read always returns 0

I searched Dejanews and it seems that others have had similar problems
with this Read() function of Netscape.Network.1
see e.g.
http://x12.dejanews.com/getdoc.xp?AN=157978532&CONTEXT=908505438.673906828&hitnum=1

However, it seems to work with VB
see e.g. http://www.zdnet.com/wsources/content/960717/taskbar.html

Perhaps, I'd better switch for the automation of Internet Explorer via
mshtml !? Any exerience of that ?
see e.g.
http://msdn.microsoft.com/developer/sdk/inetsdk/help/itt/ieprog/host/hosting.htm

Anyway (if can I manage to make it work), I'll post the solution to this
newsgroup.

- Francois


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 3996
**************************************

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