[9585] in Perl-Users-Digest
Perl-Users Digest, Issue: 3179 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 16 16:07:29 1998
Date: Thu, 16 Jul 98 13:00:38 -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 Thu, 16 Jul 1998 Volume: 8 Number: 3179
Today's topics:
Re: %vHash = $vScalar doesn't work, why? scott@softbase.com
Re: client/server help 2 <aperrin@mcmahon.qal.berkeley.edu>
Deactivating mod_perl <sascha@bespin.escape.de>
find total file size / HD space left? <rchen@wyle.com>
How to understand $sockaddr? <aperrin@mcmahon.qal.berkeley.edu>
Re: input length?? (Kevin Reid)
Re: is IF statement BROKEN in 5.004? (Greg Ward)
Re: mail bomber source code for perl. (Abigail)
Re: mail bomber source code for perl. (Steve Linberg)
Re: ODBC Access scythale@my-dejanews.com
open (IN, "foo.txt") works, open (IN, "$foo") does not? (J|rgen P|nter)
Re: open (IN, "foo.txt") works, open (IN, "$foo") does <jdf@pobox.com>
Passing null BSTR pointer with Win32::OLE marc_mims@my-dejanews.com
Re: Perl Beautifier Home Page (Craig Berry)
Re: Perl Beautifier Home Page <zenin@bawdycaste.org>
Question - push() unique? <jph@sjrwmd.state.fl.us>
Re: Question - push() unique? (Aaron B. Dossett)
Re: Removing the ^M character <daved@orion.tamu.edu>
Re: Removing the ^M character <daved@orion.tamu.edu>
Re: Sendmail ? <zenin@bawdycaste.org>
Setting up Perl database <JLEHMANN@dsccc.com>
Trapping signals under NT4.0? (Damian Jackson)
web hosting problems <wandersman@wilbursmith.com>
Re: What is awk better at than perl? (Larry quote) (Mark-Jason Dominus)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 16 Jul 1998 17:24:40 GMT
From: scott@softbase.com
Subject: Re: %vHash = $vScalar doesn't work, why?
Message-Id: <6old0o$aqo$1@mainsrv.main.nc.us>
Scott Cherkofsky (crusader@bilbo.ShireNet.com) wrote:
> Ya know, its funny but in all of
> the Nutshell books on PERL, not one of them (and I have 3) mentions or
> gives examples for populating HASH's using Scalar variables containing
> comma delimited values.
This can't be done, at least not directly. You'd have to parse the CSL
into something else and then build the hash. A CSL isn't really
anything you could put into a hash -- it could be put into an array
(split on , unless you allow embedded commas in fields), but how would
you know what was a key and what was a value to put it into a hash?
You'd need application-specific logic.
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: Thu, 16 Jul 1998 11:06:12 -0700
From: Andrew Perrin <aperrin@mcmahon.qal.berkeley.edu>
Subject: Re: client/server help 2
Message-Id: <35AE4114.FA5E8E2D@mcmahon.qal.berkeley.edu>
Not sure exactly what you're asking for - once you've done a bind and a connect,
you have a handle that can be used much like a filehandle; you can then print to
it and send your output down the socket you've created:
print SOCKET "$idnum\n";
where SOCKET is the socket you've opened and configured in your client. I found
the examples in _Programming Perl_ quite informative in developing a
client-server solution, except for two things:
1.) What the heck is $sockaddr; and
2.) You need to set the USEADDR option on your socket to true so that when the
program goes away the socket is re-useable by the system.
Best,
Andy Perrin
Joseph M Carlton wrote:
> Well, I finally got the client/server examples in the book working. I'm
> just trying to get the socket and table search working before I try to
> do it through the web. I need to send an id number to the server, so it
> can do the table search and return the data. Does anyone know how I send
> the ID number? Is in done with the connect statement or is there some
> other command to send it in?
>
> Thanks,
> Joey
>
> Joseph M Carlton (carltjm@mail.auburn.edu) wrote:
> : From page 354 of Programming Perl:
> : "For example, let's say that you have a long running database server
> : daemon that you want folks from the World Wide Web to be able to
> : access, but only if they go through a CGI interface. You'd have a small,
> : simple CGI program that does whatever checks and logging you feel
> : like, and then acts as a Unix-domain client and connects to your private
> : server. "
>
> : This is EXACTLY what I need to do. But I don't know how to get the
> : client and server working. Someone please help. See also my other posts.
> : Thanks.
>
> : --
>
> : Joey Carlton
> : Senior, Computer Engineering
> : Auburn University
> : carltjm@mail.auburn.edu
>
> --
>
> Joey Carlton
> Senior, Computer Engineering
> Auburn University
> carltjm@mail.auburn.edu
--
-------------------------------------------------------------
Andrew J. Perrin - NT/Unix/Access Consulting - (650)938-4740
aperrin@mcmahon.qal.berkeley.edu (Remove the Junk Mail King
http://socrates.berkeley.edu/~aperrin to e-mail me)
e-mail wheres-andy@socrates.berkeley.edu to find me!
-------------------------------------------------------------
------------------------------
Date: 16 Jul 1998 16:32:00 GMT
From: Sascha Matzke <sascha@bespin.escape.de>
Subject: Deactivating mod_perl
Message-Id: <6ol9u0$3d8$1@bespin.escape.de>
Hello,
is there a way to deactivate mod_perl for certain directories ??
Sascha
--
.-> Sascha Matzke - sascha@bespin.escape.de --------------.
| |
| Computers will not replace real people, |
| they will replace middle- and low-level bureaucrats. |
| Timothy Leary |
| |
`-- For 22 years, 281 days, 23:01 hours on this earth <---'
------------------------------
Date: Thu, 16 Jul 1998 10:27:17 -0700
From: "Ronald Chen" <rchen@wyle.com>
Subject: find total file size / HD space left?
Message-Id: <6old6e$j9u@enews2.newsguy.com>
How do I find out the total size of the files in a particular directory and
its subdirectory under dos? and the total harddisk space left? It's
similar to the "dir/s" command under dos, but all I need is those two info.
:)
------------------------------
Date: Thu, 16 Jul 1998 11:08:28 -0700
From: Andrew Perrin <aperrin@mcmahon.qal.berkeley.edu>
Subject: How to understand $sockaddr?
Message-Id: <35AE419B.E66A3B79@mcmahon.qal.berkeley.edu>
Greetings folks-
I've just finished constructing a client/server system for internal
use, and I have a lingering question about the sockets stuff. That is:
what exactly is $sockaddr, and how is it constructed? Both _Programming
Perl_ and _CGI Programming_ use the same string for it, and that string
works fine for my purposes as well. But I don't like just sticking it
in there and assuming it's right. Can somebody explain what the string
means, and how it's used?
Many thanks-
Andy Perrin
--
-------------------------------------------------------------
Andrew J. Perrin - NT/Unix/Access Consulting - (650)938-4740
aperrin@mcmahon.qal.berkeley.edu (Remove the Junk Mail King
http://socrates.berkeley.edu/~aperrin to e-mail me)
e-mail wheres-andy@socrates.berkeley.edu to find me!
-------------------------------------------------------------
------------------------------
Date: Thu, 16 Jul 1998 15:41:02 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: input length??
Message-Id: <1dc7win.1kcccnh16epnaqN@slip166-72-108-85.ny.us.ibm.net>
Kerrie Etter <ketter@lincolninvestment.com> wrote:
> I'M NEW TO THIS... so excuse the ignorance...
>
> I have a form (basically builds a resume) one field asks for a
> description of current responsibilities.....
>
> The input from the form (which is e-mailed to our recruiter) could be up
> to 100 words - how do I "wrap" it so that it doesn't just run off the
> page...
>
> (sorry, again for being so ignorant BUT I'M TRYING!!!!)
Use Text::Wrap or this subroutine:
#!perl -w
sub wrap ($$) {
my ($text, $length) = @_;
$text =~ s/([^\n]{0,$length})\s/$1\n/g;
my $otext = $text;
$p =~ s/\n(.*?)$/ $1/;
$text = $otext if $text =~ /\n[^\n]{$length}[^\n]/;
return $text;
}
$p = q<A somewhat long sentence, which I am providing to test my code.>;
print "-" x 20, "\n";
print wrap($p, 20), "\n";
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: 16 Jul 1998 19:40:44 GMT
From: greg@bic.mni.mcgill.ca (Greg Ward)
Subject: Re: is IF statement BROKEN in 5.004?
Message-Id: <6olkvs$hgk@sifon.cc.mcgill.ca>
Bill Catlan (wcatlan@bccom.com) wrote:
: Does anyone know why:
[code deleted -- see below]
: evaluates false?
You might get more answers if you post code that immediately runs, and
show an example session. For instance, I recast your code as
$a = 1;
$b = 0;
if ($a > $b) { print "yes\n" }
$a = "1";
$b = "0";
if ($a gt $b) { print "yes\n" }
And I run it as follows
% perl /tmp/iftest
yes
yes
...as expected, 1 > 0 and "1" gt "0". I.e., it works for me -- good
thing too; if relational operators and the conditional operator broke,
we'd be in bad shape. ;-)
If this is *not* what you get, you might want to supply the output of
"perl -V" on your system. (If you use the perlbug program to report the
apparent bug, this will be taken care of for you.)
Greg
--
Greg Ward - Programmer/Analyst greg@bic.mni.mcgill.ca
Brain Imaging Centre (WB201) http://www.bic.mni.mcgill.ca/~greg
Montreal Neurological Institute voice: (514) 398-4965 (or 1996)
Montreal, Quebec, Canada H3A 2B4 fax: (514) 398-8948
------------------------------
Date: 16 Jul 1998 18:44:49 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: mail bomber source code for perl.
Message-Id: <6olhn1$l2g$1@client3.news.psi.net>
Peter A Fein (p-fein@uchicago.edu) wrote on MDCCLXXX September MCMXCIII
in <URL: news:opg7m1dhjee.fsf@harper.uchicago.edu>:
++ abigail@fnx.com (Abigail) writes:
++
++ > The computer is the game.
++
++ Cool quote.
++
It's Tom's.
Abigail
--
perl -wle '$, = " "; sub AUTOLOAD {($AUTOLOAD =~ /::(.*)/) [0];}
print+Just (), another (), Perl (), Hacker ();'
------------------------------
Date: Thu, 16 Jul 1998 15:59:09 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: mail bomber source code for perl.
Message-Id: <linberg-1607981559090001@projdirc.literacy.upenn.edu>
In article <6olhn1$l2g$1@client3.news.psi.net>, abigail@fnx.com wrote:
> Peter A Fein (p-fein@uchicago.edu) wrote on MDCCLXXX September MCMXCIII
> in <URL: news:opg7m1dhjee.fsf@harper.uchicago.edu>:
> ++ abigail@fnx.com (Abigail) writes:
> ++
> ++ > The computer is the game.
> ++
> ++ Cool quote.
> ++
>
> It's Tom's.
Wasn't it "Perl is the game?" As in "Perl gurus don't write games in Perl
because they understand that Perl is the game." Something like that.
Very cool quote indeed!
_____________________________________________________________________
Steve Linberg National Center on Adult Literacy
Systems Programmer &c. University of Pennsylvania
linberg@literacy.upenn.edu http://www.literacyonline.org
------------------------------
Date: Thu, 16 Jul 1998 18:23:07 GMT
From: scythale@my-dejanews.com
Subject: Re: ODBC Access
Message-Id: <6olgeb$881$1@nnrp1.dejanews.com>
In article <35AB97D5.4CE907B0@mediaone.net>,
Lee Rouman <lrouman@mediaone.net> wrote:
> Anyone willing to forward me a few working examples of utilizing PERL to read
from and write to common DB products using ODBC?
Well ... someone will have to do a FAQ one day ... you'll can find an example
at:
http://www.esiea.fr/public_html/Emmanuel.PIERRE/perl/ntperl.html.en
Emmanuel
--
-= Emmanuel PIERRE epierre@mail.esiea.fr =-
http://www.esiea.fr/public_html/Emmanuel.PIERRE http://www.esiea.fr
http://www.e-presence.esiea.fr http://www.apr-job.com
L I N U X - WebMaster - SysAdm - Perl Guru
http://www.esiea.fr:8080 Intranet Inter ESIEA http://hp1.esiea.fr:2001
http://dvorak.esiea-ouest.fr:2001
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 16 Jul 1998 06:51:41 GMT
From: Juergen.Puenter@materna.de (J|rgen P|nter)
Subject: open (IN, "foo.txt") works, open (IN, "$foo") does not???
Message-Id: <6ok7tt$f5$1@penthesilea.Materna.DE>
Hello everybody,
here's my problem: I want to open several files, read their content,
manipulate that and write it back. Not even remotely difficult.
The relevant part looks like this:
open (FHIN, "$file") || die "Error 1: $!\n";
$file is the result of a POST from a webpage - but I don't think
that the problem is CGI-related, so please read on :-)
The strangeness starts now:
The above snippet ONLY works when $file is hardcoded _in the script
itself_ like
$file = "/a/b/c/DX_Seemedienow_SV.anotherlongish.name.001.001.001".
In every other case it fails when I try to construct $file, e.g.
$file = "/a/b/c/".$file2 or
$file = "/a/b/c/$file2" or even
chdir ("/a/b/c"); $file = "$file2"; open (FHIN, "$file")
Yes, I checked that $file in these cases contains the proper path
without any \n or other unwanted stuff and that I really chdir'ed
to where I thought I chdir'ed. All appears to be exactly what I
want but still the script dies.
Die always says 'File or directory not found'. Of course, the file
is there, as is the directory. Both permissions are 777. And as I
said, both _can be read_ if $file is hardcoded. BTW, -w has nothing
to complain about my script.
Should this turn out to be unrelated to Perl, I apologize, but at
the moment I'm totally puzzled and don't even know where to look
for an answer.
TIA,
Juergen Puenter
------------------------------
Date: 16 Jul 1998 15:07:10 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: Juergen.Puenter@materna.de (J|rgen P|nter)
Subject: Re: open (IN, "foo.txt") works, open (IN, "$foo") does not???
Message-Id: <oguptv9t.fsf@mailhost.panix.com>
Juergen.Puenter@materna.de (J|rgen P|nter) writes:
> open (FHIN, "$file") || die "Error 1: $!\n";
You might want to be explicit about your filemodes; it helps in
maintenance. Also, your error message is not informative. Finally,
you may wish to omit the trailing newline in your die() so that perl
will tell you the line number.
open (FHIN, "<$file") || die "Can't open '$file' for read: $!";
See if these suggestions help you sort out your problem.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
Date: Thu, 16 Jul 1998 18:15:57 GMT
From: marc_mims@my-dejanews.com
Subject: Passing null BSTR pointer with Win32::OLE
Message-Id: <6olg0t$7oc$1@nnrp1.dejanews.com>
I read Jan Dubois' excellent article, Win32::OLE, in issue #10 of TPJ. I have
successfully automated many tasks with Microsoft Visual SourceSafe using the
techniques described. I am, however, having difficulty with a particular
method, Get. Its first parameter is prototyped as follows:
[in,out,defaultvalue(0)]BSTR *Local
It behaves differently in each of three cases. 1) Passing a specific string,
2) passing an empty string, 3) passing NULL.
I need the third option, passing NULL, and can't seem to find the proper
syntax in Perl. Any assistance would be appreciated.
In C++, I would use the following
BSTR local = NULL;
HRESULT hr = item->Get(&local);
-Marc
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 16 Jul 1998 18:49:20 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Perl Beautifier Home Page
Message-Id: <6olhvg$sbq$1@marina.cinenet.net>
John Porter (jdporter@min.net) wrote:
: Larry Rosler wrote:
: >
: > That's no excuse! It is trivial to split long quoted strings over more
: > than one line and unite the fragments by concatenation or by join('',
: > ...).
:
: Oog. You're adding executable code, just (nominally) for convenience
: whilst editing? Eeeiw.
'Join does seem to be overkill for this. I tend to use string ' .
'concatenation instead, since it is equally easy to read and ' .
'does not require an extraneous code snippet after the text.'
Of course, my favorite solution to this problem is that used by C/C++, in
which adjacent string literals are folded together during preprocessing;
"Some text "
"and some more"
becomes
"Some text and some more"
Can't beat that...no extraneous stuff in the source, no runtime overhead.
Could such string-folding work in Perl? Would it break any existing
elements of the language?
---------------------------------------------------------------------
| 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: 16 Jul 1998 18:55:57 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl Beautifier Home Page
Message-Id: <900615879.753530@thrush.omix.com>
Russ Allbery <rra@stanford.edu> wrote:
: John Porter <jdporter@min.net> writes:
: > It may (arguably) be that 80 columns is too narrow for usefulness.
: It's *definitely* not. There's no reason whatsoever to use more than 80
: columns.
Yes, there is.
: I'd recommend anyone who is interested in this issue read some
: of the theoretical work on ideal line lengths for people reading. More
: than about 60-70 characters makes it difficult to track from line to line
: because the distance from the end of the line to the beginning of the next
: line is long enough that you brain is having to search for the next line.
Agreed, for your standard paragraph widths of text blocks.
But we're not talking about your standard
paragraph width here, we're talking about
code.
Code which is likely going to have deep
nesting at some points.
This throws the "ideal line length"
argument out the window, as the real
"line length" may well be >80 columns,
but that's not including leading white
space.
In such cases the code "paragraph"
may look much like this text
paragraph.
print (
'Do you really expect a'
. ' programmer to concatenate'
. ' arguably moderate lines'
. ' and statements such that'
. ' they fit like this?'
);
Sorry, I don't buy it.
Should anything and everything of such deep nesting be pulled out
into its own function/method? Maybe, maybe not. It might just be a
big default data structure. If you're embedding other languages
such as SQL it gets worse:
sub foo {
while (my $row = $sth->fetchrow_hashref()) {
my $sth2 = $dbh->prepare ("
SELECT
*
FROM
something
WHERE
foo = $row->{SOME_COLUMN}
AND (
this = that
OR (
dog = cat
fish = mutt
)
)
") or die 'dbi error: ' . $dbh->errstr();
while (my $innerRow = $sth2->fetchrow_hashref()) {
...etc...
You don't need to be using any other languages however to have
nesting deep enough to cause problems. Hell, long variable names
that make code easier to read and understand can start causing
such problems with >80 text very quickly. And then there's
working with same line comments:
$myWhatever = new What::Ever::Module (
SomeOption => 'some value', ## Some comments that may
SomeOtherOption => 'something else, ## not even be big, but if you
SomeThing => 'foobar', ## are restricted to >80
SomeFoo => 'dog', ## columns,
## They must start looking like this in order that you don't
SomeBar => 'foo',
## "violate" the no-man zone after the 80 column point
YaRight => 'cat',
);
In some cases where you have really long comments per option, it
of course makes sense to put them on there own line. But if you've
got a lot of options or elements of a data stucture, even short
comments would be required to use this much (IMHO) uglier and
harder to read/understand style throughout.
It takes very, very little to blow away 80 columns, with no
single statement ever being close to 80 columns in length. This
is why some people then choose to just make the problem worse by
using (blagh!) 2 space indents...
: Every modern computer language has sane continuation methods or is
: whitespace-flexible. Perl certainly is.
print SOME_HANDLE (
"Like I said, this isn't a"
. " question of"
. "whitespace-flexibility or"
. "continuation operators."
);
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: Thu, 16 Jul 1998 10:01:57 -0400
From: John Paul Hernandez <jph@sjrwmd.state.fl.us>
Subject: Question - push() unique?
Message-Id: <35AE07D5.96894181@sjrwmd.state.fl.us>
is there a function or some other elegant way to push a value onto an
array IF that value does not already exist in the array?
something like, push(@a,$v) unless $v exists is @a ?? i looked at
exists, and that seems to work only for a hash.
do i really need to use a foreach loop and verify each array element
before pushing?
any modules?
thanks in advance.
--
-------------------------------------------------
John P. Hernandez UNIX System Administrator
St. Johns River Water Management District
904-329-4884 jph@sjrwmd.state.fl.us
-------------------------------------------------
------------------------------
Date: 16 Jul 1998 18:38:06 GMT
From: aarond@alpha.ewl.uky.edu (Aaron B. Dossett)
Subject: Re: Question - push() unique?
Message-Id: <6olhae$ajf$1@service3.uky.edu>
John Paul Hernandez (jph@sjrwmd.state.fl.us) wrote:
> is there a function or some other elegant way to push a value onto an
> array IF that value does not already exist in the array?
>
> something like, push(@a,$v) unless $v exists is @a ?? i looked at
> exists, and that seems to work only for a hash.
Is there a reason you couldn't just use a hash instead of an array?
-Aaron
--
Aaron B. Dossett | Finger aarond@london.cslab.uky.edu for PGP key
dossett@bigfoot.com|
Comp. Sci. Senior | http://www.ewl.uky.edu/~aarond
University of Kentucky 1996 & 1998 NCAA Basketball Champions
------------------------------
Date: 16 Jul 1998 12:49:05 -0500
From: Dave Duchscher <daved@orion.tamu.edu>
Subject: Re: Removing the ^M character
Message-Id: <ue3ec1znxq.fsf@orion.tamu.edu>
xie@netcom.com (Sheppard) writes:
> Dave Duchscher (daved@orion.tamu.edu) wrote:
>
> : Not a DOS expert, but don't DOS files end in ^M (CR) not ^M^J (CR LF)
> : so the first removes all line termination and the second never
> : matches.
>
> DOS lines end with 0x0d 0x0a, UNIX lines end with 0x0a
Thanks for the clarification.
> a solution might be:
>
> $newline = pack("C",0x0A); # unix newline character
> local($dos_newline) = pack("CC",0x0D,0x0A); # dos newline character
>
> $line =~ s/$dos_newline/$newline/go; # exchange newlines
I think You are trying to solve the wrong problem. I don't believe
the problem is with the representation of the newline or carriage
return characters.
\r = \x0D = \015
\n = \x0A = \012
See my other to some of the things I noticed wrong with the original
posters code. I went down the incorrect track do to my lack of
knowledge of DOS.
DaveD
------------------------------
Date: 16 Jul 1998 12:54:56 -0500
From: Dave Duchscher <daved@orion.tamu.edu>
Subject: Re: Removing the ^M character
Message-Id: <ue1zrlznnz.fsf@orion.tamu.edu>
Dave Duchscher <daved@orion.tamu.edu> writes:
> This should work. (At least it worked just a second ago.)
>
> $line =~ s/\r$//
>
> or in a command line style:
>
> perl -i.bak -ne 's/\r$//' <file>
Hate to followup to my own post, but that should be:
perl -p -i.bak -ne 's/\r$//' <file>
DaveD
------------------------------
Date: 16 Jul 1998 19:23:47 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Sendmail ?
Message-Id: <900617549.814033@thrush.omix.com>
Eli the Bearded <*@qz.to> wrote:
: Zenin is arguing that plain vi is obsolete and that for vi style
: editing you should use one of the newer clones. There is some
: merit to this argument.
Yep. I'd *only* ever recommend stock vi for sysadmins that must
jump from random box to random box a lot. For anyone that does
any real amount of coding, to use stock vi is to waste your life
away in extra effort. Do you use /bin/sh for your shell with
the stock /etc/profile too? Didn't think so.
Personally, I can't stand vi but I do respect the reasons some
people like the basic interface. But if you're going to use
it, at the very least get a version that supports basic features
such as split screen et al. And no, adding features doesn't
need to bloat the editor. -The editor I use, "joe", is often
*smaller* then the /bin/vi! With nearly all the most useful
features of Emacs (minus the bloat of all the lisp stuff) and
then some, it's an exercise in well build, efficient, and
portable software. If you don't need an editor to enforce your
code style more then basic auto-indentation and such (aka, the
hugely annoying (IMHO) cperl mode of Emacs...), joe is great.
: You want ed(1). ed(1) is the standard editor.
Nope, you want cat(1). Cat is the editor of Real Men[tm].
: This is fewer keystrokes:
: vi filename [enter] 100 G c c <new line typed in> [esc] Z Z
Or in joe:
joe +100 filename [enter] ^y <new line typed in> [enter] ^kx
In the end, it's just a case of which key you wish to ware out
first, your escape, control, or (blagh) mouse key.
: And a perl solution:
: perl -i -pe's/.*/<new line typed in>/ if$.==100' filename [enter]
Or one char shorter (maybe faster?):
perl -i -pe'$_="new line typed in\n" if$.==100' filename [enter]
:-)
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: Thu, 16 Jul 1998 14:06:59 -0500
From: JLEHMANN <JLEHMANN@dsccc.com>
Subject: Setting up Perl database
Message-Id: <35AE4F53.FD79A83F@dsccc.com>
I'm looking to create a service where buyers and sellers can meet up.
Sellers will submit record(s) of their goods, and buyers will search the
database for record(s) they're interested in, and get the seller's
email.
I'm thinking perl is the language to do this with. In what ways could I
set up this database that would hold thousands of entries?
I believe:
- A text file could be used but would not be very robust or quick
- a DBMS must be implemented, such as Mini SQL.
(set me straight if i'm out of line or am missing some options)
The person I'm writing this code for has bought a domain at
dynamicweb.net with about 15 megs of space. I've setup a Java applet
that queried MSQL on my local machine before, but I have no idea how
would I go about setting up a MSQL server/database on this dynamicweb
server.
Any and all advice is appreciated,
John
jlehmann@dsccc.com
------------------------------
Date: Thu, 16 Jul 1998 13:59:23 GMT
From: jacd@tessella.co.uk (Damian Jackson)
Subject: Trapping signals under NT4.0?
Message-Id: <Ew6xJ0.88H@tessella.co.uk>
Hi,
I have a perl script that is currently running under UNIX
(on a Sun) that has some code for trapping the ctrl-Y key
combination. This is done simply by setting $SIG{TSTP} to point
to the handler routine. All this works fine, only now I have to
port the code over to a PC under NT4. I tried using the Config
module to look at the available signals but they all came out as
blank, therefore I figured that it might not be possible to do
this under NT. Does anyone know if there is a way to trap a ctrl
key press (specifcally ctrl-Y) under NT? Thanks in advance.
Damian Jackson
-----------------------------
Damian.Jackson@tessella.co.uk
--
TESSELLA Damian Jackson (Damian.Jackson@tessella.co.uk)
__/__/__/ Tessella Support Services plc
__/__/__/ 3 Vineyard Chambers, ABINGDON, OX14 3PX, England
------------------------------
Date: Thu, 16 Jul 1998 14:21:23 -0400
From: "Seth Wandersman" <wandersman@wilbursmith.com>
Subject: web hosting problems
Message-Id: <35ae470f.0@news.scsn.net>
I created a cgi script and now I can't find a place to put it on. does
anyone know any free sites like geocities or something where I could put it?
I'm sorry if this is an inappropriate place to post.
------------------------------
Date: 16 Jul 1998 14:46:31 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: What is awk better at than perl? (Larry quote)
Message-Id: <6olhq7$rg$1@monet.op.net>
In article <opus-1507981940170001@dave.magibox.net>,
Brock Sides <opus@magibox.net> wrote:
>So what is it that awk is (or was) better at?
... | awk '{print $1}'
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 3179
**************************************