[8902] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2519 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 6 18:07:30 1998

Date: Wed, 6 May 98 15:00:37 -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           Wed, 6 May 1998     Volume: 8 Number: 2519

Today's topics:
        "perldoc -f funcname" fails <lr@hpl.hp.com>
    Re: Another Odd Regexp Question - Buggy Behaviour? <dballing@speedchoice.com>
    Re: Bad free() ignored -- latest Perl not an option (Stuart McDow)
    Re: Bizarre problem with scalar .. operator? (Jack Applin)
        Calling NT Service from UNIX using Perl ofcourse <hoberoi@belmont.com>
    Re: Calling NT Service from UNIX using Perl ofcourse <lanier@shell6.ba.best.com>
        Capturing Command Line Output <luckys@geocities.com>
    Re: Capturing Command Line Output (brian d foy)
        Challange for perl `GURUS` <vgajjar@exodus.net>
        Challange for perl `GURUS` <vgajjar@exodus.net>
        Challange for perl `GURUS` <vgajjar@exodus.net>
        Challange for perl `GURUS` <vgajjar@exodus.net>
        Challange for perl `GURUS` <vgajjar@exodus.net>
        Checking for a reader before writing to a named pipe (F (Rob Tanner)
    Re: Child in separate window?  How? <aqumsieh@matrox.com>
    Re: COUNTING DAYS UNTIL 2000 lusol@turkey.cc.Lehigh.EDU
        Date::Manip on NT <hjf@companyname1.com>
    Re: deleting lines from file help <lr@hpl.hp.com>
    Re: Ever Wonder Why Not Everyone Uses Modules? <tchrist@mox.perl.com>
    Re: Ever Wonder Why Not Everyone Uses Modules? <upsetter@shore.net>
    Re: Ever Wonder Why Not Everyone Uses Modules? (Ilya Zakharevich)
    Re: Ever Wonder Why Not Everyone Uses Modules? <cberry@cinenet.net>
    Re: Ever Wonder Why Not Everyone Uses Modules? (Nathan V. Patwardhan)
    Re: Ever Wonder Why Not Everyone Uses Modules? (Matthew Cravit)
    Re: Ever Wonder Why Not Everyone Uses Modules? <tchrist@mox.perl.com>
    Re: Ever Wonder Why Not Everyone Uses Modules? <gburnore@netcom.com>
    Re: Ever Wonder Why Not Everyone Uses Modules? <andy@wonderworks.co.uk>
    Re: Ever Wonder Why Not Everyone Uses Modules? <tchrist@mox.perl.com>
    Re: Ever Wonder Why Not Everyone Uses Modules? (Chris Nandor)
        exists and -w messages (Wayne C. McCullough)
        Hash value length limit? <dlacroix@cray-ymp.acm.vt.edu>
    Re: Help : Generating a Unicode file <aas@sn.no>
        help wit perl in Dallas <dstanton@airmail.net>
    Re: How do I get the name of each file in a dir? <aqumsieh@matrox.com>
    Re: PERL aware code editor (Stuart McDow)
        problem with cat <webmaster@apartmentzone.com>
    Re: problem with cat (brian d foy)
    Re: Proplem with perl script (I'm new to perl) <aqumsieh@matrox.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 6 May 1998 12:53:51 -0700
From: "Larry Rosler" <lr@hpl.hp.com>
Subject: "perldoc -f funcname" fails
Message-Id: <6iqf4k$kmi@hplntx.hpl.hp.com>

Many submissions here aim Perl users at the descriptions of specific
functions by "perldoc -f funcname".  On the installation of perl
5.004_03 that I use, this produces a diagnostic that starts "Unknown
option: f".  But "perldoc perlfunc" works fine.  How can I correct this
installation?

The output of "perl -V" is:

Summary of my perl5 (5.0 patchlevel 4 subversion 3) configuration:
  Platform:
    osname=hpux, osvers=10, archname=PA-RISC1.1
    uname='hp-ux testk200 b.10.10 a 9000819 31621351 two-user license '
    hint=previous, useposix=true, d_sigaction=define
    bincompat3=y useperlio=undef d_sfio=undef
  Compiler:
    cc='/opt/ansic/bin/cc', optimize='-O', gccversion=
    cppflags='-D_HPUX_SOURCE -Aa'
    ccflags ='-D_HPUX_SOURCE -Aa'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=0, d_casti32=define, d_castneg=define
    intsize=4, alignbytes=8, usemymalloc=y, randbits=15
  Linker and Libraries:
    ld='ld', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib/pa1.1 /usr/lib /usr/ccs/lib
    libs=-lSocks -lnet -lnsl_s -lndbm -ldld -lm -lc -lndir -lcrypt
    libc=/usr/lib/libc.sl, so=sl
    useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef,
ccdlflags='-Wl,-E -Wl,-B,deferred '
    cccdlflags='+z', lddlflags='-b -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Built under hpux
  Compiled at Sep 19 1997 18:32:30
  @INC:
    /opt/perl5.004_03/lib/PA-RISC1.1/5.00403
    /opt/perl5.004_03/lib
    /opt/site_perl/PA-RISC1.1
    /opt/site_perl
    .


--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com




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

Date: Wed, 06 May 1998 15:01:46 -0500
From: Derek Balling <dballing@speedchoice.com>
Subject: Re: Another Odd Regexp Question - Buggy Behaviour?
Message-Id: <91068E6F70A1394C.79EA95E270E1BEA1.8E52E315118B2701@library-proxy.airnews.net>

Ilya Zakharevich wrote:

> > I understand what you're saying, (and the problem here is
> > that browsers word-wrapping really prevents VERBATIM
> Browsers?!  What are you taking about?!

It's the cheeze-whiz Netscape news I use because screen
real-estate is at a premium, and if I open another window to
a "real" newsreader, the monitor will be even more cluttered
than it already was. :)
 
> Hit:  Where is
> 
>     pos $request
> 
> now?
> 
> >  $uuid = $1 if $request =~ /modem (\d{5,6})/g;
> 
> What this /g is doing there?
> 
> Works as documented.

Ding ding ding!

Thank you!  It all became clearer to me now, after your
hint. Tried it out, worked fine, what a deal. :)  

Thank you everyone for their help.

Derek


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

Date: 6 May 1998 21:28:43 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: Bad free() ignored -- latest Perl not an option
Message-Id: <6iqkmb$fo5$1@ns1.arlut.utexas.edu>

Andy Armstrong <andy@wonderworks.co.uk> writes:
> 
> Unfortunately our ISP is still running 5.001 and there's no prospect
> of changing this in the near futyre.

The evidence points to a broken ISP. It should probably be replaced.

--
Stuart McDow                                     Applied Research Laboratories
smcdow@arlut.utexas.edu                      The University of Texas at Austin
  "It is obvious that about 750,000 people ago, Austin was a wonderful City."


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

Date: 6 May 1998 21:04:43 GMT
From: neutron@fc.hp.com (Jack Applin)
Subject: Re: Bizarre problem with scalar .. operator?
Message-Id: <6iqj9b$s88@fcnews.fc.hp.com>

Ian Boys (boys@aspentech.com) wrote:

>     for my $i (1..10) {
>         my $m = ($i==$i) .. ($i == 7);
>         print "$i: $m\n";
>     }

> Example 2 I think should produce the same output but doesn't:
> 
>     for my $i (1..10) {
>         my $m = (1) .. ($i == 7);
>         print "$i: $m\n";
>     }


man perlop says:

      If either operand of scalar ".." is a numeric literal, that
      operand is implicitly compared to the $. variable, the current line
      number.


				-Jack Applin
				 neutron@fc.hp.com
				 http://www.geocities.com/HotSprings/6789/


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

Date: Wed, 6 May 1998 16:06:44 -0400
From: "Himanshu Oberoi" <hoberoi@belmont.com>
Subject: Calling NT Service from UNIX using Perl ofcourse
Message-Id: <6iqgc2$9fm$1@newsie2.cent.net>

We are considering using a perl script running on a Unix box to connect to a
service running on an NT box. Has any one had problems doing this ?

Himanshu




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

Date: Wed, 6 May 1998 13:34:55 -0700
From: "matthew d. p. k. lanier" <lanier@shell6.ba.best.com>
To: Himanshu Oberoi <hoberoi@belmont.com>
Subject: Re: Calling NT Service from UNIX using Perl ofcourse
Message-Id: <Pine.BSF.3.96.980506133410.27679C-100000@shell6.ba.best.com>

as long as the perl script talks to the same port that the service answers
and there's no conflict, there are no perl issues involved.

matt lanier

On Wed, 6 May 1998, Himanshu Oberoi wrote:

> We are considering using a perl script running on a Unix box to connect to a
> service running on an NT box. Has any one had problems doing this ?
> 
> Himanshu
> 
> 
> 
> 



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

Date: Wed, 06 May 1998 04:06:40 -0400
From: Luckys <luckys@geocities.com>
Subject: Capturing Command Line Output
Message-Id: <35501A10.73EE@geocities.com>

I'm in the process of writing a script that will read in my current
dynamic ip address for update in my apache server's httpd.conf file. 
However, I'm at a lose as how to capture output from a command line
response.

I've tried using the 'system' command but can't figure out how to
capture STDOUT using it.  I was trying to use 'qx//' but again I am at a
lose when trying to capture the STDOUT.

Any suggestions on how to capture STDOUT from the command line without
me having to type it in manually?


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

Date: Wed, 06 May 1998 16:55:55 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Capturing Command Line Output
Message-Id: <comdog-ya02408000R0605981655550001@news.panix.com>
Keywords: from just another new york perl hacker

In article <35501A10.73EE@geocities.com>, luckys@geocities.com posted:

>I've tried using the 'system' command but can't figure out how to
>capture STDOUT using it.  I was trying to use 'qx//' but again I am at a
>lose when trying to capture the STDOUT.

perhaps if you showed a snippet we could point out the mistakes. :)

>Any suggestions on how to capture STDOUT from the command line without
>me having to type it in manually?

have you seen perlfaq8 and perlipc?

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>


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

Date: Thu, 07 May 1998 15:00:44 +0000
From: vimal gajjar <vgajjar@exodus.net>
Subject: Challange for perl `GURUS`
Message-Id: <3551CC9B.991DB847@exodus.net>

Hi there,
                Here is a small challange. Is it possible to have a perl
code which takes e.g. three parameters as input. time, val1, val2. and
the name of the prog. is say challange.pl. Now if  i execute
"challange.pl  10 5 2" this perl script wille  consume
5% of cpu
2 Mb of RAM
for the period of 10 Seconds.

can one of the gurus take this challange?

Vimal
-------------------------------------------------------------
        First Step To Solve Any Problem is to Analyze
-------------------------------------------------------------
        Vimal Gajjar
        Software Engineer  (R&D)
        Exodus Communications, Inc.
        Voice : (408)346-2335
        Pager : (408)994-2550
-------------------------------------------------------------
        Second Step To Solve Any Problem is to BEGIN
-------------------------------------------------------------




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

Date: Thu, 07 May 1998 15:00:07 +0000
From: vimal gajjar <vgajjar@exodus.net>
Subject: Challange for perl `GURUS`
Message-Id: <3551CC76.99EB8CD4@exodus.net>

Hi there,
                Here is a small challange. Is it possible to have a perl
code which takes e.g. three parameters as input. time, val1, val2. and
the name of the prog. is say challange.pl. Now if  i execute
"challange.pl  10 5 2" this perl script wille  consume
5% of cpu
2 Mb of RAM
for the period of 10 Seconds.

can one of the gurus take this challange?

Vimal
-------------------------------------------------------------
        First Step To Solve Any Problem is to Analyze
-------------------------------------------------------------
        Vimal Gajjar
        Software Engineer  (R&D)
        Exodus Communications, Inc.
        Voice : (408)346-2335
        Pager : (408)994-2550
-------------------------------------------------------------
        Second Step To Solve Any Problem is to BEGIN
-------------------------------------------------------------




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

Date: Thu, 07 May 1998 15:01:00 +0000
From: vimal gajjar <vgajjar@exodus.net>
Subject: Challange for perl `GURUS`
Message-Id: <3551CCAB.CE2C6B3C@exodus.net>

Hi there,
                Here is a small challange. Is it possible to have a perl
code which takes e.g. three parameters as input. time, val1, val2. and
the name of the prog. is say challange.pl. Now if  i execute
"challange.pl  10 5 2" this perl script wille  consume
5% of cpu
2 Mb of RAM
for the period of 10 Seconds.

can one of the gurus take this challange?

Vimal
-------------------------------------------------------------
        First Step To Solve Any Problem is to Analyze
-------------------------------------------------------------
        Vimal Gajjar
        Software Engineer  (R&D)
        Exodus Communications, Inc.
        Voice : (408)346-2335
        Pager : (408)994-2550
-------------------------------------------------------------
        Second Step To Solve Any Problem is to BEGIN
-------------------------------------------------------------




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

Date: Thu, 07 May 1998 15:01:47 +0000
From: vimal gajjar <vgajjar@exodus.net>
Subject: Challange for perl `GURUS`
Message-Id: <3551CCDB.B987A977@exodus.net>

Hi there,
                Here is a small challange. Is it possible to have a perl
code which takes e.g. three parameters as input. time, val1, val2. and
the name of the prog. is say challange.pl. Now if  i execute
"challange.pl  10 5 2" this perl script wille  consume
5% of cpu
2 Mb of RAM
for the period of 10 Seconds.

can one of the gurus take this challange?

Vimal
-------------------------------------------------------------
        First Step To Solve Any Problem is to Analyze
-------------------------------------------------------------
        Vimal Gajjar
        Software Engineer  (R&D)
        Exodus Communications, Inc.
        Voice : (408)346-2335
        Pager : (408)994-2550
-------------------------------------------------------------
        Second Step To Solve Any Problem is to BEGIN
-------------------------------------------------------------




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

Date: Thu, 07 May 1998 15:03:33 +0000
From: vimal gajjar <vgajjar@exodus.net>
Subject: Challange for perl `GURUS`
Message-Id: <3551CD45.4104CA7E@exodus.net>

Hi there,
                Here is a small challange. Is it possible to have a perl
code which takes e.g. three parameters as input. time, val1, val2. and
the name of the prog. is say challange.pl. Now if  i execute
"challange.pl  10 5 2" this perl script wille  consume
5% of cpu
2 Mb of RAM
for the period of 10 Seconds.

can one of the gurus take this challange?

Vimal
-------------------------------------------------------------
        First Step To Solve Any Problem is to Analyze
-------------------------------------------------------------
        Vimal Gajjar
        Software Engineer  (R&D)
        Exodus Communications, Inc.
        Voice : (408)346-2335
        Pager : (408)994-2550
-------------------------------------------------------------
        Second Step To Solve Any Problem is to BEGIN
-------------------------------------------------------------




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

Date: Wed, 06 May 1998 14:21:45 -0700
From: rtanner@linfield.edu (Rob Tanner)
Subject: Checking for a reader before writing to a named pipe (FIFO)
Message-Id: <rtanner-0605981421450001@wildflower.linfield.edu>

Problem:  I am using a named pipe for client/server communications for a
WEB based application.  The client is a CGI and the server is a background
daemon (written in perl).  Before finishing with the broswer, I check if
the pipe exits and send an error message if not.  But how do I check that
the other end of the FIFO opened for reading?  According to W. Richard
Stevens, when a writer opens a pipe to write and there is no reader, a
SIGPIPE gets generated.  But it seems Solaris, in their Streams I/O have
eliminated that.  My trap works because I can use "kill -PIPE pid" to get
the expected results.  But otherwise attempts to write to the pipe with no
reader cause my CGI to block.

So, how can I be sure there is a functioning reader at the other end of
the pipe?  Any ideas?

Thanks,
Rob

      _ _ _ _           _    _ _ _ _ _    
     /\_\_\_\_\        /\_\ /\_\_\_\_\_\  
    /\/_/_/_/_/       /\/_/ \/_/_/_/_/_/  QUIDQUID LATINE DICTUM SIT,
   /\/_/__\/_/ __    /\/_/    /\/_/          PROFUNDUM VIDITUR
  /\/_/_/_/_/ /\_\  /\/_/    /\/_/             
 /\/_/ \/_/  /\/_/_/\/_/    /\/_/         (Whatever is said in Latin
 \/_/  \/_/  \/_/_/_/_/     \/_/              sounds profound)

 Rob Tanner
 Manager of Systems and Communications
 Linfield College, McMinnville, OR
 (503) 434-2558 <rtanner@linfield.edu> _____________________________________________________________________


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

Date: Wed, 06 May 1998 16:18:28 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Child in separate window?  How?
Message-Id: <3550C594.5C6B5479@matrox.com>

Jason Gloudon wrote:

> k y n n <NOSPAMkEynOn@panix.comNOSPAM> wrote:
> >Does anyone know how to fork out a child process with its own separate
> >X window, so that keyboard input will go to the parent or the child
> >depending on which window has the focus?
>
> fork()
> then
> exec "xterm -e 'command'"
>
> --
> Jason Gloudon

 Or if you wanna get real fancy .. uses Curses!

--
Ala Qumsieh             | "How much wood would a woodchuck
ASIC Design Engineer    |  chuck if a woodchuck could
Matrox Graphics Inc.    |  chuck wood?"
Montreal, Quebec        |             - Trivial ... 5!





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

Date: 6 May 1998 20:44:12 GMT
From: lusol@turkey.cc.Lehigh.EDU
Subject: Re: COUNTING DAYS UNTIL 2000
Message-Id: <6iqi2s$mn0@fidoii.cc.Lehigh.EDU>

     Michael J Gebis wrote in article <6iq6pk$659@mozo.cc.purdue.edu> :
>
>fl_aggie@thepentagon.com (I R A Aggie) writes:
>
>}In article <01bd7860$50183840$a44a6dc2@earl.esense.nl>, "Mathijs Oosterom"
>}<thijs@esense.nl> wrote:
>
>}+ Hi there,
>}+ 
>}+ Does anyone has a Perl-script that counts the days until the year 2000? 
>
>}Yep. It uses some modules, and if you don't have them, it won't work.
>
>I made some small changes to your script for conciseness, here it is:
>
>#!/usr/bin/perl -w
>use Time::JulianDay;
>($mday,$mon,$year)=(localtime())[3..5];
>$d=julian_day(1900,1,1)-julian_day(1900+$year,++$mon,$mday);
>
>print "Only $d days till the Year 2000 bug hits!\n";
># ;-)

Along the same but different line:

#!/usr/local/bin/perl -w
#
# y2k - seconds before the big hoedown.
# 
# S. O. Lidie, 98/05/05

use Tk;
use Time::Local;
use strict;

my $y2k = timelocal(0, 0, 0, 1 , 0, 2000);

my $top = MainWindow->new;
my $countdown;
my $label = $top->Label(-text => 'Seconds Until All Hell Breaks Loose')->grid;
my $time = $top->Label(-textvariable => \$countdown)->grid;
my $tid = $top->repeat(1000 => [\&countdown, $y2k, $countdown]);
MainLoop;

sub countdown {
    my $c = $countdown = $y2k - time();
    1 while $countdown =~ s/^(-?\d+)(\d{3})/$1,$2/;
    return if $c > 10;
    if ($c == 10 ) {
	$time->configure(qw/-background red -foreground yellow/);
    } elsif ($c <= 0) {
	$tid->cancel;
	$label->gridForget;
	$countdown = 'Now get to work fixing those bugs we all missed!';
    }
    $top->idletasks;
    $top->bell;
}


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

Date: Wed, 06 May 1998 16:00:58 -0500
From: iug piug <hjf@companyname1.com>
Subject: Date::Manip on NT
Message-Id: <3550CF8A.D7D9291B@companyname1.com>

Yes, I am clueless, but stuck also...

I'm trying to use Date::Manip on a NT box. I include "use Manip;"
(without quotes) because "use Date::Manip;" (without quotes) causes
"Can't locate Date/Manip.pm..." to display. The subroutine I'm trying to
run is "$in[3] = &Date_DaysSince999($m,$d,$y);", and I constantly get
"Undefined subroutine &main::Date_DaysSince999 called...".

Any ideas as to what I'm doing wrong?

Thanks

Andy Biegel



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

Date: Wed, 6 May 1998 14:45:24 -0700
From: "Larry Rosler" <lr@hpl.hp.com>
Subject: Re: deleting lines from file help
Message-Id: <6iqllo$n2r@hplntx.hpl.hp.com>

[posted and mailed]

robert burditt wrote in message
<354F71EE.1F6A9417@london.gos.fedex.com>...
>this should be a fairly simple task, but i cannot figure out
>how to do it... i'd really appreciate any help out there.
>
>i have a log file that grows pretty large and about once a week,
>i'd like to go in and delete the first 20,000 lines or so.
>
>could anyone give insight on how to do this?
>
>thanks a lot,
>robert
>rburditt@fedex.com

By email to me, robert added another requirement:  The deletion must
occur *in place* because there is no room in the file system for two
copies of the log file.  The FAQ (at the end) presents the special case
of deletion from the end of the file (using tell and truncate), but it
doesn't deal with deleting from the front (except by selective copying).

Inspired by yesterday's thread on "seek, syssek [sic], tell... Where is
systell?", I cooked up the following:

#!/usr/local/bin/perl -w
use strict;
use Fcntl;

my $file = 'whatever';
my $lose = 20000;
my $buffer;
my $size = 4096;

sysopen FILE, $file, O_RDWR or die "sysopen: $!";
1 while sysread FILE, $buffer, $size and ($lose -= $buffer =~ y/\n//) >
0;
my $write_pos = 0;
while (sysread FILE, $buffer, $size) {
    my $read_pos = sysseek FILE, 0, 1;
    sysseek FILE, $write_pos, 0 or die "sysseek0: $!";
    syswrite FILE, $buffer, $size or die "syswrite: $!";
    $write_pos = sysseek FILE, 0, 1;
    sysseek FILE, $read_pos, 0 or die "sysseek1: $!";
}
truncate FILE, $write_pos or die "truncate: $!";
close FILE;

Note that this is fast, but approximate.  The number of lines lost will
likely be somewhat over what is requested, and the first line in the
rewritten file will likely be truncated.  To do it exactly, one might
choose to go line by line, using <FILE>, print, seek and tell.  It would
surely be much slower.

Comments or suggestions would be welcome.  Is this of sufficient
interest to be documented somewhere?

--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com





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

Date: 6 May 1998 19:56:52 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Ever Wonder Why Not Everyone Uses Modules?
Message-Id: <6iqfa4$seo$3@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, cberry@cinenet.net (Craig Berry) writes:
:I can't use
:it (for example) on my old brain-dead DOS box, where I do a good deal of
:Perl development.  

Whose fault is that one, again?

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    echo "Your stdio isn't very std."
            --Larry Wall in Configure from the perl distribution


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

Date: 6 May 1998 20:12:25 GMT
From: Art Cohen <upsetter@shore.net>
Subject: Re: Ever Wonder Why Not Everyone Uses Modules?
Message-Id: <6iqg79$9t3@fridge.shore.net>

Tom Christiansen <tchrist@mox.perl.com> wrote:
: In comp.lang.perl.misc, cberry@cinenet.net (Craig Berry) writes:
: :I can't use
: :it (for example) on my old brain-dead DOS box, where I do a good deal of
: :Perl development.  

: Whose fault is that one, again?

Oh, sure, if everybody used Unix for everything there'd be no problem, but
one of the advantages of Perl is that it's supposed to be cross-platform.

--Art

National Ska/Reggae Calendar: www.ziplink.net/~upsetter/ska/calendar.html
        Boston Ska Home Page: www.ziplink.net/~upsetter/ska/index.html



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

Date: 6 May 1998 20:37:15 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Ever Wonder Why Not Everyone Uses Modules?
Message-Id: <6iqhlr$8gs$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Craig Berry
<cberry@cinenet.net>],
who wrote in article <6iqepc$o71$5@marina.cinenet.net>:
> And, by the way, while CPAN.pm is great, it's not a cure-all.  I can't use
> it (for example) on my old brain-dead DOS box, where I do a good deal of
> Perl development.  I have spent far too much time trying to find (say)

Which part does not work?  Spawning lynx to get the stuff?

Ilya


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

Date: Wed, 6 May 1998 13:34:26 -0700
From: Craig Berry <cberry@cinenet.net>
To: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Ever Wonder Why Not Everyone Uses Modules?
Message-Id: <Pine.GSO.3.95.980506131430.23850A-100000@hollywood.cinenet.net>

[courtesy cc of this posting sent to cited author via email]

On Wed, 6 May 1998, Tom Christiansen wrote:

> In comp.lang.perl.misc, cberry@cinenet.net (Craig Berry) writes:
> :I can't use it (for example) on my old brain-dead DOS box, where I do a
> :good deal of Perl development.  
> 
> Whose fault is that one, again?

OK, before I go ballistic, let me take several deep breaths and ask what
you are refering to by 'that'.

Whose fault is it that CPAN.pm doesn't work under a Win3.1 winsock net
connection?  The many authors of DOS and Windows, the marketing forces
that kept DOS evolutionarily distinct from Unix, and so forth.

Whose fault is it that I do a good deal of Perl development on a Win3.1
486 box?  My own, I guess...I really should've sunk a few thousand dollars
into upgrading my hardware, rather than putting food on the table and
caring for sick family members.  My mistake.  But the money I'm making off
my after-hours Perl work is going into the upgrade fund (some of it,
anyway), so I can stop offending the Perl Gods with my loathesome and
inadequate system.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."



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

Date: 6 May 1998 20:45:17 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Ever Wonder Why Not Everyone Uses Modules?
Message-Id: <6iqi4t$cav@fridge.shore.net>

Craig Berry (cberry@cinenet.net) wrote:

: And, by the way, while CPAN.pm is great, it's not a cure-all.  I can't use
: it (for example) on my old brain-dead DOS box, where I do a good deal of
: Perl development.  I have spent far too much time trying to find (say)

Sad to say it, but you've incriminated yourself here.  By calling your
box brain-dead, it's no longer the fault of CPAN or CPAN.pm -- it's
the fault of your box!

To tell you the truth, CPAN.pm works with Sarathy's Win32 *standard*
port.  I'm sure that it's called the *standard* port for a reason.
:-)  I believe that the CPAN module uses LWP instead of lynx to
retrieve things.

--
Nathan V. Patwardhan



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

Date: 6 May 1998 14:05:04 -0700
From: mcravit+usenet@mcravit.vip.best.com (Matthew Cravit)
Subject: Re: Ever Wonder Why Not Everyone Uses Modules?
Message-Id: <6iqja0$hps$1@shell3.ba.best.com>

In article <pk8T1IIelIQc092yn@netins.net>,
Brett Tabke <phdss@writeme.comm> wrote:
>mcravit+usenet@mcravit.vip.best.com (Matthew Cravit) wrote:

>Have you actually looked at what it takes to install the full
>package lately?  3-4 prerequistes plus man pages, it has grown quite

Umm...libnet has the following prerequisites:

Socket       - included with Perl 5.004_04
IO::Socket   - included with Perl 5.004_04
Data::Dumper - 123 KB when untarred and uncompressed

And, you _can_ use libnet without installing Data::Dumper; you just won't
be able to dynamically modify the stuff in Net::Config and have them saved
to disk.

/MC

-- 
Matthew Cravit, N9VWG               | Experience is what allows you to
E-mail: mcravit@best.com (home)     | recognize a mistake the second
        mcravit@net.com (work)      | time you make it.


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

Date: 6 May 1998 21:21:21 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Ever Wonder Why Not Everyone Uses Modules?
Message-Id: <6iqk8h$884$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Craig Berry <cberry@cinenet.net> writes:
:> In comp.lang.perl.misc, cberry@cinenet.net (Craig Berry) writes:
:> :I can't use it (for example) on my old brain-dead DOS box, where I do a

                                           ^^^^^^^^^^^
:> Whose fault is that one, again?
:OK, before I go ballistic, let me take several deep breaths and ask what
:you are refering to by 'that'.

    I note that that that that you question from me 
    Was that that that you uttered so unhappily.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


    "You can only measure the size of your head from the inside." --Larry Wall


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

Date: Wed, 6 May 1998 21:32:01 GMT
From: Gary L. Burnore <gburnore@netcom.com>
Subject: Re: Ever Wonder Why Not Everyone Uses Modules?
Message-Id: <gburnoreEsK15D.FE0@netcom.com>

On Mon, 04 May 1998 15:28:42 -0400
 in article <354E16EA.34EF25BA@kodak.com>
 someone claiming to be Brian Mathis <brianm@kodak.com> wrote:
: Art Cohen wrote:
: > 
: > You know, it's very annoying to reply to an (unmarked) email cc only to
: > discover that the same message was also posted to the group. Doesn't your
: > newsreading software give you an option to put "posted and mailed" at the
: > top of the message?
: [...]
: > --Art

: I'm sorry for the inconveinence.  I usually send an email reply, as well
: as a newsgroup one, for courtesy of the original poster.  Many people
: post questions, and often time an email response gets to them much
: faster than waiting for a usenet reponse to propagate through the
: system.  Quit your whining, it's not like you were spammed or anything.


Emailing when posting is oine of the rudest things you can do.  It IS
like being spammed "or something".  If you email, don't post. If you
post, don't email. Unless of course it's REQUESTED of you.  Just because 
you like to do it or "usually" do it, doesn't make it right.

Telling someone to "quit whining" when they mention they'd rather not
receive email from you when you post is simply stupid.

--
     for i in databasix netcom primenet ; do ; gburnore@$i.com ; done
---------------------------------------------------------------------------
                  How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore                       |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DataBasix                             |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
spamgard(tm): zamboni                 |  ][3 3 4 1 4 2  ]3^3 6 9 0 6 9 ][3
http://www.databasix.com              |     Official Proof of Purchase
===========================================================================


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

Date: Wed, 6 May 1998 22:23:23 +0100
From: Andy Armstrong <andy@wonderworks.co.uk>
Subject: Re: Ever Wonder Why Not Everyone Uses Modules?
Message-Id: <h5jrXGALTNU1Ew6w@wndrwrks.demon.co.uk>

In article <Pine.GSO.3.95.980506131430.23850A-
100000@hollywood.cinenet.net>, Craig Berry <cberry@cinenet.net> writes
>[courtesy cc of this posting sent to cited author via email]
>
>On Wed, 6 May 1998, Tom Christiansen wrote:
>
>> In comp.lang.perl.misc, cberry@cinenet.net (Craig Berry) writes:
>> :I can't use it (for example) on my old brain-dead DOS box, where I do a
>> :good deal of Perl development.  
>> 
>> Whose fault is that one, again?
>
>OK, before I go ballistic, let me take several deep breaths and ask what
>you are refering to by 'that'.

Why would you go ballistic? Perl is free and the source is available. If
it doesn't support your preferred platform why not port it? If you're
not prepared to do that who do you expect to do it for you?

>Whose fault is it that CPAN.pm doesn't work under a Win3.1 winsock net
>connection?  The many authors of DOS and Windows, the marketing forces
>that kept DOS evolutionarily distinct from Unix, and so forth.

What am I missing here? What are your grounds for complaining? This
stuff is *free*. If you don't like the way it works then fix it and
contribute something back to the community which gave you the free stuff
in the first place.

>Whose fault is it that I do a good deal of Perl development on a Win3.1
>486 box?  My own, I guess...

Well, frankly, yes. It's certainly the not the fault of anyone else
here. There's a whole raft of commercial software you can't run on that
system either -- are you complaining to Adobe, Microsoft et al?

In fact you could run Linux on this 'brain-dead' system; then you could
run the latest Perl.

>I really should've sunk a few thousand dollars
>into upgrading my hardware, rather than putting food on the table and
>caring for sick family members.  My mistake.  But the money I'm making off
>my after-hours Perl work is going into the upgrade fund (some of it,
>anyway), so I can stop offending the Perl Gods with my loathesome and
>inadequate system.

Get real. Maybe you'd like some cash with your free software?

-- 
** Don't CC any follow-ups to me - I *do* read the newsgroups I post to **
Andy Armstrong, Wonderworks, http://www.wonderworks.co.uk


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

Date: 6 May 1998 21:45:22 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Ever Wonder Why Not Everyone Uses Modules?
Message-Id: <6iqlli$aqv$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Gary L. Burnore <gburnore@netcom.com> writes:
:Emailing when posting is oine of the rudest things you can do.  It IS
:like being spammed "or something".  If you email, don't post. If you
:post, don't email. 

Funny, I get thank-you letters about it all the time.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

You have to admit that it's difficult to misplace the Perl sources.  :-)
		--Larry Wall in <1992Aug26.184221.29627@netlabs.com>


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

Date: Wed, 06 May 1998 21:54:02 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Ever Wonder Why Not Everyone Uses Modules?
Message-Id: <pudge-0605981752090001@192.168.0.3>

In article <6iqg79$9t3@fridge.shore.net>, Art Cohen <upsetter@shore.net> wrote:

# Oh, sure, if everybody used Unix for everything there'd be no problem, but
# one of the advantages of Perl is that it's supposed to be cross-platform.

Not everything about Perl is or can possibly be fully cross-platform. 
When you give up hope, you'll feel a lot better (write it down).

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
MacPerl: Power and Ease (ISBN 1881957322), http://www.ptf.com/macperl/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: 6 May 1998 21:40:28 GMT
From: wayne@Glue.umd.edu (Wayne C. McCullough)
Subject: exists and -w messages
Message-Id: <6iqlcc$2id$1@hecate.umd.edu>

Whenever I use an exists command on a hash entry, and the
command turns false, I get a warning if I have -w on.  I
understand the logic, but is there a way to supress that without
turning off -w?  

I mean, I am checking, not useing the value, just to make sure I 
don't get an error later, so why bitch when I check?

Ok, maybe it is hopeless.

W


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

Date: 6 May 1998 17:28:49 GMT
From: David La Croix <dlacroix@cray-ymp.acm.vt.edu>
Subject: Hash value length limit?
Message-Id: <6iq6kh$ane$1@dane.cslab.vt.edu>


I inherited an application that uses a hash of hashes for internal 
data storage (similar to the example I have fabricated below).

I am experiencing a phenomenon where the value appears to be truncated
at about 250 bytes.  Is this a limit or a bug?

$hash1{'key1'} = {
        subkey1 => "20",
        subkey2 => "",
        subkey3 => "Pile & Co., Boston ",
        subkey4 => "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
};


perl -v reports:

This is perl, version 5.003 with EMBED
        built under irix at Dec 18 1996 13:20:50
        + suidperl security patch

This application saves the data to a file in perl syntax (so it can be 
sucked back in by a require).  This should not be limiting the length 
of the records, right???

-- 
dlacroix@acm.vt.edu


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

Date: 06 May 1998 22:30:05 +0200
From: Gisle Aas <aas@sn.no>
Subject: Re: Help : Generating a Unicode file
Message-Id: <m3somn3zxu.fsf@furu.g.aas.no>

Sull Kidon <kdsull@softmagic.co.kr> writes:

> I need to generate a Unicode file for CJK Unified
> Ideographs (ie some 20K characters, from 4e00 to
> 9fff) to edit and comment so on after reading the
> file from NT's notepad. I simply can't cut and paste
> 20k times from NT's Unicode characters table,
> can I ?
> 
> So I need to generate a file containing 0xfffe and
> the following 20K unicode, but can't find any tip how
> to generate the binary file from my book (Teach myself
> Perl 5 in 3 weeks, tho I find it an excellent guidebook.
> That translated in Korean of course).
> 
> Shouldn't be more than 10 lines, methinks, so please
> can somebody give it a couple of minutes and make
> my life a bit easier...

If you want an UTF-16 encoded file it can easily be produced like
this:

   perl -e 'print pack("n*", 0x4e00 .. 0x9fff)'

If you want it UTF-8 encoded you should be able to use the
Unicode::String module to do the conversion before you print it.

   perl -MUnicode::String=utf16 -e 'print utf16(pack("n*", 0x4e00 .. 0x9fff))->utf8'

The Unicode::String module is available on CPAN.

-- 
Gisle Aas


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

Date: Wed, 06 May 1998 14:45:43 -0700
From: david <dstanton@airmail.net>
Subject: help wit perl in Dallas
Message-Id: <47A5D55FF34B17E9.5188470F6E909150.DCE52C35E3A45BCC@library-proxy.airnews.net>

I have a project which I think I will need some perl.  I am trying to
learn perl but I do not have the experance nor the expertize to do what
I need done.

I am wondering if there is anyone in the Dallas area that would be
willing to help me with my project.

Please feel free to contact me at my personal email if you have any
questions because it takes a long time to sort thru all the headers.

Thank you in advance for any help that you can send my way

David



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

Date: Wed, 06 May 1998 16:42:28 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: How do I get the name of each file in a dir?
Message-Id: <3550CB34.F1ACC598@matrox.com>

Aaron wrote:

> Mike Williams wrote:
> >
> > On Sun, 19 Apr 1998 12:38:42 -0500, Chocolate <poohba@io.com> wrote:
> > >How do I get the name of each file in a dir and print it?
> >
> > How about
> >
> > print `ls`;
> >
> I too have wondered about this.  I have had to resort to the above or
> also I have used $foo=`echo /some_dir/*`;
> But what if I'm on a different platform, win32?  Do we always have to
> resort to the shell to get a file list?  Hell we can chmod, chdir, mkdir
> and the like, but I can't find a "perl" command to list the files.
>
> Aaron

 Haaaa???
You're telling me that you haven't heard of opendir() ???

--
Ala Qumsieh             | "How much wood would a woodchuck
ASIC Design Engineer    |  chuck if a woodchuck could
Matrox Graphics Inc.    |  chuck wood?"
Montreal, Quebec        |             - Trivial ... 5!





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

Date: 6 May 1998 21:30:01 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: PERL aware code editor
Message-Id: <6iqkop$fvs$1@ns1.arlut.utexas.edu>

Ala Qumsieh <aqumsieh@matrox.com> writes:
> 
> EMACS is available for windows .. it is exactly the same as the UNIX EMACS.
> 
> Can't remember where I downloaded it from though .. you have to do
> your own search.

http://www.cs.washington.edu/homes/voelker/ntemacs.html

--
Stuart McDow                                     Applied Research Laboratories
smcdow@arlut.utexas.edu                      The University of Texas at Austin
  "It is obvious that about 750,000 people ago, Austin was a wonderful City."


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

Date: Wed, 06 May 1998 15:01:38 -0500
From: Ricky <webmaster@apartmentzone.com>
Subject: problem with cat
Message-Id: <3550C1A1.5AE7BE0@megsinet.net>

i'm trying to switch isp's and i'm having problem's getting the cgi
stuff to work.  here's the problem.  i grabbed this from the mouse book
a while back:

sub cat{

     open (FILE, "/usr/bin/cat  $_[0] |") || die "error opening pipe!";

     while (<FILE>) {
      print;
     }

}


so i've been doing something like this. . .

&cat("header.cat");

 . . . to grab headers and footers to build html pages on the fly.
unfortunately, it doesn't work on the new server.  i talked to the tech
support and they said that they don't have the old version of perl.
isn't this supposed to work on perl 5?  is there an equivalent
alternative?  can i use exec( ) to spawn a process that will invoke
/usr/bin/cat ?

if anyone can help me, i would greatly appreciate it.  i'd hate to
hardcode the headers and footers.

thanks in advance

ricky



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

Date: Wed, 06 May 1998 16:58:56 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: problem with cat
Message-Id: <comdog-ya02408000R0605981658560001@news.panix.com>
Keywords: from just another new york perl hacker

In article <3550C1A1.5AE7BE0@megsinet.net>, Ricky <webmaster@apartmentzone.com> posted:

>i'm trying to switch isp's and i'm having problem's getting the cgi
>stuff to work.  here's the problem.  i grabbed this from the mouse book
>a while back:
>
>sub cat{
>
>     open (FILE, "/usr/bin/cat  $_[0] |") || die "error opening pipe!";


how about

   open(FILE, $file) or die "my error message";

   while( defined( $line = <FILE> ) ) { print $line }

you don't need the cat.

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>
looks around for Mecha-Randal


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

Date: Wed, 06 May 1998 16:16:16 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Proplem with perl script (I'm new to perl)
Message-Id: <3550C510.821EEAB0@matrox.com>

Toby Heywood wrote:

> I have just started to learn to write perl scripts, I am using the book
> Learning Perl.
>
> I have gotten upto what I have called the 5 exercise, and have been
> trying to debug my script.
>
> here is the script that I have rewritten from the book.
>
> _____________________________________ START OF CODE
>
> #!/usr/bin/perl
> @words = ("camal","llama","oyster");
> print "What is your name? ";
> $name = <STDIN>;
> chop($name);
> if ($name eq "Toby") {
>         print "Hello, Toby! Back here again? oh well, have fun!\n";
> } else {
>         print "Hello, $name!\n"; # Ordinary greeting
>         print "What is the secret word? ";
>         $guess = <STDIN>;
>         chop($guess);
>         $i = 0; # Try this first
>         $correct = "maybe"; # is the guess correct or not?
>         while ($correct == "maybe") { # is the guess correct or not?
>

                                    ^^^^^^Hmmm ... (eq??)

>              if ($words[$i] eq $guess) { # right?
>                      $correct = "yes"; # Yes!
>              } elsif ($i < 2) { # more words to look at?
>                      $i = $i + 1; # look at the next word next time
>              } else { # no more words, must be bad
>                      print "Wrong, try again.  What is the secret word?
> ";
>                      $guess = <STDIN>;
>                      chop($guess);
>                      $i = 0; # start check from the beginning
>              }
>         } # end of while not correct
> } # end of "not toby"
>
> ________________________________________________ END OF CODE
>
> Anyway, I used the the -w flag for trying to debug the script, and all I
> keep getting is this message.  I'm now stuck, and would be grateful if
> you can help.
>
> Argument "yes" isn't numeric in eq at perl_exercise_5 line 16, <STDIN>
> chunk2.
> Argument "maybe" isn't numeric in eq at perl_exercise_5 line 16, <STDIN>
> chunk2.
>

BINGO! Your argument isn't numeric :) Check out the difference between eq and == . That should put you on the right track.
Don't worry, professional programmers fall into this trap over and over again!

> Thanks in advance!
> --
> Toby Heywood <toby@he-net.demon.co.uk>
> Proprietor, Heywood Enterprises
> ----------------------------------------
> Website - http://www.he-net.demon.co.uk/
> ----------------------------------------
>
>                                                   ------------------------------------------------------------------------
>
>   Toby Heywood <toby@he-net.demon.co.uk>
>   Proprietor
>   Heywood Enterprises
>
>   Toby Heywood
>   Proprietor           <toby@he-net.demon.co.uk>
>   Heywood Enterprises  HTML Mail
>                        Netscape Conference Address
>                        Netscape Conference DLS Server
>   Additional Information:
>   Last Name     Heywood
>   First Name    Toby
>   Version       2.1

Enjoy,

--
Ala Qumsieh             | "How much wood would a woodchuck
ASIC Design Engineer    |  chuck if a woodchuck could
Matrox Graphics Inc.    |  chuck wood?"
Montreal, Quebec        |             - Trivial ... 5!





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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

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

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