[10574] in Perl-Users-Digest
Perl-Users Digest, Issue: 4166 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 6 13:07:43 1998
Date: Fri, 6 Nov 98 10:00:24 -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 Fri, 6 Nov 1998 Volume: 8 Number: 4166
Today's topics:
Re: [HELP] Newbie question. <ludlow@us.ibm.com>
Re: [HELP] Newbie question. (Larry Rosler)
Re: ActiveState Perl: problem with PerlPacketManager: p <botterwe@uni-koblenz.de>
Array Problems... <rdsys@inficad.com>
Re: Array Problems... (Larry Rosler)
Re: Array Problems... <jdf@pobox.com>
Re: Array Problems... <ludlow@us.ibm.com>
Re: BIZARRE -- Perl vs C for Y2K (I R A Aggie)
enabling O_DIRECT on Irix <pburry@smt.net>
Form Information <ahanif@eastbridgetech.com>
Re: Help on version 4 and version 5... droby@copyright.com
Re: Heterogeneous Data Structures: possible? If so, ho <d-edwards@nospam.uchicago.edu>
Re: How can I reset a file? <tonylabb@infonline.net>
Re: magic increment problem <sr@pc-plus.de>
Opening many files. (John Horne)
Re: pass a file directly to stdout? <jeromeo@atrieva.com>
Passing dbh from Pro*C to perl/DBI/Oracle? jack.haberle@bigfoot.com
Re: perl newbie desperate question tcpeter@iname.com
perldoc dumps core for Date::Calc (Charles "Skip" Hartley)
Re: Processing form (Larry Rosler)
Re: really complicated reg. exp. question <garethr@cre.canon.co.uk>
REMOTE_USER <j.moore@domain-tech.com>
Re: REMOTE_USER <uri@fastengines.com>
Re: sending an email to two different email addresses (I.J. Garlick)
Re: Sendmail-code needed (Alan Dye)
Re: Sendmail-code needed <perlguy@technologist.com>
Re: Tk on NT <erich@orator.usma.edu>
Re: Tk on NT <ludlow@us.ibm.com>
Re: Tk on NT <lusol@Pandora.CC.Lehigh.EDU>
UG: San Francisco Perl User's Group meeting on 11/10/19 <bob.goolsby@kp.org>
Re: what does split do on empty fields? <emschwar@mail.uccs.edu>
Write to an htm field from perl <bill@sterzenbach.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 06 Nov 1998 10:30:13 -0600
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: [HELP] Newbie question.
Message-Id: <36432415.8EF988C@us.ibm.com>
Roger Kenneth Trussell wrote:
> I don't mean to be a pain, but isn't the correct syntax for the "or die" command
> for this context is as follows?
>
> open CFG,'config' || die "Unable blah, blah, blah.\n";
>
> Isn't "||" more correct than the word "or"?
Better go check your camel book again. You could, I guess, use "||" if
you wrote it like this:
(open IN, "fakefile") || die "Error..., $!";
--
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)
------------------------------
Date: Fri, 6 Nov 1998 08:34:39 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: [HELP] Newbie question.
Message-Id: <MPG.10acc4f67fbcd10b9898fb@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <71v5b2$ctu$1@supernews.com> on Fri, 6 Nov 1998 10:36:41 -
0500, Roger Kenneth Trussell <rtrussell@hps-inc.com> says...
>
> Matthew Bafford wrote in message ...
> >In article <<363B527A.21ACA33D@mail2.intellect.com.tw>>,
...
> >open CFG, 'config' or die "Unable to open 'config', reason: $!\n";
>
> I don't mean to be a pain, but isn't the correct syntax for the "or die" command
> for this context is as follows?
>
> open CFG,'config' || die "Unable blah, blah, blah.\n";
>
> Isn't "||" more correct than the word "or"?
Not 'more correct'. Considerably 'less correct' -- i.e., wrong --
because the || binds tighter than the comma that separates list
elements.
Either
open(CFG, 'config') || die "Unable blah, blah, blah.\n";
or
open CFG, 'config' or die "Unable blah, blah, blah.\n";
is correct. I prefer the latter, because it visually distinguishes
logical conjunction or alternation (&& and ||) from flow-of-control (and
and or):
$x && $y || $z or $w = 'foo';
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 6 Nov 1998 17:43:03 +0100
From: "Goetz Botterweck" <botterwe@uni-koblenz.de>
Subject: Re: ActiveState Perl: problem with PerlPacketManager: ppm.pl (proxy/internet)
Message-Id: <71v8rt$ic6$1@newshost>
[1] HOW TO GET DEBUGGING OUTPUT
Open the Module ppm.pm (in c:\perl\lib ?)
Find the Lines:
use LWP::UserAgent;
use LWP::Simple;
Add the following line:
use LWP::Debug qw(+);
This way you will get debugging output each time PPM tries to get something
from the Network (for instance the list of available packages list).
Note: The debugging output includes all the data transferred. So when
installing a package (and therefore downloading it) your screen will show
some binary characters. Simply ignore this.
[2] SETTING UP PROXY
If you got a firewall (and therefore must use a proxy to get HTTP
Connections) make sure that the environment variable HTTP_PROXY is set to
something like http://myproxy.mydomain.com:portnumber/. You can get the
correct information from the settings of you web browser.
You can set the environment variable permanently using the Control
Panel/System/Environment. Remember that You have to close and reopen the
Command Line Windows to let the changes take effekt.
Check the correct setting with 'set' at the command line.
[3] THE "NEED MORE HEADER DATA" PROBLEM
I for myself connect to the Network via a Firewall and a Squid Proxy. After
setting the HTTP_PROXY and trying to connect I got a response something like
LWP::Protocol::http::request: HTTP/1.0 200 OK
LWP::Protocol::http::request: need more header data
If you run into the same problem, perhaps You can fix it in the following
way (JUST A WORKAROUND!):
- Open the Module ppm.pm (in c:\perl\lib ?)
- Find the subroutine valid_URL_or_file
- In the line
return 1 if ($File =~ m@^...*://@i && defined read_href("href" => $File,
"request" => 'HEAD'));
replace HEAD with GET
If you want to know the details:
The above subroutine tries to decide if a provided location (in the variable
$File) is a valid URL. Therefore it sends a HEAD-Request to get only the
HTTP-Headers for this URL not the content. Somewhere in the modules called
from the PPM this info seems not enough (I had not the time to find out
where).
Changing HEAD to GET has the effect that for simply checking the URL the PPM
downloads the whole file (it's just a workaround!). If you have a proxy the
following second GET to really download and install the package will be much
faster, so it doesn't bother you anyway.
GB
------------------------------
Date: Fri, 6 Nov 1998 15:47:44 GMT
From: "Ray A. Lopez" <rdsys@inficad.com>
Subject: Array Problems...
Message-Id: <36431A20.85244370@inficad.com>
I have defined an array of invalid names as such.
@invalid_names = {"AH", "T/R", "BUSY", "SPARE", "ADDRESS", "RESERVED",
"SUBADDRESS"};
I want to parse a file for some word patterns. These invalid words
happen to match my word pattern and want to exclude them.
SAMPLE DATA:
***************************************************************
RESERVED<Tab>-00-1<Tab>MSB<Tab-dash><Tab-dash><Tab-dash>
<"data">
ADDRESS<Tab>-01-1<Tab>ADDRESS OF RECEIVE TERMINAL,
<"data">
<Tab><Tab>ADDRESS = 11001 (25)
<"data">
<Tab>-02-0
KEYWORD1<Tab>-01-0<Tab><Tab-dash><Tab-dash><Tab-dash>
<"data">
KEYWORD2<Tab>-02-C<Tab>MSB<Tab-dash><Tab-dash><Tab-dash>
<"data">
****************************************************************
I tried something as follows to compare my pattern match to each word in
@invalid_names (as well as a few other variations of foreach):
while (<INFILE>) {
if ( /(.+)\-\d{2}\-\w/ ) {
$pattern_match = $1;
$pattern_match =~ s{\<Tab\>}{};
foreach $invalid_name (@invalid_names) {
#print "$invalid_name\n;
if ($invalid_name eq $pattern_match) {
$valid = "";
last;
} else {
$valid = "1";
}
}
if ( $valid ) { print OUTFILE "$pattern_match\n"; }
}
}
I had thrown in a print statement to see what $invalid_name was and I
get the
following:
HASH(0x40014850)
HASH(0x40014850)
HASH(0x40014850)
HASH(0x40014850)
HASH(0x40014850)
HASH(0x40014850)
So now I either don't understand how to read arrays or maybe just going
about this the wrong way. Any feedback is encourage on how I should go
about fixing this. Just in case you're wondering, I am a newbie!
thanks,
ray
------------------------------
Date: Fri, 6 Nov 1998 08:48:46 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Array Problems...
Message-Id: <MPG.10acc84ab2bbc3169898fd@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <36431A20.85244370@inficad.com> on Fri, 6 Nov 1998 15:47:44
GMT, Ray A. Lopez <rdsys@inficad.com> says...
> I have defined an array of invalid names as such.
>
> @invalid_names = {"AH", "T/R", "BUSY", "SPARE", "ADDRESS", "RESERVED",
> "SUBADDRESS"};
...
What you have defined here is an array of one element, which is a
reference to a hash (initialized incorrectly with an odd number of
elements).
What you want is either:
@invalid_names = ("AH", "T/R", "BUSY", "SPARE", "ADDRESS", "RESERVED",
"SUBADDRESS");
(note the parenetheses instead of the curlies), or (cleaner visually):
@invalid_names = qw( AH T/R BUSY SPARE ADDRESS RESERVED SUBADDRESS );
You also want to use the '-w' flag on every program. Every time.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 06 Nov 1998 17:55:58 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: "Ray A. Lopez" <rdsys@inficad.com>
Subject: Re: Array Problems...
Message-Id: <m3ww58wyjl.fsf@joshua.panix.com>
"Ray A. Lopez" <rdsys@inficad.com> writes:
> @invalid_names = {"AH", "T/R", "BUSY", "SPARE", "ADDRESS", "RESERVED",
> "SUBADDRESS"};
>
> I want to parse a file for some word patterns. These invalid words
> happen to match my word pattern and want to exclude them.
Please see perlfaq6, "How do I efficiently match many regular
expressions at once?"
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Fri, 06 Nov 1998 10:58:10 -0600
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: Array Problems...
Message-Id: <36432AA2.ACBFECDE@us.ibm.com>
Ray A. Lopez wrote:
>
> I have defined an array of invalid names as such.
>
> @invalid_names = {"AH", "T/R", "BUSY", "SPARE", "ADDRESS", "RESERVED",
> "SUBADDRESS"};
You want to use () rather than {}. Also, make sure that you're using
-w. It should have warned you about an "odd number of hash elements..."
which would be a clue that perhaps your array isn't what you intended it
to be.
--
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)
------------------------------
Date: Fri, 06 Nov 1998 12:04:17 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: BIZARRE -- Perl vs C for Y2K
Message-Id: <fl_aggie-0611981204170001@aggie.coaps.fsu.edu>
In article <36423255.830DF16@pbi.net>, Troy Terry <tterry@pbi.net> wrote:
+ Year 0 (1900) -- Epoch: 946713600 # Surprising (and wrong)
My results:
Year=0, Epoch=946702800 Year=1900, Epoch=-1
from:
use Time::Local;
$sec=0;
$min=0;
$hours=0;
$mday=1;
$mon=0;
$year=0;
$time = timelocal($sec,$min,$hours,$mday,$mon,$year);
print "Year=$year, Epoch=$time\t";
$year=$year+1900;
$time = timelocal($sec,$min,$hours,$mday,$mon,$year);
print "Year=$year, Epoch=$time\n";
When given a fully qualified year -- 1900, in this case, it does the
correct thing -- the epoch time is out-of-range. The documentation is
a bit sparse on _what_ values should be fed to this routine.
+ Year 138 (2038) -- Epoch: -1 # Surprising (and wrong?)
+ Year 139 (2039) -- Epoch: -1
Surprising only if you haven't read the documentation for Time::Local,
which states:
Both routines return -1 if the integer limit is hit. I.e.
for dates after the 1st of January, 2038 on most machines.
James
------------------------------
Date: Fri, 06 Nov 1998 11:48:59 -0500
From: Paul Burry <pburry@smt.net>
Subject: enabling O_DIRECT on Irix
Message-Id: <3643287B.C4E5B6AB@smt.net>
Is it possible to enable O_DIRECT on Irix with Perl?
While I have been able to add the flag when openning a file with
$O_DIRECT = 0x8000; ## From fcntl.h
$fh = new FileHandle $filename, O_CREAT| O_WRONLY | $O_DIRECT;
any write to the file handle returns undef and $! is set to "Invalid
Argument".
TIA.. Paul
------------------------------
Date: Fri, 6 Nov 1998 10:39:27 -0600
From: "Aamir Hanif" <ahanif@eastbridgetech.com>
Subject: Form Information
Message-Id: <36432569.0@news.lh.net>
Hello all.
I have made a form where the user enters their name and password and then
clicks the submit button, upon which the file Log.pl is accessed, to log on
the page.
I can put the username and the password into an array using the code below:
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs)
{
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/~!/ ~!/g;
$FORM{$name} = $value;
}
To see if I am getting the right information from the arrays I did a small
test using the code below and I got the right results:
foreach $item (keys(%FORM))
{
print "$item is $FORM{$item}<br>";
}
The thing that I want to do though is to assign the username to $Username
and the password to $Password.
Any ideas on how I can do that?
Any help is appreciated.
Thanks.
A.
------------------------------
Date: Fri, 06 Nov 1998 16:30:44 GMT
From: droby@copyright.com
Subject: Re: Help on version 4 and version 5...
Message-Id: <71v87k$9bu$1@nnrp1.dejanews.com>
In article <LXt02.104$DA6.22583@news.connectnet.com>,
"Rusty Williamson" <rwilliamson@uno.gers.com> wrote:
> Hi!
> I've hit a little problem -- on the dozen or so servers we have at work,
> /usr/bin/perl on some systems is version 5, while on others its version 4
> and version 5 is /usr/bin/perl5. We have tons of v4 scripts all starting
> out with #!/usr/bin/perl. What are people doing?
>
Delete Perl4, and on the systems that had it, make /usr/bin/perl a symbolic
link to /usr/bin/perl5. Then make sure all your Perl4 scripts work with
Perl5.
Perl4 is obsolete and insecure and is going to stay that way.
--
Don Roby
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 6 Nov 1998 16:01:31 GMT
From: Darrin Edwards <d-edwards@nospam.uchicago.edu>
Subject: Re: Heterogeneous Data Structures: possible? If so, how?
Message-Id: <tgiugs3j50.fsf@noise.bsd.uchicago.edu>
Charles Roten <croten@bigger.aa.net> writes:
> Actually, it's worse than my original post indicated.
>
> Sooner or later, I run into the need for something like _this_ ...
>
> $FireWall_Rule->[7]->{"services"}
>
> has to point to the following wretched sordid _list_-_style_ mess ...
When you find yourself saying "non-wretched, non-sordid, non-messy, _ordered_
list," that's an array. Anything else is a hash. :)
> A scalar:
> "IMAP"
> A scalar:
> "pop-3"
> A hash key/value pair, where the key is a string and the value
> is an array-like construct:
> "smtp->In", [ "resource In", "service smtp", \
> {"color", "firebrick}, {"type", "Tcp"}]
This is what I meant by the "read it backwards" metaphor. Forget
about your "Firewall_rule" thingy up there for a second, and just
pretend you want to code this, er, "sordid mess" all by itself.
Three loosely related things, presumably which you can describe
to yourself, i.e. gives names to, right? "Be the hash" as the
sports fans would say:
my %service_stuff;
$service_stuff{dudel} = "IMAP";
$service_stuff{sack} = "pop-3";
$service_stuff{pfeiffer} = {"smtp->In", [qw(your list of stuff)]};
Hmm, still looks messy. Unless "smtp->In" is only one of a "group"
of similar constructs (each pointing to one of these lists), you
might prefer a simple key-value pair, rather than a pointer to a
single-element hash:
my %service_stuff;
$service_stuff{rebec} = "IMAP";
$service_stuff{tabor} = "pop-3";
$service_stuff{"smtp->In"} = [qw(your list of stuff)];
Ha! By doing that, you also got rid of the "extra" hash reference,
it's now just a simple array reference. (Of course, if my guess was
wrong, and you needed to do it that way, then you needed to do it
that way.)
Regardless of those details, when you've finally figured out what
%service_stuff will look like, then you just make it "be pointed to"
by something:
$FireWall_Rule->[7]{services} = \%service_stuff;
> This is where matters get ugly. These are three elements in a LIST.
> The first two are _SCALARS_. The third is a _HASH_ key/value PAIR.
That's a hash: things _you_ know are conceptually or semantically
related (so you want to give them one "name"), but that the
computer doesn't think of as logically equivalent units (so an
array might not do the trick).
(Actually, I've lied: if your strucures always have three items like
this, in this order, you might just as well say
@service_stuff = ["IMAP", "pop-3", {"smtp->In", [qw(your list)]}];
How will you need to _access_ all this data? Arrays and hashes
make different things easy... Don't be afraid to try both.)
> At this point, I am not at all sure that something like this can be
> done cleanly in Perl. I would _really_ appreciate being proven
> wrong !!
Everything can be done cleanly in perl, for suitable definitions
of "cleanly." :)
Darrin
------------------------------
Date: Fri, 06 Nov 1998 11:20:01 -0500
From: Tony Labbiento <tonylabb@infonline.net>
Subject: Re: How can I reset a file?
Message-Id: <364321B1.4466C929@infonline.net>
use seek F,0,0; to reset to the beginning of the file.
"PERL ROCKS!" wrote:
>
> If I have a file opened for reading, and I've read some of all of it
> with <F>, how can I RESET the filepointer back to the beginning of the
> file (just like RESET in PASCAL).
>
> I investigated in my trusty camel book but I can't find any info on it
> there. I don't want to have to CLOSE and OPEN the file again, but of
> course I know that would do the trick if I have to. I thought that
> maybe the code below would work (but I'm sure many of you know it
> didn't!). It didn't like me trying to open an open'ed file, as I
> suspected it might not.
>
> Thanks,
> E
>
> #!/usr/local/bin/perl -w
> #
> open A,"./test";
> while (<A>)
> {print;}
>
> open A;
> while (<A>)
> {print;}
>
> close A;
--
****************************************
* Tony Labbiento *
* Infinity Online, Inc. *
****************************************
------------------------------
Date: Fri, 06 Nov 1998 18:24:19 +0100
From: Stephen Riehm <sr@pc-plus.de>
Subject: Re: magic increment problem
Message-Id: <364330C3.41C6@pc-plus.de>
Darrin Edwards wrote:
>
> karlon@bnr.ca (Karlon West) writes:
>
> > Stephen Riehm (sr@pc-plus.de) wrote:
> > > Hi JAPH's,
> >
> > > I was astounded to find the following "magic" in perl's magical
> > > autoincrementation. Here are a few simple strings to be incremented:
> >
> > > $a = "123";
> > > $b = "file1";
> > > $c = "1file";
> > > $d = "my1stfile";
> >
>
> > from "perldoc perlop" $c and $d above do not match the pattern
> > specified below that invokes the autoincrment magic:
> [snip]
> > a numeric context, you get a normal increment. If, however, the
> > variable has been used in only string contexts since it was set, and
> > has a value that is not null and matches the pattern
> > C</^[a-zA-Z]*[0-9]*$/>, the increment is done as a string, preserving each
> > character within its range, with carry:
>
> But why does $c become 2 then? $d I understand; a string in numeric
> context is 0, so it increments to 1. I expected the same behavior
> from $c, but I get:
>
> noise:~>perl -e '$Homer="17file"; $Homer += 0; print "Homer is $Homer.\n";'
> Homer is 17.
>
> Aha! Found it in the _Perl Cookbook_, p. 42:
> 'Perl quietly converts non-numeric strings to 0, and it will stop
> converting the string once it reaches a non-numeric character -- so
> "A7" is still 0, and "7A" is just 7. (Note, however, that the -w
> ^^^^^^
> flag will warn you of such improper conversions.)'
> ^^^^
> (Emphasis (^^^) added...)
>
> Couldn't find that bit in the faq, at least not in that much
> detail... Certainly the _moral_ is the same one that every perl
> tale seems to have. :)
err.. but but but but... :-)
OK, so it's defined to work that way (the blue camel book doesn't
mention the regex by the way) then I would have to say "Broken as
designed"!
Is there anyone who can give a "reason" why the autoincrement can't
be done such that:
if it was used in a string context, and matches /^\w*$/ or
/^[a-zA-Z0-9]*$/ then it gets incremented as a string, otherwise
it gets the numerical treatment. As far as making the rule transparent,
any string, seen in string context should be autoincremental, if special
characters are used, then they could be 'wrapped' to "a" or something.
Suddenly getting a number instead of a string because you put a dodgy
character in your string worries me.
Steve
// __________________________ ._ o ________________________________
\\\\ Stephen Riehm / //\. Stephen.Riehm@pc-plus.de
//// pc-plus ' \>> | Phone: +49 89 45566 148
\\ 81675 Munich, Germany \\ ` Fax: +49 89 45566 113
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2
mQCNAjWaUeoAAAEEAMSI/hFLWlcAFVSwMHdHFiSbXP+IfbDzHg1IUSjlGseTsi5o
kxDRFjvpxJUpH8S4XHbVAkyAMyysNaBI/LxuCvS66WiMINzJTxeDMJCUnzGpLcQH
h/Co2ymaw0KnjHJtBvFAptntu8wgEM712cU0LSdoD25x1faWDDlT6pxFM0BlAAUR
tChTdGVwaGVuIFJpZWhtIDxTdGVwaGVuLlJpZWhtQHBjLXBsdXMuZGU+
=+MnD
-----END PGP PUBLIC KEY BLOCK-----
------------------------------
Date: 6 Nov 98 17:09:26 GMT
From: J.Horne@plymouth.ac.uk (John Horne)
Subject: Opening many files.
Message-Id: <36432d46.0@palantir.pbs.plym.ac.uk>
Hello,
I have a program - okay a CGI script - which opens a lot of files. By
a lot, this is anything from 1 I guess to about 4000. The program looks
in each file and does a bit of processing; the files are not changed.
This works fine up to the 97th file - with 97 files I get a response
from the system in about 3 seconds. Above this - even just by 1 file-
and I wait for ages. Initially the HTML server was timing out, so I
upped the timeout to 32000 seconds. After waiting 10 minutes for a
response I gave up. I have set $| for the standard output. I have
tried putting print statments in too see how far the program gets,
but it seems that these are not printed - the system seems to
be waiting for something (or something to be unlocked). The files
are all in the same directory, and opened/closed with the perl
builting open/close statements.
This is on a Sun Ultra 1/170, Solaris 2.5.1, perl 5.005, and
apache 1.2.1. I have tried it at home, and it all works well -
RedHat linux 5.1, perl 5.005, apache 1.3.
Any ideas?
Thanks,
John.
-----------------------------------------------------------------------------
John Horne E-mail: J.Horne@plymouth.ac.uk
Academic and Information Services Phone : +44 (0) 1752 - 233911
University of Plymouth, UK Fax : +44 (0) 1752 - 233919
------------------------------
Date: Fri, 06 Nov 1998 08:20:13 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
To: Brad Fenwick <bfenwick@mts.net>
Subject: Re: pass a file directly to stdout?
Message-Id: <364321BC.A3F5657F@atrieva.com>
Brad Fenwick wrote:
>My guess is there is a very elegantly simple way to pass a file to
> stdout (without using a system command) without having to parse it
> through first and print it out that way... I just can't find any clear
> examples that show me that elegant way.
>
open (FOO,"/path/to/file.html") or die "A hideous death:
$!\n";while(<FOO>){
print;
}
--
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: Fri, 06 Nov 1998 15:46:02 GMT
From: jack.haberle@bigfoot.com
Subject: Passing dbh from Pro*C to perl/DBI/Oracle?
Message-Id: <71v5jq$6re$1@nnrp1.dejanews.com>
Anyone know (or care to guess) how (and/or whether its even doable)
to pass a database handle from a Pro*C program to a perl/DBI/Oracle
script? (My boss wants to conserve Oracle connections.)
Thanks in advance for any advice, hints on where to look, or sympathy!
-Jack
"I'm a dog, I'm a workin' dog ..."
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 06 Nov 1998 16:02:12 GMT
From: tcpeter@iname.com
Subject: Re: perl newbie desperate question
Message-Id: <71v6i4$7q3$1@nnrp1.dejanews.com>
In article <71pkd4$2eu$1@sun4000.casema.net>,
"Casema" <ours@casema.net> wrote:
> Hi perl programmers,
>
> I downloaded perl from www.perl.com and installed it on my windows98 pc for
> testing.
> the compiler itself is in c:\perl\bin
As another new Perl on Windows scripter, I have gotten great results with the
ActiveState port. (http://www.activestate.com)
> #!c:\perl\bin\perl does not work.
> Please, can someone point me in the right direction?
I actually follow the shebang with /usr/bin/perl in all my scripts so that I
can use them on my Linux boxes as well as Windows, and they have worked under
Linux, Win NT, and Win95.
First thing to do is check that the perl interpreter is in the path. Then
simply type "perl <scriptname>" without the quotes at the command prompt and
it should work just fine.
Hope this helps.
Tim
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 6 Nov 1998 17:22:19 GMT
From: skip@cssun.mathcs.emory.edu (Charles "Skip" Hartley)
Subject: perldoc dumps core for Date::Calc
Message-Id: <71vb8b$7t0$1@cssun.mathcs.emory.edu>
hello,
i have just installed the Date::Calc module, but when i
run perldoc Date::Calc, it dumps core with a seg fault
and then prints the documentation. this does not happen
with perldoc -f split, etc. any ideas?
i have perl5.004_04 on solaris 2.6
-skipper
--
Skipper Hartley
Emory University, Atlanta, GA
Internet: skip@mathcs.emory.edu BITNET: skip@emory.bitnet
UUCP: {rutgers,ogicse,gatech}!emory!skip
------------------------------
Date: Fri, 6 Nov 1998 08:42:33 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Processing form
Message-Id: <MPG.10acc6d0abf836529898fc@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <3642E8C2.57B8970F@technologist.com> on Fri, 6 Nov 1998
12:17:06 GMT, Brent Michalski <perlguy@technologist.com> says...
...
> use CGI qw /:standard/;
> $email = param(email);
> $msg = param(message);
> $subj = param(subject);
>
> It is __that__simple Michael! Good luck with the rest of your program!
Is it __that__simple really? Isn't there a problem here with barewords
that '-w' would complain about?
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 6 Nov 1998 17:40:19 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
Subject: Re: really complicated reg. exp. question
Message-Id: <siemrgpvng.fsf@cre.canon.co.uk>
Alexander Farber <eedalf@eed.ericsson.se> wrote:
> How do I say "match any character (even \n), but not !#####"?
Use the /s regexp option to make . match newline, and then use
negative lookahead (?!regexp) to exclude the text you don't want:
/.(?!!#####)/s
Having said that, your problem may not best be solved with a complicated
regexp...
> I read some file (not perl) with many comments and phase numbers:
>
> !########################################################################
> !Check recorded RP events
> !########################################################################
> @gosub DIRRP_SUB
> @label PHASE_90
> @set PHASE = 90
> @write (PHASE_FILE,"@set MAINPHASE= {PHASE}")
>
> and I would like to create a hash with keys = phase numbers (here 90)
> and values = comment (between the !###### lines).
Here's a fairly readable solution using the rarely-seen ... operator:
while (<>) {
if (/^!#+$/ ... /^!#+$/) {
$comment = $1 if /^!([^#].*)$/;
} else {
$phase{$1} = $comment if /^\@set PHASE = ([0-9]+)$/;
}
}
--
Gareth Rees
------------------------------
Date: Fri, 06 Nov 1998 12:18:07 -0500
From: Jay Moore <j.moore@domain-tech.com>
Subject: REMOTE_USER
Message-Id: <36432F4E.D8FD3F97@domain-tech.com>
This is a multi-part message in MIME format.
--------------C6642FD344D0671411EB9626
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
While this is not really a Unix security question, I don't know where
else to post.
If I enable SSL for client authentication on my web server, does the CGI
environment variable REMOTE_USER still get set?
Thanx,
jay
--------------C6642FD344D0671411EB9626
Content-Type: text/x-vcard; charset=us-ascii;
name="j.moore.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Jay Moore
Content-Disposition: attachment;
filename="j.moore.vcf"
begin:vcard
n:Moore;Jay
tel;work:703.351.5870 x252
x-mozilla-html:TRUE
org:Domain Techonolgies
adr:;;1901 N. Ft Myer Drive;Arlington;VA;;
version:2.1
email;internet:moorejay@netscape.net
title:Senior Unix Systems Engineer
fn:Jay Moore
end:vcard
--------------C6642FD344D0671411EB9626--
------------------------------
Date: 06 Nov 1998 12:39:19 -0500
From: Uri Guttman <uri@fastengines.com>
To: Jay Moore <j.moore@domain-tech.com>
Subject: Re: REMOTE_USER
Message-Id: <sarg1bwbu0o.fsf@camel.fastserv.com>
>>>>> "JM" == Jay Moore <j.moore@domain-tech.com> writes:
JM> While this is not really a Unix security question, I don't know where
JM> else to post.
DING! DING! DING!!!
you have won the prize for the the most off-topic question of the
day. and in BOTH groups no less. you say it is not security and it never
mentions perl either, so why post to these groups.
JM> If I enable SSL for client authentication on my web server, does the CGI
JM> environment variable REMOTE_USER still get set?
ever thought about posting to a cgi group since your question mentions
that?
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: Fri, 6 Nov 1998 15:49:53 GMT
From: ijg@csc.liv.ac.uk (I.J. Garlick)
Subject: Re: sending an email to two different email addresses
Message-Id: <F20Bz6.KD7@csc.liv.ac.uk>
In article <3642FD3B.41D64D4E@ctrl-v.nl>,
Marco Vlemmings <marcov@ctrl-v.nl> writes:
> Hello,
>
> I have a script which will send an email to one person.
> Now i want to send the same email to two or more persons.
> Can anybody help me?
>
> With kind regards
>
> Marco Vlemmings
> email:marcov@ctrl-v.nl
>
You need to investigate how to use the Cc: field of a mail header.
It does ecactly what you want. Now you just have to cinvince our script of
this fact.
--
--
Ian J. Garlick
<ijg@csc.liv.ac.uk>
As long as the answer is right, who cares if the question is wrong?
------------------------------
Date: Fri, 06 Nov 1998 16:46:05 GMT
From: alan@akqa.com (Alan Dye)
Subject: Re: Sendmail-code needed
Message-Id: <364326fd.718478717@news.theplanet.net>
well try:
$Sendmail = "/path/to/sendmail";
# Open sendmail
open(EMAIL, "|$Sendmail whatever@there");
# Print mail headers
print EMAIL "To: whatever@there\n";
print EMAIL "From: whoever@there\n";
print EMAIL "Reply-to: whatever@there\n";
print EMAIL "Subject: the subject\n\n";
print EMAIL "what ever what ever what ever\n\n";
>Hi Group,
>
>To send mail to ours@casema.net
>subject : test
>body: $boy
>
>What would the perl code be?
>
>Thanks,
>
>Michel
>
>
------------------------------
Date: Fri, 6 Nov 1998 17:00:58 GMT
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: Sendmail-code needed
Message-Id: <36432B4A.74C53AC2@technologist.com>
Casema wrote:
>
> Hi Group,
>
> To send mail to ours@casema.net
> subject : test
> body: $boy
>
> What would the perl code be?
>
> Thanks,
>
> Michel
What have you got so far?
Do you have any of the Mail::* modules installed?
Have you checked the FAQ or www.perl.com?
Also, I know for a fact the www.cgi-recources and webreview.com have
code that will do this for you, as long as you are willing to do some
slight modifications...
Let us know when you get a start and we can __help__ you out. If you
want someone to write it for you, you typically have to hire a
programmer...
Brent
--
Java? I've heard of it, it is what I drink when I am hacking Perl. -me
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Brent Michalski $
$ -- Perl Evangelist -- $
$ E-Mail: perlguy@technologist.com $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
------------------------------
Date: Fri, 06 Nov 1998 11:06:26 -0500
From: "Erich L. Markert" <erich@orator.usma.edu>
To: Mark Tagawa <swingkid@usa.net>
Subject: Re: Tk on NT
Message-Id: <36431E82.A9AFA994@orator.usma.edu>
Or just use Gurusamy Sarathy's NT port of perl. No need to download TK because it's part
of this build.
Mark Tagawa wrote:
>
> In article <71kj5j$6ui@panix.com>, clay@panix.com says...
> > In <71keqe$kq4$1@nnrp1.dejanews.com> keydet89@yahoo.com writes:
> >
> > >Does anyone have any information regarding where to get
> > >and how to install/use Tk on NT?
> >
> > Try: http://www.scriptics.com/software/download.html
> >
> > --
> > Clay Irving
> > clay@panix.com
> >
> The above is good for Tcl/Tk, but for perl, it's probably easier to
> download the latest ActiveState Perl distribution. After you install
> that run ppm.pl to install Tk.
>
> i.e.
> cd to \perl\bin
> perl ppm.pl
> PPM>install Tk
>
> Good luck
--
__________________________________________________________
Mr. Erich L. Markert erich@orator.usma.edu
USMA Webmaster TEL (914)938-6463
Directorate of Information Management FAX (914)938-7308
United States Military Academy
West Point, NY 10996
"If you put three drops of poison into a 100 percent pure Java,
you get ... Windows. If you put a few drops of Java into Windows,
you still have Windows."
-- Sun Microsystems CEO, Scott McNealy
------------------------------
Date: Fri, 06 Nov 1998 10:46:29 -0600
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: Tk on NT
Message-Id: <364327E5.F3D3848D@us.ibm.com>
Mark Tagawa wrote:
>
> The above is good for Tcl/Tk, but for perl, it's probably easier to
> download the latest ActiveState Perl distribution. After you install
> that run ppm.pl to install Tk.
>
> i.e.
> cd to \perl\bin
> perl ppm.pl
> PPM>install Tk
I agree. This is a very easy way to install Tk onto an NT system. As a
follow-up to this, I'd add that you might have trouble if you're going
through a proxy server. In this case, you can download the zip file
directly from www.activestate.com/packages/zips. Then, in ppm, use the
"set" command to remove the repository entry for ActiveState, and add a
repository (name it LOCAL or whatever). For instance, if you downloaded
Tk.zip, and extracted it to d:\perl\mod\in, you'd make a repository that
pointed to that directory.
ppm
set repository /remove ActiveState Package Repository
set repository LOCAL d:\perl\mod\in
install Tk
If you don't have ppm, build 506 of ActivePerl is available and includes
ppm.
--
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)
------------------------------
Date: 6 Nov 1998 16:47:00 GMT
From: "Stephen O. Lidie" <lusol@Pandora.CC.Lehigh.EDU>
Subject: Re: Tk on NT
Message-Id: <71v964$15ns@fidoii.cc.Lehigh.EDU>
Erich L. Markert <erich@orator.usma.edu> wrote:
> Or just use Gurusamy Sarathy's NT port of perl. No need to download TK because it's part
> of this build.
Generally, you do want ActiveState's perl/Tk, because it's version 8.x
while Sarathy's is 4.x. Plus, the Perl is newer (5.005 vs 5.004).
> Mark Tagawa wrote:
>>
>> In article <71kj5j$6ui@panix.com>, clay@panix.com says...
>> > In <71keqe$kq4$1@nnrp1.dejanews.com> keydet89@yahoo.com writes:
>> >
>> > >Does anyone have any information regarding where to get
>> > >and how to install/use Tk on NT?
>> >
>> > Try: http://www.scriptics.com/software/download.html
>> >
>> > --
>> > Clay Irving
>> > clay@panix.com
>> >
>> The above is good for Tcl/Tk, but for perl, it's probably easier to
>> download the latest ActiveState Perl distribution. After you install
>> that run ppm.pl to install Tk.
>>
>> i.e.
>> cd to \perl\bin
>> perl ppm.pl
>> PPM>install Tk
>>
>> Good luck
> --
> __________________________________________________________
> Mr. Erich L. Markert erich@orator.usma.edu
> USMA Webmaster TEL (914)938-6463
> Directorate of Information Management FAX (914)938-7308
> United States Military Academy
> West Point, NY 10996
> "If you put three drops of poison into a 100 percent pure Java,
> you get ... Windows. If you put a few drops of Java into Windows,
> you still have Windows."
> -- Sun Microsystems CEO, Scott McNealy
--
--
Stephen.O.Lidie@Lehigh.EDU
Lehigh University Computing Center, USA
------------------------------
Date: Thu, 05 Nov 1998 15:03:05 -0800
From: Bob Goolsby <bob.goolsby@kp.org>
Subject: UG: San Francisco Perl User's Group meeting on 11/10/1998
Message-Id: <36422EA9.28F9CC9C@kp.org>
The Next meeting of the San Francisco Perl User's Group will
be held on Tuesday, November 10, at Intershop, fifth floor
conference room, beginning at 7PM. Intershop is located at
600 Townsend, in San Francisco.
For an hour prior to the meeting, the room will be open for
general conversation and assorted Perlery. Snacks and such,
complements of Intershop, will be provided.
Our speaker is Matt Lanier, the topic is
"Objects, Why do I Care About Them, and How Do I
Use Them In Perl?"
This talk will demonstrate the fundamentals of object-oriented
programming as used in other languages such as c++ and Java,
and will show how to implement them in perl. It will also
demonstrate how a Perl oop implementation can both help and
hinder your software project, and how to avoid common pitfalls.
The meeting should adjourn around 9PM.
For more information, see the Sfpug web site at
http://pootpoot.com/sfpug
See you on Tuesday.
------------------------------
Date: 06 Nov 1998 09:48:42 -0700
From: "Eric The Read" <emschwar@mail.uccs.edu>
Subject: Re: what does split do on empty fields?
Message-Id: <xkfd870n4wl.fsf@valdemar.col.hp.com>
tadmc@flash.net (Tad McClellan) writes:
> Eric The Read (emschwar@mail.uccs.edu) wrote:
>
> : My question is, what does "split" do if the value between the split
> : characters is empty? I've tried testing
>
> : if(defined $tmp[21])
> : if($tmp[21] ne '')
>
> : to find out if there's anything in that field, but neither of those seem
> : to work.
>
>
> That's strange. The second one should work. There is something
> else going on...
You're right, there is. Stupid me was completely misreading the warning
message. Oh well, ya live 'n' learn. The actual warning produced was:
preprocess: WARNING- Caught SIGUse of uninitialized value at
MemberDatabase.pm line 221.
-- warning!
Where the line in question was:
if($tmp[20] ne '')
This doesn't seem to have caused any problems, but I'm curious as to what
caused it.
Sorry for misleading you.
-=Eric
------------------------------
Date: Fri, 6 Nov 1998 13:04:37 -0500
From: "Billsterz" <bill@sterzenbach.com>
Subject: Write to an htm field from perl
Message-Id: <71vajf$9hs$1@nntp.erinet.com>
Hi all,
I realize I haven't made my question very clear. Please bear with me as I
have very little (almost no) knowledge of perl.
Here's what I want to do.
Have passdata.cgi pass a variable $form{whatever} to a field in an htm form
it opens and displays to the user.
The value $form{whatever} in the form must not be static as different
people use it.
Now, here's the tricky part (for me):
###### Using (abbreviated) #####
if ($line =~ /<!--passme-->/)
print FILE "<!--login-->$form{whatever} \n";
this works...sorta...it replaces the WHOLE Line the tag is on in the htm
file. I just want to put a variable in a text box.
Please don't think I haven't tried to find this info...Oh, Lord knows I've
tried. I'm just drawing a blank.
This is the last thing keeping me from completing this script.
Any help?
Thanks,
Bill
------------------------------
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 4166
**************************************