[8240] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1857 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 11 09:15:25 1998

Date: Wed, 11 Feb 98 06:01:09 -0800
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, 11 Feb 1998     Volume: 8 Number: 1857

Today's topics:
    Re: Binary Search Trees (Matija Grabnar)
    Re: Counter problem - resets (Stephen P. Clouse)
        Downloading multiple files via CGI <eggbert.pad@sni.de>
    Re: Fork/Threads (M.J.T. Guy)
    Re: garbage collection in perl <dformosa@st.nepean.uws.edu.au>
        Help with code.........!! (asdf)
        How to get disk's volume label under Win95? <spam@patriot.net>
        Learning Perl <kaddba@nedernet.nl>
    Re: Padding out a string <tchrist@mox.perl.com>
    Re: Padding out characters (Craig Berry)
    Re: Padding out characters <tchrist@mox.perl.com>
        Periodically check for lost-carrier (NT4) <jaybird612@frootloops.prodigy.net>
    Re: Perl For Win32 <jaybird612@frootloops.prodigy.net>
    Re: Permission Help!! <dlong@null.net>
    Re: RFC about ``Matt's Script Archive'' (Bart Lateur)
    Re: RFC about ``Matt's Script Archive'' <tchrist@mox.perl.com>
    Re: Seriously Off Topic, but a Common Complaint/Problem (Matija Grabnar)
    Re: Sharing variables between scripts scott@softbase.com
    Re: strange split behaviour <ahartman@geolin5.geophys2.uni-bremen.de>
    Re: Syntax-coloring editor for NT scott@softbase.com
    Re: Syntax-coloring editor for NT scott@softbase.com
    Re: Text databases.  Was: Should I stock up on food and (cory hamasaki)
    Re: Text databases.  Was: Should I stock up on food and (T.S. Monk)
        Web page does not display all output of cgi !!!!! <etlndh@etlxdmx.ericsson.se.not>
    Re: Year 2000 Compliance: Lawyers, Liars, and Perl (M.J.T. Guy)
    Re: Year 2000 Compliance: Lawyers, Liars, and Perl (Bart Lateur)
    Re: Year 2000 Compliance: Lawyers, Liars, and Perl (Bart Lateur)
    Re: Year 2000 Compliance: Lawyers, Liars, and Perl (Phil Barnett)
    Re: Year 2000 Compliance: Lawyers, Liars, and Perl (Daniel P. B. Smith)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 11 Feb 1998 13:17:22 GMT
From: matija@rzenik.arnes.si (Matija Grabnar)
Subject: Re: Binary Search Trees
Message-Id: <6bs8d2$kbl$1@kanja.arnes.si>

In article <6bpul1$ibb$1@csnews.cs.colorado.edu>,
Tom Christiansen  <tchrist@mox.perl.com> wrote:
>To test this, I've made several benchmarks.  All work on the 
>same datafile containing 100000 random (but distinct) words
>out of a very large version of /usr/dict/words.

Thank you for a very interesting and detailed analysis.
Without impuning your results in any way, let me just point out, that there
is a case where trees or other "kept sorted" methods come in handy:
when your elements arrive one by one (with noticable intervals between 
arrivals), but you need your results in a bunch (or need the top N for some 
reason.)

Granted that in most applications, data comes in all at once, and leaves all 
-- 
"My name is Not Important. Not to friends. 
    But you can call me mr. Important"  - Not J. Important 
Matija.Grabnar@arnes.si


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

Date: Wed, 11 Feb 1998 08:05:43 GMT
From: stephenc@granddesign.com (Stephen P. Clouse)
Subject: Re: Counter problem - resets
Message-Id: <34e45b95.14629233@news2.kc.net>


Hash: SHA1

On Tue, 10 Feb 1998 20:51:24 -0800 in message <<34E12E4C.26D4@idi-ut.com>
comp.lang.perl.misc>, "Doug Munn (Technical Wizard)" <doug@idi-ut.com> wrote:

>I'm having a horrible problem with a counter file resetting every few
>days.  Originally, I just read the galcntr file, updated then rewrote
>the file.  Then I declared the variable, thinking that some memory might
>be getting stomped, then I tried locking the file.
>
>The code is below:
>
>$galcnt=0;
>open (GALCNTRIN, "cgi-bin/galcntr");
>flock (GALCNTRIN, 2);
>$galcnt = <GALCNTRIN>;
>close GALCNTRIN;
>flock (GALCNTRIN, 8);
>$galcnt++;
>open (GALCNTROUT, ">cgi-bin/galcntr");
>flock (GALCNTOUT, 2);
>print GALCNTROUT $galcnt;
>close GALCNTROUT;
>flock (GALCNTROUT, 8);

Well, my semi-trained eye spots several problems in this script.  First, you're
not checking any return values from the system calls (open, flock, close), so
you'd never know if an error was occuring.  Secondly, you're incrementing the
counter while the file is closed and thus unlocked...this is not good.  You need
to keep the counter file locked the whole time you're using it.

I wrote this little Counter.pm module to handle counters like this for me. 
(Yes, I know CPAN lists a module called File::CounterFile that does this, but I
DARE you to find it.)  There's pod documentation at the end, although the module
is pretty straightforward.

I hope this is a nice start to Take 2 in this newsgroup for me (first time I'm
sure I sent several people to mental institutions due to my inaneness, hopefully
I'll never be that lame again :)

Steve

- - -- 
Stephen P. Clouse -- stephenc@granddesign.com
Grand Design, Inc. (http://www.granddesign.com) -- Quality Business Web Design
PGP-Encrypted E-Mail Preferred (Key available at www.granddesign.com/~stephenc)

(module starts here)
package Counter;
require 5.004;
use Fcntl;
use FileHandle;

    sub new {
        my $proto = shift;
        my $class = ref($proto) || $proto;
        my $self = {};
        $self->{'filename'} = shift;
        $self->{'count'} = 0;
        if ($self->{'filename'}) {
            my $fh = new FileHandle;
            $self->{'fh'} = $fh;
            sysopen($fh, $self->{'filename'}, O_RDWR|O_CREAT, 0600) || die \
"Couldn't open counter file $filename: $!";
            flock($fh,2) || die "Couldn't exclusive lock counter file: $!";
            select((select($fh), $| = 1)[0]);
            $self->{'count'} = <$fh>;
        }
        bless ($self, $class);
        return $self;
    }
    sub set {
        my $self = shift;
        my $value = shift;
        $self->{'count'} = 0 + $value if $value;
        return $self->{'count'};
    }
    sub increment {
        my $self = shift;
        my $increment = $_[0] || 1;
        $self->{'count'} += $increment;
        return $self->{'count'};
    }
    sub DESTROY {
        my $self = shift;
        return 0 unless $self->{'filename'};
        seek($self->{'fh'},0,0) || die "Couldn't seek counter file: $!";
        truncate($self->{'fh'},0) || die "Couldn't truncate counter file: $!";
        print {$self->{'fh'}} $self->{'count'};
        close($self->{'fh'});
        return 0;
    }

1;

__END__

=head1 NAME

Counter - simple object class to implement a numeric counter

=head1 SYNOPSIS

    use Counter;
    $foo = Counter->new();

    use Counter;
    $foo = Counter->new('/home/mydir/count');

=head1 DESCRIPTION

The Counter module implements a simple numeric counter routine in an
object.  It can work either with a stored counter file on disk or
completely in memory.

=head1 REQUIREMENTS

Perl 5.004 (although it probably works with an older version, feel free
     to give it a shot)
The Fcntl and FileHandle modules, both part of the standard Perl 5
     distribution.

=head1 USAGE

=head2 new

The new call creates a new counter.  If given a parameter pointing to a
file, the counter will be stored on disk in the given file.  Without a
parameter, the counter will be stored in memory only and will vanish when
the program ends or the object variable otherwise goes out of scope.

The file will be locked using Perl flock().  Obviously you only want one
instance at a time accessing the counter file.

=head2 set

The set call sets the counter to an arbitrary number.  It returns the new
value of the counter.  If no parameter is given the current value of the
counter is returned.

=head2 increment

The increment call adjusts the current counter value by the value in the
given parameter.  The parameter may be negative to effect a decrement.
If no parameter is given increment defaults to +1.  The call returns the
new value of the counter.

=head1 EXAMPLE

use Counter;
$foo = Counter->new('count.dat');
print $foo->set(50), "\n";
print $foo->increment(), "\n";
print $foo->increment(-10), "\n";
print $foo->increment(5), "\n";

This should print on screen:

50
51
41
46

The file "count.dat" in the current directory should also contain "46".

=head1 AUTHOR/REDISTRIBUTION

Copyright (C) 1998 Stephen P. Clouse <stephenc@granddesign.com>.  This
module is free for use for commercial or non-commercial purposes.  You
may redistribute this module or modified versions thereof as long as
this copyright remains intact and any modifications by you are noted as
such.  No warranties.  No refunds.  No shirt, no shoes, no service.

=head1 CAVEATS/GENERAL WEIRDNESS

The script assumes all your input is numeric and that you are bright
enough to pass only numeric data to it.  In case it isn't or you aren't,
your string evaluates to zero, which is the standard Perl response in
a numeric function.

The original intent was a basic integer counter, like a Web page thingy,
but there's nothing to stop you from using floats with it.

It seems fairly fault-tolerant, but I wouldn't recommend this for a
nuclear reactor.   Like a nuclear reactor has any use for this anyway.

=cut


Version: PGP for Business Security 5.5

iQA/AwUBNOFbwmOLD55Fj/ZkEQIW2QCg9iMp+SP2hZBI1nBvWVIyKygpt08An2Bn
IF+stC/sc87p2DFHsaxYZO6c
=igMZ
-----END PGP SIGNATURE-----



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

Date: Wed, 11 Feb 1998 10:30:14 +0100
From: Jochen Luig <eggbert.pad@sni.de>
Subject: Downloading multiple files via CGI
Message-Id: <34E16FA5.1699BE81@sni.de>

Hello!

I'm trying to download multiple files with a perl script. The files are
supposed to be specified by a checklist in an HTML-form.
I have in mind something like this:

foreach $key (keys %input)
{
    if ($input{$key} eq 'on')
    {
        # download the file associated with $key
    }
}

As I aim at downloading multiple files this can't be done by a simple
redirection (At least it seems like that).
Can anyone help me or point me to a module that will help me do the job?

Thanks in advance

Jochen



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

Date: 11 Feb 1998 10:00:06 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Fork/Threads
Message-Id: <6brsr6$4m3$1@lyra.csx.cam.ac.uk>

 <patrick@cre8tivegroup.com> wrote:
>This is the basic flow....
>
>open a log file.
>print an intro message to the log file.
>concurrently examine all sites, writing results to the log file.
>print concluding message to log file.
>close log file.
>
>I've tried fork() from the Camel book, but it forks the entire script, and not
>just the code I want it to (I get the intro message multiple times). I know
>threads are going to be part of 5.005,  but I want to "fake" implementation
>now.

You must flush all output filehandles before forking.   Otherwise, the
intro message will be sitting in a buffer which gets duplicated in
each child.


Mike Guy


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

Date: 11 Feb 1998 12:55:26 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: garbage collection in perl
Message-Id: <887201686.385546@cabal>

In <6bp1re$7k$2@marina.cinenet.net> cberry@cinenet.net (Craig Berry) writes:

[...]

>Also, Perl never returns any
>memory to the OS (it keeps it in a pool for reuse instead),

Is this a perl thing or an OS thing?

--
Please excuse my spelling as I suffer from agraphia see the url in my header. 
Never trust a country with more peaple then sheep. 
Support NoCeM http://www.cm.org/                   
I'm sorry but I just don't consider 'because its yucky' a convincing argument


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

Date: 11 Feb 1998 09:44:25 GMT
From: you@somehost.somedomain (asdf)
Subject: Help with code.........!!
Message-Id: <6brrtp$pkv@argentina.earthlink.net>

I am having problems understanding the mechanics of the following code:

@movies=('Casablanca', 'Star Wars', 'Buttfuck', 'Jerkoff');
@choices=();

unshift (@movies, "return of the jedi");


for ($letter='a'; $letter lt 'k'; $letter++)
{print "$letter";}

print "\n\n";

for ($i=0; $i<=4; $i++)
{print "Movie number $i is $movies[$i] \n";}
print "\nHow many people are there in your party? ";
chomp ($num=<>);

for ($i=1; $i <= $num; $i++)
{print "What movie would you like to see, person #$i? ";
chomp ($choice=<>);
push(@choices, $choice);
}
print "\nfor your party of $num:\n";

for ($i=0; $i<$num; $i++)
{print 'Person ', $i+1, " would like to see $movies[$choices[$i]], \n";
}

--------->The problem is with the "like to see $movies[$choices[$i]], \n";"
code.  I dont understand how the $movies[$choices[$i]] works exactly...any
help would be appreciated.

Sean



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

Date: Wed, 11 Feb 1998 07:26:32 -0500
From: Jim <spam@patriot.net>
Subject: How to get disk's volume label under Win95?
Message-Id: <34E198F8.B40556D1@patriot.net>

I've searched through the FAQ's that seemed appropriate, CPAN, and
message boards for references to disk labels and found nothing.

I am writing a script that needs to read the volume label from a
floppy disk (or any disk, for that matter), but I am too stupid to
figure out how to do it nor can I find any function (perlfunc),
module (CPAN, ...) that does it.

Q:  How can I get a Win95 (DOS or NT) disk volume label in a Perl
    script?

TIA, RTFM is fine with reference.
Feel free to CC: sender 
-- 
Change 'spam' to 'koke' in return email address.


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

Date: Wed, 11 Feb 1998 11:06:51 +0100
From: kees <kaddba@nedernet.nl>
Subject: Learning Perl
Message-Id: <34E1783B.1339B430@nedernet.nl>

I am implementing Software Configuration Management with ClearCase (and
DDTS and Guide, eventually). These tools include Perl as language for
automating functions and extending functionality.

So what? Well, I want to use Perl (version 4), and I want to get to know
it quickly. But without a decent introduction I tend to get lost in the
complete syntax guides, I'm not a C programmer. Is there a good
introduction course or book to show me the 'getting started' part of
using Perl 4.

I have to use Perl 4 because Rational supports the use of it with
ClearCase (and my managers require support ;-).

BTW, I am not so familiar with C (I'm a Fortran and Pascal engineer)

Jan Oudman
J.Oudman@ap.kadaster.nl.net (Text only messages)
jano@tip.nl (anything else)




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

Date: 11 Feb 1998 13:46:20 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Padding out a string
Message-Id: <6bsa3c$l5o$2@csnews.cs.colorado.edu>

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

Using that paragon of idiocy that permitted and encouraged him to send
his message not once, twice, or even thrice, but rather four times,
the execrable Microsoft Outlook Express 4.72.2106.4 let "Tan Aksoy"
<tan@morline.com> write in quadruplicate in comp.lang.perl.misc:

:How would I pad out a string with extra characters?
:
:e.g. I have the number 10 but would like to represent it as a 6-digit
:number/string i.e. 000010.
:
:Is there a command that will do this or should I write a little algorithm?

You mean like printf?  Maybe sprintf?  Did you not get clues from 
perlfaq4's entry on rounding numbers?  Did you even look?  Why did
you post this message four times?

You mean like printf?  Maybe sprintf?  Did you not get clues from 
perlfaq4's entry on rounding numbers?  Did you even look?  Why did
you post this message four times?

You mean like printf?  Maybe sprintf?  Did you not get clues from 
perlfaq4's entry on rounding numbers?  Did you even look?  Why did
you post this message four times?

You mean like printf?  Maybe sprintf?  Did you not get clues from 
perlfaq4's entry on rounding numbers?  Did you even look?  Why did
you post this message four times?

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

*bp++ = i;      /* now go back to screaming loop */
    --Larry Wall, from perl/sv.c in the v5.0 perl distribution


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

Date: 11 Feb 1998 08:35:48 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Padding out characters
Message-Id: <6brnt4$39a$1@marina.cinenet.net>

Tan Aksoy (tan@morline.com) wrote:
: Is there a Perl command that will allow padding of characters?
: 
: e.g. If I have 10 then I would like this to be represented as a 6-digit
: string i.e. 000010
: 
: Otherwise I would have to write a simple algorithm.

I was going to answer, until I noticed you'd posted this same question 
five separate times over the course of a few minutes.  What's the deal?  
Asking once gets the job done; more than that moves into spammage.

---------------------------------------------------------------------
   |   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: 11 Feb 1998 13:47:39 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Padding out characters
Message-Id: <6bsa5r$l5o$3@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, "Tan Aksoy" <tan@morline.com> writes his message
a fifth time. A fifth time?  *FIVE TIMES*  WTF?  Throw out your
piece of crap sorry excuse for a newsreader.  Use rn or something 
sane.

And go read the FAQ.
And go read the FAQ.
And go read the FAQ.
And go read the FAQ.
And go read the FAQ.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
    Does the same as the system call of that name.
    If you don't know what it does, don't worry about it.
            --Larry Wall in the perl man page regarding chroot(2)


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

Date: Wed, 11 Feb 1998 03:29:58 -0600
From: "Jay J" <jaybird612@frootloops.prodigy.net>
Subject: Periodically check for lost-carrier (NT4)
Message-Id: <6brqn5$2sm2$1@newssvr08-int.news.prodigy.com>

Unfortunately I'm having difficulties getting Apache (RH5 Build) to allow me
to run CGI, so I opted to install Omni HTTPd for NT after a revelation from
a NG post that said Perl would read output from an HTML form as <STDOUT>.

Admittedly this is 9 chapters ahead of where I'm at in my Waite Group/Perl 5
book.

But regardless:

I've written a script that uses a number of <ahem> system calls to NT to
resolve my current dynamic-IP address (regex from ipconfig), if offline use
rasdial to make the connection, then "get" an index file from my provider's
"home page" space (ftp -s:), s/$oldip/$dynip/ the JavaScript reDirect(),
then "put" the index file back.

So in essence - I can serve from home with a dynamic-IP, when I'm offline I
run a script to swap an index file on the server that doesn't redirect.

While this works great and proved to be a very valuable learning experience
(while somewhat frivolous), it might be nice to periodically check for a
carrier, if lost - redial and run the whole script over again.

Any ideas?

-Jay J

jaybird612@prodigy.net <--- hapless victim of marketing scheme (19.95 is
19.95 is 19.95)

p.s. anyone who takes pity on me for my problems w/Apache, free advice is
gladly accepted...




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

Date: Wed, 11 Feb 1998 03:39:46 -0600
From: "Jay J" <jaybird612@frootloops.prodigy.net>
Subject: Re: Perl For Win32
Message-Id: <6brr9g$16pc$1@newssvr08-int.news.prodigy.com>

I'm not an expert but, steer clear of your browser for now..(look at recent
posts on running CGI for Win32 build/editing the registry)

from the command-line ---> perl myscript.pl

It's asking you to save-to-disk because no program is associated with the
 .pl extension.

If that script were intended to run as a CGI it would contain a statement
like: print "Content-type: text/html\n\n";

Sixto Becerra wrote:
>I just started to learn about perl for Win32.
>I installed a version 5 copy in a directory c:/perl
>I also place the file CGI.PM in the bin directory, all files with
>extension *.pl
>are associated with perl.exe but I can not get any of the examples that
>came with the book to work.  the example supposet to take the user first
>name and last, display thank you notice and save the information in a
>*.txt file.  When I run it the browser wants me to "save to disk"
>instead or displaying the greetings and vaving it to the specified file.




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

Date: Wed, 11 Feb 1998 16:31:04 -0600
From: Dustin Long <dlong@null.net>
To: Alex Oliva <aoliva@uspe.com>
Subject: Re: Permission Help!!
Message-Id: <34E226A8.22DF9C5B@null.net>

Alex,

It's likely that you can't do server-parsed (shtml) documents
from perl.  Your perl script, generally, doesn't get interpreted
by Apache/NCSA/whatever before it goes out the port.

In other words, you can issue commands to your web server
(Apache!) like this:

<!--#include file="top.txt" -->

Apache sees the command and reads the file in before it
sends the text out the port.  Often, to make Apache "pay
attention" to these little doodads, you have to call them
 .shtml instead of .html.

You can also write nifty perl scripts that make pages on the
fly.  But since the print statements from perl aren't getting
interpreted by Apache, the commands that work up above
fly out the port unnoticed, and get interpreted by your browser
as a comment.

If you want to do "server includes" from perl, you can do
something like this:

open(FHANDLE, "<top.txt") || die('File top.txt not found');
print $_ while defined($_ = <FHANDLE>);
close(FHANDLE);


hth!

Dustin Long
dlong@null.net
Texas A&M University

Alex Oliva wrote:

> OK... I am at wits end! :)
>
> I am creating an .shtml file via a perl based cgi script.
> The directory the file is being written to has permissions of 777.
> Since I have a server side include, I use a `chmod 755` inside my
> perl script to change the permission of the subdir the .shtml file is
> being accessed from. The problem is I STILL get the
>
> "404 - document not found or INSECURE" error message.
>
> It's obvious that even though I changed my permission to 755, it still
> won't let me run the SSI file (it runs NON SSI html files fine).
>
> Is there something I'm missing here? Also, I can't seem to DELETE the
> subdir via FTP if I have set the permissions from within the perl
> script.
>
> Your help would be GREATLY appreciated... thanks!!
>
> Please respond to aoliva@uspe.com





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

Date: Wed, 11 Feb 1998 10:26:16 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: RFC about ``Matt's Script Archive''
Message-Id: <34e97914.3886877@news.tornado.be>

Tom Christiansen <tchrist@mox.perl.com> wrote:

>In comp.lang.perl.misc, palincss@nicom.com writes:
> Why, oh why has Matt not done that yet?
>
>Bad programmer, or evil.  Take your pick.

Bad? No. Somebody who can build a project like this, all on his own,
isn't a bad programmer. Merely a sloppy one.

    Bart.
-
        'D*mn!', said Carrot, a difficult linguistic feat.
           -- Terry Pratchett, "Feet of Clay"


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

Date: 11 Feb 1998 13:41:41 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: RFC about ``Matt's Script Archive''
Message-Id: <6bs9ql$l5o$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, bart.mediamind@tornado.be (Bart Lateur) writes:
:Bad? No. Somebody who can build a project like this, all on his own,
:isn't a bad programmer. Merely a sloppy one.

You'd think he'd have the good sense now to display his
dirty laundry in public then.

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

I'm a programmer: I don't buy software, I write it.
    --Tom Christiansen


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

Date: 11 Feb 1998 13:51:13 GMT
From: matija@rzenik.arnes.si (Matija Grabnar)
Subject: Re: Seriously Off Topic, but a Common Complaint/Problem in this NG
Message-Id: <6bsach$l1p$1@kanja.arnes.si>

In article <6br0d7$8jc$1@news.ml.com>,
Michael Wang <mwang@alhena.ibk.ml.com> wrote:
>trn is very hard to build since it does not include inews. 
Huh? The last time I built trn, it did so include inews.

Check out trn4.0 beta
at ftp.clari.net:/private/trn/

-- 
"My name is Not Important. Not to friends. 
    But you can call me mr. Important"  - Not J. Important 
Matija.Grabnar@arnes.si


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

Date: 11 Feb 1998 12:45:19 GMT
From: scott@softbase.com
Subject: Re: Sharing variables between scripts
Message-Id: <6bs6gv$a3i$4@mainsrv.main.nc.us>

Brian M. Beaulieu (banman@execpc.com) wrote:
> and i have script1.pl, script2.pl etc ..
> and I want to use variables.pl in script#.pl .. sharing the variables..
> sort of like sharing a sub{}; in between scripts.. 
> Sounds like it can't be done.. but thanks for your help.

Use a relational database. You can share variables in tables.

Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more. 


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

Date: 11 Feb 1998 11:15:19 +0100
From: Andreas Hartmann <ahartman@geolin5.geophys2.uni-bremen.de>
Subject: Re: strange split behaviour
Message-Id: <opafby5txk.fsf@geolin5.geophys2.uni-bremen.de>

Shame on me!

I found out. There were some remnants of an older version of Perl 
(Perl 4.something) not properly removed. My link pointed to the wrong
binary. 

Sorry to have bothered you.

Andy.

-- 
***********************************************************************
Andreas Hartmann                mailto:ahartman@geophys2.uni-bremen.de 
Department of Geoscience        http://gphsrv1.geophys2.uni-bremen.de/
University of Bremen
***********************************************************************


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

Date: 11 Feb 1998 12:36:33 GMT
From: scott@softbase.com
Subject: Re: Syntax-coloring editor for NT
Message-Id: <6bs60h$a3i$2@mainsrv.main.nc.us>

Eric Bohlman (ebohlman@netcom.com) wrote:

> In all but the smallest business, the people making the decisions about
> what software to buy are *not*, for the most part, the people who will be
> *using* that software.

One could make an equally compelling argument that the people using
general purpose software aren't qualified to make such a decision. :)
At least not the ones I've met :) We're talking people who are amazed
when you show them how cut and paste works here.

Anyway, this situation is hardly the fault of the free market
or Microsoft that the organization of companies is such that
bad decisions are made. Any company could gain a competitive
advantage by allowing more qualified people to select the tools
which are used, thus improving productivity and the amount of work
performed per person. Were a company to provide a better alternative
to Microsoft software, and it catch on as a more productive
way to get work done, then that company would do well. Perl for
Windows is an example of this, even though it is not a commercial
product. Word is slowly beginging to spread that Perl is a better
way to do system administration. People are using it rather
than other languages.

Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more. 


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

Date: 11 Feb 1998 12:44:12 GMT
From: scott@softbase.com
Subject: Re: Syntax-coloring editor for NT
Message-Id: <6bs6es$a3i$3@mainsrv.main.nc.us>

Here are some more interesting points:

> Microsoft IS screwing the rest of us.  The "free market" does not 
> exist in the presence of a monopoly.  Microsoft does not have 
> competitors, at least not any that last.

I maintain that Microsoft's competition is and has been
so incompetent that Microsoft has succeeded in all markets other
than operating systems by *default*, just by being the least
bad choice and looking like they'll be viable in 5 years.
For more information about this, read my essay
Microsoft: Truth vs Monopoly at http://www.skwc.com/essent/mstruth.html
which has a summary of my thoughts on the issue.

I also maintain Microsoft is *NOT* a monopoly at all. They
have a commanding share of the market because the alternatives
are so awful. Microsoft has many rival Intel platform OSes:
OS/2, Linux, Solaris, and more. 

> They use underhanded 
> legalisms, lies, marketing, and their unique position in the economy 
> to destroy any competitors that might dare to oppose them.

I see this acusation a lot, but I have found very little evidence of
it.  Most of the times this is alleged, the competitior to Microsoft
has done itself in through bad business decisions. Some
competitiors have actually shared their trade secrets with MS!
Not smart. And then there's the case study of the fall of Lotus,
a sad and pathetic story about how one of the best software
houses was ruined.

> Most consumers are stupid.

That explains the ongoing viability of a magazine like Consumer
Reports, anyway :) Perhaps they are, but most *people* are
stupid, in the sense that they rarely make consciously directed
informed decisions about *anything* at all.

> There is a difference between the need to eat and the desire to get rich.

There's also the difference between the ivory tower and the real
world. I think it's a much bigger difference.

Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more. 


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

Date: 11 Feb 98 12:31:57 GMT
From: kiyoinc@ibm.net         (cory hamasaki)
Subject: Re: Text databases.  Was: Should I stock up on food and buy an AK-47?
Message-Id: <34e19a3d.0@news3.ibm.net>

In <Pine.GSO.3.96.980211012838.12279A-100000@area51>, David Lee Lambert <lamber45@EGR.msu.edu> writes:
>On Tue, 10 Feb 1998, A. T. Hagan wrote:
>
>> kiyoinc@ibm.net         (cory hamasaki) wrote:
>> 
>> >Yes, I know about text databases and inversions....  I haven't been able to 
>> >set aside the time to work on that.
>> 
>> I'm beginning to have a problem with this myself.
   ...
>> Any one know of anything like
>> this that I can use with Windoze 3.11?  Freeware or shareware is to be
>> preferred since money is always an issue, but I can probably propitiate the
>> boss for the dough if I must.
>
>Try porting grep using Turbo C or djgpp,  or else upgrade to Win '95 and
>get perl.  (Actually,  djgpp might come with a port of grep.)  I myself
>use Linux,  so I just need to do something like
>
>grep -i 'rice.*beans' `find ~/survive-info`
>
>I imagine that perl and procmail could be mixed to do fuzzy
>measurement of files for relevance to an ill-defined phrase.  Perhaps
>someone has done this already?
>
>Linux and perl are more year 2000 compliant than MS-DOG and Win 3.11
>anyway.
>
>David Lee Lambert   MHm 16x20   Hack Programmer and Student

Hey Dave,

We know how to do it, we don't have time to build an application.  We also 
know about products that do exactly what we need but darn if I'm going to pay 
for "Virtual File Cabinet" or any of the other text databases.

The problem w/ grep'ing, what text processing pro's call 'streaming text' is 
that it is 1) too slow, 2) doesn't allow for enough fuzziness, 3) can't do 
proximity, 4) fails on ranking.

Here's the deal....  With a btree'ed inversion, I can find a word or document 
in several orders of magnitude fewer IO's than by grep'ing.

As prone as I am to pontificating in the cool, clear, light of morning, I'll 
just mention that proximity and ranking (which are related) are big ones as 
the data store gets larger.  We'd like to do, "find me all the documents that 
mention 'alfalfa' and 'vitamin*' in the same paragraph AND show me the 
documents that mention them in the same sentence first."

If anyone knows of a CHEAP product or preferably a GNU'ed text database or 
text engine, let us know.

Gadgets like Alta Vista are good too but they don't do exactly what I want.

cory hamasaki  sorry, no rates or Y2K in this one.



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

Date: Tue, 10 Feb 1998 13:43:29 GMT
From: UNBOLT.ME-ts_monk@hotmail.com (T.S. Monk)
Subject: Re: Text databases.  Was: Should I stock up on food and buy an AK-47?
Message-Id: <34e056ee.6591106@news.binc.net>

On Wed, 11 Feb 1998 01:41:43 -0500, David Lee Lambert
<lamber45@EGR.msu.edu> wrote:

---< deleted for brevity >---
>Try porting grep using Turbo C or djgpp,  or else upgrade to Win '95 and
>
>David Lee Lambert   MHm 16x20   Hack Programmer and Student

A bud of mine uses something called "Gofer" that usually turns up some
pretty embarrassing strings from our mail list group's BBS days.  <g>
(We've all somehow gotten a bit older and some what wise now, you
see.)

I'm surprised I don't see it mentioned here yet.

===============================
UNBOLT.ME-ts_monk@hotmail.com
===============================
Sorely mistaken. Just because 
you may able to function 
passably well is no indication 
that anyone else can. Some 
will be able to function. Most
won't.

 - Paul Milne
===============================
Plain, simple and to the point.
===============================


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

Date: Wed, 11 Feb 1998 10:58:53 +0000
From: Nick Djurovich <etlndh@etlxdmx.ericsson.se.not>
Subject: Web page does not display all output of cgi !!!!!
Message-Id: <34E1846C.D8CF9993@etlxdmx.ericsson.se.not>

Hi,
      I've written a cgi script to format a file and output it line by
line. Only a *fixed* amount
of output appears in the web. I have test procedures, which output
useful debugging information
to a logfile, to mirror what's output to the web, and that shows the
data is complete, so the
browser is being sent the information but it's not displaying it.

Sounds to me like some bufffer's full somewhere, and it's not being
flushed ?
Is there a limit on Netscape's input buffer or something like that ?

/Nick

-----

 ** Remove .not on the end of the reply-to address **

Name:    Nicholas Djurovich
E-Mail:  etlndh@etlxdmx.ericsson.se
Phone:   (0)1444 23 4179

Product Development Manager, Business Comms
Ericsson Telecommunications Ltd.
Burgess Hill, England

Opinions : All or none of the opinions not expressed here
           are not necessarily those of my own or of
           anybody else that I don't know or haven't not
           yet met.

Disclaimer : I disclaim everything, I didn't do it, nobody
             saw me, you can't prove anything.




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

Date: 11 Feb 1998 10:23:08 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <6bru6c$5eb$1@lyra.csx.cam.ac.uk>

Craig Berry <cberry@cinenet.net> wrote:
>I think the real issue isn't so much bad habits (though that's another
>important topic), but rather bad data.  As others have pointed out, a lot
>of the data formats in production systems today trace their ancestry back
>to the 1401 era.  At no point has it made sense to take the massive hit in
>expense and inconvenience to move terabits of data into a more modern
>format.

That's exactly the fallacy that has got things into the mess they are.
The longer you leave it, the bigger the pile of bits will be and the
harder the conversion will be.   And the dimmer the memories of those
who remember what it all meant anyway.   So it _always_ makes sense
to convert at the earliest opportunity.

But people are too busy worrying "can I survive tomorrow" to think
about surviving the millenium (or even the year leading up to it).


MIke Guy


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

Date: Wed, 11 Feb 1998 11:02:46 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <34ec83f0.6666192@news.tornado.be>

Zooko Journeyman <zooko@xs4all.nl> wrote:

>I glanced at the
>Perl time functions, said "Holy shit!  Looks like the Y2K 
>bug!", put "printf("19%2d", time);" for the timestamp, and made
>a note to myself to check up on that bug.
>
>Fortunately I got around to checking up on it before the 
>utility shipped to any of our customers.  When I did so a 
>co-worker, friend and Real Perl Hacker, Branko L, pointed
>out to me what my mistake was, and all was solved.

You don't mention what it your error was. You've got me guessing.

I guess that the code REALLY did what it was supposed to do, so you
would have fixed a bug that wasn't one.

But I just can't image how this can be. Could you explain some more, if
that's not revealing any company secrets?

	Bart.


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

Date: Wed, 11 Feb 1998 11:04:53 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <34ed855e.7032981@news.tornado.be>

Yet  another excellent brainchild from Tom Christiansen. Just some
thoughts:

>Most of the time that people think about dates, they use only the
>final two digits of the year.  They write it on checks.  They write in
>family Bibles.  You hear someone casually say, "I remember back in '65,"
 ...
>and you're just supposed to know what they mean.  Just which 65 is that?
>Assuming a living speaker, it provably has to be 1965.
 ...
>But if you don't have that context, then you
>just have to guess.  And remember: computers make notoriously bad guessers.
>
>The most horrifying aspect of all this is that even with a perfectly
>accurate and working computer program, one that is obviously "Y2K
>compliant", you are still in big trouble.  Take for example, the famous
>Unix `cal' program.  Let's check out the current month.
  
 >	    $ cal 2 98
 >		 February 98
 >	    Su Mo Tu We Th Fr Sa 
 >			 1  2  3
 >	     4  5  6  7  8  9 10
 >	    11 12 13 14 15 16 17
 >	    18 19 20 21 22 23 24
 >	    25 26 27 28

>Hold on.  What was that?  Isn't Valentine's Day is supposed to fall on
>Saturday, not Wednesday, this year?  Oops; wrong millennium!  What you
>really meant to type was:

 >	    $ cal 2 1998
 >		February 1998
 >	    Su Mo Tu We Th Fr Sa 
 >	     1  2  3  4  5  6  7
 >	     8  9 10 11 12 13 14
 >	    15 16 17 18 19 20 21
 >	    22 23 24 25 26 27 28
 
>As you see, it doesn't matter whether the programs are compliant,
>because the humans using them are not!

>And no one has yet figured out how to fix the wetware.

My solution would be to make the software less tolerant. For instance,
"cal" could simply reject a two digit year.

Call it nagware, if you like. Whenever one of your programs gets some
user input that is supposed to be a year, in a GUI, and it consists of
just two digits, then pop up a messagebox:

	Excuse me, is that 1915 or 2015?

Doubts resolved.

Soon enough, the operators will learn.

>Now, what about Perl?  Is Perl "Year 2000 Compliant"?  The answer is
>that Perl is every bit as Y2K compliant as is your pencil; no more, and
>no less.  Does that comfort you?  It shouldn't. 

>The date and time functions supplied with Perl are the gmtime and
>localtime functions.
>The year returned by these functions (when used in list context) is,
>contrary to popular misconception, *not* by definition a two-digit year.
>Rather, it merely happens to be such right now.  What it actually is,
>is the current year minus one thousand nine hundred.  For years between
>1900 and 1999 this happens to be a 2-digit decimal number, but that's
>not going to last long.  To avoid the year 2000 problem, simply do not
>treat the year as a 2-digit number.  Easy to say, and easy to break.

Well I think this is a design error. The reasoning behind that "year
minus 1900" is clearly the two-digit representation.

Perl's functions should always have returned 4 digit years.

But, for backward compatibility reasons, this is not easy to patch.

    Bart.
-
        'D*mn!', said Carrot, a difficult linguistic feat.
           -- Terry Pratchett, "Feet of Clay"


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

Date: Wed, 11 Feb 1998 13:13:06 GMT
From: dev.nul@iag.net (Phil Barnett)
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <34e1a394.337144498@news.iag.net>

On Wed, 11 Feb 1998 11:02:46 GMT, bart.mediamind@tornado.be (Bart
Lateur) wrote:

>Zooko Journeyman <zooko@xs4all.nl> wrote:
>
>>I glanced at the
>>Perl time functions, said "Holy shit!  Looks like the Y2K 
>>bug!", put "printf("19%2d", time);" for the timestamp, and made
>>a note to myself to check up on that bug.

>You don't mention what it your error was. You've got me guessing.

>I guess that the code REALLY did what it was supposed to do, so you
>would have fixed a bug that wasn't one.

In 2000, the code would have output 19100 instead of 2000. It's a bug.

---

    Phil Barnett  mailto:phil.b@iag.net  <-- Remove the first .
             WWW  http://www.iag.net/~philb/
      WWW Mirror  http://www.enterconnex.com/oasis/
        FTP Site  ftp://ftp.iag.net/pub/clipper

      I'd rather write code that writes code than write code!


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

Date: Wed, 11 Feb 1998 13:19:53 GMT
From: dpbsmith@world.std.com (Daniel P. B. Smith)
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <Eo7uD5.DGu@world.std.com>

In article <34E061A1.BF53C520@mail.uca.edu>,
Cameron Dorey  <camerond@mail.uca.edu> wrote:
>Jon R. Kibler wrote:
>> [snip]
>> If data was stored on disk or tape, the common
>> means of backing it up was to create a punched card backup of the disk
>> or tape.
>> 
>> Man, THE TREES WE WASTED in those days...
>
>But, the punches made GREAT confetti for football games! The longhairs
>(girls _and_ boys) couldn't get it out of their hair for days, the
>punches were so small... Waste, nah - entertainment value!

And, you could toss a nice fist-size deck high in the air and at the
apex of the trajectory the cards would come apart and descent slowly,
spinning around their long axis.

And, they were great for keeping in your shirt pocket to take notes on.

And, you could recognize comrades by looking for rubber bands around their
wrist.  (The well-attired programmer always kept a few rubber bands
stored around his or her wrist, for rapid deployment around a deck held
the hand).

And you could send friends notes written on computer cards and they would
see that you were associated with computers and therefore a presumptive
genius and therefore cool. 

And you could fold, spindle, and mutilate them as a gesture of adolescent
protest.  (I haven't seen a spindle in a LONG time.  Remember the dramatic
scene in "The Pawnbroker" where Rod Steiger was so overcome with angst
that he spindles his _hand_?)

-- 
Daniel P. B. Smith
dpbsmith@world.std.com


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

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

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