[6520] in Perl-Users-Digest
Perl-Users Digest, Issue: 145 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 19 15:28:23 1997
Date: Wed, 19 Mar 97 12:00:22 -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 Wed, 19 Mar 1997 Volume: 8 Number: 145
Today's topics:
Re: 2 fields 2 files <rootbeer@teleport.com>
Re: [Q] for loop - making multiple arrays <Brett.W.Denner@lmtas.lmco.com>
Re: A question regarding s/(w+)/\L\u$1/g (Tom Christiansen)
Am I on the console? (John Horne)
Re: ANYONE COMPILE PERL 5.003 FOR LINUX? (Cary Coulter)
Re: BUG? Improper variable interpolation in patterns? <dehon_olivier@jpmorgan.com>
Client Server help <jeremy@xxedgexx.com>
Core Dump!?!? <mikeha@ncmi.com>
Re: Executable? <boc@top.mitre.org>
Re: flock() - Just the basics <tchrist@mox.perl.com>
Here Document ....How in Perl ???? <rbhatt@netscape.com>
Re: How To Pattern Match To The First Occurance Of A Ch (Honza Pazdziora)
how2 run perl on win 3.11 system?? (marc)
interupt option fo Perl <sford@admin4.hsc.uth.tmc.edu>
Re: Mailing files from a perl script <tchrist@mox.perl.com>
Re: Multiple substitutions (Clinton Pierce)
Re: Newbie Question on accessing elements of Strings (Tad McClellan)
Re: ODBC package problem <joneil@is.ssd.k12.wa.us>
overloading operators? <phil@irvine.com>
Re: PERL on Windows NT (Danny Aldham)
Re: perl-script doesn't run (Clay Irving)
Re: PLEASE HELP! I don't wanna get fired tomorrow!! My <dsb@world.std.com>
Re: Redefining character set matched by \w ? <tchrist@mox.perl.com>
Re: replacing et al (Eric Bohlman)
Re: replacing et al (brian d foy)
Reporting Win32 Perl Bugs (Scott Phelps)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 19 Mar 1997 10:25:56 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: John Clark <john@mcl.net>
Subject: Re: 2 fields 2 files
Message-Id: <Pine.GSO.3.96.970319102519.29459G-100000@julie.teleport.com>
On Wed, 19 Mar 1997, John Clark wrote:
> I have 2 fields in 2 files. A and B in file 1, A and C in file2.
> Fields A in both files are not necessary in the same order and some
> entries may be missing. How do I use keys to sort and print ABC.
The perl documentation should be of some help. Start with the perl(1) man
page, then read the ones it references. Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: Wed, 19 Mar 1997 12:06:24 -0600
From: Brett Denner <Brett.W.Denner@lmtas.lmco.com>
Subject: Re: [Q] for loop - making multiple arrays
Message-Id: <33302B20.41C6@lmtas.lmco.com>
<snip>
> u need to use a reference (ref)
> and [] for an anonymous array...
>
> for ($i=0;$i<20;$i++){
> $num[i] = ["$string[$i]","$string[$i+1]"];
> }
>
> but itd probably be better to use...
> for $i (0..20) {
> $num[$j++] = [$string[$i], $string[++$i]]; #note the j
> }
>
> so i guess ull wanna like print em out r something...
<snip>
I'm amazed how we so frequently discuss computer language syntax with
such improper English language "syntax".
Spelling like this, while cute, is hard to read sometimes.
Brett
------------------------------
Date: Wed, 19 Mar 1997 08:35:57 -0700
From: tchrist@jhereg.perl.com (Tom Christiansen)
Subject: Re: A question regarding s/(w+)/\L\u$1/g
Message-Id: <199703191535.IAA15576@jhereg.perl.com>
>Last night I played around with this and came up with a similar answer
>that you did. However, I reversed the \L\u construct to \u\L. I would
>have thought the characters should first be forced to lower case and then
>the first chracter changed to upper case. To my surprise, the answer is
>the same and \L does not undo \u. I checked page 40 of Camel 2nd Ed but
>it didn't say. Could you please explain why?
Because that's just the way it works. I know: that's not
much of an answer. But it's how Larry designed it.
--tom
------------------------------
Date: 19 Mar 1997 11:59:09 GMT
From: J.Horne@plymouth.ac.uk (John Horne)
Subject: Am I on the console?
Message-Id: <5goked$fv@palantir.pbs.plym.ac.uk>
Hello,
I am trying to write a Perl program to be used on our Sun systems from
the workstation console and remote PC's running X-window (don't ask
why!). However I need to know if the program is initiated from the
console or not. So the problem is is there an easy way of determining
if I am at the console? I'm not sure if this is more of a Sun or Unix
question, but I can't seem to figure it out and I would have thought
it was easy enough :-) I'm using solaris 2.5.1 and Perl 5.003.
I don't read this list very often (sorry :-) ) so could you mail me
direct instead. Thanks.
John.
------------------------------
Date: Tue, 18 Mar 1997 20:38:24 GMT
From: cwc@sound.net (Cary Coulter)
Subject: Re: ANYONE COMPILE PERL 5.003 FOR LINUX?
Message-Id: <332ef82c.21288689@news.sound.net>
Larry <Larry@softech-consulting.com> wrote:
>>Has anyone successfully compiled PERL 5.003 for LINUX?
>>I've tried about 100 different response sets for Configure.sh, and
>>no matter what I do, I get the following message toward the end of
>>the first make process:
>>
>>make: *** [makefile] Error 2
>>
>>This comes after the recursive collection of MAKEDEPEND's
>>"entering directory" and "leaving directory" messages.
>>
>>Anyone have any suggestions? I'd sincerely appreciate it.
>>
>>Please email to Larry@softech-consulting.com
>>
>>Thanks!
I'm trying to build 5.003 on Linux 2.0.27. Taking the defaults in
sh Configure
and running
make
gives the following error on the step to create the miniperl
executable:
cc -L/usr/local/lib -o miniperl miniperlmain.o libperl.a \
-lgdbm -ldbm -ldb -ldl -lm -lc
cc: Internal compiler error: rogram ld got fatal signal 11
make: *** [miniperl] Error 1
All of the compile steps seem to run OK.
The ld program is:
145695 May 24 1995 /usr/bin/ld (from orig slackware
install of 1.3.20 - ??)
21716 Aug 6 1996 /usr/bin/ld86 (from )bin86-0.3.tar.gz)
Looks like something is causing a SIGSEGV (11). Do I have old/corrupt
programs? I have made several other packages/kernels on this system.
Don't know what to look for.
Any ideas?? All appreciated.
Cary Coulter
cwc@sound.net
------------------------------
Date: 19 Mar 1997 17:32:28 +0000
From: Olivier Dehon <dehon_olivier@jpmorgan.com>
Subject: Re: BUG? Improper variable interpolation in patterns?
Message-Id: <njz67ynn5xv.fsf@jpmorgan.com>
mer@world.evansville.net (Marc Rouleau) writes:
>
> $_ = '$x'; $a = '$x'; $b = '\$x';
> print "\$a matched\n" if /$a/;
> print "\$b matched\n" if /$b/;
>
> My output from this fragment is
>
> $b matched
>
> I guessed that perl is interpolating $a to be the string '$x' and then
> incorrectly re-interpolating $x, but that doesn't seem to be the case.
> If I try
>
> $_ = 'abc'; $x = abc; $a = '$x'; $b = '\$x';
> print "\$a matched\n" if /$a/;
> print "\$b matched\n" if /$b/;
>
> I get no output. Is this pilot error or a bug? If the former, would
> some kind soul please enlighten me?
>
You simply forgot that $ is a RE meta-character matching the
end-of-string. Thus, when interpolating $a into $x, you want to match
a x following the end of the string !
Hope this helps
Olivier Dehon
------------------------------
Date: 19 Mar 1997 16:36:33 GMT
From: Jeremy Hansen <jeremy@xxedgexx.com>
Subject: Client Server help
Message-Id: <33301611.1F06@xxedgexx.com>
I've have been playing with sockets according to the Second addition
Camel Book.
I took the client/server progs they had written and basically copied
them to get an understanding how things are working.
I altered the server to return stats on disk usage on the server machine
using a simple df command. Now for some reason after the client accepts
and reports output from the server, the server die. Here is what I
have. Any help would be appreciated:
client.pl
--------------------
#!/usr/local/bin/perl -w
require 5.002;
use strict;
use Socket;
my ( $remote, $port, $iaddr, $paddr, $proto, $line);
$remote = shift || 'localhost';
$port = shift || 2345; # random port
if ($port =~ /\D/) { $port = getsrvbyname($port, 'tcp') }
die "No port" unless $port;
$iaddr = inet_aton($remote) or die "no host: $remote";
$paddr = sockaddr_in($port, $iaddr);
$proto = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto) or die "socket: $!";
connect(SOCK, $paddr) or die "connect: $!";
while ($line = <SOCK>) {
print $line;
}
close (SOCK) or die "close: $!";
exit;
server.pl
-----------------------
#!/usr/local/bin/perl -Tw
require 5.002;
BEGIN { $ENV{PATH} = '/usr/ucb:/bin' }
use Socket;
use Carp;
sub logmsg { print "$0 $$: @_ at ", scalar localtime, "\n"; }
my $port = shift || 2345;
my $proto = getprotobyname ('tcp');
socket(Server, PF_INET, SOCK_STREAM, $proto) or die "socket: $!";
setsockopt(Server, SOL_SOCKET, SO_REUSEADDR, pack("l", 1))
or die "setsockopt: $!";
bind(Server, sockaddr_in($port, INADDR_ANY)) or die "bind: $!";
listen(Server, SOMAXCONN) or die "listen: $!";
logmsg "server started on port $port";
my $paddr;
$SIG{CHLD} = \&REAPER;
for ( ; $paddr = accept(Client, Server); close Client) {
my($port,$iaddr) = sockaddr_in($paddr);
my $name = gethostbyaddr($iaddr, AF_INET);
logmsg "connect from $name [",
inet_ntoa($iaddr), "] at port $port";
&df_stat;
}
#Sub
sub df_stat
{
open DFOUT, "/usr/sbin/df 2>&1 |" or die "Dead.";
while (<DFOUT>)
{
print Client $_;
}
close DFOUT;
return;
}
Here's the error I get from the server when it dies after contact fromt
he client.
error
-----------------------------
./server.pl 14620: connect from localhost [ 127.0.0.1 ] at port 46315 at
Wed Mar 19 11:36:04 1997
Use of uninitialized value at ./server.pl line 39, <DFOUT> chunk 14.
Use of uninitialized value at ./server.pl line 39, <DFOUT> chunk 14.
Unable to create sub named "" at ./server.pl line 39, <DFOUT> chunk 14.
Thanks for any help. Please reply by mail.
Thanks
-jeremy
------------------------------
Date: Wed, 19 Mar 1997 11:10:56 -0800
From: "Michael C. Harris" <mikeha@ncmi.com>
Subject: Core Dump!?!?
Message-Id: <33303A40.31C1@ncmi.com>
We have a Perl script (5.001 patch level 1m) running on an HP-UX
platform (10.01 C).
It consistently core dumps in the same place, during the execution of a
printf statement that is within a loop (i.e., has executed successfully
prior to the dump). The debugger cannot help as it "blows up" when we
core dump. We took a stack dump just prior to the core dump and are in
the process of analyzing it.
Does anyone have any experience or idea that might be useful?
TIA
Mike & Ben
------------------------------
Date: 19 Mar 1997 16:27:33 GMT
From: "Markus" <boc@top.mitre.org>
Subject: Re: Executable?
Message-Id: <01bc349a$f9123820$0b0b5381@boc_pc>
You probably don't have rights to execute scripts on you ISP's server from
a browser. You can find this out if you can execute it with: perl <my
cgi>,
but not from your web browser.
markus
Mike Smith <masmith@telusplanet.net> wrote in article
<01bc342c$71e57600$b24722cf@Mike.compusmart.ab.ca>...
> I put a perl script on my isp's cgi server last week. I telnet to the
> server, type perl mcr.cgi in the directory where the script is and
> everything works fine. The tags print to screen and such. I used chmod
777
> mcr.cgi to make it executable. Doesn't that mean I can tpye mcr.cgi
> (without running perl; ie. perl mcr.cgi)? Anyway, when I type mcr.cgi
Unix
> gives me a "bad command" message.
>
> The other thing is when I click the form using the script I get a server
> error that states there is an internal configuration problem. I called my
> ISP and they said my cgi password may (they are not sure??????) be
> crackable so that may be the problem. But how can I execute scripts
through
> telnet if that is true?
>
> Thanks,
> Mike aka stressed out in Edmonton
> masmith@telusplanet.net
>
------------------------------
Date: 19 Mar 1997 17:18:47 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: flock() - Just the basics
Message-Id: <5gp75n$fjm$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
sailboat@tiac.net (Robert Schuldenfrei) writes:
:I am trying to learn how to use flock(). My old SCO box seems to have it, but I
:am probably using it wrong. Is there some documentation for flock() on version
:3.2.2 of SCO UNIX? One program is opening the file for writing and then locking
:the file like this:
:
:open(OUTFILE, "myfile");
:flock(OUTFILE, 02);
:
:The other program is trying to read that file. I do not know the test in the
:reading program to see if the file is locked. If so, the second program should
:sleep and then try again. I am not sure of the codes for flock(). I think 02
:is to lock the file before writing, and 03 is to remove the locks before
:closing. I would like to know the answer, but even more important some good
:source reference would be a great help. Thanks for you help.
NAME
perlfaq5 - Files and Formats ($Revision: 1.19 $)
DESCRIPTION
This section deals with I/O and the "f" issues: filehandles,
flushing, formats, and footers.
....
How can I lock a file?
Perl's built-in flock() function (see the perlfunc manpage for
details) will call flock(2) if that exists, fcntl(2) if it
doesn't (on perl version 5.004 and later), and lockf(3) if
neither of the two previous system calls exists. On some
systems, it may even use a different form of native locking.
Here are some gotchas with Perl's flock():
1 Produces a fatal error if none of the three system calls (or
their close equivalent) exists.
2 lockf(3) does not provide shared locking, and requires that
the filehandle be open for writing (or appending, or
read/writing).
3 Some versions of flock() can't lock files over a network (e.g.
on NFS file systems), so you'd need to force the use of
fcntl(2) when you build Perl. See the flock entry of the
perlfunc manpage, and the INSTALL file in the source
distribution for information on building Perl to do this.
The CPAN module File::Lock offers similar functionality and
(if you have dynamic loading) won't require you to rebuild
perl if your flock() can't lock network files.
What can't I just open(FH, ">file.lock")?
A common bit of code NOT TO USE is this:
sleep(3) while -e "file.lock"; # PLEASE DO NOT USE
open(LCK, "> file.lock"); # THIS BROKEN CODE
This is a classic race condition: you take two steps to do
something which must be done in one. That's why computer
hardware provides an atomic test-and-set instruction. In
theory, this "ought" to work:
sysopen(FH, "file.lock", O_WRONLY|O_EXCL|O_CREAT, 0644)
or die "can't open file.lock: $!":
except that lamentably, file creation (and deletion) is not
atomic over NFS, so this won't work (at least, not every time)
over the net. Various schemes involving involving link() have
been suggested, but these tend to involve busy-wait, which is
also subdesirable.
I still don't get locking. I just want to increment the number
in the file. How can I do this?
Didn't anyone ever tell you web-page hit counters were
useless?
Anyway, this is what to do:
use Fcntl;
sysopen(FH, "numfile", O_RDWR|O_CREAT, 0644) or die "can't open numfile: $!";
flock(FH, 2) or die "can't flock numfile: $!";
$num = <FH> || 0;
seek(FH, 0, 0) or die "can't rewind numfile: $!";
truncate(FH, 0) or die "can't truncate numfile: $!";
(print FH $num+1, "\n") or die "can't write numfile: $!";
# DO NOT UNLOCK THIS UNTIL YOU CLOSE
close FH or die "can't close numfile: $!";
Here's a much better web-page hit counter:
$hits = int( (time() - 850_000_000) / rand(1_000) );
If the count doesn't impress your friends, then the code
might. :-)
--
Tom Christiansen tchrist@jhereg.perl.com
Down that path lies madness. On the other hand, the road to hell is
paved with melting snowballs. --Larry Wall in <1992Jul2.222039.26476@netlabs.com>
------------------------------
Date: Wed, 19 Mar 1997 08:37:57 -0800
From: Ronak Bhatt <rbhatt@netscape.com>
Subject: Here Document ....How in Perl ????
Message-Id: <33301665.5DF3@netscape.com>
How do I acheive here document feature of Shell in Perl.....
I want following piece of code,
sqldba > $ofile << EOF
connect internal
select * from v$session
exit
EOF
What would be the perl code for this ??????
Thanks, Ronak.
------------------------------
Date: Wed, 19 Mar 1997 18:02:32 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: How To Pattern Match To The First Occurance Of A Character
Message-Id: <adelton.858794552@aisa.fi.muni.cz>
dharma@msys.net (Rhadji P) writes:
> I must be missing something. It can't be that difficult.
>
> What I'm trying to do is pattern match to the first occurance of a
> character.
>
> For example, given the following string...
>
> <TEXTAREA NAME="area 1" ROWS="10" COLS="10"></TEXTAREA>
>
> I want $1 to equal NAME="area 1" ROWS="10" COLS="10"
>
> but the pattern /<TEXTAREA(.*)>/
>
> gobbles up the string to the second ">" causing
>
> $1 to equal NAME="area 1" ROWS="10" COLS="10"></TEXTAREA
>
> How do I pattern match to the first occurance of > ?
/<TEXTAREA(.*?)>/
Read the man pages.
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
I can take or leave it if I please
------------------------------------------------------------------------
------------------------------
Date: Wed, 19 Mar 1997 18:39:21 GMT
From: rubinm@aztec.asu.edu (marc)
Subject: how2 run perl on win 3.11 system??
Message-Id: <5gpc6v$1ddc$1@news-s01.ca.us.ibm.net>
I'd like to develop perl app on my windows 3.1/486 machine. Would be
most grateful for instructions on how to get started.
------------------------------
Date: Wed, 19 Mar 1997 11:58:37 -0600
From: SRFord <sford@admin4.hsc.uth.tmc.edu>
Subject: interupt option fo Perl
Message-Id: <3330294D.1ECD@admin4.hsc.uth.tmc.edu>
Is there a command in Perl that can perform a certain action if a user
who
is running the script hits control-C. I'm writing a menu type script
and I do not want users to be able to exit to the command line by typing
control-C. Is this possible in Perl. Thanks.
Stephen Ford
sford@admin4.hsc.uth.tmc.edu
------------------------------
Date: 19 Mar 1997 19:03:51 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Mailing files from a perl script
Message-Id: <5gpdan$kfb$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Chris Plachta <stats9@mail.idt.net> writes:
:I'm running Perl 5 on a linux box.I'm writing a script to
:email some text files to people.
:
:`mail -I person@addr.com < mail.file`;
You have millions of mistakes, like not escaping the @ sign, like
using backticks when you should be using system, and not
reading the perl faq at http://www.perl.com/perl/faq/index.html,
which talks about such things.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
echo $package has manual pages available in source form.
echo "However, you don't have nroff, so they're probably useless to you."
--Larry Wall in Configure from the perl distribution
------------------------------
Date: 19 Mar 1997 17:17:45 GMT
From: cpierce1@cp501.fsic.ford.com (Clinton Pierce)
To: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Multiple substitutions
Message-Id: <5gp73p$bed1@eccws1.dearborn.ford.com>
In article <ebohlmanE79GEM.8Hr@netcom.com>,
ebohlman@netcom.com (Eric Bohlman) writes:
>Randal Schwartz (merlyn@stonehenge.com) wrote:
>: Eventually, the *rhythm* of the language starts pounding in my head...
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
>That is truly an outstanding metaphor for having a mental model of how
>the language works.
I think so also. When there's a problem to solve, and I've been using
a language (or an OS, eg UNIX) even if I don't know the commands/syntax/
function that I need...I KNOW it's there somewhere. It becomes a game
of "Name That Tune". Eventually, I try what I think is right, or run
across the right syntax...and the beat goes on. I know the score,
but sometimes need to fill in measures. To try to fill in the measures
from a Waltz with a Mambo just "to get by" eventually leads to trouble.
[edited for brevity]
>It saddens me to see lots of CGI writers trying to modify someone else's
>existing code [...] without understanding what the code *means*. [...]
>but it seems that nowadays everyone is approaching Web development as if
>it were [personal code]; too many people just experiment with
>techniques they don't really understand until they've got something that
>appears to work for them (you might say they throw random "solutions" at
>the problem until one sticks), and take the attitude that it doesn't
>matter if it doesn't work for others as long as they get paid before the
>shit hits the fan.
I think this has a lot to do with the fact that this is one of the few
eras in Comptuer Programming where "Make Money Fast" by any means necessary
is a possibility. (Others include the Video Games boom of the 1980's and
the year 2000 fiasco coming up.) Corporate America wants on the Web, and
they're willing to pay anybody anything to do it. If some Joe can slap
together some CGI code that appears to work long enough to cash the check,
then he's making serious money. And it's happening on Intranets, too.
(I see this all around me.)
Corporate America learned to take care of its "back room" IS departments,
but the Web is IS-Meets-Marketing and they blindly drop their shorts.
Interesting Times ahead.
--
+------------------------------------------------------------------------+
| Clinton A. Pierce | "If you rush a Miracle Man, | http://www. |
| cpierce1@ford.com | you get rotten miracles" | dcicorp.com/ |
| cpierce@mica.net |--Miracle Max, The Pricess Bride | ~clintp |
+------------------------------------------------------------------------+
GCSd-s+:+a-C++UALIS++++P++++L++E---t++X+b+++DI++++G++e+>++h----r+++y+++>y*
------------------------------
Date: Wed, 19 Mar 1997 07:35:39 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Newbie Question on accessing elements of Strings
Message-Id: <b3qog5.ap.ln@localhost>
Mark Glover (mglover@rnib.org.uk) wrote:
: I am sure there is a very simple and obvious answer to this question,
: but I can't find the answer in any of the books I have!
: I am reading lines of text into a string from a file using the READ
: function call and now I want to cycle through the string character by
: character but because PERL strings are not arrays I cannot see how to
: do this; in 'C' I would simply do:-
: for (n=0; n<strlen(str); ++n) {
: do something useful with str[n];
: }
: Any help would be very much appreciated.
Here are only three ways to get a letter at a time:
---------------------------------------
#! /usr/bin/perl -w
$_ = "Mark Glover";
for ($n=0; $n<length($_); $n++) {
$letter = substr($_, $n, 1);
print "$letter\n"; # is printing 'something useful'? ;-)
}
print "\n\n";
foreach $n (0..length($_)) { # inefficient for very long strings
$letter = substr($_, $n, 1);
print "$letter\n"; # is printing 'something useful'? ;-)
}
print "\n\n";
foreach $letter (split //) {
print "$letter\n"; # is printing 'something useful'? ;-)
}
print "\n\n";
---------------------------------------
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Wed, 19 Mar 1997 08:22:22 -0800
From: Jerome O'Neil <joneil@is.ssd.k12.wa.us>
To: Donovan Janus <donovan@zaak.nl>
Subject: Re: ODBC package problem
Message-Id: <333012BE.1066@is.ssd.k12.wa.us>
Donovan Janus wrote:
> use Win32::ODBC;
> $Data = new Win32::ODBC("DSN=DeZaak;UID=MyName;PWD=MyPassWord");
> ($qualifier, $owner, $name, $type) = $Data->Catalog("", "", "%",
> "'TABLE'");
> $Data->Close();
>
> I get the error:
>
> Can't call method "Catalog" without a package or object reference at
> line 3.
Your $Data object isn't being initialized for some reason or another.
Check and make sure your DSN, UID, and PWD are all correct. An easier
way to do it (since you are using NT) is to define your database as a
System DSN with the NT ODBC32 applett. That way you get to use the much
easier
$Data = new Win32::ODBC("NT_System_DSN_name") and let the NT ODBC
functions take care of the details.
Your permissions may vary.
Jerome
------------------------------
Date: Wed, 19 Mar 1997 09:18:57 -0800
From: Phil Sallee <phil@irvine.com>
Subject: overloading operators?
Message-Id: <33302001.26E@irvine.com>
Does anyone know of a way to overload operators in Perl? Other
object oriented languages such as C++ or Ada allow you to do this,
but I haven't found a way to do this in Perl yet. How do you allow
objects to be manipulated using standard operators?
Is this a feature that might be added in a future release of
Perl maybe??
Phil Sallee
phil@irvine.com
------------------------------
Date: 17 Mar 1997 21:49:24 -0800
From: danny@hendrix.postino.com (Danny Aldham)
Subject: Re: PERL on Windows NT
Message-Id: <5glad4$rvd@hendrix.postino.com>
Daniel McManus (mcmanus@ait.fredonia.edu) wrote:
: Anyone out there using WindowsNT and have PERL running.
: I tried to set up PERL on NT and its not working. But I'm too baffeled to
: be able to say what the symptoms are so, if there is anyone out there who
: is doing this please contact me so I can ask you a couple of questions.
It is not fair. The first time I installed Perl on a unix box I spent
days struggling with the configure script, the hints, and the compile errors.
"Unreferenced symbol, first found in ..." . Now to get perl running on
an NT box all you have to do is download the 110-i86.zip file from
www.perl.hip.com , unzip it, and run the install.bat file. That's it.
I'll say it again. It's just not fair.
Danny Aldham
------------------------------
Date: 19 Mar 1997 13:06:49 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: perl-script doesn't run
Message-Id: <5gp9vp$l78@panix.com>
In <332FF03A.4EDD@chem.leidenuniv.nl> matgorl@chem.leidenuniv.nl writes:
>I have written a simple perl-script and put it on my server in
>my-home-directory/public_html/cgi-bin/
>When I run it from the command-line during a telnet session it works
>perfectly and outputs the text hallo. (see script below)
>When I run it through Netscape (using a form and POST) I get an error
>501.
>What do I do wrong? The location of perl on the server is right. The
>script itself works but it doesn't seem to be interpreted as a script
>when I refer to it by an html request. The attributes are rwxrwxrwx so
>it is accessible by any means. And when I call the file with the GET
>method it just is printed on the screen as was it a normal html
>document.
>Do I have to place the script in a specific directory on the server? Or
>do I have to change a file on the server that indicates that a file with
>a cgi-extension has to be interpreted instead of echoed to the caller.
>Or is there some kind of environment variable that has to be set.
>#!/usr/local/bin/perl
>print <<EOF ;
>hallo
>EOF
>exit ;
You need to give the Web server a little more information -- Check one of
the CGI programing tutorials in the "Tutorials, Guides, and FAQs" section
of the Perl Reference:
http://www.panix.com/~clay/perl/query.cgi?tutorials+index
Like:
CGI Programming 101
http://www59.metronet.com/dev/class/index.shtml
If you are writing a CGI that's going to generate a HTML page, you must
include this statement somewhere in the script, before you print out any
HTML tags:
print "Content-type:text/html\n\n";
This is a MIME header that tells the receiving web browser what sort of
data it is going to get.
Your Perl program works from a command line, so you don't have a problem
with Perl. You should check:
news:comp.infosystems.www.authoring.cgi
Hope this helps!
--
Clay Irving See the happy moron,
clay@panix.com He doesn't give a damn,
http://www.panix.com/~clay I wish I were a moron,
My God! Perhaps I am!
------------------------------
Date: Wed, 19 Mar 1997 17:52:52 GMT
From: David Boyce <dsb@world.std.com>
Subject: Re: PLEASE HELP! I don't wanna get fired tomorrow!! My girlfriend leaves me last week now this! Ugh!
Message-Id: <333027F4.2415@world.std.com>
What's your girlfriend's phone number?
-David
------------------------------
Date: 19 Mar 1997 19:07:29 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Redefining character set matched by \w ?
Message-Id: <5gpdhh$kfb$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Olivier Dehon <dehon_olivier@jpmorgan.com> writes:
:I was wondering if it was possible in Perl to redefine the character
:set that is matched by \w.
Not without crazy games with fake locales.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
Now and then an innocent person is sent to the legislature.
------------------------------
Date: Wed, 19 Mar 1997 15:53:55 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: replacing et al
Message-Id: <ebohlmanE7As5v.Dt@netcom.com>
Alex Schajer (schajer@dircon.co.uk) wrote:
: How do I replace everything after a certain point.
: EG /this/that/then/this/replace.me
: How do I leave the this and thats and cut replace.me
s/(/this/that/then/this/)replace\.me/$1/;
------------------------------
Date: Wed, 19 Mar 1997 11:16:16 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: replacing et al
Message-Id: <comdog-1903971116160001@nntp.netcruiser>
In article <33301209.167E@dircon.co.uk>, Alex Schajer
<schajer@dircon.co.uk> wrote:
> How do I replace everything after a certain point.
> EG /this/that/then/this/replace.me
>
> How do I leave the this and thats and cut replace.me
well, there are lots of ways to do it. here's one of them :)
#!/usr/bin/perl
$string = '/this/that/then/this/replace.me';
$string =~ s| [^/]* # characters that are not /
$ # at the end of the string
||x; # x = extended regex
print $string, "\n";
__END__
--
brian d foy <URL:http://computerdog.com>
unsolicited commercial email is not appreciated
------------------------------
Date: Wed, 19 Mar 1997 18:31:37 GMT
From: scoph@bga.com (Scott Phelps)
Subject: Reporting Win32 Perl Bugs
Message-Id: <33302f7f.21147941@news3.bga.com>
Activeware no longer has an active bug-reporting link on their
web-site (that I could find). Any suggestions as to where I can
report a bug?
Is there a known bug list that is more extensive than what is in the
distribution text files?
The specific bug I wish to report is that when I use an array in a
scalar context, I seem to be getting undef, instead of the length of
the array.
------------------------------
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 145
*************************************