[10424] in Perl-Users-Digest
Perl-Users Digest, Issue: 4017 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 20 09:03:09 1998
Date: Tue, 20 Oct 98 06:00:22 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 20 Oct 1998 Volume: 8 Number: 4017
Today's topics:
"->" operator and "unquoted string warning" ronald_f@my-dejanews.com
Re: "->" operator and "unquoted string warning" (David Alan Black)
[Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
Can't create a socket on win95 HELP!!!! <pete@tradewind.net>
Re: grrrrr, why not while(<blah>) <jimbo@soundimages.co.uk>
help: hash <rolf.rettinger@desy.de>
how to process fixes length record files <tim.schelfhout@telenet.be>
Re: I have a few elementary Perl problems <jimbo@soundimages.co.uk>
Re: I have a few elementary Perl problems <jimbo@soundimages.co.uk>
Re: Info on crypt() (Michael J Gebis)
Konvert function unpack in C++ - Code (Harald Lorenz)
Network browsing <mansley@investec.co.za>
Re: New Module: File::Finder -- OO version of File::Fin <jimbo@soundimages.co.uk>
non blocking <stdin> <cyrilm@nortel.ca>
PERL and a DATABASE.. <webmaster_NO*SPUDS*@dportal.co.uk>
Re: PERL and a DATABASE.. <Tony.Curtis+usenet@vcpc.univie.ac.at>
Re: Perl as a first language... I vote yes! <jimbo@soundimages.co.uk>
Re: Perl DBI AND Oracle (ORACLE_HOME) (thanks) gavin@orbital.co.uk
Re: Perl Y2K copmliance dave@mag-sol.com
Re: Perl Y2K copmliance (David Alan Black)
Re: Perl's a first in my book <jimbo@soundimages.co.uk>
Re: Perl, SQL & Oracle tutorial sought (Rolf Schaufelberger)
printing problems with records <marx@idiom.com>
Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has regi (David Cantrell)
Re: Sending Word-Docs directly to the Browser via CGI <tanja.riedel.tr3@bayer-ag.de>
Solved! (was: unresolved symbol: _dbm_open) ronald_f@my-dejanews.com
String substition <k.thomson@scet.com>
Re: String substition (Larry Rosler)
Re: trouble with sub (Larry Rosler)
Using IO::Socket and spawning child processes ronald_f@my-dejanews.com
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 20 Oct 1998 11:53:10 GMT
From: ronald_f@my-dejanews.com
Subject: "->" operator and "unquoted string warning"
Message-Id: <70htj6$9uu$1@nnrp1.dejanews.com>
Maybe someone can give me some explanation for this: I have a class
package mod;
sub new {
my $class = shift;
my $self = {};
return bless($self,$class);
}
and, in a separate file, a client of this class:
#!/usr/local/bin/perl -w
use mod;
my $i = mod->new();
When using the "-w" switch, I get the warning message
Unquoted string "mod" may clash with future reserved word
for the expression (mod->new()). Beside this nasty warning, the
program seems to work fine.
I understand that Perl also accepts the form ("mod"->new()), sinces
package (i.e. class) names are simply strings, and I can understand why
Perl complains when running under "-w". What I do not understand is
why all expression in the Camel book involving class methods use bare
words, not quoted strings, for writing the class name. Since obviously
it is meant to use the class name in this context *without* quotes,
and running under "-w" is generally encouraged, I suppose that I overlooked
something. I re-read the chapters on objects, but did not find any clue.
Ronald
--
Ronald Fischer <ronald_f@my-dejanews.com>
http://ourworld.compuserve.com/homepages/ronald_fischer/
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 20 Oct 1998 08:33:40 -0400
From: dblack@pilot.njin.net (David Alan Black)
Subject: Re: "->" operator and "unquoted string warning"
Message-Id: <70hvv4$soj$1@pilot.njin.net>
Hello -
ronald_f@my-dejanews.com writes:
>Maybe someone can give me some explanation for this: I have a class
>package mod;
>sub new {
> my $class = shift;
> my $self = {};
> return bless($self,$class);
>}
>and, in a separate file, a client of this class:
>#!/usr/local/bin/perl -w
>use mod;
>my $i = mod->new();
>When using the "-w" switch, I get the warning message
> Unquoted string "mod" may clash with future reserved word
>for the expression (mod->new()). Beside this nasty warning, the
>program seems to work fine.
If you capitalize your module's name, you won't get the warning:
package Mod;
...
my $i = Mod->new();
etc.
This is standard practice anyway, so it's a good idea to do it as a rule.
David Black
dblack@pilot.njin.net
------------------------------
Date: Tue, 20 Oct 1998 10:24:01 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage908879041.22659@news.teleport.com>
Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 10 Sep 1998
[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The last major update of the Perl FAQ was in Summer of
1998; of course, ongoing updates are made as needed. ]
For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).
http://cpan.perl.org/doc/FAQs/
Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.
perldoc perlfaq
man perlfaq
If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.
If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
560_986_526 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.
http://cpan.perl.org/
http://www.perl.com/CPAN/
http://cpan.perl.org/doc/FAQs/FAQ/html/
http://www.perl.com/CPAN/doc/FAQs/FAQ/html/
You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)
California ftp://ftp.cdrom.com/pub/perl/CPAN/
Texas ftp://ftp.metronet.com/pub/perl/
South Africa ftp://ftp.is.co.za/programming/perl/CPAN/
Japan ftp://ftp.dti.ad.jp/pub/lang/CPAN/
Australia ftp://cpan.topend.com.au/pub/CPAN/
Netherlands ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
Switzerland ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
Chile ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/
If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.
Another possibility is to use one of the FTP-via-email services; for
more information on doing that, send mail to <mail-server@rtfm.mit.edu>
(not to me!) with these lines in the body of the message, flush left:
setdir usenet-by-group/news.announce.newusers
send Anonymous_FTP:_Frequently_Asked_Questions_(FAQ)_List
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.
Have fun with Perl!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 20 Oct 1998 07:45:10 -0400
From: John Smallberries <pete@tradewind.net>
Subject: Can't create a socket on win95 HELP!!!!
Message-Id: <362C77C6.ABED50D9@tradewind.net>
I have been trying to use the HTTP::Daemon packake on win95. The example
from the
package (reproduced below) works like a dream on Linux but on 95 it
always returns a port of 0, even if if explicitly set the port.
I'm using ActiveState Perl (I think 5.02, it's the one from the Perl
Conference)
If anyone knows how to get this to work on 95 I could really use this.
Pete
pete@tradewind.net
--------------------------
use HTTP::Daemon;
use HTTP::Status;
$d = new HTTP::Daemon LocalAddr => '127.0.0.1',LocalPort=>80;
print "Please contact me at: <URL:", $d->url, ">\n";
while ($c = $d->accept) {
$r = $c->get_request;
if ($r) {
if ($r->method eq 'GET' and $r->url->path eq "/xyzzy") {
# this is *not* recommened practice
$c->send_file_response("/etc/passwd");
} else {
$c->send_error(RC_FORBIDDEN)
}
}
$c = undef; # close connection
}
------------------------------
Date: 20 Oct 1998 11:27:27 +0100
From: Jim Brewer <jimbo@soundimages.co.uk>
Subject: Re: grrrrr, why not while(<blah>)
Message-Id: <uk91vjzow.fsf@jimbosntserver.soundimages.co.uk>
Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> writes:
>
> Tom Christiansen wrote:
>
> > I guess that means he gets to kick for the extra point.
>
> Last I checked, there wasn't that sort of thing in the baseball
> paradigm, but I could be wrong. Though trying to make a field goal with
> a baseball would really be a &^*&%!. I'm buying a round of beer for
> everyone concerned. Life is too short to nitpick. Breathe in, breathe
> out. It's only Perl, did you mow your lawn today or hug the person close
> to you? just a reality check.
>
Please stop. You'll give *grumpy* a bad name. What, you want the
world, as well as the people in it to be happy? What, are we supposed
to be smiling as well? Next you'll be insisting on a daily dose of
laughter. Stop. Now. Unspeakable evil!
Just remember, the San Diego Padres are in the World Series for only
the SECOND time in their history. The last being in 1984. If they want
to kick for an extra point, well I say they should get the chance! As
often as they reckon they can score a point while standing at home
plate in such a way. More points good; no points bad.
--
Jim Brewer
e-mailed courtesy copies are unappreciated, please refrain.
------------------------------
Date: Tue, 20 Oct 1998 13:16:18 +0200
From: "Rolf Rettinger" <rolf.rettinger@desy.de>
Subject: help: hash
Message-Id: <70hrer$riv$1@claire.desy.de>
I have a list @groups, where the administrative groups of an user are given
and I have a list @users or better $users[$i], where the members of each
group in @groups are given. My problem is how to write that information in a
%hash that I can correlate each group and the corresponding users from the
web by a select statement or a scroll menue?
Thank's Rolf
------------------------------
Date: 20 Oct 1998 10:15:18 GMT
From: "Tim Schelfhout" <tim.schelfhout@telenet.be>
Subject: how to process fixes length record files
Message-Id: <01bdfc12$4b056ea0$4737000a@tl000143>
Hi there,
I've been trying to process files with a fixed length records content
(fields of 25 bytes).
Is there perhaps a function I don't know about that would take care of this
? Some of the fields are not filled in so I can't do it wit split !!
I've done it with <read TEST,$veld,25> but I think it's rather stupid.
there must be a more intelligent way to go about it.
Thanks beforehand
See ya
------------------------------
Date: 20 Oct 1998 13:26:25 +0100
From: Jim Brewer <jimbo@soundimages.co.uk>
Subject: Re: I have a few elementary Perl problems
Message-Id: <uems3ju6m.fsf@jimbosntserver.soundimages.co.uk>
Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> writes:
>
> /me sends poster a big mug of Newcastle.
>
I'll bet you have a poster of Alan Shearer as well! Bet your a Ruud
fan too. There is no accounting for taste. :)
Birmigham City! (Or Aston Villa if you prefer European cup play).
--
Jim Brewer
e-mailed courtesy copies are unappreciated, please refrain.
------------------------------
Date: 20 Oct 1998 13:37:26 +0100
From: Jim Brewer <jimbo@soundimages.co.uk>
Subject: Re: I have a few elementary Perl problems
Message-Id: <ud87njto9.fsf@jimbosntserver.soundimages.co.uk>
ilya@ns1.foothill.net (Ilya) writes:
>
> system ("remsh $_ command" > /home/ilya/web/sysinfo/$_/test.$_)
>
> But that gives me an error as well. The $_ variable is fine.
>
Why not open a pipe and read the results from the command as you would
an ordinary file handle? Then you can write the results to whatever
file you care to. Then you can avoid the need to redirect the command
output to a different location.
--
Jim Brewer
e-mailed courtesy copies are unappreciated, please refrain.
------------------------------
Date: 20 Oct 1998 06:39:38 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Info on crypt()
Message-Id: <70hb7a$obb@mozo.cc.purdue.edu>
bart.mediamind@ping.be (Bart Lateur) writes:
}I'm trying to figure out some properties of Perl's built-in crypt
}function.
}In particular I want to create my own password geberation/encryption
^^^^^^^^^^
That's got to have something to do with my last name, I know it.
}code. One requirement I put on it, is that generated passwords only
}consist of upper case letter, and digits: [A-Z0-9].
}So I'm trying to figure out the correlation between the input text, the
}salt, and the possible resulting characters in the encrypted string.
On my system, the man page says:
By taking the lowest 7 bit of each character of the key, a
56-bit key is obtained. This 56-bit key is used to
encrypt repeatedly a constant string (usually a string
consisting of all zeros). The returned value points to
the encrypted password, a series of 13 printable ASCII
characters (the first two characters represent the salt
itself). The return value points to static data whose
content is overwritten by each call.
Perl's crypt should really just tie you into the system crypt, so in
my case, I'm always getting "13 printable ASCII characters." I'd note
that if you could find a correlation between input text and the
crypted string, that would reduce the search space. That is a bad thing.
I'd also note that for an eight character "password" you end up with a
search space of 2821109907456 keys, which is equivalent to about 41.4
bits, generally considered insecure (except in the US).
In other words, I'm saying I don't think you can do what you want, and
if you could, it would be a bad thing.
You don't give the reasons for your restrictions; however, you could
generate a MD5 or SHA hash of a pass phrase, and print out the result
in hex, which could look something like:
282ba05a 4bf052d9 1726a54f 764f3a02
And since you're using perl, this is all available, almost without
thought, via modules.
}I've looked at the crypt(3) man pages, but it doesn't even look like
}it's the same functionality. For example: these man pages talk about a
}4-bytes salt key, while I thought that Perl's crypt() uses only two
}characters for salt.
Weird, man. What OS?
--
Mike Gebis gebis@ecn.purdue.edu mgebis@eternal.net
------------------------------
Date: 20 Oct 1998 10:31:04 GMT
From: lorenz@sdm.de (Harald Lorenz)
Subject: Konvert function unpack in C++ - Code
Message-Id: <70hop8$cp7$1@bsdti6.sdm.de>
Hi there!
I have to convert a perl-script to C++ - Code.
Can anybody tell my how to translate the function
unpack ?
My special Part of the perl-code:
unpack ( "%32C*", $str )
where $str is a <normal string>.
I don't want solutions, that
call a perl-programm from C++ (like XS-CALL. etc.)
Harald
--
Dipl.-Math. Harald Lorenz mailto:harald.lorenz@sdm.de
sd&m GmbH & Co. KG http://www.sdm.de
software design & management
Thomas-Dehler-Str. 27, 81737 Muenchen, Germany
Tel +49 89 63812-228 Fax -515
------------------------------
Date: Tue, 20 Oct 1998 13:08:58 +0200
From: "Michael Ansley" <mansley@investec.co.za>
Subject: Network browsing
Message-Id: <70hr0e$ai2$1@hermes.is.co.za>
Could somebody please direct me to a suitable reference for accessing
the NT directory database or browser service.
What I need is to retrieve a list of all computers as appears in the
server manager. This list must contain the disconnected computers as
well. The module Win32::NetAdmin::GetServers seems to only retrieve
active machines. If there is no module available to do this, perhaps the
database (wherever it is) can be accessed directly.
Thanks
Alistair Farquharson
Network Analyst
NOC Security Team
London Outsourcing Centre
SHL Systemhouse
An MCI Company
137 Stamford Street, Waterloo, LONDON SE1 9NJ.
( Phone: +44 (0)171-922-0029 J Fax: +44 (0)171-401-9678
* Mail: Afarquharson@shl.com
Please return to the address above, as I do not have access to the newsgroup
------------------------------
Date: 20 Oct 1998 13:02:11 +0100
From: Jim Brewer <jimbo@soundimages.co.uk>
Subject: Re: New Module: File::Finder -- OO version of File::Find
Message-Id: <uiuhfjvb0.fsf@jimbosntserver.soundimages.co.uk>
John Porter <jdporter@min.net> writes:
> John "Gashlycrumb" Porter
Okay, which is it? 'Many Jars' or 'Gashlycrumb'? The XS Files are
waiting in the wings. Agents Mouldy and Scuzzy are on full alert. What
will the tale (or, tail, if you prefer) reveal?
--
Jim Brewer
e-mailed courtesy copies are unappreciated, please refrain.
------------------------------
Date: Tue, 20 Oct 1998 10:43:46 +0200
From: "Matalon, Cyril" <cyrilm@nortel.ca>
Subject: non blocking <stdin>
Message-Id: <362C4D42.D2CD8887@nortel.ca>
Does anyone how to perform a no blocking read of stdin ?
I would like to test if a key was pressed in a while (1) loop.
Thanks.
--
------------------------------------
Cyril Matalon : cyrilm@nortel.ca
------------------------------------
------------------------------
Date: Tue, 20 Oct 1998 10:00:49 +0100
From: "DPortal Webmaster" <webmaster_NO*SPUDS*@dportal.co.uk>
Subject: PERL and a DATABASE..
Message-Id: <70hjhl$1dg$1@flex.london.pipex.net>
I would like to query a database using PERL (and something like SQL), but I
can only seem to be able to do this on NT, does anyone know of any
UNIX/LINUIX database's that I can query using PERL. (If there FREE then even
better ;-) ).
Webmaster DPortal
http://www.dportal.co.uk/
to email from _NOSPUDS* from the address.
------------------------------
Date: 20 Oct 1998 11:21:09 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: PERL and a DATABASE..
Message-Id: <83ogr7k2re.fsf@vcpc.univie.ac.at>
Re: PERL and a DATABASE.., DPortal
<webmaster_NO*SPUDS*@dportal.co.uk> said:
DPortal> I would like to query a database using PERL (and
DPortal> something like SQL), but I can only seem to be able
DPortal> to do this on NT, does anyone know of any
DPortal> UNIX/LINUIX database's that I can query using
DPortal> PERL. (If there FREE then even better ;-) ).
There are lots of DB interfaces in CPAN. Look for the DBI
and DBD directories, which will then indicate which
databases these modules let you talk to.
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | private email:
Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: 20 Oct 1998 13:20:35 +0100
From: Jim Brewer <jimbo@soundimages.co.uk>
Subject: Re: Perl as a first language... I vote yes!
Message-Id: <ug1cjjugc.fsf@jimbosntserver.soundimages.co.uk>
Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> writes:
>
> mterich wrote:
>
> > 4. I do not have time (or money) to take programming courses (trying to be
> > a SysAsmin and a rock star simultaneously, also trying to prevent myself
>
> This is funny as we saw a resume' not to long ago where the person
> listed 'wearing leather pants' in one of his positions as a drummer for
> some band. The guys couldn't understand why I wanted to interview the
> guy with a request that he wear the leather pants :).
Well, as well all know, you are a bit of a perv. :)
--
Jim Brewer
e-mailed courtesy copies are unappreciated, please refrain.
------------------------------
Date: Tue, 20 Oct 1998 10:01:26 GMT
From: gavin@orbital.co.uk
Subject: Re: Perl DBI AND Oracle (ORACLE_HOME) (thanks)
Message-Id: <70hn1k$2qa$1@nnrp1.dejanews.com>
Hi,
Just wanted to say thanks for the help everyone! I still have a problem in
that I dont have the client software for the platform I am working on so I am
going to take a look at the ProxyServer stuff...
Anyway, thanks again.
Gavin
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 20 Oct 1998 08:55:15 GMT
From: dave@mag-sol.com
Subject: Re: Perl Y2K copmliance
Message-Id: <70hj5i$tua$1@nnrp1.dejanews.com>
In article <70fdqa$hnh$1@newsreader2.core.theplanet.net>,
"Ron Hejdeman" <ron@hejdeman.freeserve.co.uk> wrote:
> Hi,
>
> Anyone out there know if perl is Y2K compliant on Suns and Win-95 ?
Anyone who was done the most basic research by reading the docs, the faqs or
this newgroup on DejaNews would know the answer to your question. Try reading
perlfaq4.
Dave...
--
dave@mag-sol.com
London Perl M[ou]ngers: <http://london.pm.org/>
[Note Changed URL]
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 20 Oct 1998 06:43:42 -0400
From: dblack@pilot.njin.net (David Alan Black)
Subject: Re: Perl Y2K copmliance
Message-Id: <70hpgu$s83$1@pilot.njin.net>
finsol@ts.co.nz writes:
>Ron
>An article I had published last week describes what could be a major
>problem with some Perl applications (and several other languages) - the booby
>trap code problem. Check it out at:
>http://www.idg.co.nz/WWWfeat/Y2000/amon1005.htm
I don't see a single reference to Perl in this article. It's all about
the BIOS on PCs, and how it interacts with Micros**t.
Please (yawn) check out the usual archives and references for this
topic as it actually relates to Perl.
>--
>Financial Solutions Limited
>http://www.ts.co.nz/~finsol/
>In article <70fdqa$hnh$1@newsreader2.core.theplanet.net>,
> "Ron Hejdeman" <ron@hejdeman.freeserve.co.uk> wrote:
>> Hi,
>>
>> Anyone out there know if perl is Y2K compliant on Suns and Win-95 ?
>>
>> BR,
>>
>> Ron.
David Black
dblack@pilot.njin.net
------------------------------
Date: 20 Oct 1998 13:06:59 +0100
From: Jim Brewer <jimbo@soundimages.co.uk>
Subject: Re: Perl's a first in my book
Message-Id: <uhfwzjv30.fsf@jimbosntserver.soundimages.co.uk>
Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> writes:
> You are a freak gurlfren ;)! Austin Powers would be proud.
Well, sisters in arms. At least from where we sit! :)
--
Jim Brewer
e-mailed courtesy copies are unappreciated, please refrain.
------------------------------
Date: 19 Oct 1998 20:06:53 GMT
From: RSchaufelberger@t-online.de (Rolf Schaufelberger)
Subject: Re: Perl, SQL & Oracle tutorial sought
Message-Id: <70g64u$tqt$1@news00.btx.dtag.de>
I've had no problems just with tho pod coming with DBD and DBI-Oracle.
Very interesting ist the DBI-Oracle mailing-list , the adress is listet
somewhere in the DBI Files.
--
Best Regards
Rolf Schaufelberger
------------------------------
Date: Tue, 20 Oct 1998 07:45:28 -0500
From: "Marcus J. Foody" <marx@idiom.com>
Subject: printing problems with records
Message-Id: <362C85E8.3D7E@idiom.com>
Hello, I'm having some printing problems. I have a record header that
has multiple line items. The record head is printing out correctly as
well as the line items. The problem is the line items are on the next
line not the same line as the record header; My code for the current
output is at the bottom. Does anyone have any suggestions on how to
join or concatinate the record header with the line item or line items.
My current output:
|709 15:41:45|709|1000|1000.00|1|----"This is the record header"
|REC ITEMS|1|2|2|EACH|500.00|0|1000.00|------"This is the line items"
|709 15:41:45|709|2500|2500.00|2|
|REC ITEMS|1|1|1|EACH|1500.00||1500.00|
|REC ITEMS|2|4|4|EACH|250.00||1000.00|
|709 15:41:45|709|2000|2000.00|3|
|REC ITEMS|1|1|1|EACH|2000.00||2000.00|
Possible solution(spacing for clarity):
|709 15:41:45|709|1000|1000.00|1||REC ITEMS|1|2|2|EACH|500.00|0|1000.00|
|709 15:41:45|709|2500|2500.00|2||REC ITEMS|1|1|1|EACH|1500.00||1500.00|
|709 15:41:45|709|2500|2500.00|2||REC ITEMS|2|4|4|EACH|250.00||1000.00|
|709 15:41:45|709|2000|2000.00|3||REC ITEMS|1|1|1|EACH|2000.00||2000.00|
while ($line=<FH25>) {
chomp;
$line =~ m,^\|REC FILE(\|[^|]+)\|,;
$prefix = $1 if $1;
if ($line =~ /REC BATCH/) {
$line = $prefix . $line;
@record = split(/\|/, $line);
$field = "|$record[4] $thetime";
@f_record = split(/\|/);
$f_array = "|$f_record[1], if(/REC ITEMS/)";
while (<FH25>){
chomp;
@data = split(/\|/);
$rec_amt1 = @data[14];
$rec_amt2 = @data[15];
$rec_amt3 = @data[16];
$sum = $rec_amt1+$rec_amt2+$rec_amt3;
if(/REC HEAD/){
$cnt++;
}
print "$field|".join('|',@data[4]),"|$sum|".
join('|',@data[16]),"|$cnt|",$f_array,"\n" if(/REC HEAD/);
print "$_" if(/REC ITEMS/);
}
}
}
------------------------------
Date: Tue, 20 Oct 1998 09:16:39 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
Message-Id: <362f54b7.61642557@thunder>
On 19 Oct 1998 23:58:44 -0400, ziggy@panix.com (Adam Turoff)
enlightened us thusly:
>OK. How about open source beer? :-)
My source is supplied - along with a pint - to anyone who'll listen.
--
David Cantrell, part-time Unix/perl/SQL/java techie
full-time chef/musician/homebrewer
http://www.ThePentagon.com/NukeEmUp
------------------------------
Date: Tue, 20 Oct 1998 12:58:00 +0200
From: Tanja Riedel <tanja.riedel.tr3@bayer-ag.de>
Subject: Re: Sending Word-Docs directly to the Browser via CGI
Message-Id: <362C6CB8.BEB260C0@bayer-ag.de>
I am afraid, this won4t work.
The documents are *not* (only for the test) in a directory, where I can access
them via URLs. They are in a special FileSystem, where I can access them with a
special API and read the contents of the documents.
I thought I just can read them binary and send them to the browser, but it does
not work.
I think, this is a problem caused by VMS which is sending blocks of data to
STDOUT, instead of writing a stream...
Any more ideas...?
Thank you!
Tupshin Harper schrieb:
> If you're not doing anything to the file except serving it up, why wouldn't
> you just want to redirect them to the file(i.e. have your CGI script spit
> out an HTTP redirect or an HTML meta tag refresh to the URL that you want to
> send them to? Then you just need to make sure that your web server has the
> correct mime type for .doc files.
>
> -Tupshin Harper
> -Programmer/Network Administrator
> -Studio Verso
>
> Tanja Riedel wrote in message <362C2BB5.BFF71CFB@bayer-ag.de>...
> >Hello!
> >
> >perhaps someone can help me, I got stuck with a CGI-script, for a
> >problem, which looked so simple at first glance...
> >
> >I am using Perl 5.003 on VMS V6.2-1H3 and I would like to send a
> >Word_document directly to the browser (cause it is not in a subdirectory
> >of the web-root, so that I can4t use a link).
> >
> >I use the following code (for tests, "wordneu1.doc" is in the same
> >directory as the perl script now)
> >
> > open(FROM, "wordneu1.doc");
> > binmode FROM;
> > print <<END_of_Multiline_Text;
> > Content-type: application/msword
> >
> > END_of_Multiline_Text
> >
> > use FileHandle;
> > STDOUT->autoflush(1);
> >
> > while (read FROM, $buf, 1024)
> > {
> > print $buf;
> > };
> > [EOB]
> >
> >"application/msword" names a Plugin, which works when I type the URL of
> >the source document "wordneu1.doc" directly in the browser. When I use
> >the scipt I can see that the content of the document is send. It looks
> >fine, but neither word nor the plugin are able to open the file (invalid
> >file format).
> >
> >When I use a destination file instead of STDOUT and type the URL of the
> >created file in the browser everything works, so it must be the STDOUT
> >(format?) causing the problem. I used autoflush, but no effect.
> >
> >Can please someone help me...???
> >
> >Thanks a lot in advance!
> >
> >Tanja,
> >Leverkusen, Germany.
> >
> >E-Mail: tanja.riedel.tr3@bayer-ag.de
> >
------------------------------
Date: Tue, 20 Oct 1998 11:06:23 GMT
From: ronald_f@my-dejanews.com
Subject: Solved! (was: unresolved symbol: _dbm_open)
Message-Id: <70hqrf$7cd$1@nnrp1.dejanews.com>
In article <6vuvj9$r2c$1@nnrp1.dejanews.com>,
ronald_f@my-dejanews.com wrote:
> lib/odbm ... /usr/lib/dld.sl
> Unresolved symbol: _dbm_open from /usr/lib/libdbm.1
This problem was due to an erroneous patch, provided by HP for libdbm. When
one undid the patch, the problem disappears.
--
Ronald Fischer <ronald_f@my-dejanews.com>
http://ourworld.compuserve.com/homepages/ronald_fischer/
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 20 Oct 1998 12:19:59 +0100
From: <k.thomson@scet.com>
Subject: String substition
Message-Id: <70hrtp$mhh@news5-gui.server.cableol.net>
just a quick question for all you perl gurus
I have a variable called $user
I have a string replace statement that goes like so.
$_ =~ s/other/$user/g;
how do I make this replace the sting other with the value of user
thanks in advance
Kevin Thomson.
------------------------------
Date: Tue, 20 Oct 1998 05:07:40 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: String substition
Message-Id: <MPG.10961cea38a1d2949898cd@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <70hrtp$mhh@news5-gui.server.cableol.net> on Tue, 20 Oct 1998
12:19:59 +0100, k.thomson@scet.com <k.thomson@scet.com> says...
> I have a variable called $user
>
> I have a string replace statement that goes like so.
>
> $_ =~ s/other/$user/g;
>
> how do I make this replace the sting other with the value of user
By executing the statement???
The statement will replace each occurrence of the string 'other' in the
string $_ by the value of $user, as you seem to want.
You have not shown the value of $_ before and after executing the
statement or the value of $user, so it is difficult to understand your
question.
BTW, the '$_ =~ ' part is superfluous (because that is the default) but
not incorrect.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 20 Oct 1998 04:46:32 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: trouble with sub
Message-Id: <MPG.109617eff07dad1a9898cc@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <362C432E.56FC8466@ensam.inra.fr> on Tue, 20 Oct 1998
08:00:46 +0000, Xavier Cousin <cousin@ensam.inra.fr> says...
> I send this message some days ago but didn't receive any answer, may be
> because the "subject" was not attractive enough : i post it again with a
> new subject...
...
> open (IN,essai_automat);
Is essai_automat a bareword -- quote it, or the name of a scalar
variable -- precede it by $. And *ALWAYS* check the result of an
'open'. And use the '-w' flag.
> while (<IN>){
> if ($_ !~ /^\"/){
More succinctly,
unless (/^"/) {
> $une_table = "non";
> $c=0;
> }
> if ($une_table eq "oui"){
> $passe = $_;
Print the value of $rout here. Unless it is 'distribution_des_champs1',
there is no subroutine to call. Are there also subs named
'distribution_des_champs2' etc.? If not, why are you doing this 'call
by symbolic reference' at all? (In fact, there are usually better ways
than symbolic references to achieve whatever the goal is.)
> &$rout($passe); #writing 1
> &distribution_des_champs1($passe); #writing 2
>
> }
> if ($_ =~ /acedb\>/){
if (/acedb>/) {
> $une_table = "oui";
> $table ++;
> $rout="distribution_des_champs".$table;
See above. How do you know $table is now 1? What if it isn't?
> &$rout($premiere_ligne); #writing 1
> &distribution_des_champs1($premiere_ligne); #writing 2
>
> }
> }
<SNIP>
It wasn't the subject that led me to go past this post the first time.
It was the difficulty of following the flow of the program without
having the input data, to see that the symbolic references were
calculated correctly, and the difficulty of understanding why a symbolic
reference with only one acceptable value was being calculated at all.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 20 Oct 1998 11:59:49 GMT
From: ronald_f@my-dejanews.com
Subject: Using IO::Socket and spawning child processes
Message-Id: <70htvm$ahl$1@nnrp1.dejanews.com>
Hi!
I am using IO::Socket::INET to implement a server. After accepting a client
request, I would like to spawn a child to deal with the request and send
the answer eventually. This is how much I have so far:
$server = IO::Socket::INET->new( ... );
while ($client = $server->accept())
{
my $pid = fork;
if ($pid==0)
{
# child process
# WHAT TO DO HERE ????????
while ( <$client>)
{
# Process client request in $_
# ....
# Send answer to client
print $client ....;
}
exit(0);
}
else
{
# parent
close $client;
}
}
The problem is the line marked ??????. I think that I have to close the server
socket in the child process, since that socket has to stay open in the parent
process. I did not find a "close" sub in IO::Socket, though.
If someone knows how to do this right, or detects other flaws in my program,
please let me know!
--
Ronald Fischer <ronald_f@my-dejanews.com>
http://ourworld.compuserve.com/homepages/ronald_fischer/
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
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 4017
**************************************