[6577] in Perl-Users-Digest
Perl-Users Digest, Issue: 202 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 29 19:07:34 1997
Date: Sat, 29 Mar 97 16:00:19 -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 Sat, 29 Mar 1997 Volume: 8 Number: 202
Today's topics:
Re: 'flock' equivelent for NT <dbenhur@egames.com>
BETA version and "DB 1.86"(???, where?) (David Combs)
Compiliing CGI Scripts <amerar@unsu.com>
Re: Compiliing CGI Scripts (Tad McClellan)
Re: CORRECT Re: Q: sorting by date (Chris Russo)
Error: Parse exception <ting@platinum.com>
Re: Establishing Distances??? (John Kodis)
Re: File Locking (M.J.T. Guy)
Re: general question: databases w/ perl <fisherka@xmission.com>" <fisherka@xmission.com>
Re: How to sort? How about in a database? (Jeffrey Rice)
Re: Numeric / bitwise 'and' problem <rootbeer@teleport.com>
Re: Perl Mail Parser Question <rootbeer@teleport.com>
Re: Perl mishandles some multidimensional array referen (Brian L. Matthews)
Re: perl5 string splitting question <dbenhur@egames.com>
scripts broken after 5.003 install (Keith Burdis )
Re: Sending Control- characters <rootbeer@teleport.com>
Re: tying %HoH to DB_File? (Paul Marquess)
Re: Unix and ease of use (WAS: Who makes more ...) <dyke@trump.rutgers.edu>
Re: Unix and ease of use (WAS: Who makes more ...) <jtpolk@localhost.localdomain>
work on command line and not via browser? diep.truong@mci.com
Re: Wrapping text in perl <dbenhur@egames.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 29 Mar 1997 08:58:04 -0800
From: Devin Ben-Hur <dbenhur@egames.com>
To: Geoffrey Hebert <soccer@microserve.net>
Subject: Re: 'flock' equivelent for NT
Message-Id: <333D4A1C.7A1A@egames.com>
[mail&post]
Geoffrey Hebert wrote:
> Here is something I use:
> Concept is to use a tempory file indicating that the file is in use.
>
> if (-e "file.lock") { # is the file in use
> sleep 1; # do anything if busy
> }
> open (LOCKFILE,">file.lock"); # file is now busy
And has been repeatedly pointed out, this technique
does not work. Your lock test and set operation
*must* be atomic (execute without possibility
of being interrupted by another process). This is not,
so it can wind up with two processes both believing
they have an exclusive lock. The best this can do is
reduce the period of vulnerability where multiple
processes could erroneously access the locked
resource(s).
--
Devin Ben-Hur <dbenhur@egames.com>
eGames.com, Inc. http://www.egames.com/
eMarketing, Inc. http://www.emarket.com/
"It's better to be lucky than good." -- Elizabeth Bourne
------------------------------
Date: Sat, 29 Mar 1997 22:41:13 GMT
From: dkcombs@netcom.com (David Combs)
Subject: BETA version and "DB 1.86"(???, where?)
Message-Id: <dkcombsE7ttop.BwE@netcom.com>
I note that the beta doc of new things it has
says it now supports DB 1.86.
So I go look for that (alta vista), and get this
address:
3. [1]The Berkeley DB Package Home Page
http://mongoose.bostic.com/db/
That page mentions (a) 1.85 and (b) version TWO --
but no 1.86.
Am I looking in the wrong place?, or is there
something I don't understand?
THANKS
------------------------------
Date: Sat, 29 Mar 1997 13:11:10 -0600
From: Arthur Merar <amerar@unsu.com>
Subject: Compiliing CGI Scripts
Message-Id: <333D694E.2307@unsu.com>
Hello,
I have a CGI script that I am trying to run on my Linux drive. I am
having two problems.
1) I cannot seem to get it to execute from my HTML document. Is there
a specific type of call I need?
2) When I tried executing it from a prompt, I got a message that says:
'Can't locate CGI.pm in @INC'
'Begin failed - compliation aborted'
Any idea what this means? I know almost nothing about Linux, so any
help would be appreciated.
Thanks,
Arthur
amerar@unsu.com
http://www.unsu.com
------------------------------
Date: Sat, 29 Mar 1997 16:57:03 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Compiliing CGI Scripts
Message-Id: <vn6kh5.456.ln@localhost>
Arthur Merar (amerar@unsu.com) wrote:
: Hello,
Hi.
: I have a CGI script that I am trying to run on my Linux drive. I am
: having two problems.
: 1) I cannot seem to get it to execute from my HTML document. Is there
: a specific type of call I need?
CGI scripts run on a _server_, not a browser (client).
Do you have an HTTP server installed?
( I had one with my RedHat 4.0 Linux system, just had to get it
to start up as part of the bootup process)
This is a CGI question. CGI questions are best asked in the CGI newsgroup:
comp.infosystems.www.authoring.cgi
But, off-topic posts to the perl newsgroup are so common, that the
fine folks who maintain the _Perl_ FAQ have actually given some
pointers to help with this non-perl topic (CGI scripting). From
said FAQ part 9:
---------------------------------------
The useful FAQs are:
http://www.perl.com/perl/faq/idiots-guide.html
http://www3.pair.com/webthing/docs/cgi/faqs/cgifaq.shtml
http://www.perl.com/perl/faq/perl-cgi-faq.html
http://www-genome.wi.mit.edu/WWW/faqs/www-security-faq.html
http://www.boutell.com/faq/
---------------------------------------
Those should make an excellent start on CGI scripting.
There _is_ also a specific type of call to get the CGI script invoked,
but as it is not related to perl, the CGI newsgroup would be the
correct place to ask.
: 2) When I tried executing it from a prompt, I got a message that says:
: 'Can't locate CGI.pm in @INC'
: 'Begin failed - compliation aborted'
Now here is an on-topic question about perl. We can likely help
with this one.
: Any idea what this means?
Included with the perl distribution are a bunch of files with a .pod
filename extension. These are known as "man pages".
The perldiag man page lists all of the error messages that perl
might issue. Let's go look up your particular error message...
grep "Can't locate" perldiag.pod
----------------------------------------
=item Can't locate %s in @INC
(F) You said to do (or require, or use) a file that couldn't be found
in any of the libraries mentioned in @INC. Perhaps you need to set
the PERL5LIB environment variable to say where the extra library is,
or maybe the script needs to add the library name to @INC. Or maybe
you just misspelled the name of the file. See L<perlfunc/require>.
----------------------------------------
Do you have the CGI.pm module installed on your system?
To find out, run the script below to see what directories your perl
will look in for modules:
---------------------------
#! /usr/bin/perl -w
foreach (@INC) {
print "$_\n";
}
---------------------------
Do any of those directories have a file named 'CGI.pm' and a directory
named 'CGI' ?
If not, then you will need to install the CGI module, available
from CPAN.
: I know almost nothing about Linux, so any
: help would be appreciated.
Hope this helps.
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Sat, 29 Mar 1997 11:01:51 -0800
From: crusso@alink.net (Chris Russo)
Subject: Re: CORRECT Re: Q: sorting by date
Message-Id: <crusso-2903971101510001@buzz.russo.org>
>Brad Bosley wrote:
>>
>> I have an associative array with the date (mm/dd/yy) as the keys.
>> When I do a sort(keys(%ARRAY)), it will of course sort by
>> month/day/year. What I really need is year/month/day. I was looking
>> for a slick way to do this sort, without having build a 2nd array keyed
>> with (yy/mm/dd).
>>
>> Any Suggestions?
>>
>> Thanks,
>> Brad Bosley
>> Motorola SPS
Hey..... Schwartzarena! (Sung to the tune of "The Macarena")
Unlike a regular array, a hash can't be kept in a "sorted" state. If
you'd like the keys in sorted order, try this:
@sortedkeys = map { $_->[1] }
sort { $a->[0] <=> $b->[0] }
map { m!(\d\d)/(\d\d)/(\d\d)!; [ "$3$1$2", $_ ] } keys %ARRAY;
for (@sortedkeys) { print "$ARRAY{$_}\n" }
Regards,
Chris Russo
----------------------------------------------------------------------
Chris Russo A-Link Network Services, Inc.
crusso@alink.net Bolo me
http://www.alink.net/~crusso
------------------------------
Date: 29 Mar 1997 20:38:00 GMT
From: "Wen Ting" <ting@platinum.com>
Subject: Error: Parse exception
Message-Id: <01bc3c81$5c804850$1e2611ac@tingw>
I wrote a Perl extension for Win32, during execution, I was given the
message 'Error: parse exception'. What could it mean? Can someone give me
a hint?
wt
------------------------------
Date: 29 Mar 1997 19:16:23 GMT
From: kodis@kodis.jagunet.com (John Kodis)
Subject: Re: Establishing Distances???
Message-Id: <slrn5jqqk7.84k.kodis@kodis.jagunet.com>
Previously, Jonathan S Hardiman wrote:
>Whoever can help.
>
>I am trying to find out whether it is possible to determine (Preferrably in
>CGI) the distance between a persons address and the nearest office, without
>use of an extremely lengthy subroutine.
I've recently written something that may be of use to you. It's a
Perl module that translates a user-entered location in any of several
formats into a latitude-longitude coordinate pair. There's an test
page that will look up a pair of locations and calculate and display
the great-circle distance between them at:
http://www.jagunet.com/~kodis/where.html
If it seems useful to you, you can browse the example source code and
download the whole module. HTH.
-- John Kodis.
------------------------------
Date: 29 Mar 1997 19:24:35 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: File Locking
Message-Id: <5hjq9j$fkb@lyra.csx.cam.ac.uk>
Tom Christiansen <tchrist@mox.perl.com> wrote:
>
>It's also important that you not write anything
>derived from data fetched with a read lock.
>
>Classic fiasco here:
>
> open file
> get shared lock
> read datum
> upgrade to exclusive lock
> munge datum
> write datum
> close file
>
>That won't work. You have to do this:
>
> open file
> get exclusive lock
> read datum
> munge datum
> write datum
> close file
At the risk of confusing things, it's also worth mentioning the style to
use when you'll only occasionally update the datum:
open file
get shared lock
read datum
decide if update wanted
upgrade to exclusive lock
re-read datum <<<<<<<<<<<<< vital step
munge datum
write datum
close file
Note also that the re-read may lead to re-evaluation of the decvision to
update.
Mike Guy
------------------------------
Date: 29 Mar 1997 19:23:25 GMT
From: "Kurt A. Fisher <fisherka@xmission.com>" <fisherka@xmission.com>
Subject: Re: general question: databases w/ perl
Message-Id: <01bc3c78$45c4d1c0$6888e4cc@kurtfish>
An excellent link to other links is:
http://cscsun1.larc.nasa.gov/~beowulf/db/web_access.html
Ster <ster@stargazer.net> wrote in article
<01bc3ae0$37475bc0$187b65cf@cornholio>...
> Is there built in database abilities/function in perl?
>
------------------------------
Date: Sat, 29 Mar 1997 17:31:09 GMT
From: jrice@pomona.edu (Jeffrey Rice)
Subject: Re: How to sort? How about in a database?
Message-Id: <5hjjb5$q4s@epcot.pomona.edu>
In article <332d985f.4374501@news1.alterdial.uu.net>, steve@golf.com (Steven Sajous) wrote:
>On 15 Mar 1997 17:49:26 GMT, martig@cam.org (Georges Martineau) wrote:
>
>>I have the following data(data file):
>> John=17
>> Peter=25
>> Fred=10
>> Andrew=7
>>I would like to get:
>> Peter...25
>> John...17
>> Fred...10
>> Andrew...7
I have the same question, except the data is in a database. I know I can
sort the greatest values in the database using values(%DB), but then I lose
the key that goes with each one. What I really want to do is sort the
database in descending order by value, then be able to pull off the first 5
or so keys with the value attached...
Jeff
------------------------------
Date: Sat, 29 Mar 1997 14:27:22 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: stirra@wwc.edu
Subject: Re: Numeric / bitwise 'and' problem
Message-Id: <Pine.GSO.3.96.970329142031.29714H-100000@kelly.teleport.com>
On 27 Mar 1997 stirra@wwc.edu wrote:
> $rdtest = $rdbyte & 0x0f;
> I get the warning "Argument "D" isn't numeric for and"
> when a 0x44 is read in, and $rdtest contains "0", not 0x04!
The arguments to bitwise operators may be strings or numbers, but Perl
tries to make both sides the same type. Of course, "D" isn't a number!
You want to convert the arguments to be both strings or both numbers,
depending upon what you want $rdtest to be.
$rdtest = ord($rdbyte) & 0x0f;
$rdtest = $rdbyte & "\x0f";
Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: Sat, 29 Mar 1997 14:03:42 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Luigi Mattera <mattera@ssga.ssb.com>
Subject: Re: Perl Mail Parser Question
Message-Id: <Pine.GSO.3.96.970329140055.29714D-100000@kelly.teleport.com>
On 28 Mar 1997, Luigi Mattera wrote:
> I've been trying write a mail parser for Perl on a unix system. It
> simply has to filter out the subject and body of the message.
Doesn't formail(1) do what you want? It's free... :-)
> Programming Perl only uses a while(<>) to loop through a filehandle.
> I can feed through it manually with $var = <NAME>, but I can not
> differentiate the end of the message.
Check out what perlfunc(1) says about eof, and I think you'll have your
answer. Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 29 Mar 1997 10:56:36 -0800
From: blm@halcyon.com (Brian L. Matthews)
Subject: Re: Perl mishandles some multidimensional array references???
Message-Id: <5hjol4$rq6$1@halcyon.com>
In article <333e8107.157432085@news.airmail.net>,
Patrick Duff <pduff@airmail.net> wrote:
|@Array = [ 'Value1', 'Value2']; #line 4
|line 4: a one-element array whose first element contains a
|two-element array
No. An array element (or hash value) is *always* a scalar. An
array element is *never* an array (or hash or file handle or
subroutine). That scalar may be a number, a string, or a reference.
By storing a reference in an array or hash element, you can make it
look like you have multi-dimensional data structures, but you really
don't.
|$Title[0] = ['A1', 'A2', 'A3', 'A4'];
|$Title[1] = ['B1', 'B2', 'B3', 'B4'];
|What actually works correctly seems counter-intuitive to me [...].
Then your intuition is wrong. :-) On the left side, you're naming
an element of the array @Title. You want it to look like there's
a whole array in that element. However, we know from above that an
element of an array can only hold a scalar, not another array. So,
you want to use a reference. You generate a reference to an array
by enclosing the array elements in square brackets, which leads to
the two lines above.
Note that you could also build all of @Title at once thusly:
@Title = ( ['A1', 'A2', 'A3', 'A4'], ['B1', 'B2', 'B3', 'B4'] );
Here you've got an array on the left, so you build an array on the
right by enclosing the elements of the array in parens. Each of
those elements is a list in square brackets, which is a reference
to an array, so the right hand side is a two-element array, each
element being a reference to a four-element array.
|Does anyone care to expand on the above analysis to come up with a
|heuristic for determining the correct syntax ( $ or @ or %, and ( ) or
|[ ] or { } ) to use in all circumstances when specifying arrays and
|hashes with varying numbers of dimensions?
You'll probably be better off if you stop thinking of arrays with
varying numbers of dimensions (unless they vary between 1 and 1 :-)).
Perl doesn't have any such thing. It has one-dimensinal arrays and
hashes, the elements of which can refer (or point, if you happen to
know C or C++) to other arrays and hashes (and scalars and file
handles and subroutines), plus some syntactic sugar that lets you
write things that look like multi-dimensional array references.
Anyway, I suggest you reread the perldata and perldsc man pages and
check out the perl FAQ. Those three should cover pretty much
anything you'd want to do with arrays, hashes, and references.
Brian
--
Brian L. Matthews Illustration Works, Inc.
For top quality, stock commercial illustration, visit:
http://www.halcyon.com/artstock
------------------------------
Date: Sat, 29 Mar 1997 09:35:00 -0800
From: Devin Ben-Hur <dbenhur@egames.com>
To: Pat Lashley <patl@tencor.com>
Subject: Re: perl5 string splitting question
Message-Id: <333D52C4.692A@egames.com>
[mail&post]
Pat Lashley wrote:
> I've got a question for the wizards: What is the BEST
> way to split a string into equal-sized chunks? (The
> chunk size is known a-priori; but the number of chunks
> in the string is not.)
What means 'best'?
fastest? shortest code? clearest?
best handling of unexpected input?
most likely to win obfuscated Perl contest?
invented here?
also sends mail and reads news?
Here are some reasonable alternatives:
(assumes string is in $_)
1) @chunks = /(.{$chunksize})/gs;
2) for ($i=0, $l=length; $i < $l; $i += $chunksize) {
push(@chunks, substr($_,$i,$chunksize));
}
3) @chunks = unpack("a$chunksize" x (length/$chunksize), $_);
1 is probably slowest, but is also the shortest and
most idiomatic that I came up with.
2 or 3 are probably much faster.
2 is probably clearest to newbies (C or BASIC
programmers would likely understand it at a glance)
3 may be best for you because you could change the
template from "a$chunksize" to whatever you use
to pick apart a chunk and do the chunking and
c-structure interpretation in one swell foop.
HTH
--
Devin Ben-Hur <dbenhur@egames.com>
eGames.com, Inc. http://www.egames.com/
eMarketing, Inc. http://www.emarket.com/
"It's better to be lucky than good." -- Elizabeth Bourne
------------------------------
Date: 29 Mar 1997 22:34:36 GMT
From: keith@rucus.ru.ac.za (Keith Burdis )
Subject: scripts broken after 5.003 install
Message-Id: <5hk5ds$g11@quagga.ru.ac.za>
Keywords: help, cgi, 5.003
Hi there
Some of my perl scripts that worked fine under perl version 5.002
don't seem to work now that I have installed version 5.003.
Here's an example of a cgi script that now doesn't work :
rucus:/var/www/server/cgi-bin/krb# perl -c -w krbdb-process.cgi
Use of uninitialized value at /usr/local/lib/perl5/CGI.pm line 687.
Can't load '/usr/local/lib/perl5/i386-freebsd/auto/Msql/Msql.so' for module Msql: Undefined symbol "_stack_base" in perl5:/usr/local/lib/perl5/i386-freebsd/auto/Msql/Msql.so at /usr/local/lib/perl5/DynaLoader.pm line 140.
at /usr/local/lib/perl5/Msql.pm line 56
BEGIN failed--compilation aborted at krbdb-process.cgi line 27.
rucus:/var/www/server/cgi-bin/krb#
(Yes, I did read Tom's cgi guide for dummies :> ).
Line 27 of krbdb-process.cgi is :
use Msql;
My perl version :
rucus:/var/www/server/cgi-bin/krb# perl -v
This is perl, version 5.003 with EMBED
built under freebsd at Mar 29 1997 06:13:09
+ suidperl security patch
My @INC :
.rucus:/usr/local/lib/perl5$ perl -e 'print join("\n",@INC)'
/usr/local/lib/perl5/i386-freebsd/5.003
/usr/local/lib/perl5
/usr/local/lib/perl5/site_perl/i386-freebsd
/usr/local/lib/perl5/site_perl
/usr/local/lib/perl5/i386-freebsd
.rucus:/usr/local/lib/perl5$
I presume that the reason it doesn't work is because it is trying to use
the shared library instead of Msql.pm. How do I make it use Msql.pm instead
or how do I fix the shared library?
Any help would be appreciated. (If there is an FAQ that answers this PLEASE
tell me. I can't find one.)
- Keith
PS : pgperl and cpan are also being horrible. If I didn't like the perl
configure script so much, I wouldn't bother :>
--
Keith Burdis - BSc Honours (Com Sci) - Rhodes University
Email : keith@rucus.ru.ac.za
WWW : http://www.rucus.ru.ac.za/~keith/
IRC : Panthras JAPH
Standard disclaimer.
---
------------------------------
Date: Sat, 29 Mar 1997 14:18:29 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Jim Hribnak <hribnak@nucleus.com>
Subject: Re: Sending Control- characters
Message-Id: <Pine.GSO.3.96.970329141405.29714G-100000@kelly.teleport.com>
On 29 Mar 1997, Jim Hribnak wrote:
> Can anyone tell me how to send a control-d character from a perl
> program?
The same way you send other characters.
Oh, you want to know how to get a control-d into a string, don't you?
Lotsa ways to do that. Most of them are documented in perlop(1) in the
section about "Quote and Quote-like Operators". Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 29 Mar 1997 20:53:53 GMT
From: pmarquess@bfsec.bt.co.uk (Paul Marquess)
Subject: Re: tying %HoH to DB_File?
Message-Id: <5hjvh1$t7p@pheidippides.axion.bt.co.uk>
[ Posted & Mailed ]
Jonathan R. Seagrave (jrs@abiogenesis.com) wrote:
: #!/usr/bin/perl -w
: #
: # Hi. I'm having a heck of a time trying to tie a
: # Hash of a Hash to a DB_File (or any of the DB files
: # for that matter.)
: #
: # I've spent a bunch of time just experimenting with
: # different ways to do this and I'm at wit's end.
: #
: # Here's a bit of code that I've written to highlight
: # my confusion. I've commented out the parts that don't
: # do what I'd like them to. Any helpful hints will be
: # greatly appreciated. Heck, even outright criticisms
: # would be welcome.
You cannot (directly) store hashes of hashes with DB_File (or any of
the other DBM* modules for that matter).
Luckily, there is a wrapper module called MLDBM which will allow you to
do what you want. You can find it on CPAN.
Paul
------------------------------
Date: Sat, 29 Mar 1997 13:33:41 -0500
From: George Dyke <dyke@trump.rutgers.edu>
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <333D6085.6B83@trump.SPAM_BE_GONErutgers.edu>
Steve Mading wrote:
>
> Here's another example. Imagine if each car manufacturer chose to
> use a different 'secret' formula for the gasoline for their cars,
> instead of the current case where all cars run on the same kind
> of gas. If you bought a Ford, you'd have to use gas stations that
> carried Ford gasoline.
Most cars use isooctane due to its combustion properties : high critical
compression ration, low volatility, high energy/mass, etc. This fuel is
used because it is the *best* with present technology and economics.
Note fuel alternatives: diesel, solar, electric, hydrogen, natural gas,
and various hybrid combos of these.
>(For this example to work, you have to imagine that the formula
>for car's gasoline is secret and it is illegal to reverse-engineer
>it.)
Sorry guy, 7 years of studying mechanical engineering has crushed my
imagination to dust. Nexy time use a cogent analogy or you point will
get lost in the analogy.
------------------------------
Date: 29 Mar 1997 17:23:57 -0600
From: Jim Tom Polk <jtpolk@localhost.localdomain>
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <m3d8siwacy.fsf@localhost.localdomain>
jacobus@pasteur.up.ac.za (Jacobus Erasmus) writes:
> : > >Unix is more advanced technically? That's interesting. The last time
> : > >I installed a modem on Windows NT the OS found it for me. The last
> : > >time I tried it on Unix I read about the nine files one had to edit,
> : > >then gave up. It seems to me that Unix is losing market share
> : > >precisely because end users never make the programmer's mistake of
> : > >confusing technical advancement with obtuseness.
Hehe, you musta have never had the joy of having a buncha modems not quite
work correctly with Window95 (this was really a problem with the modem's
plug-and-play) or had to spend hours and hours laboring to get a scanner
to work correctly, and then have the lovely thing decide that where the
modem was, it wanted to be, and uninstalling the scanner still left the
modem unusable, so we had to go to the registry and then....
...seriously though, most of the time Windows 95 is a technicians friend,
just when it does go wrong, it REALLY goes wrong. (grin)
> There is a fundamental design difference. Windows has been design from the
> beginning to be maintained by novices that why everything sets up
> automatically. This is very nice if you don't want to tweak your computer.
> Unfortunately Unix was designed to have a Administrator that manages the
> system. A person that know how to operate a computer.
Pretty true. I like to explain that Windows 95 is novice friendly, while
something like Unix is user friendly. Once one is no longer a novice
(an most people never leave, nor want to leave this level) then Window95
becomes unfriendly. Unix is a royal pain to learn, just because of it's
design philosophy, which is towards users, not novices. The thing
I like about Unix is that I can figure out about 10 different ways
to skin a cat, while often with MSWin, there is one way, and it costs
big buck to do it another way.
>
> For me as an administrator it is much easier administrating UNIX machines than
> NT machines. For that matter any other operating system.
>
No kidding there. (from experience) Of course you cannot be afraid of those
pesky ascii configuration files and the wonderful joys of man pages. (grin)
> There is one interesting thing about support and that is so what Windows is
> easier to setup. It's faster to setup. Unix is harder to setup and takes
> longer.
>
Setup does not, in my experience, equal administration. I cruise the web
and hit many easy to set up NT machines. Heck, who needs a SysAdmin or
Unix? Then I anaylize the site...a different story. I look upon it
this way: if it takes me 3 hours to set up a system that takes 20 hours
a week to maintain vs. a system that takes me one day to set up and
5 hours a week to maintain, which is more cost effective?
> The main difference is I need to setup my application once for my 500 UNIX
> users but I have to setup my application 500 times for my Windows users. Which
> one would you choose. Just asking. UNIX has all the facilities that Windows
> has and more. Caldera and some other companies is working hard to make it just
> as easy to setup and maintain as Windows. Check out Caldera Open Linux if you
> want to see the type of work being done.
True! I remember my obligatory Unix class (we were using Linux). I knew
Linux very well. After I had set up some basic networking services for
each machine, I went in during a lecture on file systems and installed
the patches that were needed for each of the other students accounts, and
disabled their ability (out of total irritation) for them to log into
each others machine as root and reboot (they thought that was utter gloss).
The next day, they logged in, found messages and the new configuration
files (that had nothing to do with the class--the stuff they had to
learn was not touched)
Whoops, have gone on too long!
--
Jim Tom Polk -:- jtpolk@camalott.com -:- http://camalott.com/~jtpolk/
''You might as well fall flat on your face as
lean over too far backwards.'' --James Thurber--
------------------------------
Date: Sat, 29 Mar 1997 15:21:14 -0600
From: diep.truong@mci.com
Subject: work on command line and not via browser?
Message-Id: <859668113.32066@dejanews.com>
The following routine, which reads a web page and writes the data to
a file, works everytime in a command line environment but works
intermitently when the program is called from a web browser.
Any ideas why? and what can I change to make it work every time?
Thanks,
Diep.
===============================
sub GETDAT
{
local ($_, $savefilename) = @_;
/http:\/\/([^\/]*)\/*([^ ]*)/;
$site = $1;
$file = "/".$2;
if (!$site) { die "$0: Fatal Error. You appear to have munged your URL
address.\nIt must be in the form of http://www.any.site/location\n"; }
$_ = $site;
/^([^:]*):*([^ ]*)/;
$site = $1;
$port = $2;
$port = 80 unless $port;
$hostname = $site;
#print STDERR "[$site] [$port] [$file]\n";
# Open a socket and get the data
($sockaddr,$there,$response,$tries) = ("Snc4x8");
$there = pack($sockaddr,2,$port, &getaddress($hostname));
($a, $b, $c, $d) = unpack('C4', $hostaddr);
$proto = (getprotobyname ('tcp'))[2];
socket(S, AF_INET, SOCK_STREAM, $proto) || die "socket: $!";
connect(S, $there) || die "connect: $!";
# bind(S, $this) || die "bind: $!"; # if
(!socket(S,AF_INET,SOCK_STREAM,$proto)) { die "$0: Fatal Error. $!\n";
} # if (!connect(S,$there)) { die "$0: Fatal Error. $!\n"; }
select(S); $|=1; select(STDOUT);
if ($savefilename) {open(OUT,">$savefilename") || die "$0: Fatal
error. Cannot create $savefilename.\n";}
print S "GET $file\r\n";
while() {
if ($savefilename) {
print OUT;
} else {
print;
}
}
close(S);
if ($savefilename) {close(OUT);}
}
sub getaddress {
local($host) = @_;
local(@ary);
@ary = gethostbyname($host);
return(unpack("C4",$ary[4]));
}
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Sat, 29 Mar 1997 09:49:47 -0800
From: Devin Ben-Hur <dbenhur@egames.com>
To: Geoffrey Hebert <soccer@microserve.net>
Subject: Re: Wrapping text in perl
Message-Id: <333D563B.6BB5@egames.com>
Geoffrey Hebert wrote:
> A better solution will be to use html.
Why is this better? Define HTML.
Does your definition look anything like
<URL:http://www.w3.org/pub/WWW/TR/REC-html32.html>
> define your testarea a 40
> in the textare definition include a WRAP=PHYSICAL
<TEXTAREA> doesn't have a WRAP attribute. This works
on some browsers, but I sure wouldn't rely on it.
> Then you user will see exactly what you file away.
Well, some of your users might.
The original poster had the right idea, handle the word
wrapping in the CGI script.
Lookup the Text::Wrap module. It does what Alan wants
in Perl.
> Alan Bond <alanbond@sky.net> wrote:
> >Word wrap in perl?
HTH
--
Devin Ben-Hur <dbenhur@egames.com>
eGames.com, Inc. http://www.egames.com/
eMarketing, Inc. http://www.emarket.com/
"It's better to be lucky than good." -- Elizabeth Bourne
------------------------------
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 202
*************************************