[11152] in Perl-Users-Digest
Perl-Users Digest, Issue: 4752 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 26 14:07:22 1999
Date: Tue, 26 Jan 99 11:00:26 -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 Tue, 26 Jan 1999 Volume: 8 Number: 4752
Today's topics:
Re: ActivePerl on Win95 <niall_wallace@yahoo.com>
Another newbie question :-) <sfu@ficsgrp.com>
Another newbie question: CGI w/ Apache problem seba_fouss5392@my-dejanews.com
Re: Anyone know of a stock quote script? (Jim Michael)
Re: Arrays vs Hashes. <fty@utk.edu>
Blank Line in Format: how do I get one? <jsockel@drew.edu>
Re: Can you pattern match using an array? (Abigail)
Re: Deleting duplicates in a text file (Larry Rosler)
Diamond Operator and $ARGV[0] <DaveH@nnoossppaamm.acinom.com>
Re: Diamond Operator and $ARGV[0] <tchrist@mox.perl.com>
Re: Diamond Operator and $ARGV[0] <tbriles@austin.ibm.com>
Re: edit @INC?/DBI install--Can't locale Config.pm <mark.c.hamlin@bt.com>
Re: edit @INC?/DBI install--Can't locale Config.pm <mark.c.hamlin@bt.com>
HELP - with redirect of STDERR and STDOUT <qdtrini@jdicms88.ericsson.se>
Re: How long would the Unixes last without Perl? <kperrier@blkbox.com>
Re: How long would the Unixes last without Perl? <jeromeo@atrieva.com>
Re: How long would the Unixes last without Perl? <kperrier@blkbox.com>
Re: How long would the Unixes last without Perl? <dgris@moiraine.dimensional.com>
Re: How long would the Unixes last without Perl? (I R A Aggie)
Re: humor: site for cheap crappy perl books <upsetter@ziplink.net>
impossible configure perl CGI on IIS4? foobar678@my-dejanews.com
Re: login script with perl ! kurtje@my-dejanews.com
Match block header, perform addition on block, continue <charlesjourdan@worldnet.att.net>
Re: Match block header, perform addition on block, cont (Greg Bacon)
multidimensional arrays or something like it?? <dnichols@fhcrc.org>
Re: multidimensional arrays or something like it?? (Clinton Pierce)
Oracle from Perl and Linux <rolf@parallax.co.uk>
Re: perl and linux (Rich)
Re: perl and linux <jim.michael@gecm.com>
Re: Perl Criticism [summary] droby@copyright.com
Re: Perl Criticism [summary] (I R A Aggie)
Re: Perl Criticism (I R A Aggie)
Re: Sorting an Array (Clinton Pierce)
Re: Sorting an Array (Robert Saunders)
Re: Sorting an Array <uri@home.sysarch.com>
Re: using # as literal '#' in a cgi (Randal L. Schwartz)
Re: Using MS Access wisecounselor@yahoo.com
What's the character? om7@cyberdude.com
Why is my note removed all the time? <jimmy@globalSpam.org>
Re: Why is my note removed all the time? (Clinton Pierce)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 26 Jan 1999 17:52:18 -0000
From: "Wallace" <niall_wallace@yahoo.com>
Subject: Re: ActivePerl on Win95
Message-Id: <78kvgc$no$1@newnews.global.net.uk>
Try opening a DOS Box and then running using perl file
Wallace
Jason Boyd wrote in message <3697BAC3.7DA17D9F@hotmail.com>...
>If anyone knows how I can get ActivePerl (509) to fuction properly on my
>Win95 system, could you please help me?
>
>I can open the perl.exe in Windows, but any scripts I run shut down as
>soon as they have displayed, meaning I can't see the results. When I try
>to open perl from DOS, it tells me "this program doesn't run in DOS
>mode." Yet the docs that come with the build claim it is for Win NT, 95
>and 98 systems.
>
>Any help is appreciated (even the name of another version of perl that
>IS built for Win95).
>
>Jason Boyd
------------------------------
Date: Tue, 26 Jan 1999 18:59:26 +0100
From: =?iso-8859-1?Q?S=E9bastien?= Fouss <sfu@ficsgrp.com>
Subject: Another newbie question :-)
Message-Id: <36AE027E.F0E47C88@ficsgrp.com>
Hi all,
Here is my question:
1. If I use a very simple Perl Script:
#!c:/perl/bin/perl
use strict;
print "Content-type: text/html\n\n" ;
print "blah blah\n ";
exit;
it works ok, either in command line or if the script is put in the
cgi-bin directory of my Apache server, and the request is made by a
client.
Now, if I add one of these lines after 'use strict;' :
use LWP::UserAgent;
use HTTP::Request::Common;
(I have to use this for an http connection), the script can still run in
command line mode, but I get an Internal Server Error from Apache (in
the log file from Apache: Premature end of script headers).
Where is the problem ?
Thanks in advance,
Sibastien
------------------------------
Date: Tue, 26 Jan 1999 18:09:04 GMT
From: seba_fouss5392@my-dejanews.com
Subject: Another newbie question: CGI w/ Apache problem
Message-Id: <78l0bp$5vr$1@nnrp1.dejanews.com>
Hi all,
Here is my question:
1. If I use a very simple Perl Script:
#!c:/perl/bin/perl
use strict;
print "Content-type: text/html\n\n" ;
print "blah blah\n ";
exit;
it works ok, either in command line or if the script is put in the
cgi-bin directory of my Apache server, and the request is made by a
client.
Now, if I add one of these lines after 'use strict;' :
use LWP::UserAgent;
use HTTP::Request::Common;
(I have to use this for an http connection), the script can still run in
command line mode, but I get an Internal Server Error from Apache (in
the log file from Apache: Premature end of script headers).
Where is the problem ?
Thanks in advance,
Sibastien
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 26 Jan 1999 16:02:56 GMT
From: genepool@netcom.com (Jim Michael)
Subject: Re: Anyone know of a stock quote script?
Message-Id: <genepoolF66CKw.Es3@netcom.com>
Cypher (cypher5@yahoo.die.spammers.com) wrote:
: I'm looking for a stock quoting script that would send thw output to
: email. Does anyone know of such a script?
: All I need is the ticker symbol and the current value (Last traded at)
: to be sent to an email message.
See MarketAlert and QuoteMonster at http://xmlworks.com/
Cheers,
Jim
------------------------------
Date: Tue, 26 Jan 1999 13:07:25 -0500
From: Jay Flaherty <fty@utk.edu>
Subject: Re: Arrays vs Hashes.
Message-Id: <36AE045D.F0A765E5@utk.edu>
Dennis Kowalski wrote:
> If the search key is an alpha value (i.e. Joe), a hash is prefered
> because you can access element "Joe" directly without traversing an
> array until you come to the proper element.
>
> $key = 'Joe';
> $element = $hash{$key};
If you use enum.pm you can index into an array with an alpha key, ie:
use enum qw(Sun Mon Tue Wed Thu Fri Sat);
# Sun == 0, Mon == 1, etc
my @days;
$day[Sun] = "the first day of the week";
$day[Mon] = "the second day of the week";
$day[Tue] = ...
my $sunday = $day[Sun];
print "Sunday is $sunday\n";
jay
------------------------------
Date: Tue, 26 Jan 1999 12:15:48 -0500
From: Jessica Sockel <jsockel@drew.edu>
Subject: Blank Line in Format: how do I get one?
Message-Id: <36ADF844.C3414ADC@drew.edu>
This seems like a very faq-ish, easily answered question, but I can't
find it in the man perlfaqs, or perlform, or the o'reilly programming,
learning, cooking, advanced perl books.
I just want a blank line at the end of my format. The closest thing I
can find is the $\ variable, which is the output_record_separator, but
it's for the print function. This is what my format code looks like:
format UN_UIC_EX_FL =
@<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~
$uname, $uic
Flags: ~@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Exp:
@<<<<<<<<<<<<<<<<<<<<<<<<
$flag, $expire
.
This is what I want the output to look like (example):
JSOCKEL [12,12]
Flags: DisMail Exp: (none)
MMORGAN [12,11]
Flags: Exp:
12-jan-1999 00:00:00
Thanks.
------------------------------
Date: 26 Jan 1999 17:54:29 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Can you pattern match using an array?
Message-Id: <78kvgl$8pk$1@client2.news.psi.net>
End User (kimntodd@dontspamus.execpc.com) wrote on MCMLXXIII September
MCMXCIII in <URL:news:78ivvb$725$1@news1-alterdial.uu.net>:
~~ I would think that you could, but it wouldnt be as clean as what you are
~~ proposing.
~~
~~ Such that:
~~
~~ @array = <STDIN>;
~~ while (defined($line=<STDIN>)){
Well, that doesn't leave many lines, now does it?
~~ foreach $array(@array) {
~~ $s = substr(/$array/,$line);
Uhm... what is this supposed to do?
~~ if ($s =~ /$string/i){
~~ do something here}
~~ }
~~
~~
~~ It should compare
Did you try?
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'
------------------------------
Date: Tue, 26 Jan 1999 07:45:47 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Deleting duplicates in a text file
Message-Id: <MPG.11178304d3f05b1e9899c8@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <78kmd0$sto$1@nnrp1.dejanews.com> on Tue, 26 Jan 1999
15:19:07 GMT, wilsonjf@nima.mil <wilsonjf@nima.mil> says...
> I'm a beginner Perl user and I'm working on a project to take log files from
> an Exchange server and look for recipients for that day. I've written enough
> to compile a list with all the users names, but now I need to delete the
> duplicates
Posted twice within three minutes, with different Subjects and email
addresses! Bad...
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 26 Jan 1999 17:58:16 GMT
From: "DaveH" <DaveH@nnoossppaamm.acinom.com>
Subject: Diamond Operator and $ARGV[0]
Message-Id: <Ymnr2.3388$QU6.48349458@c01read10.service.talkway.com>
Hi all,
I'm having trouble explaining to myself why the value of $ARGV[0] seems
to get clobbered upon entering a "while(<>)" loop. The code snippet
below simply counts the number of lines in the file specified in
$ARGV[0].
I tried searching the Usenet archives but couldn't find this question
asked or answered anywhere.
Here's the code...
#!C:/Perl/bin/perl.exe -w
############################
#
# Filename: my_program.pl
#
############################
use strict;
use diagnostics;
my ($i) = 0;
print "=== Begin my_program.pl ===\n";
print "ARGV[0] is $ARGV[0]\n";
print "=== Start While Loop ===\n";
while (<>) {
++$i;
}
print "=== End While Loop ===\n";
print "ARGV[0] is: $ARGV[0]\n";
print "There are $i lines in ARGV[0]\n";
print "=== End my_program.pl ===\n"
########################################
That's it. Any explanation of why $ARGV[0] gets clobbered?
Thanks,
Dave Honeyford
--
Surf Usenet at home, on the road, and by email -- always at Talkway.
http://www.talkway.com
------------------------------
Date: 26 Jan 1999 11:09:11 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Diamond Operator and $ARGV[0]
Message-Id: <36ae04c7@csnews>
In comp.lang.perl.misc, "DaveH" <DaveH@nnoossppaamm.acinom.com> writes:
:I'm having trouble explaining to myself why the value of $ARGV[0] seems
:to get clobbered upon entering a "while(<>)" loop.
The answer is clearly documented in the manpages. If you had not screwed
with your address, I might even have told you what it is.
--tom
--
I just hate to be pushed around by some fucking machine. - Ken Thompson, on the i960
------------------------------
Date: Tue, 26 Jan 1999 12:34:40 -0600
From: Tom Briles <tbriles@austin.ibm.com>
Subject: Re: Diamond Operator and $ARGV[0]
Message-Id: <36AE0AC0.9BB83BDE@austin.ibm.com>
DaveH wrote:
> Hi all,
>
> I'm having trouble explaining to myself why the value of $ARGV[0] seems
> to get clobbered upon entering a "while(<>)" loop. The code snippet
> below simply counts the number of lines in the file specified in
> $ARGV[0].
>
> I tried searching the Usenet archives but couldn't find this question
> asked or answered anywhere.
>
> Here's the code...
>
> #!C:/Perl/bin/perl.exe -w
> ############################
> #
> # Filename: my_program.pl
> #
> ############################
> use strict;
> use diagnostics;
> my ($i) = 0;
> print "=== Begin my_program.pl ===\n";
> print "ARGV[0] is $ARGV[0]\n";
> print "=== Start While Loop ===\n";
> while (<>) {
> ++$i;
> }
> print "=== End While Loop ===\n";
> print "ARGV[0] is: $ARGV[0]\n";
> print "There are $i lines in ARGV[0]\n";
> print "=== End my_program.pl ===\n"
> ########################################
>
> That's it. Any explanation of why $ARGV[0] gets clobbered?
>
> Thanks,
>
> Dave Honeyford
> --
> Surf Usenet at home, on the road, and by email -- always at Talkway.
> http://www.talkway.com
The diamond operator does a
$ARGV = shift;
HTH,
Tom
------------------------------
Date: Tue, 26 Jan 1999 16:39:39 +0000
From: Mark Hamlin <mark.c.hamlin@bt.com>
To: Eugene Sotirescu <eugene@snailgem.org>
Subject: Re: edit @INC?/DBI install--Can't locale Config.pm
Message-Id: <36ADEFCB.C0B996F0@bt.com>
Eugene,
Thanks, thats what I figured, how do I edit Perl's PATH (@INC) variable?
------------------------------
Date: Tue, 26 Jan 1999 17:07:21 +0000
From: Mark Hamlin <mark.c.hamlin@bt.com>
To: Eugene Sotirescu <eugene@snailgem.org>
Subject: Re: edit @INC?/DBI install--Can't locale Config.pm
Message-Id: <36ADF649.1EC2122D@bt.com>
I think I've figured it, I'm now trying to confirm that I use the: use lib
(LIST);
method.
Does this sound right, to permenantly change the path contained in @INC?
Mark Hamlin
------------------------------
Date: Tue, 26 Jan 1999 18:52:42 +0100
From: Richard Nilsson <qdtrini@jdicms88.ericsson.se>
Subject: HELP - with redirect of STDERR and STDOUT
Message-Id: <36AE00EA.1B1D56D9@jdicms88.ericsson.se>
Hi,
I'm quite new to Perl, but in the current project I'm in, Perl is the
language to be used.
We're using Perl 5.xxx, so it's object oriented.
However, the code example I'm looking for is just common perl.
What I need to do is to execute a command, and redirect STDOUT to my own
filehandle,
and redirect SDTERR to another filehandle. As usual, I use
open(<my_handle>, "<command>|")
to redirect STDOUT to my filehandle. But what about STDERR for the
command I just exe-
cuted?
The definition of the function (method) should be:
(out, err, ret) = execute_mycmd($params),
Where:
out is the output printed on STDOUT
err is the output from STDERR
ret is a return code from the function
I would be very greatful for an example. I'm almost there, but I only
seems to turn off STDERR,
rather than redirect it.
Thanks in Advance,
/Richard Nilsson
------------------------------
Date: 26 Jan 1999 11:01:14 -0600
From: Kent Perrier <kperrier@blkbox.com>
Subject: Re: How long would the Unixes last without Perl?
Message-Id: <ysig18y0y05.fsf@blkbox.com>
kirbyk@best.com (K. Krueger) writes:
> You might want to get a little more caught up on the times, then, and
> check out:
> http://www.varesearch.com/
>
> Looks to me like what you're looking for. (And I have no vested interest
> in the company. In fact, technically, I have a vested interest against
> the company, but that's hardly my fault.)
>
> This has little to do with Perl, by this point. Apologies.
I was not aware that VA Research provided 24x7 HW and OS support. Looking
at their web page I don't see it either (I may have missed it, though).
But the point it taken. As I said before, this issue of a commercial support
(VERY important organization to corp. America) is changeing (for the better).
Kent
------------------------------
Date: Tue, 26 Jan 1999 09:14:22 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
Subject: Re: How long would the Unixes last without Perl?
Message-Id: <36ADF7EE.C5DC6B8C@atrieva.com>
Kent Perrier wrote:
> > Red Hat is commercial. Period.
>
> But not in corperate America's defination. It will not be until I can purchase
> 24x7 hardware and OS support from a well known organization.
Holy cats! I better tell all the developers here they can't use Linux
any more! Please, Kent, let me know when it's safe to use Linux again.
I'm sure corporate America will be grateful.
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: 26 Jan 1999 11:09:51 -0600
From: Kent Perrier <kperrier@blkbox.com>
Subject: Re: How long would the Unixes last without Perl?
Message-Id: <ysiemoi0xls.fsf@blkbox.com>
Daniel Grisinger <dgris@moiraine.dimensional.com> writes:
> Kent Perrier <kperrier@blkbox.com> writes:
>
> > Daniel Grisinger <dgris@moiraine.dimensional.com> writes:
> > > Kent Perrier <kperrier@blkbox.com> writes:
> > > > I don't consider RedHat a
> > > > commercial unix.
>
> > > Ummmmm.... so is it not unix, or not commercial?
>
> > I don't consider it commercial.
>
> It must be nice to go through life disregarding inconvenient things
> like what the words you use actually mean. It must be much easier to
> just be able to say random things and then redefine all of the terms
> until they mean what you wanted.
He asked for clarification if I ment that RedHat was not UNIX or commercial.
I provided that clarification.
>
> To make it more explicit- by definition, if something is produced
> and sold for a profit, it is commercial. It doesn't matter what
> _you_ consider it, it doesn't matter that the source is available
> or that it can be had for free. The fact that it is sold for a
> profit leaves no room for interpretation or equivocation.
>
> Red Hat is commercial. Period.
But not in corperate America's defination. It will not be until I can purchase
24x7 hardware and OS support from a well known organization. I cannot even
bring Linux into my place of work until this option exists. I can resell
Linux to my employer, and charge them $10,000 for an "unlimited" use license
but it will not be considered until the 24x7 support issue is taken care.
Please, lets not debate over terminology. I fully support the Open Source
movement. (Which is why I install the latest perl on every machine I get
the chance to. Which is why I am attempting to get Linux in to my
organization.) Until Compaq starts selling and supporting Linux on their
servers it will not be taken seriously by my management (and, I believe, most
companies as well).
Kent
------------------------------
Date: 26 Jan 1999 10:59:28 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: How long would the Unixes last without Perl?
Message-Id: <m3g18xc3un.fsf@moiraine.dimensional.com>
[ This may sound like a flame to some, but it isn't. Sorry, Kent, if
you feel that it is. ]
Kent Perrier <kperrier@blkbox.com> writes:
> Daniel Grisinger <dgris@moiraine.dimensional.com> writes:
> > Red Hat is commercial. Period.
>
> But not in corperate America's defination.
Please provide me a reference to the `Corporate American Dictionary of
the English Language'.
<snip>
> Please, lets not debate over terminology.
Apparently we need to debate terminology, though.
You can't just go around making up defintions for words. Well, you
can, but then the words lose all communicative value. By saying that
Linux is not `commercial' you perpetuate a myth about the reliability
and usability of Linux.
I might as well say (with apologies to pudge) that I am now defining
`free' as meaning `with ketchup'. Therefore, since linux is not
normally provided with ketchup it isn't free. I've done the same as
you (redefined a term to something that has no relation to its
original meaning) and now can claim that linux isn't free. Neither is
perl, apache, *BSD, emacs, or the various GNU utilities.
Interestingly enough, McDonald's hamburgers are free. :-)
The point is that you have to use words to mean what they mean, not
what you think they should mean. If your bosses don't believe that
RedHat is commercial you would be far better off forcing them to
reevaluate what they mean. You can force them to understand what they
mean be `commercial' and `non-commercial', giving you a better
position to argue in favor of introducing Linux into your
organization.
But accepting their Newspeak and trying to argue from it will never
get you anywhere. It's kind of like trying to beat Microsoft at their
own game. Once you've accepted their definition of commercial
(supported by Compaq) it becomes extremely easy to accept further
bastardization of meaning and abuse of semantics. Next thing you know
`commercial' is defined as `produced in Redmond' and you're fighting
the battle once more.
Expecting precision in speech and writing is not unreasonable, and
leads to better debate. If confronted by a PHB that wants to play
stupid semantic games, simply pull out your nearest dictionary and
force them to use real words with real meanings. Most of the
arguments against open source disappear when you do this.
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: Mon, 25 Jan 1999 14:27:59 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: How long would the Unixes last without Perl?
Message-Id: <fl_aggie-2501991427590001@aggie.coaps.fsu.edu>
In article <78i4so$o5h$1@client2.news.psi.net>, abigail@fnx.com wrote:
+ Kent Perrier (kperrier@blkbox.com) wrote on MCMLXXII September MCMXCIII
+ !! I don't have any experience with HP-UX and I don't consider RedHat a
+ !! commercial unix.
+ What's your definition of a commercial Unix then?
Something you pay money for and can't download over the net. Last I looked,
I could still make my own RH CD's.
Solaris would be a good example, tho the academic version is dirt cheap.
James - actually, I made a debian CD this past week
------------------------------
Date: Tue, 26 Jan 1999 16:15:55 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: humor: site for cheap crappy perl books
Message-Id: <%Slr2.366$h95.91550@news.shore.net>
Uri Guttman <uri@home.sysarch.com> wrote:
: list at $50!!). my favorite title is "TEACH YOURSELF CGI PROGRAMMING
: WITH PERL 5 IN A WEEK" for only $20. (note: lincoln stein's CGI.pm book can be
: had for $18 at bookpool.com).
: if you want to complete your collection of out of print crappy perl
: books, here is your chance!
Is that book finally out of print or did they just release another new
"version"? One of the very worst computer "instructional" books I've ever
had the misfortune to use. I did manage to learn (some) CGI from it (I
knew a little perl already) but it took me years to unlearn the bad habits
I picked up.
--Art
--
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: Tue, 26 Jan 1999 17:46:43 GMT
From: foobar678@my-dejanews.com
Subject: impossible configure perl CGI on IIS4?
Message-Id: <78kv20$4rl$1@nnrp1.dejanews.com>
*The folder it's in is marked executable.
*The "Application Settings"|Configuation contains the
correct mappings for .pl files.
*The script checkbox is checked
*I ran the adsutil script and "adsutil set w3svc/CreateCGIWithNewConsole TRUE"
and it seemed to work.
Nothing I do gets perl CGI to run. The perl script is
very simple, it contains:
print "Content-Type: text/plain\n\n";
print "Hello, Perl world!\n";
And ever time you click on the file, for a millisecond a console
window flashes and the "you have chosen to download a file" box
also flashes. Then Nothing.
I am beginning to think IIS is a big piece of shit.
Help is possible.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 26 Jan 1999 15:53:02 GMT
From: kurtje@my-dejanews.com
Subject: Re: login script with perl !
Message-Id: <78kocq$upe$1@nnrp1.dejanews.com>
In article <369CC686.E9DB743F@ip-plus.net>,
Patrick <ammann@ip-plus.net> wrote:
> Hi,
>
> I'm really new and I don't know much about perl programming.
> My problem is that i have to write a script witch should do the
> following. I have a few routers and i have do do some commands to all of
> them. I also have a list witch is formated likethe following one:
>
> IP-Adress Hostname
> IP Adress Hostname
>
> The point is that i have to login to ech router and make a "show
> version" and "show mem". Then i need to analyse the output.
>
> If you already have a script that does the described thing please e-mail
> it to ammann@ip-plus.net. If you can give me some information on how to
> make a telnet connection with perl please let me know also.
>
> Many thanks in advance.
>
> Patrick
>
>
I am looking for the same so please help me
Kurtje,
kurt.baetens@unisource.be
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 26 Jan 1999 17:14:23 GMT
From: "sysadmin" <charlesjourdan@worldnet.att.net>
Subject: Match block header, perform addition on block, continue
Message-Id: <78kt5f$j38@bgtnsc02.worldnet.att.net>
problem: proper matching to identify string containing math values to add
I tried this in awk and the totals never came out to what I knew they should
be; so essentially the hardest part about this is properly matching a line
whose argument is a string of characters whose individual value is a
quantity.
But there is one line similar who is not a quantity grid but a size matrix,
so that must be avoided.
The math part works, although far less elegantly than I would I have thought
in perl:
#!/usr/local/bin/perl -w
# faccom_check
# 99-01-20
# This is a re-do of the awk script
# Purpose:
# dump the transmit file and analyze content for quantities
#use strict;
umask 0000;
#use locale;
# sizegrid array
@ASCII_ay = ();
# total
$sum = 0;
# Match the sizegrid, use first token as order number
while ($line = <>) {
# identify sizegrid
$sizegrid_str=$line;
# Convert sizegrid into an ascii array
$sum=0;
@ASCII_ay=split(//, $sizegrid_str);
for($i=@ASCII_ay; $i != 0; $i--) {
$sum += ($ASCII_ay[$i]);
printf("ASCII Value of Array Elements: %3d Total (cumulative): %8d\n",
$ASCII_ay[$i], $sum);
}
}
It is the matching; I am screwing up on perl syntax; I can't even get it to
match an order line
Is it possible to match this way:
while(<>){
/pattern/ {
/pattern/ {
action
}
}
}
This is what the file looks like (about 2100 lines)
<snip>
W207518 003 1 B8BANGOR14 MORDORE NOIR
1
W207518 003 2 040045050055060065070075080085090095100105110120000
990225990107 0102 0002259091
W207518 003 3 AA 000000000000000000000000000000000000000000000000000
W207518 003 4 M 000000000002002003005005005003003000002000000000000
W207518 003 5 000000000000000000000000000000000000000000000000000
W207518 003 6 000000000000000000000000000000000000000000000000000
W207518 003 7 000000000000000000000000000000000000000000000000000
W207518 004 1 B8BANGOR14 MORDORE ARGENT
1
W207518 004 2 040045050055060065070075080085090095100105110120000
990225990107 0102 0002259099
W207518 004 3 AA 000000000000000000000000000000000000000000000000000
W207518 004 4 M 000000000002002003005005005003003000002000000000000
W207518 004 5 000000000000000000000000000000000000000000000000000
W207518 004 6 000000000000000000000000000000000000000000000000000
W207518 004 7 000000000000000000000000000000000000000000000000000
C206131 009 1 C9GAGST14 CHINE NOIR
1
C206131 009 2 040045050055060065070075080085090095100105110120000
990327990107 0102 0002842091
C206131 009 3 AA 000000000000000000000000000000000000000000000000000
C206131 009 4 B 000001002002003003003002001001000000000000000000000
C206131 009 5 000000000000000000000000000000000000000000000000000
C206131 009 6 000000000000000000000000000000000000000000000000000
C206131 009 7 000000000000000000000000000000000000000000000000000
--
===========================================
Opinions my own and not representative of my employer
Do not listen to me: I have brain damage
===========================================
------------------------------
Date: 26 Jan 1999 17:34:50 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Match block header, perform addition on block, continue
Message-Id: <78kubr$7j3$1@info.uah.edu>
What did a2p say when you fed it your awk program?
Greg
--
Bluto: My advice to you is to start drinking heavily.
Otter: Better listen to him, Flounder. He's pre-med.
------------------------------
Date: Tue, 26 Jan 1999 17:01:32 +0000
From: Douglas Nichols <dnichols@fhcrc.org>
Subject: multidimensional arrays or something like it??
Message-Id: <36ADF4EC.7E5CC3B3@fhcrc.org>
I need to set up a scheme where I read is a list of fields
and
then each field has a format. I then read in the format
which
I do not know how long is but I will need to evaluate later.
ie:
say I read in a table(tablex) with three fields: x1, x2, x3.
My data looks like this:
x1 x2 x3
22 2 1
99 7 2
etc...
x1 has format x1fmt I then read in the format x1fmt which
can
take has the following fields start stop label. ie:
Format start stop Label
x1fmt 0 5 'Normal'
6 10 'abnormal'
x2fmt 1 1 'female
2 2 'male'
etc...
Any rate I need some scheme to print these out, but I think
I'd
better read them in from the database first before I print
them
out so I can evaluate them first.
I want my print out to look like this:
22 normal female
99 abnormal male
Someone might recognize this as a SASish thing and it really
is, but I
don't want to use SAS- it doesn't work on linux.
I think once I can figure out how to read in the values and
formats
and store them the evaluation process should be straight
forward...,
we will see.
Thanks in advance.
--
Cheers
Douglas Nichols
dnichols@fhcrc.org
----------------------------------------------------------------------------
Database Manager National Wilms
Tumor Study Group
------------------------------
Date: Tue, 26 Jan 1999 18:02:52 GMT
From: cpierce1@mail.ford.com (Clinton Pierce)
Subject: Re: multidimensional arrays or something like it??
Message-Id: <36c101c7.527130102@news.ford.com>
[Courtesy CC sent to poster in E-Mail]
On Tue, 26 Jan 1999 17:01:32 +0000, Douglas Nichols <dnichols@fhcrc.org>
wrote:
>I need to set up a scheme where I read is a list of fields
>and
That's nice.
It's traditional, when posting to comp.lang.perl.misc to:
1. Ask a Perl-specific question
2. Post a response, or comment to a Perl question.
3. Contribute to a rambling thread about something
completely off-topic, like Python or CGI.
4. Ask for someone to write your code for you,
only to be shot down later.
You did none of these.[1] What's your perl question?
[1] Technically, neither did I. Although Flames can be considered in
category #3.
------------------------------
Date: Tue, 26 Jan 1999 18:03:57 +0000
From: Rolf Howarth <rolf@parallax.co.uk>
Subject: Oracle from Perl and Linux
Message-Id: <36AE038D.CA1416D3@parallax.co.uk>
What's the easiest way to access an Oracle database running on NT from a
Perl client under Linux?
I've seen this question asked many, many times and each time the answer
is use DBD::Oracle, but to get this module to compile you need an Oracle
ODBC or OCI driver installed on your client, so what do you do if you
don't have any Oracle software installed on the client? Where are these
drivers available from, and are they free? I've been pointed at Oracle
for Linux on http://technet.oracle.com/ but I'm sure I don't have to
download 145M (compressed) to get a client driver, do I? (In any case, I
tried it but gunzip couldn't uncompress the file.)
I'm sure if I perserve I can get a driver that works, but what if I then
wanted to move to another platform (eg. MacPerl, or Perl under a
non-Intel Linux)? Surely it would be possible to develop a purely
Perl-based implementation of SQL*Net/Net8 and then problems such as
these would go away?
(I'm thinking of something like Oracle's thin JDBC client which
implements SQLNet in pure Java, but written in Perl. The thin client
classes aren't that big, and even if the SQL*Net protocol itself isn't
published I wouldn't expect it to be too difficult to decompile them and
reverse engineer a Perl implementation. Has anyone done this?)
-Rolf
------------------------------
Date: Tue, 26 Jan 1999 16:53:49 GMT
From: richm@ucesucks.rochester.rr.com (Rich)
Subject: Re: perl and linux
Message-Id: <slrn7art1e.7mg.richm@ll.aa2ys.ampr.org>
On Mon, 25 Jan 1999 15:28:10 -0600, Fernando <help@doit.wisc.edu> wrote:
>I'm lerning perl.
>
>I tried a couple of simple programs on unix. I have the line
>"#!usr/bin/perl" as the very first line in my scripts. They work fine if i
>just type the name of the program and its extension OR if i type "perl
>name.cgi".
>
>However, when I tried to run exactly the same program on two different
>linux boxes (Caldera and Debian), the scripts will only run if I type the
>whole thing (e.g. "perl name.cgi"). On this linux boxes, perl is located
>at "/usr/bin/perl/" so the path seems to be the same.
>
>Question: is there a way I can run my scripts in my linux boxes without
>having to type "perl" in front of the name?
Yes - fix your shebang line with the correct path. You need to put
a slash before the 'usr' directory.
- Rich
--
Rich Mulvey
http://mulvey.dyndns.com
Amateur Radio: aa2ys@wb2wxq.#wny.ny.usa
------------------------------
Date: Tue, 26 Jan 1999 13:21:20 -0500
From: Jim Michael <jim.michael@gecm.com>
Subject: Re: perl and linux
Message-Id: <36AE07A0.7B0B@gecm.com>
Tad McClellan wrote:
> Fernando (help@doit.wisc.edu) wrote:
> : Question: is there a way I can run my scripts in my linux boxes without
> : having to type "perl" in front of the name?
> By giving a _correct_ path in the shebang line ;-)
Also, make sure to chmod the file to make it executable.
Cheers,
Jim
------------------------------
Date: Tue, 26 Jan 1999 17:13:14 GMT
From: droby@copyright.com
Subject: Re: Perl Criticism [summary]
Message-Id: <78kt31$33f$1@nnrp1.dejanews.com>
In article <m3emojgsdm.fsf@moiraine.dimensional.com>,
Daniel Grisinger <dgris@moiraine.dimensional.com> wrote:
> iqbal <iqbal@orangenet.co.uk> writes:
>
> > Dont suppose anyone has a summary to this thread :-)
>
[Wonderful summary snipped for OCR]
>
> I'd provide the rest of the story, unfortunately this is the point at
> which I started plonking everyone posting to the thread. You'll need
> to ask elsewhere to see how it ends up, although I'd be surprised if
> any last minute character development took place. :-)
>
You've missed nothing of great consequence.
Please unplonk me and pour me a drink, I want out!
What's most disturbing is that this thread has topped the stats for 3 weeks
running.
And topmind's in the top 10 for both count and volume and in the bottom 10 for
OCR, at least this week.
It's definitely time to stop feeding the troll.
--
Don Roby
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 25 Jan 1999 14:26:03 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Perl Criticism [summary]
Message-Id: <fl_aggie-2501991426040001@aggie.coaps.fsu.edu>
In article <36ACB426.D17870F5@ngb.se>, Staffan Liljas <staffan@ngb.se> wrote:
+ Most interesting is to note that most people who thought they could
+ avoid being dragged into this useless discussion were dragged in...
It helped me crack the top-10 in terms of # of posts... :) I'd like to thank
all the little people...like topmind...
James - but hurt my OCR standing... :\
------------------------------
Date: Mon, 25 Jan 1999 14:06:12 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Perl Criticism
Message-Id: <fl_aggie-2501991406120001@aggie.coaps.fsu.edu>
In article <36ACB635.1CC0FFE0@ngb.se>, Staffan Liljas <staffan@ngb.se> wrote:
+ 4. topmind is a stupid troll who doesn't care about the discussion
+ 5. topmind is a computor program written by a AI programmer trying to
+ become immortal by creating a program that passes the Turing Test,
+ and tests it on the perl community.
+ I think 4 and 5 are about as likely. Number 5 is my favourite, but
+ unfortunately, I think it's number 4 that is true.
If 5. is true, then it had better be written in perl!
James
------------------------------
Date: Tue, 26 Jan 1999 16:08:47 GMT
From: cpierce1@mail.ford.com (Clinton Pierce)
Subject: Re: Sorting an Array
Message-Id: <36bee75a.520363976@news.ford.com>
[Courtesy CC sent to poster in E-Mail]
On Tue, 26 Jan 1999 15:44:40 GMT, robert@iminet.com (Robert Saunders)
wrote:
> I have a multifield array that I am wanting to sort.. the data would
>look like this
>
>What am wanting to do is sort the Julian Date part of the record in
>accending order. I know how to do a normal sort.. but with the fields
>in each record I am at a loss..
FAQ: "How do I sort an array by (anything)?"
Ooohh. Amazing. Try reading the FAQ before posting. It's in your
distribution. Use it.
------------------------------
Date: Tue, 26 Jan 1999 18:32:50 GMT
From: robert@iminet.com (Robert Saunders)
Subject: Re: Sorting an Array
Message-Id: <EC49E9458B29E011.37AFB370B34B27DB.695559518C43DD42@library-proxy.airnews.net>
I got the code that I was working on, thank you for the reply though.
My code that works loos like this
I loaded my array into the @users_records with the bar as the
delimeter and it works like a charm..
@newlist = sort by_date_field @users_records;
sub by_date_field
{
@alist = split(/\|/, $a);
@blist = split(/\|/, $b);
if ( $alist[2] > $blist[2] )
{
return 1;
}
elsif ( $blist[2] > $alist[2] )
{
return -1
}
else
{
return 0;
}
}
On Tue, 26 Jan 1999 16:08:47 GMT, cpierce1@mail.ford.com (Clinton
Pierce) wrote:
>[Courtesy CC sent to poster in E-Mail]
>On Tue, 26 Jan 1999 15:44:40 GMT, robert@iminet.com (Robert Saunders)
>wrote:
>> I have a multifield array that I am wanting to sort.. the data would
>>look like this
>>
>>What am wanting to do is sort the Julian Date part of the record in
>>accending order. I know how to do a normal sort.. but with the fields
>>in each record I am at a loss..
>
> FAQ: "How do I sort an array by (anything)?"
>
>Ooohh. Amazing. Try reading the FAQ before posting. It's in your
>distribution. Use it.
>
------------------------------
Date: 26 Jan 1999 13:45:18 -0500
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: Sorting an Array
Message-Id: <x7zp75swjl.fsf@home.sysarch.com>
>>>>> "RS" == Robert Saunders <robert@iminet.com> writes:
RS> I got the code that I was working on, thank you for the reply though.
RS> My code that works loos like this
RS> I loaded my array into the @users_records with the bar as the
RS> delimeter and it works like a charm..
RS> @newlist = sort by_date_field @users_records;
RS> sub by_date_field
RS> {
RS> @alist = split(/\|/, $a);
RS> @blist = split(/\|/, $b);
RS> if ( $alist[2] > $blist[2] )
RS> {
RS> return 1;
RS> }
RS> elsif ( $blist[2] > $alist[2] )
RS> {
RS> return -1
RS> }
RS> else
RS> {
RS> return 0;
RS> }
RS> }
besides being very slow due to the splits inside the sub (use the
schwartz(ian transform), luke!), you do a wasteful if/else clause. that
is what the <=> operator is for:
return( $alist[2] <=> $blist[2] )
is all you need after the splits.
much else could be done but that sin is hard to overlook.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
uri@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: 26 Jan 1999 10:02:19 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: using # as literal '#' in a cgi
Message-Id: <m1yamp3ob8.fsf@halfdome.holdit.com>
>>>>> "schmale" == schmale <schmale@my-dejanews.com> writes:
schmale> I have written a CGI script in perl and recieve input in the
schmale> following manner: http://..../cgi/test?f=index.html#mydog
No you don't. The browser never sends a fragment address (the # part).
It expects the result of fetching URL /cgi/test?f=index.html to return
something that has <a name=mydog>...</a> in it.
schmale> now, the problem is that $ENV{QUERY_STRING} only contains:
schmale> f=index.html
Right.
schmale> when I want to have:
schmale> f=index.html#mydog
schmale> Is there anyway to accomplish this?
Nope. Time to redesign.
And this should have been asked in CIWAC, not here.
And if you asked in both places, shame on you. :)
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Tue, 26 Jan 1999 15:56:07 GMT
From: wisecounselor@yahoo.com
Subject: Re: Using MS Access
Message-Id: <78koii$uso$1@nnrp1.dejanews.com>
I am using these modules with Access, and I can't seem to make an "insert"
statement work. I have tried it as a prepared statement, and I also tried
the "do" method of the connection object. Can anyone help me, the error
says that my sql statement is invalid, it must be an updatable statement. I
am using Activestate ActivePerl 509 on Win32. Brian
In article <36ACDE52.B8355F42@hotmail.com>,
Michael Ching <m_ching@hotmail.com> wrote:
> Set up ODBC server and add Access db DSN. Access via DBI::ODBC or
> Win32::ODBC
>
> Piyush Jain wrote:
> >
> > Hello everyone,
> >
> > Is there a way to connect to an MS Access database using Perl? I need to
> > use this in a script to read from the Access database. Right now the
> > cgi-bin directory is on a Unix box and from this a connection needs to
> > be opened to Windows NT where the Access database resides.
> >
> > Any pointer and help will be appreciated.
> >
> > Thanks in advance,
> >
> > piyush
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 26 Jan 1999 18:21:24 GMT
From: om7@cyberdude.com
Subject: What's the character?
Message-Id: <78l12q$6hv$1@nnrp1.dejanews.com>
I'm writing some code, whereby I do a listing and have the results put in an
array.
What I'm storing is the following data, by doing "ls -1 dir1 dir2 dir3...".
(That's a number one and not the letter l.)
dir1:
file1
file2
file3
dir2:
file4
file5
dir3:
file6
etc.
I'm having trouble determining what the line separting the data is. I've
tested for it being undef and also a \n character, but that doesn't match. I
need to determine what it is and how to check for it. I know I could get
round it by checking if it's a string or something (or doing separate "ls
-1"'s; I will do if I can't figure out anything else. And I don't want to do
separate "ls -1" because that gives me a long list and I can't determine what
files came from which directory.
Can anyone help??
Thanks.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 26 Jan 1999 16:30:10 GMT
From: jimmy <jimmy@globalSpam.org>
Subject: Why is my note removed all the time?
Message-Id: <36ADEBE3.B7C38859@globalSpam.org>
People,
I was trying to ask if anyone knows of a Perl-capable editor other than
Perl builder. My note constantly disappears! Why is that? I did read the
intro about what's relevant, I did check the mentioned resources--and
there's nothing of the kind there. What am I missing?
------------------------------
Date: Tue, 26 Jan 1999 17:55:44 GMT
From: cpierce1@mail.ford.com (Clinton Pierce)
Subject: Re: Why is my note removed all the time?
Message-Id: <36bfff70.526531652@news.ford.com>
[Courtesy CC sent to poster in E-Mail]
On Tue, 26 Jan 1999 16:30:10 GMT, jimmy <jimmy@globalSpam.org> wrote:
>People,
>I was trying to ask if anyone knows of a Perl-capable editor other than
>Perl builder. My note constantly disappears! Why is that? I did read the
>intro about what's relevant, I did check the mentioned resources--and
>there's nothing of the kind there. What am I missing?
If your posts are vanishing--good. The patron saint of
comp.lang.perl.misc must have put in a good word.
Because you havent't even made a cursory search! You've found USENET,
now try finding the Web. Once you do that, find a good search engine
and put in "Perl" and "Editor". Click on some of those links. Most of
them will give you what you're looking for.
Or try a news-search service like www.dejanews.com, search this group's
history for "Editor". You will find what you're looking for: long and
rambling threads started every two weeks or so by people who didn't
bother to look around first.
Shoo!
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 4752
**************************************