[9289] in Perl-Users-Digest
Perl-Users Digest, Issue: 2884 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 16 14:17:14 1998
Date: Tue, 16 Jun 98 11:00:50 -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 Tue, 16 Jun 1998 Volume: 8 Number: 2884
Today's topics:
Re: ascii to hex <aqumsieh@matrox.com>
Re: Curly braces in if elsif contructs (Paul David Fardy)
Re: fixed width files into an array ? <quednauf@nortel.co.uk>
Re: fixed width files into an array ? <rootbeer@teleport.com>
Having STDERR go to STDOUT in a system call <Brett.W.Denner@lmco.com>
Re: Having STDERR go to STDOUT in a system call <alex@cmhc.com>
Re: Having STDERR go to STDOUT in a system call <rootbeer@teleport.com>
Re: Having STDERR go to STDOUT in a system call <rootbeer@teleport.com>
Re: HELP: Perl Scripts for a unix host using Apache <rootbeer@teleport.com>
Re: How can I run Perl in Microsoft Access ? scott@softbase.com
How to delete a character from a string? <at@pixelfilm.com>
Re: How to delete a character from a string? (Andy Lester)
Re: I need a simple scrip that... rpearce@my-dejanews.com
Re: insert - quick script <jdf@pobox.com>
Re: insert - quick script <rootbeer@teleport.com>
Re: insert - quick script <quednauf@nortel.co.uk>
Is there a module for rmon? (DIAL|MB|Higher Powered Software - Ed Finch)
Re: Is there a module for rmon? <rootbeer@teleport.com>
Re: Newbie question <quednauf@nortel.co.uk>
Perl with ASP? <warp@internetcom.com.br>
Re: Perl with ASP? <rootbeer@teleport.com>
Re: pod syntax error (Tye McQueen)
Re: prob with *.txt file <rootbeer@teleport.com>
Re: Problem with MOMSpider <bowlin@sirius.com>
Re: raliases???? <paraicoc@aldiscon.ie>
Re: REGEX HELP <rootbeer@teleport.com>
Re: REVIEW: Perl CGI Programming - No Experience Requir <franzen@pmel.noaa.gov>
script that will replace a image and some text on a web <nospam@nospam.com>
Re: Script to monitor email traffic <rootbeer@teleport.com>
stat() and file attributes? <alcazar@netcomp.net>
Re: stat() and file attributes? (Stuart McDow)
Re: strange error message .. "value of <handle> ..." <ebohlman@netcom.com>
Re: substitute backslash (Craig Berry)
Training References?? (Christine McDevitt)
Win NT- CGI script help please <edgar@sbrt.com>
Re: Win NT- CGI script help please <bowlin@sirius.com>
Re: Windows95, Perl-32 and Personal Web Server (PWS) <warp@internetcom.com.br>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 16 Jun 1998 12:04:26 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: ascii to hex
Message-Id: <3586978A.171779E2@matrox.com>
Jim Brewer wrote:
> Ala Qumsieh <aqumsieh@matrox.com> writes:
>
> > Jason Oakley wrote:
> >
> > > How do i convert eg. "hello21" into it's hex equiv of each
> > > character?
> > > ------------
> > Here's a one-liner:
> >
> > $bit = unpack("H*", pack("A*", "hello21"));
>
> Isn't "hello21" already packed into the format 'A*'?
Yes! My mistake!
> Do I need to
> pack/unpack in order to achieve the desired result?
>
No! My mistake!
> Jim Brewer
$bit = unpack("H*", "hello21");
--
Ala Qumsieh | No .. not just another
ASIC Design Engineer | Perl Hacker!!!!!
Matrox Graphics Inc. |
Montreal, Quebec | (Not yet!)
------------------------------
Date: 16 Jun 1998 15:35:25 GMT
From: pdf@morgan.ucs.mun.ca (Paul David Fardy)
Subject: Re: Curly braces in if elsif contructs
Message-Id: <6m63bt$amb$1@coranto.ucs.mun.ca>
Ask Bjoern Hansen (ask@netcetera.dk) wrote:
>> } elsif ($testset eq "esfs") {
>> What do you think?
scott@softbase.com writes:
> I absolutely, positively, 100% ***HATE*** the style you propose and
> would use a source reformatter to obliterate it from the universe if
> any of it got near me. Such strong reactions are not unusual in
> the war of indention styles.
[ If my tone appears stronger than I meant it, I've failed to
suppress my reaction to violent words like "obliterate" and
prejudicial words like "obfuscate" and "squiggles". :-) ]
Okay, there's your real problem, right there. You are _much_ too
emotionally attached to your chosen code format. Relax.
Go for a walk. Find beauty in nature.
Don't expect it from source code... especially Perl: its reputation
as a write-only language is not without basis. There's more than
one use for almost every %&@! character on the keyboard. On just
page 12 of the Camel we have the following code.
#!/bin/sh -- # perl, to stop looping
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
if 0;
That little bit of arcana deserves at least one of Knuth's dangerous
bends. It rivals Bolsky and Korn.
export FILE=$HOME/.envfile
# The subscript below evaluates to 0 when interactive.
ENV='${FILE[(_$-=0)+(_=1)-_${-%%*i*}]}'
There's a madness in the method.
Ah, but it does have a certain charm. :-)
[ Okay, those are extreme examples. But they're colourful.
I could include mundane examples, but they'd just be boring. ]
>I dislike this, and the equivalent C
> if () {
> } else {
> }
>on the grounds that it obfuscates the code unnecessarily. An important
>keyword should not be left on the ground amongst a dense undergrowth of
>squiggles. It needs to be held up high where people can notice it.
I don't think of the "key" in "keyword" as "important". I think
of "key" as a lookup, like a hash. It points to a concept stored
in my memory; it's just a mnemonic key. Like punctuation, it
should serve the code; I don't think it should be "held up high".
>Also, the obfuscatory style defeats good block structuring by defeating
>the logical structure of the code. Both the if and else are important
>and need to begin a block, not be nested in a squiggle forest.
As has already been said, the braces (frankly, it's unfair to
deride them with the term "squiggles") structure blocks. That's
not the role of keywords unless those keywords include "fi",
"esac", and "done".
In opposition to the "uncuddled else", I argue that the "else" is
simply a dependent of its "if" and, to my mind, it's better to
express that by cuddling the else. Further, the "one true brace
style" was illustrated first in the seminal work of Kernighan &
Ritchie. It works and everyone should be familiar with it.
That really is enough to say "use the OTBS", but not if you've
demonstrated something better. I just don't think that anyone has
demonstrated anything better. It's not a cast-in-stone rule
by any means. I just think you have to have a better argument
for varying the style; better than I've seen here, anyway.
Paul Fardy
--
Paul David Fardy | pdf@morgan.ucs.mun.ca
Computing and Communications | pdf@InfoNET.st-johns.nf.ca
Memorial University of Newfoundland |
St. John's, NF A1C 5S7 |
------------------------------
Date: Tue, 16 Jun 1998 16:53:03 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: fixed width files into an array ?
Message-Id: <358694DF.ED055469@nortel.co.uk>
Chris Beatson wrote:
>
> Could someone please advise me as to the best way to read a fixed width
> text file line into an array ?
see the read command under perlfunc
--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________
------------------------------
Date: Tue, 16 Jun 1998 17:05:09 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: fixed width files into an array ?
Message-Id: <Pine.GSO.3.96.980616095826.7978L-100000@user2.teleport.com>
On Tue, 16 Jun 1998, Chris Beatson wrote:
> Could someone please advise me as to the best way to read a fixed width
> text file line into an array ?
Define "best". What's best for me may not be best for you, and there's no
point in any of us wasting our time until you can say just what you want.
You may need to choose among fastest, most memory efficient, easiest to
program, fewest lines of code, most robust, most portable, easiest to
debug, easiest to maintain, most like your other favorite programming
languages, or perhaps you want something else. (Of course, one solution
may fall into more than one of these categories.)
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 16 Jun 1998 11:41:46 -0500
From: Brett Denner <Brett.W.Denner@lmco.com>
Subject: Having STDERR go to STDOUT in a system call
Message-Id: <3586A04A.A8C09387@lmco.com>
I have an executable program that is called through a Perl script. The
executable program periodically writes information to both STDOUT and STDERR.
I can redirect the output sent to STDOUT by running the program with:
$ret = system "my_program > file.txt";
but this does not catch the writes to STDERR.
I have tried this approach:
open (STDOUT, "> file.txt") or die;
open (STDERR, "> file.txt") or die;
$ret = system "my_program";
but I don't know how to "undo" the two open statements so that future writes
or prints go to the original STDOUT and STDERR instead of file.txt. If I
close STDOUT and STDERR, any writes or prints later in the script do not work.
Can anyone suggestion a way to accomplish this?
Thanks,
Brett
--
Brett W. Denner Lockheed Martin TAS
Brett.W.Denner@lmco.com P.O. Box 748
(817) 935-1144 (voice) Fort Worth, TX 76101
(817) 935-1212 (fax) MZ 9333
------------------------------
Date: Tue, 16 Jun 1998 16:58:01 GMT
From: "alex" <alex@cmhc.com>
Subject: Re: Having STDERR go to STDOUT in a system call
Message-Id: <tuxh1.337$iB.478806127@newsreader.digex.net>
Brett,
Hope you haven't tried this:
Try closing STDOUT and then selecting it again.
close (STDOUT);
select (STDOUT);
Maybe that might work.
Good Luck,
Alex Rogowski
Brett Denner wrote in message <3586A04A.A8C09387@lmco.com>...
>I have an executable program that is called through a Perl script. The
>executable program periodically writes information to both STDOUT and
STDERR.
>I can redirect the output sent to STDOUT by running the program with:
>
> $ret = system "my_program > file.txt";
>
>but this does not catch the writes to STDERR.
>
>I have tried this approach:
>
> open (STDOUT, "> file.txt") or die;
> open (STDERR, "> file.txt") or die;
> $ret = system "my_program";
>
>but I don't know how to "undo" the two open statements so that future
writes
>or prints go to the original STDOUT and STDERR instead of file.txt. If I
>close STDOUT and STDERR, any writes or prints later in the script do not
work.
>
>Can anyone suggestion a way to accomplish this?
>
>Thanks,
>
>Brett
>
>--
> Brett W. Denner Lockheed Martin TAS
> Brett.W.Denner@lmco.com P.O. Box 748
> (817) 935-1144 (voice) Fort Worth, TX 76101
> (817) 935-1212 (fax) MZ 9333
------------------------------
Date: Tue, 16 Jun 1998 17:18:37 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Having STDERR go to STDOUT in a system call
Message-Id: <Pine.GSO.3.96.980616101746.7978Q-100000@user2.teleport.com>
On Tue, 16 Jun 1998, Brett Denner wrote:
> Subject: Having STDERR go to STDOUT in a system call
> Can anyone suggestion a way to accomplish this?
Isn't this in section eight of the FAQ? Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 16 Jun 1998 17:27:18 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Having STDERR go to STDOUT in a system call
Message-Id: <Pine.GSO.3.96.980616101844.7978R-100000@user2.teleport.com>
On Tue, 16 Jun 1998, alex wrote:
> Try closing STDOUT and then selecting it again.
>
> close (STDOUT);
> select (STDOUT);
>
> Maybe that might work.
You seem to be sacrificing an incorrect number of goats. :-)
I'm not sure why you think that selecting a closed filehandle will help
anything. But catching STDERR from an external command is covered in the
FAQ in any case. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 16 Jun 1998 17:12:10 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: HELP: Perl Scripts for a unix host using Apache
Message-Id: <Pine.GSO.3.96.980616100847.7978N-100000@user2.teleport.com>
On Tue, 16 Jun 1998, Christian Friedl wrote:
> My problem is that I'm working on a Win95 machine at home and have to
> write scripts for a unix host that doesn't show me any error messages
> except "Internal Server Error".
It sounds as if you're talking about CGI programming. Are you? You should
still be able to test most programs from the command line.
> Is it possible there are bugs in CGI.pm?
Every program has at least one bug. :-)
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.
http://www.perl.com/CPAN/
http://www.perl.org/CPAN/
http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.org/CPAN/doc/manual/html/pod/
Hope this helps!
> +++ please remove ".nospam" when replying via email +++
Please remove ".nospam" when desiring replies via email.
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 16 Jun 1998 15:37:10 GMT
From: scott@softbase.com
Subject: Re: How can I run Perl in Microsoft Access ?
Message-Id: <6m63f6$1mp$3@mainsrv.main.nc.us>
BBQ (warp@internetcom.com.br) wrote:
> My name is Finie, how can I run Perl in Microsoft Access ?
The word "in" is somewhat misleading -- if your question is taken
literally, you're asking how to run a Perl program from within
Microsoft Access itself, from VBA code. The answer is to use the VBA
Shell command. You can use the built in VBA file I/O commands to
convert Access data into a text file format Perl can handle, and read
output from the Perl program by redirecting it to a file and reading it
with VBA commands. For a lot of complex processing, you might
want to look at exporting the database as a CSV file and creating
one out of the results for Access to import.
But I doubt that's what you really mean. You probably really are asking
the exact opposite, how to use an Access database from within a Perl
program. For that, there's Win32::ODBC package available on the net.
Just search for it.
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: Tue, 16 Jun 1998 19:34:02 +0200
From: Alex T <at@pixelfilm.com>
Subject: How to delete a character from a string?
Message-Id: <3586AC8A.3F33C91A@pixelfilm.com>
Hi!
I have a variable, for example "$xy". If the first character is "0", the
character should be
deleted.
How can I compare and delete a character from a string???
Please help!!
alex (hamburg germany)
------------------------------
Date: 16 Jun 1998 17:47:37 GMT
From: petdance@maxx.mc.net (Andy Lester)
Subject: Re: How to delete a character from a string?
Message-Id: <6m6b3p$is4$1@supernews.com>
: I have a variable, for example "$xy". If the first character is "0", the
: character should be
: deleted.
: How can I compare and delete a character from a string???
You want to look at the s/// operator in the Perl documentation.
xoxo,
Andy
--
--
Andy Lester: <andy@petdance.com> http://tezcat.com/~andy/
Chicago Shows List: <shows@ChicagoMusic.com> http://ChicagoMusic.com/
------------------------------
Date: Tue, 16 Jun 1998 15:57:18 GMT
From: rpearce@my-dejanews.com
Subject: Re: I need a simple scrip that...
Message-Id: <6m64ku$h2m$1@nnrp1.dejanews.com>
In article <01bd98b7$2bf11960$ca7852a6@immortal>,
"Andy Sain" <lsain@vnet.net> wrote:
>
> I need a simple script that will track my .html pages and tell me what
> traffic each are getting...and free woudl be nice:-)
> Thanks...please send replies to groups as well as lsain@vnet.net or ICQ me
> at 650225
> THanks,
> ANdrew
There's a ton of page counters and stat keepers available. Have you tried
doing a search for either topic? There are some free remote counters/stats
that you can use. You can find some scripts at www.cgi-resources.com .
You might try doing a little more personal research before posting to a group
like this. Folks don't like posts that sound like you want to be spoon fed
free food. You'll save yourself alot of flaming and you might actually learn
something in the process.
Good luck,
Rick...
>
> --
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Andrew Sain <mailto:lsain@vnet.net> ICQ 650225
> Web Hosting & Design <http://www.net-matrix.com/>
> GraphX Kingdom <http://www.net-matrix.com/graphx/>
> $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
>
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 16 Jun 1998 12:13:03 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: jon@blading.com
Subject: Re: insert - quick script
Message-Id: <wwah8e3k.fsf@mailhost.panix.com>
jon@blading.com writes:
> i'm trying to write a quick script that will insert a small bit of
> text and a tab mark to the beginning of every line in a file.
perl -pi.bak 's/^/sometext\t/'
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
Date: Tue, 16 Jun 1998 17:07:35 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: insert - quick script
Message-Id: <Pine.GSO.3.96.980616100659.7978M-100000@user2.teleport.com>
On 16 Jun 1998, Jonathan Feinberg wrote:
> > i'm trying to write a quick script that will insert a small bit of
> > text and a tab mark to the beginning of every line in a file.
>
> perl -pi.bak 's/^/sometext\t/'
I think you meant to include -e before that code. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 16 Jun 1998 17:45:32 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: insert - quick script
Message-Id: <3586A12C.424721A1@nortel.co.uk>
jon@blading.com wrote:
>
> hello
> i'm trying to write a quick script that will insert a small bit of text
> and a tab mark to the beginning of every line in a file. what i have is:
>
> #!/usr/bin/perl -pi.bak
> s/(\S+?)/text\t$1\t\n/g;
check this out:
print "gimme a sumtin:";
$testthis = <STDIN>;
$testthis =~ s/^/You wrote:\t/;
print $testthis;
excerpt from perlre:
By default, the ``^'' character is guaranteed to match at only the beginning of
the string, the ``$'' character at only the end ...
--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________
------------------------------
Date: 16 Jun 1998 16:18:36 GMT
From: efinch@yellow.vais.net (DIAL|MB|Higher Powered Software - Ed Finch)
Subject: Is there a module for rmon?
Message-Id: <6m65ss$i9@netaxs.com>
I'm interested in using the rmon protocol to collect data from our
comm equipment. I searched CPAN but didn't find a module for this. Is
one being developed?
Ed
Microsoft Windows: the Budweiser of operating systems.
------------------------------
Date: Tue, 16 Jun 1998 17:16:55 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Is there a module for rmon?
Message-Id: <Pine.GSO.3.96.980616101619.7978P-100000@user2.teleport.com>
On 16 Jun 1998, DIAL|MB|Higher Powered Software - Ed Finch wrote:
> I'm interested in using the rmon protocol to collect data from our
> comm equipment. I searched CPAN but didn't find a module for this. Is
> one being developed?
Check the modules list. If it's not there, register your intent to write
your own module. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 16 Jun 1998 16:47:41 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: Newbie question
Message-Id: <3586939D.9BC2046B@nortel.co.uk>
Thomas Resing wrote:
[cut]
> foreach $file (sort readdir(IDIR)) {
> print "<img src=",$myurl.$file,"><br>\n" if $file =~ /gif/;
> print "<img src=",$myurl.$file,"><br>\n" if $file =~ /jpg/;
> }
> closedir(IDIR);
[cut]
Yep. However, there might be situations where no URL will reach the files...
--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________
------------------------------
Date: Tue, 16 Jun 1998 13:34:17 -0300
From: "BBQ" <warp@internetcom.com.br>
Subject: Perl with ASP?
Message-Id: <6m66qj$bu2@www001.itanet.com.br>
Does anyone know if it is possible to use Perl as the default scripting
language within Active Server Pages (instead of VBScript or JavaScript)?
Somewhere along V. InterDev's documentation it says that it can be done, but
doesn't exactly tell you much apart from that.
Any hints or pointers?
------------------------------
Date: Tue, 16 Jun 1998 17:41:48 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Perl with ASP?
Message-Id: <Pine.GSO.3.96.980616104104.7978X-100000@user2.teleport.com>
On Tue, 16 Jun 1998, BBQ wrote:
> Does anyone know if it is possible to use Perl as the default scripting
> language within Active Server Pages (instead of VBScript or JavaScript)?
The docs, FAQs, and newsgroups about Active Server Pages (and related
topics) may be of some assistance. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 16 Jun 1998 12:07:07 -0500
From: tye@fohnix.metronet.com (Tye McQueen)
Subject: Re: pod syntax error
Message-Id: <6m68nr$gk6@fohnix.metronet.com>
Ask Bjoern Hansen <ask@netcetera.dk> writes:
) What's wrong with this?
)
) =head1 TEST
)
) $r-E<gt>push_handlers(PerlHandler =E<gt>
) $self-E<gt>perl_handler_method($r);
)
) It returns:
)
) /usr/bin/pod2man: bad option in paragraph 2 of test.pod:
) ``perl_handler_method($r)'' should be [LCI] <perl_handler_method($r)>
)
) I've tried all sorts (well, all I can imagine) of removing and
) replacing >'s with E<gt>.
It is just warning you that you entered what looked like code
[which should be in C<>] or a documentation reference [a.k.a link,
which should be in L<>] and didn't mark it as such. Several
replacements come to mind. The best two are below with by far
the best saved for last:
=head1 TEST
The spacing of this code is ignored because POD text
paragraphs are wrapped and probably justified:
C<$r-E<gt>push_handlers(PerlHandler =E<gt>
$self-E<gt>perl_handler_method($r) );>.
To control the spacing, indent your code and no quoting
is required at all:
$r->push_handlers(PerlHandler =>
$self->perl_handler_method($r) );
=cut
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
------------------------------
Date: Tue, 16 Jun 1998 16:43:06 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: prob with *.txt file
Message-Id: <Pine.GSO.3.96.980616093934.7978H-100000@user2.teleport.com>
On Tue, 16 Jun 1998, Marc Bornes wrote:
> WHEN A FILE IN FORMAT *.TXT IS DISPLAYED ON THE SCREEN HOW CAN I FREEZE
> THE TWO FIRST LINES AS HEADINGS.
There's no need to shout.
If you're trying to get some program (such as a web browser) to do what
you want, it's a simple matter of sending it the proper instructions. The
docs, FAQs, and newsgroups about the program and protocol you're using may
be helpful here. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 16 Jun 1998 09:47:54 -0700
From: Jim Bowlin <bowlin@sirius.com>
To: James Sutherland <jasuther@dux.dundee.ac.uk>
Subject: Re: Problem with MOMSpider
Message-Id: <3586A1BA.DC4A364F@sirius.com>
James Sutherland wrote:
>
> OK, so I can:
> 1. Install Perl4
> 2. Convert MOMSpider to Perl5
> 3. Ditch MOMSpider and write my own link-checker.
>
> 1. I can't really install Perl4 again on the WWW server.
> 2. Hmm. Big undertaking, but then that's what I thought when I fixed
> WebCopy to handle redirects.
> 3. Write my own checker? No thanks. That would be a BIG job and a half..
>
> OK, so I'll re-write MOMSpider to use Perl5. If anyone out there has
> started on this, or has any info on porting 4->5, please let me know!
>
> James Sutherland
You may want to take a look at
http://www.goldwarp.com/bowlin/linklint/
This is a shareware link checker written in Perl 4 but it works in
Perl 5 as well. It might do what you want better than MOMSpider,
even after the port.
-- Jim Bowlin
------------------------------
Date: Tue, 16 Jun 1998 17:39:03 +0100
From: Paraic O'Ceallaigh <paraicoc@aldiscon.ie>
To: Chris Reynolds <cmreynolds@hotmail.com>
Subject: Re: raliases????
Message-Id: <35869FA7.71F14DD9@aldiscon.ie>
Chris Reynolds wrote:
> >> make a script that will extract the email address corresponding to an
> >> email alias in unix.
> >
> >Perhaps you want to read the system mail aliases database? If that's not
> >what you want, maybe you should ask again. Hope this helps!
> Well, I did that. But for some reason I must be missing something,
> basically it's not working!
Try this - it should do the trick:
#!/bin/sh -f
MAILHOST=mailhost
MAILPORT=25
if [ $# -lt 1 ]; then
echo "Usage: showalias <alias-name>"
exit
fi
telnet $MAILHOST $MAILPORT << END 2> /dev/null | grep 250 | cut -c
5- | sort
expn $1
quit
END
..although this belongs in the comp.unix.shell newsgroup.
Regards,
--
Paraic O Ceallaigh mailto:paraicoc@aldiscon.ie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
"You will know the truth and the truth will set you
free..but first it will piss you off!" - Anonymous
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
(Ph) +353 1 819 3514 mailto:swipe@redbrick.dcu.ie
_____________________________________________________
------------------------------
Date: Tue, 16 Jun 1998 16:48:56 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: REGEX HELP
Message-Id: <Pine.GSO.3.96.980616094615.7978I-100000@user2.teleport.com>
On Tue, 16 Jun 1998, Bob Reynolds wrote:
> Subject: REGEX HELP
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> there was an app someone told me about that was a regex generator, does
> anyone know what it was and where its living at the moment?
Yes, it's next to the remote control. :-)
Honestly, with a description as vague as that, how could we know what
program you mean? "There was a business someone told me about that sold
food, does anyone know where it is?" :-)
> alternatively, can anyone suggest some good regex help pages??
The manpages, and the pages of "Mastering Regular Expressions", the Hip
Owls book. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 16 Jun 1998 09:57:16 -0700
From: Nathan Franzen <franzen@pmel.noaa.gov>
Subject: Re: REVIEW: Perl CGI Programming - No Experience Required
Message-Id: <Pine.SOL.3.96.980616091451.7716A-100000@corona.pmel.noaa.gov>
> In article <6m5gcl$j78$1@samba.rahul.net>, c.c.eiftj@54.usenet.us.com
> (Rahul Dhesi) wrote:
>
> # To show that lists and arrays are different, you would have to (a) have
> # a good unambiguous definitions of 'list' and 'array', and *then* show
> # that they behave differently. Until you have such definitions no amount
> # of perl code will prove anything.
And Chris Nandor replied:
>
> You have been given a completely unambiguous definition. You just don't
> understand it. An array has an AV allocated, and a list is just some
> values on a stack somewhere.
I'd like to point out that this definition is both a good one, and one
which does not appear obviously in the documentation. (OK, I know
every comment regarding the documentation has to be spelled out carefully,
so skip this parenthetical comment if you are already comfortable with the
previous sentence. I'm relatively new to perl, so I do not know the docs
inside and out. However, I have perused Learning Perl, my copy of
Programming Perl is getting dog-eared, and I'm familiar with the locations
of the perl documentation on my Unix machine, on the VMS machine (both
5.004) and my Window 95 machine (standard port). When I say that the
definition does not "appear obviously", I mean that *I*, as a reasonably
studious perl beginner, haven't seen it).
Therefore, the statement that "You [which I take to mean 'all Perl
users'] have been given a completely unambious definition" is not wholely
true.
But it's a good definition. Everybody should know that there is such a
thing as the AV, and that it just isn't the same as a list.
Chris goes on to list^H^H^H^Henumerate a number of other difference
between lists and AV. So from the standpoint of the Perl user, the "list"
is an abstraction, a way to think about how Perl shovels values around.
However, I'm not convinced that it is a useful abstraction *at all*. Is
it even possible to look at a list without altering it? I mean, without
using careful debugging tools (which to my mind is peeking behind the
curtain).
Some time ago, during one of the interminable discussions of "list in
scalar context" or whatever the heck it was, I thought to myself, how
would I go about discovering what a list is? Surely a subroutine returns
a pure list, doesn't it? But I don't think so. Each of the "lists"
returned by this subroutine betray its real origins as outputs of the
array, hash, comma operator or range operator that created it.
--------------
#!/opt/local/bin/perl -w
sub whats_a_list{
my $a = shift;
if ($a == 0) { return (5,6,7,8,9,10) }
elsif ($a == 1) { return my @a = (5,6,7,8,9,10) }
elsif ($a == 2) { return my %a = (5,6,7,8,9,10) }
else { return 5..10 }
}
for(0..3){
print scalar whats_a_list($_), "\n";
print whats_a_list($_), "\n";
}
---------------
I'm perfectly comfortable with the idea of "list context" and "scalar
context", but I don't see a "list" anywhere. I think the idea of a "list"
as a thing in and of itself leads to confusion for Perl beginners.
I'm not denying the existence of a list in every sense. (I'm a couple days
into Advanced Perl Programming, and I'm in over my head, but that's ok) I
realize Perl does have stacks of values that it sends around.
Beginners should get documentation that says that the array, the AV, is a
real thing, and the the list is but a fiction.
-Nathan
------------------------------
Date: Tue, 16 Jun 1998 19:34:37 +0200
From: "nospam" <nospam@nospam.com>
Subject: script that will replace a image and some text on a web page once every day
Message-Id: <3586ae7f.0@news4.image.dk>
Hi all,
I have been looking many different places for at script
that will replace a image and some text on a web page
once every day. But with no luck.
I am looking for a script that can read from a file and
do a Server Side Include from that file say once every
24 hours.
The ideal thing was if I could write which text and pictures
I want placed on my page for the next week and then the
script automatically updates the page every day.
I have found various scrips that can random place the
text and images but not script that will change the
text based on time of the day.
Can you help me?
Kind regards
Tony Fabian
<tonny@byggeinfo.dk>
------------------------------
Date: Tue, 16 Jun 1998 16:35:55 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Script to monitor email traffic
Message-Id: <Pine.GSO.3.96.980616093327.7978G-100000@user2.teleport.com>
On Tue, 16 Jun 1998, John Smith wrote:
> I need a script for a linux box that will measure the email traffic for
> a particular user. I know it is simple - I don't have much experience
> with linux and I'm not sure where to start.
I'd recommend that you start by learning Perl with a good book like the
Llama book. If you're also needing information on how your system's mail
handling works, the docs, FAQs, and newsgroups about your software should
be helpful. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 16 Jun 1998 10:46:30 -0500
From: "Ric Alcazar" <alcazar@netcomp.net>
Subject: stat() and file attributes?
Message-Id: <OQXOk3Tm9GA.258@upnetnews05>
Hello all,
I'm new to perl and experimenting with it quite a bit. I stuck,
however, with a problem. I'm trying to list the files within a directory
and the file attributes. I understand that the stat() function can achieve
this, however I'm having trouble trying to get it to work. Here's a snippet
from my code:
($size, $mtime) = stat($file);
print "<tr>\n\t";
print "<td class=files>";
print "$file";
print "</td>\n";
print "<td colspan=2 class=files>$size</td>\n";
print "</tr>\n";
This code is located in a "foreach" loop which properly displays a list of
filenames within the directory,however doesn't not return the proper file
sizes. My result looks like this:
Filename: File Size: Modification
Date:
black.gif
crack.sig
file_id.diz
pc.nfo
genesis.cgi 8388614
genesis.dat 8388614
I'm thoroughly confused and am seeking a solution. Any help will be greatly
appreciated. Thank you.
Ric.
------------------------------
Date: 16 Jun 1998 16:41:18 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: stat() and file attributes?
Message-Id: <6m677e$hmp$1@ns1.arlut.utexas.edu>
"Ric Alcazar" <alcazar@netcomp.net> writes:
>
> ($size, $mtime) = stat($file);
($size, $mtime) = (stat($file))[7,9];
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"Look for beauty in roughness, unpolishedness"
------------------------------
Date: Tue, 16 Jun 1998 17:37:19 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: strange error message .. "value of <handle> ..."
Message-Id: <ebohlmanEunnM7.4CA@netcom.com>
Michael J Gebis <gebis@albrecht.ecn.purdue.edu> wrote:
: I've experienced times when my news service was pretty flaky, and I
: would have a pretty good chance of missing responses through no fault
: of my own, so I feel for these people. But on the other hand, I
: almost always forget to send the mail.
It is *not* rude to say "my news server is acting up, so please CC me on
any followups." There's very little the poster can do about that
situation, and anyone reading the post can sympathize; either something
like that has already happened to them, or it soon will.
But there is a *ton* of difference between requesting a CC so that server
problems beyond your control don't prevent you from seeing a response,
and requesting a CC merely so you don't have to spend the time looking
for a response. Doing the latter conveys a hidden message, namely that
you believe your time is more valuable than other people's.
------------------------------
Date: 16 Jun 1998 16:23:32 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: substitute backslash
Message-Id: <6m6664$hgp$1@marina.cinenet.net>
Ole E. JENSEN (Ole.Jensen@cern.ch) wrote:
: Can anybody tell me how to substitute backslash characters like:
:
: $mystr =~ s/\//g; # Off course this does not work
Just escape the backslash with another backslash:
$mystr =~ s/\\//g;
Of course, for this application, tr may be more efficient:
$mystr =~ tr/\\//d;
---------------------------------------------------------------------
| 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 Jun 1998 17:22:23 GMT
From: cmcdevit@pobox.upenn.edu (Christine McDevitt)
Subject: Training References??
Message-Id: <6m69kf$9c$1@netnews.upenn.edu>
I'm looking for training references for Perl/CGI/HTML at a beginner
to intermediate level. I'm a C programmer with lots of database
experience. Looking for something on the east coast that is
instructor based training.
Would appreciate recommendations. Anyone heard of WestLake Solutions
in the DC area?
Thanks,
Chris
--
------------------------------------------------------------------
Christine McDevitt, Programmer Analyst-Senior
University of Pennsylvania, ISC Network Services
Tues/Wed/Fri: 215-898-9928 fax: 215-898-9348
------------------------------------------------------------------
------------------------------
Date: Tue, 16 Jun 1998 13:03:19 -0300
From: Edgar <edgar@sbrt.com>
Subject: Win NT- CGI script help please
Message-Id: <35869746.4538908F@sbrt.com>
Hi,
I need some advice if you are so kind:
I installed perl 5.004. The last download from the perl site.
After playing around quite a while, modifying the registry for IIS I got
it to work.
However something odd happens.
I have a form which calls a script, the script runs, and produces some
output.
If I change the form input field, the output changes, i.e. the cgi -perl
program works fine.
BUT when I want to modify the perl program to let's say, print a new
title, there is a problem.
I modify the program, save it and when I call it using the mentioned
form, It still gives me the old output copy, as if the old script was
resident in memory. It is as if the program was compiled only once and
then that copy used from memory.
I tried everything, from restarting the browser, to stopping and
restarting the IIS www server.
Apparently the only thing that works is to delete the entire
subdirectory where the program and form reside. Then stopping IIS www
sever, and then coping back the programs and restarting the IIS www
server.
Even then I think on some occasions it gave me trouble.
Any suggestions on how to fix this annoying problem will be greatly
appreciated.
Best regards.
Edgar.
------------------------------
Date: Tue, 16 Jun 1998 10:10:44 -0700
From: Jim Bowlin <bowlin@sirius.com>
To: edgar@sbrt.com
Subject: Re: Win NT- CGI script help please
Message-Id: <3586A714.B723B3CC@sirius.com>
Edgar wrote:
>
> Hi,
>
> I need some advice if you are so kind:
>
> I installed perl 5.004. The last download from the perl site.
> After playing around quite a while, modifying the registry for IIS I got
> it to work.
> However something odd happens.
>
> I have a form which calls a script, the script runs, and produces some
> output.
> If I change the form input field, the output changes, i.e. the cgi -perl
> program works fine.
> BUT when I want to modify the perl program to let's say, print a new
> title, there is a problem.
> I modify the program, save it and when I call it using the mentioned
> form, It still gives me the old output copy, as if the old script was
> resident in memory. It is as if the program was compiled only once and
> then that copy used from memory.
> I tried everything, from restarting the browser, to stopping and
> restarting the IIS www server.
> Apparently the only thing that works is to delete the entire
> subdirectory where the program and form reside. Then stopping IIS www
> sever, and then coping back the programs and restarting the IIS www
> server.
> Even then I think on some occasions it gave me trouble.
>
> Any suggestions on how to fix this annoying problem will be greatly
> appreciated.
>
> Best regards.
> Edgar.
Try a different Web Server. Xitami from iMatix, for example.
-- Jim Bowlin
------------------------------
Date: Tue, 16 Jun 1998 14:15:24 -0300
From: "BBQ" <warp@internetcom.com.br>
Subject: Re: Windows95, Perl-32 and Personal Web Server (PWS)
Message-Id: <6m697l$d3j@www001.itanet.com.br>
I had a similar setup at home, and discovered that PWS simply doesn't do
what it's supposed to with PERL (or anything else for that matter). I
haven't run into the system() problem, but I had many others, like not
managing to print headers diferent than Content-type: html/text\n\n, or
maintaining a persistant connection.
Try running WebSite Lite from O'Reiley! Solved my problem, and its freeware
for non-comercial use...
Last time I checked you could download it from:
http://software.ora.com
HTH!
Pete Sattler wrote in message <01bd98d4$5331c020$LocalHost@VOYAGER>...
>I am trying to set-up an environment on Windows 95 for developing web
>applications. I have installed ActiveState's Perl for Win32 (build 316)
>along with Microsoft's personal web server (PWS). I'm finding that anytime
[snip]
------------------------------
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 2884
**************************************