[10971] in Perl-Users-Digest
Perl-Users Digest, Issue: 4571 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 7 12:07:26 1999
Date: Thu, 7 Jan 99 09: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 Thu, 7 Jan 1999 Volume: 8 Number: 4571
Today's topics:
Active Perl / NT: XCopy don't work <Thomas.Stieglitz@Zeppelin.DE>
Re: Adding a path to the @INC variable <tchrist@mox.perl.com>
Re: automatic ftp (I R A Aggie)
Bourne shell scripts and Perl <jglorios@aerotek.com>
chmod in perl <r2-d2@REMOVEbigfoot.com>
Re: Conditional inclusion of modules <newsposter@cthulhu.demon.nl>
Re: Conditional inclusion of modules <newsposter@cthulhu.demon.nl>
Re: Conditional inclusion of modules (Andrew M. Langmead)
Deleting Messages <mtg82814@melsud.res.ray.com>
Extended version of "hex" <fpichard@siris.fr>
Getting UNIX Filesystems list? lethr@my-dejanews.com
help w/ fnord server & perl <tabaker@ele.net>
Re: help with embedded Perl - accessing complex data st (Timothy C. Gion)
Re: How can I send mail with file ? (Clay Irving)
How can i undefine hash elemnt of hash table with key ? <zal@rest.ru>
Re: How can i undefine hash elemnt of hash table with k <Allan@due.net>
Re: If Larry Wall's listening out there.... (Elf Sternberg)
Re: If Larry Wall's listening out there.... (Bart Lateur)
Is ASN.1 decoding possible? <sdatta@lucent.com>
Re: line continuation; the switch statement <tchrist@mox.perl.com>
Re: line noise (Bart Lateur)
Need help using MakeMaker for scripts <dwc3q@cs.virginia.edu>
password security <peter.herger@swisslife.ch>
perl and MS Access 7.0 on UNIX scot777@my-dejanews.com
Re: Problem with Perl script <newsposter@cthulhu.demon.nl>
Problems Making DBD with DBI1.03 <pmein@johnco.cc.ks.us>
Re: Randal's code [was Re: How do I delete tmp files ba (Randal L. Schwartz)
Re: Rename Files Button <Allan@due.net>
Re: Sendmail 8.9.1 makemap hash format and Perl droby@copyright.com
size 1M dbm file has only 1 record? (2n3055@usa.net)
Re: Split on whitespace sintax ? gattaz@hotmail.com
STDIN Read buffer size <mikeob@itas.net>
Re: STDIN Read buffer size (Clay Irving)
TelNet.pm win95 problem (EXCHANGE:CAR:5J42)
Re: what's with all the job posts? (I R A Aggie)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 07 Jan 1999 17:38:48 +0100
From: Thomas Stieglitz <Thomas.Stieglitz@Zeppelin.DE>
Subject: Active Perl / NT: XCopy don't work
Message-Id: <3694E317.36CF94BF@Zeppelin.DE>
Hello all!
I try to copy a whole directory tree via the NT/DOS (?) Command XCopy,
but it doesn't work.
I've tried the following:
$mycommand = 'xcopy from to';
$message = `XCOPY $mycommand`;
or
system ($mycommand)
The result is, that nothing happens: Neither $! nor $? are giving any
results, there are no files copied and there is no message, neither on
the output screen nor in $message.
If I try other commands as "notepad" as example for an NT Programm or
"blat" as example for an DOS-program, everything runs well.
Who knows a solution or an other solution for copying whole directory
trees?
Thanks all, Tom
------------------------------
Date: 7 Jan 1999 14:35:56 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Adding a path to the @INC variable
Message-Id: <772goc$tk$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, Jim Searle <jims@broadcom.com> writes:
:I'd prefer to use lib, but I can't seem to get this to work.
:
:BEGIN {
: $MyDir = "/path/to/some/dir";
: use lib ($MyDir . "/goo");
:}
:
:It just end's up with '/goo' added to the path.
That's because you're confusing compile-time and run-time.
The assignment did not happen when you thought it it. By
putting the use lib in the begin, you make it happen first.
You mean something more like:
BEGIN {
$MyDir = "/path/to/some/dir";
$libdir = "$MyDir/goo";
}
use lib $libdir;
--tom
--
If I allowed "next $label" then I'd also have to allow "goto $label",
and I don't think you really want that... :-) [now works in perl5!]
--Larry Wall in <1991Mar11.230002.27271@jpl-devvax.jpl.nasa.gov>
------------------------------
Date: Thu, 07 Jan 1999 09:22:22 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: automatic ftp
Message-Id: <fl_aggie-0701990922220001@aggie.coaps.fsu.edu>
In article <nSYk2.999$cT4.8453@newsfeed.slurp.net>, "Rob S"
<rob.slattery@amaonline.com> wrote:
+ How should I go about this?
+ ftp I suppose, but how?
+ system(ftp) ?
No. Straight from the docs for Net::FTP :
use Net::FTP;
$ftp = Net::FTP->new("some.host.name");
$ftp->login("anonymous","me@here.there");
$ftp->cwd("/pub");
$ftp->get("that.file");
$ftp->quit;
James
------------------------------
Date: Thu, 07 Jan 1999 10:23:04 -0500
From: John Glorioso <jglorios@aerotek.com>
Subject: Bourne shell scripts and Perl
Message-Id: <3694D157.78E4C84B@aerotek.com>
This is a multi-part message in MIME format.
--------------C21257E0069B784B8FDE7E22
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I am having a problem with trying to execute a Bourne shell script from
my Perl cgi. The idea is to be able to start and stop several webservers
from one main html page. It works to an extent, but the script seems to
be getting hung during the start script (the stop works fine). I have
just recently learned how to execute a script without doing a system()
call by using the pipe with the open statement. Could someone please
offer any suggestions about what my problem might be? When the cgi gets
to running the start script it gets hung in the while loop. It starts
the webserver, but then gives a message that it can't bind to port 80
making me think it is trying to run the script over and over. I then
have to kill the process from the command prompt. a snipet from my code
is as follows:
(The $script variable is either the start or stop script)
open SCRIPT, "$script|" or die endError("$script failed! $!");
while (<SCRIPT>) {
print;
}
close SCRIPT or die endError("$script failed! $!");
The start and stop script have exit 0 and exit 1 in them. If it finishes
with an exit 1 will this while loop keep running?
--------------C21257E0069B784B8FDE7E22
Content-Type: text/x-vcard; charset=us-ascii;
name="jglorios.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for John Glorioso
Content-Disposition: attachment;
filename="jglorios.vcf"
begin:vcard
n:Glorioso;John
x-mozilla-html:TRUE
org:<img src="http://www.corp.aerotek.com/images/aerologo2.gif" width=108>
adr:;;;Hanover;MD;21076;USA
version:2.1
email;internet:jglorios@aerotek.com
title:Web Developer
tel;fax:410-579-4296
tel;work:410-579-4081
x-mozilla-cpt:;0
fn:John Glorioso
end:vcard
--------------C21257E0069B784B8FDE7E22--
------------------------------
Date: Thu, 7 Jan 1999 16:13:45 -0000
From: "Artoo" <r2-d2@REMOVEbigfoot.com>
Subject: chmod in perl
Message-Id: <772mir$bhk$1@plug.news.pipex.net>
Hi all
How can you chmod a directory that already exists from within perl? Also
how do you chmod a file (the same way??)
Thanks
Artoo
------------------------------
Date: Thu, 07 Jan 1999 08:45:40 -0500
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: Conditional inclusion of modules
Message-Id: <3694BA82.85F5315A@cthulhu.demon.nl>
Jonathan Nicholson wrote:
>
> I want to include different modules depending on which version of the
> program is running. This will allow me to maintain one program which can
> access a variety of databases.
>
> I've tried the following code:-
>
> my $c = $0;
>
> if($c =~ /.*\/([^\/]+)$/) {
> $c = $1;
> }
>
> if($c eq 'aprogram') {
> use amodule;
> elsif($c eq 'othercode') {
> use another;
> }
> else {
> die "Dunno which module to use\n";
> }
>
> This doesn't work because it sees redefinitions of subroutines at
> compile time.
Yep, use is handled compiletime, and you want to require stuff
runtime. See 'Programming Perl' p238 (documentation on 'use':
require Module;
import Module;
Erik
--
Sure, doesn't everyone sign up for internet service so as to have
their mailbox stuffed with megabytes of postage-due rubbish every day?
Absolutely. And everyone who owns a car intends that it be used as a
portable dumpster. Any unwanted garbage in their vehicle they can
simply throw away, after all.
------------------------------
Date: Thu, 07 Jan 1999 08:59:15 -0500
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: Conditional inclusion of modules
Message-Id: <3694BDB1.A5B0008D@cthulhu.demon.nl>
Jonathan Nicholson wrote:
>
> I want to include different modules depending on which version of the
> program is running. This will allow me to maintain one program which can
> access a variety of databases.
> if($c eq 'aprogram') {
> use amodule;
> elsif($c eq 'othercode') {
> use another;
> }
> else {
> die "Dunno which module to use\n";
> }
>
> This doesn't work because it sees redefinitions of subroutines at
> compile time.
Yep, use is handled compiletime, and you want to require stuff
runtime. See 'Programming Perl' p238 (documentation on 'use':
require Module;
import Module;
Erik
--
Sure, doesn't everyone sign up for internet service so as to have
their mailbox stuffed with megabytes of postage-due rubbish every day?
Absolutely. And everyone who owns a car intends that it be used as a
portable dumpster. Any unwanted garbage in their vehicle they can
simply throw away, after all.
------------------------------
Date: Thu, 7 Jan 1999 15:13:05 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Conditional inclusion of modules
Message-Id: <F573Lt.A5p@world.std.com>
Jonathan Nicholson <jjn@sanger.ac.uk> writes:
>I want to include different modules depending on which version of the
>program is running. This will allow me to maintain one program which can
>access a variety of databases.
Since the "use" function can be broken down into its component
BEGIN{}, require, and import(), steps, you may be able to do something
like:
#mapping of program name to required module.
my %module = ( aprogram => 'amodule', othercode => 'another');
# find the program's name
my $programname = (split m^/^, $0)[-1];
# find the proper module for this program name.
my $module = $module{$programname} || die "Dunno which module to use\n";
# load module
require $module;
# import its default symbols.
$module->import();
But this happens at runtime instead of compile time, which may affect
the way the module operates in some subtle or not so subtle
ways. (Prototypes won't work, and having the modules subroutines names
predeclared gives perl some hints as to whether later code is a
subroutine call or a bareword.) If thats a problem, then just wrap the
whole thing up in a BEGIN block.
--
Andrew Langmead
------------------------------
Date: Thu, 07 Jan 1999 11:07:36 -0500
From: Mike Godfrey <mtg82814@melsud.res.ray.com>
Subject: Deleting Messages
Message-Id: <3694DBC8.C88DFDAD@melsud.res.ray.com>
Hi,
I'm kind of new to this whole newsgroup thing. Although it's been
very helpful. I just can't seem to figure out how to delete messages
I'v already read, or don't want to read. There are overseven hundred
messages. I'm using Netscape 4.05 for Unix (SunOS).
Thanks,
Mike Godfrey
------------------------------
Date: Thu, 07 Jan 1999 16:27:48 +0000
From: Francois PICHARD <fpichard@siris.fr>
Subject: Extended version of "hex"
Message-Id: <3694E084.AB067781@siris.fr>
--------------EFC8C5BAD9B17D8F04EBEBA3
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I search a solution to convert long ascii chain into decimal, as the 'hex' command do.
For example, I want to obtain the decimal value of "0xFFF1FFF2FFF3FFF4".
I don't want obtain a result like "1,2345678912453e19"
The 'hex' command stop at "0xFFFFFFFF'. If your value is higher you will have an error.
--
Cordialement.
Francois PICHARD SIRIS
------------------------------------------------------------------
Tel: +33-1-41-97-96-15 54, Place de l'Ellispe
Fax: +33-1-41-97-96-89 92983 La Defense Cedex
Mel: fpichard@siris.fr FRANCE
------------------------------------------------------------------
--------------EFC8C5BAD9B17D8F04EBEBA3
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
I search a solution to convert long ascii chain into decimal, as the 'hex'
command do.
<p>For example, I want to obtain the decimal value of "0xFFF1FFF2FFF3FFF4".
<br>I don't want obtain a result like "1,2345678912453e19"
<p>The 'hex' command stop at "0xFFFFFFFF'. If your value is higher you
will have an error.
<br>
<pre>--
Cordialement.
Francois PICHARD SIRIS
------------------------------------------------------------------
Tel: +33-1-41-97-96-15 54, Place de l'Ellispe
Fax: +33-1-41-97-96-89 92983 La Defense Cedex
Mel: fpichard@siris.fr FRANCE
------------------------------------------------------------------</pre>
</html>
--------------EFC8C5BAD9B17D8F04EBEBA3--
------------------------------
Date: Thu, 07 Jan 1999 16:20:56 GMT
From: lethr@my-dejanews.com
Subject: Getting UNIX Filesystems list?
Message-Id: <772mt4$s3$1@nnrp1.dejanews.com>
Is there a good way to get a list of mounted filesystems within perl? (other
than using a system call or reading fstab). Ideally, I'd like to get results
similar to:
df -k |awk '{print $7}' (or whatever field might have the filesystem /dir )
Thanks in advance.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 07 Jan 1999 14:20:35 GMT
From: Tony Baker <tabaker@ele.net>
Subject: help w/ fnord server & perl
Message-Id: <915718835.245681@iris.nyx.net>
I could sure use some help. I have the fnord server working and it will
serve up html files to my browers. I have perl running at it will run
perl programs in a dos window (win95 sys). However, I cannot seem to
execute my perl programs in the cgi-bin directory. The brower ignores the
"action" parameter in the <form method="post" action="http:...">.
the system is configured as follows
1) perl.exe is located in c:/perl/perl5/
2) html files located in c:/My Programs/fnord/root
3) perl source files I am trying to call located in c:/My
Programs/fnord/root/cgi-bin
4) I have tried many variations of the first line of the perl code
including the exact path to perl.exe.
I would greatly appreciate some help.
--
Tony Baker
tabaker@ele.net
http://www.ele.net
------------------------------
Date: 7 Jan 1999 15:10:18 GMT
From: tcg3j@cobra.cs.Virginia.EDU (Timothy C. Gion)
Subject: Re: help with embedded Perl - accessing complex data structure
Message-Id: <772ioq$pp2$1@murdoch.acc.Virginia.EDU>
In article <76u08h$pao$1@murdoch.acc.Virginia.EDU>,
Timothy C. Gion <tcg3j@cobra.cs.virginia.edu> wrote:
>After further work on the problem, I've condensed it to not being able to
>properly extract the complex data structure in C++. My perl program now
>just creates a simple test case, but I get a bus error when I try to
>extract elements of the data structure. The code follows below. Any help
>would be greatly appreciated.
In case any one was trying to assist me (judging from the numerous
responses, I doubt it), I solved my problem yesterday.
Tim
------------------------------
Date: 7 Jan 1999 11:16:13 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: How can I send mail with file ?
Message-Id: <772mkd$q5j@panix.com>
In <3690F434.81E15C23@ms4.hinet.net> Mecer <k25@ms4.hinet.net> writes:
>I want to send mail with mail...
That's the way most people do it. :)
>But I don't know how to use any module or function to
>compress files with base64...
MIME doesn't compress files -- It encodes them.
Which MIME module(s) are you using? What difficulty are you having?
>Is there any module or function which can do this ?
Have you looked in CPAN?
http://www.perl.com/CPAN/CPAN.html
--
Clay Irving
clay@panix.com
------------------------------
Date: Thu, 7 Jan 1999 18:34:48 +0500
From: "Aleksey Zvyagin" <zal@rest.ru>
Subject: How can i undefine hash elemnt of hash table with key ?
Message-Id: <772d5o$eas$1@news.mplik.ru>
Hello!
Sorry for my bad English.
My perl version is 5.005_2
I have happen to meet a problem:
If i am defining hash tables for example:
$hash{'alex'} = 2;
$hash{'bob'} = 3;
then
keys %hash is ('alex', 'bob');
It's right ;-) But if i am doing following:
undef $hash{'alex'}
then i am expecting that keys %hash will be ('bob')
But after this statement the perl asserts following:
keys %hash is ('alex', 'bob')
defined($hash{'alex'}) == 0
My question is:
How can i undefine hash element of hash table so that a hash table doesn't
hold key of undefined hash element ???
Please, to send your replies to me at E-main: zal@rest.ru
Aleksey Zvyagin
------------------------------
Date: Thu, 7 Jan 1999 09:50:19 -0500
From: "Allan M. Due" <Allan@due.net>
Subject: Re: How can i undefine hash elemnt of hash table with key ?
Message-Id: <772h8q$8fl$1@camel0.mindspring.com>
Aleksey Zvyagin wrote in message <772d5o$eas$1@news.mplik.ru>...
>Hello!
>
>Sorry for my bad English.
>My perl version is 5.005_2
>I have happen to meet a problem:
>If i am defining hash tables for example:
>$hash{'alex'} = 2;
>$hash{'bob'} = 3;
>then
>keys %hash is ('alex', 'bob');
>It's right ;-) But if i am doing following:
>undef $hash{'alex'}
Well, don't do that :-). Try delete instead.
perldoc -f delete;
delete $hash{alex};
>Please, to send your replies to me at E-main: zal@rest.ru
The general standard of coduct for this group is:
if (post_it eq 'here') {read_it('here')};
HTH
AmD
------------------------------
Date: 7 Jan 1999 15:37:08 GMT
From: elf@halcyon.com (Elf Sternberg)
Subject: Re: If Larry Wall's listening out there....
Message-Id: <772kb4$go3$1@brokaw.wa.com>
In article <76urmk$ncd$1@news.akl.netlink.net.nz>
"Andrew Mayo" <andrew@geac.co.nz> writes:
>Those of us working in a Windows environment generally will use notepad as a
>text editor. Simple-mindedly, notepad does *not* display line numbers. (it
>also doesn't do brace matching, but this I can live with)
Um, no. Those of us who write *programs* on the Windows
environment use something else. DOS's EDIT program, or a shareware
editor, or even the Win98 port of xemacs if we really have to.
Something, anything that saves us from Notepad and its limitations.
>1. Programs rapidly become unreadable if special care isn't taken to comment
>carefully. This is due not just to leaning toothpick syndrome, which is
>curable by careful choice of quote characters, as well as the quotemeta
>function, but because almost every metacharacter sequence that could exist
>has a semantic meaning which of course can't be deduced without looking it
>up, until you become a Perl veteran.
The same is true of any language. I've seen obfuscated
Cobol. If your Perl is unreadable after a while, that's because you
both tmtowtdi'd yourself into a frenzy and failed to stick to
tried-and-true, easily readable patterns that were familiar to you. I
won't comment on a failure to comment-- it's a common enough disease.
>2. No macro pre-processor (AFAIK) which would let me add a bit of syntactic
>sugar; most experienced C programmers find #define and #typedef are
>invaluable for rendering sense out of chaos.
There's nothing stopping you from using CPP if you so choose;
Hell, you could write a pre-parser is perl, loop your main body
through it, and eval the whole mess, but why would you want to?
>3. The variable argument list array is a nice idea but lack of proper
>subroutine prototypes makes code rather obscure. Yes, I do see the section
>on Perl 5.003 prototypes but, using VB as an example this time..
>
>sub DrawImage(pic as Picture, optional rotation as degrees=zero_degrees)
>I don't see how to write Perl code which comes close to being
>self-documenting in this way, particularly function arguments.
Then you don't understand Perl. Perl is meant to get the job
done--if part of the job is to make the program maintainable, it's
your responsibility to include comments. "Self-documenting code" is a
sick buzzword; it has no real-word applicability, where the ease of
parsing the grammar of a single line does nothing to help you
understand the intent of a phrase.
>A further, related issue is that arguments appear to be passed by
>reference,
Um, no. Arguments are pass-by-value unless wery serious care
is taken to do otherwise.
>4. Lack of structures (aka VB types) and enums - at least, I can't find such
>things. Sure, hashes are very nice, but they're not really the same thing.
Sure they are. Hashes of hashes and lists of lists and lists
of hashs provide you with all the structural richness you could ever
want.
>5. Try as I might, I find the bind operator counter-intuitive.
Then don't use it.
>6. Lack of strong typing. There are times when you want to prevent someone
>from assigning a string to an integer and I don't see how to do this with
>Perl - in fact, I don't know how to define a variable as being of a specific
>type (other than an array, or a hash or a simple variable). Variables just
>'spring into existence' as they did in early versions of BASIC - which can
>lead to some very obscure programming errors. Does 'use strict' really help
>here?.
No, good programming techniques help here, along with an
understandind that Perl is not Basic, or C++, or Java, or even
Python. Perl is a mature language with its own syntax. Deal with
it. Given that it's the processing language of choice on websites and
among sysadmins, and given that this list has seen these exact same
complaints often enough, and still the language grows in popularity, I
doubt we're gonna change it for you.
>7. Lack of structured exception handling (I may, however, be wrong here, I
>just haven't found it yet).
do / eval || die isn't good enough for you?
>8. No switch() or case statement, leading to nasty indented if... else if
>type of constructs.
I suggest you invest in the Camel book. How to do switch
statements in Perl is covered early.
>I conclude from these observations, some or all of which may turn out to be
>mistaken, that Perl is suitable for fairly small programs (and indeed, was
>designed this way, in all fairness) but that large Perl programming projects
>will need considerable care in order to be maintainable. Has anyone out
>there had experience in maintaining large (>10,000 line) Perl programs or
>program suites, and if so, what techniques would you recommend to maximise
>maintainability, other than the obvious recourse of commenting every line,
>which is currently what I am doing?.
I've been in at least three projects that had between 10 and
30 KLOCs of Perl. The best tool in each and every case was a design
document up front, peer code reviews (if he can't read it, go back and
rewrite it), and a set of applied and followed coding standards. In
short, Perl is an excellent language for writing major systems if and
only if you apply the same disciplines required to write a major
system in any other language.
Elf
--
Elf M. Sternberg, rational romantic mystic cynical idealist
If you're so smart, why aren't you naked?
http://www.halcyon.com/elf/
------------------------------
Date: Thu, 07 Jan 1999 16:02:13 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: If Larry Wall's listening out there....
Message-Id: <3697da2b.30635462@news.skynet.be>
Elf Sternberg wrote:
>>4. Lack of structures (aka VB types) and enums - at least, I can't find such
>>things. Sure, hashes are very nice, but they're not really the same thing.
>
> Sure they are. Hashes of hashes and lists of lists and lists
>of hashs provide you with all the structural richness you could ever
>want.
Except: hashes of hashes do take a lot of space. Far more than the bare
data.
I have read that newer/future versions would tackle this, by reusing
storage of hash keys. What's the status on that?
Bart.
------------------------------
Date: Thu, 07 Jan 1999 10:19:37 -0600
From: Sujay Datta <sdatta@lucent.com>
Subject: Is ASN.1 decoding possible?
Message-Id: <3694DE99.2B8BC2C5@lucent.com>
I am trying to find Perl modules/scripts that will look at Abstart
Syntax Notation (ASN.1) and do some decode.
I don't know where to look -- can somebody help?
Sujay Datta
------------------------------
Date: 7 Jan 1999 14:36:48 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: line continuation; the switch statement
Message-Id: <772gq0$u1$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
"Andrew Mayo" <andrew@geac.co.nz> writes:
:BUT.... if there were more than one of these in my program, the second one
:would have to have a different label at the top, not SWITCH. (AFAIK).
This is false. You can reuse labels.
And see http://language.perl.com/misc/fmswitch
--tom
--
The autodecrement is not magical.
--Larry Wall in the perl man page
------------------------------
Date: Thu, 07 Jan 1999 15:15:44 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: line noise
Message-Id: <3695cf16.27798750@news.skynet.be>
bj wrote:
>OTOH, the lack of a formal, legal support requirement makes the
>"suits" nervous and upset at times.
Does the "legal support requirement" actually help in commercial
products? It's my (limited) experience that it's not the top notch
people that do the technical support, to put it politely. Yet, those
support problems may be the toughest of all.
Bart.
------------------------------
Date: Thu, 7 Jan 1999 11:00:10 -0500
From: David Coppit <dwc3q@cs.virginia.edu>
Subject: Need help using MakeMaker for scripts
Message-Id: <Pine.WNT.4.03.9901071046150.268-100000@legacy.cs.virginia.edu>
Okay, I've got a script that is broken into several modules (that are
not shared). Below is my small Makefile.PL that installs the script and
supporting files. I have a few questions, though:
- How do I get the permissions to be 755 -- in particular, the main script
and configuration file?
- How can I force the user to specify the PREFIX using
"perl Makefile.PL PREFIX=~/somedir". (I *don't* want this stuff
installed in the normal perl locations.)
- What about people on non-Unix systems? Does perl come with make?
- Is there a way to get MakeMaker to take the version information from
the id line? (Some modules don't set VERSION, and use something like
the following instead.)
# $Id: Parse.pm,v 2.3 1996/06/09 14:49:59 aas Exp $
- My use of PM for all the files seems weird. Is there a better way?
- Make uninstall doesn't seem to work, and is pretty unnecessary here.
How do I suppress the creation of the .packlist file?
Thanks a lot!
David
use ExtUtils::MakeMaker;
require 5.004;
WriteMakefile(
# For debugging
# 'NOECHO' => '',
'NAME' => 'DailyUpdate',
'VERSION_FROM' => 'DailyUpdate.pl', # finds $VERSION
# You have to tell Perl where to install
'PREFIX' => '/users/dwc3q/DailyUpdate',
'LIB' => '$(PREFIX)/DailyUpdate',
'INSTALLMAN1DIR' => '$(PREFIX)/man/man1',
'INSTALLMAN3DIR' => '$(PREFIX)/man/man3',
'dist' => { COMPRESS => 'gzip', SUFFIX => 'gz' },
'PM' => {
'DailyUpdate.pl' => '$(PREFIX)/DailyUpdate.pl',
'DailyUpdate.cfg' => '$(PREFIX)/DailyUpdate.cfg',
'MakeHandler.pl' => '$(PREFIX)/MakeHandler.pl',
'template.txt' => '$(PREFIX)/template.txt',
'DailyUpdate/AcquisitionFunctions.pm' => '$(INST_LIB)/AcquisitionFunctions.pm',
'DailyUpdate/Handler.pm' => '$(INST_LIB)/Handler.pm',
'DailyUpdate/HTMLTools.pm' => '$(INST_LIB)/HTMLTools.pm',
'DailyUpdate/HandlerFactory.pm' => '$(INST_LIB)/HandlerFactory.pm',
'DailyUpdate/OutputFunctions.pm' => '$(INST_LIB)/OutputFunctions.pm',
'DailyUpdate/Parser.pm' => '$(INST_LIB)/Parser.pm',
}, # lib files to install
'PREREQ_PM' => { 'HTML::Parser' => 2.06, 'HTML::FormatText' => 0,
'HTML::TreeBuilder' => 0, 'URI' => 1.0, 'LWP' => 5.15},
);
_________________________________________________________________________
David Coppit - Graduate Student coppit@cs.virginia.edu
The University of Virginia http://www.cs.virginia.edu/~dwc3q
"For I am a Bear of Very Little Brain,
and long words Bother me" - Winnie the Pooh
------------------------------
Date: Thu, 07 Jan 1999 15:14:59 +0000
From: Herger Peter <peter.herger@swisslife.ch>
Subject: password security
Message-Id: <3694CF73.293A9325@swisslife.ch>
Hello
I would like to store my userid and passwords in a seperate file and to
get those informations from a perlscript, which uses the password to
logon a remote machine. In the password file I will store more than one
passwords and user ID's.
How is it to do?
Thanks for your information
Peter
**********************************************************************
Peter Herger
Rentenanstalt/Swiss Life
Management Services - Informatik Betrieb, SA1558
Soodmattenstrasse 4
Postfach
CH-8134 Zuerich
Tel. P : 0041 (0)41 870 62 13
Tel.G (direkt) : 0041 (0) 1 284 52 42
Fax : 0041 (0) 1 284 52 93
eMail (P) : peter.herger@bigfoot.com
eMail (G) : peter.herger@swisslife.ch
**********************************************************************
------------------------------
Date: Thu, 07 Jan 1999 15:47:04 GMT
From: scot777@my-dejanews.com
Subject: perl and MS Access 7.0 on UNIX
Message-Id: <772ktn$unn$1@nnrp1.dejanews.com>
Is there a module that can read an Microsoft Access database. I'm writing a
web site running on a solaris box and I need to get info from an access
database sitting on a novell file server. I am able mount the novell drive
but I need to read and update the database.
Thanks in advance.
--
Scot Tucker - Network Data Systems
New Hartford, New York
http://www.mvnhealth.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 07 Jan 1999 09:01:02 -0500
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: Problem with Perl script
Message-Id: <3694BE1C.63132D4@cthulhu.demon.nl>
John wrote:
>
> I am (a newbie) getting an error message
> 'premature ending of script' for the
> following:
[snip, my nntp server refuses to accept this message when I include
this cript. Annoying 'included too much' stuff *curse*]
> print "Your first name is $firstname<BR>";
> print "Your last name is $lastname<BR>";
> print "Your e-mail is $email<BR>";
>
> Can anyone spot the problem?
Add newlines to the print statements. eg
print "Your first name is $firstname<BR>\n";
Your script does not add any newlines to the body, so the
server thinks your script did not run successfully.
One print "\n"; at end of script may be the only thing required,
but adding a few newlines does not matter to the layout,
and it makes the poor human that has to look at the html generated
a lot happier.
Erik
--
Sure, doesn't everyone sign up for internet service so as to have
their mailbox stuffed with megabytes of postage-due rubbish every day?
Absolutely. And everyone who owns a car intends that it be used as a
portable dumpster. Any unwanted garbage in their vehicle they can
simply throw away, after all.
------------------------------
Date: Thu, 7 Jan 1999 09:22:58 -0600
From: Phil Mein <pmein@johnco.cc.ks.us>
Subject: Problems Making DBD with DBI1.03
Message-Id: <F44364C301FCD111906F00805FEAAFAA06F4A68B@news.jccc.net>
I was getting compile errors on DBD after install DBIv1.03
removed DBI1.03 and installed DBI1.02 and the problems went away with
compiling DBDv.59
> -----Original Message-----
> From: Phil Mein
> Posted At: Wednesday, January 06, 1999 5:06 PM
> Posted To: comp.lang.perl.misc
> Conversation: ORACLE DBD compile error
> Subject: ORACLE DBD compile error
>
> any ideas on what might be causing this?
> AIX v4.3.1
> Oracle v8.0.4
> Perl v5.x
> DBI v1.03
> DBD v.59
>
>
> cc -c -I/oracle/v8040/rdbms/demo -I/oracle/v8040/rdbms/public
> -I/oracle/v8040/plsql/public -I/oracle/v8040/network/public
> -I/oracle/v8040/rdbms/demo -I/oracle/v8040/rdbms/demo
> -I/usr/local/lib/perl5/site_perl/5.005/aix/auto/DBI -D_ALL_SOURCE
> -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=8192 -I/usr/local/include -O
> -DVERSION=\"0.59\" -DXS_VERSION=\"0.59\"
> -I/usr/local/lib/perl5/5.00502/aix/CORE Oracle.c
> "Oracle.xsi", line 54.5: 1506-276 (S) Syntax error: possible missing
> ':'?
> "Oracle.xsi", line 298.9: 1506-045 (S) Undeclared identifier imp.
> make: 1254-004 The error code from the last command is 1.
>
> environment:
> LANG=C
> LC_MESSAGES=en_US
> LC__FASTMSG=true
> LD_LIBRARY_PATH=/oracle/v8040/lib:/usr/include/Motif1.2
> LOCPATH=/usr/lib/nls/loc
> LOGIN=root
> LOGNAME=root
> MAIL=/usr/spool/mail/root
> MAILMSG='[YOU HAVE NEW MAIL]'
> NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/en_US/%N:/usr/lib/nls/
> msg/%L/%N.cat:/usr/lib/nls/msg/en_US/%N.cat
> ODMDIR=/etc/objrepos
> ORACLE_BASE=/oracle
> ORACLE_HOME=/oracle/v8040
> ORACLE_SID=PROD
> PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/etc:/usr/sbi
> n:/usr/lib:/usr/local/bin:/oracle/v8040/bin:/oracle/v8040/lib
> PWD=/public/latest_tar/DBD-Oracle-0.59
> SHELL=/bin/ksh
> TERM=vt100
> TZ=CST6CDT
>
>
------------------------------
Date: 07 Jan 1999 07:25:02 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Randal's code [was Re: How do I delete tmp files based on age?]
Message-Id: <m1n23vxfzl.fsf@halfdome.holdit.com>
>>>>> "mark" == mark thomas <mark_thomas@my-dejanews.com> writes:
mark> In article <m1zp7x4shv.fsf@halfdome.holdit.com>,
mark> merlyn@stonehenge.com (Randal L. Schwartz) wrote:
>> But I think this would be simpler written as:
>>
>> $dirname = 'some_directory';
>> opendir DIR, $dirname or die "...";
>> unlink grep -A > $hold_time, map "some_directory/$_", readdir DIR;
>> closedir DIR;
mark> Thanks, Randal, for taking the time to respond to posts with
mark> code samples. I'm sure it improves the coding of countless
mark> numbers of casual Perl programmers like myself.
Of course, scanning this code the next day, I realized that I didn't
parameterize the prefixing of the directory name properly. So, a better
example looks like:
$dirname = 'some_directory';
$holdtime = 1.5;
opendir DIR, $dirname or die "...";
unlink grep -A > $hold_time, map "$dirname/$_", readdir DIR;
closedir DIR;
Sorry 'bout that, chief!
print "Just another Perl re-hacker,"
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Thu, 7 Jan 1999 09:18:41 -0500
From: "Allan M. Due" <Allan@due.net>
Subject: Re: Rename Files Button
Message-Id: <772fde$8hi$1@camel0.mindspring.com>
SGhalay68 wrote in message <19990107021902.05849.00009249@ng-fr1.aol.com>...
>I am looking for a Rename Files Button to post in a form. This button
should
>allow the users to rename the file names in their hard drives.
Dear Sir,
Are you asking for a script that would remotely access and modify the
hard drive of a person posting to a form on a web page? May I suggest that
such ideas lead only to degradation and despair; and that they should be
suppressed by all available means. Think of the catastrophic damage that
might be wrought if such a device where to fall into the hands of
disreputable, base individuals; obsessed by thoughts of destruction and
annihilation. The prevention of such activity is a high moral calling.
Please rethink your intents, I fear they may lead you from the path of
righteousness.
With warmest regards,
AmD
------------------------------
Date: Thu, 07 Jan 1999 15:37:50 GMT
From: droby@copyright.com
Subject: Re: Sendmail 8.9.1 makemap hash format and Perl
Message-Id: <772kcf$u68$1@nnrp1.dejanews.com>
In article <36925177.CFFEA736@eur.sas.com>,
dieter.koegel@eur.sas.com wrote:
> Hi,
>
> I'm not too familiar with perl's dbmopen however:
Might have been a good reason for not trying to answer this.
>
> - depending on what dbm (newdbm, hash) you used when creating the
> aliases databases the extension of the database is AFAIK either .dir or
> .pag
>
Or both. Or .db. Or God knows what else...
> - probably you also have have to specify the database type when using
> dbmopen
>
I don't even know how to do this, but then I haven't used dbmopen in a
while... It's not a parameter, and it's not by including the file extension.
But dbmopen isn't the right thing anyway.
Sendmail uses Berkeley DB. Which version of Berkeley DB changed (at least as
an option) with the release of 8.9.1. Since it sounds from the original
poster's query like he had something working with an earlier version of
sendmail and it died with the install of 8.9.1, I suspect his sendmail setup
is using Berkeley DB 2.X, and the dbmopen is trying to open a Berkeley 1.85
file. It in fact worked on my machine, which is running sendmail 8.8.7.
Best solution is to forget about dbmopen (it's deprecated) and use tie/untie
with the appropriate DB module. For version 1.85 of Berkeley that is DB_File.
For version 2.X is is BerkeleyDB. Both are available on CPAN.
--
Don Roby
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 07 Jan 1999 15:27:03 GMT
From: 2n3055@usa.net (2n3055@usa.net)
Subject: size 1M dbm file has only 1 record?
Message-Id: <3696d0ef.3483678@news.supernews.com>
1st problem:
I have a dbm file, originally, it has 3000 record,
the size is 1M bytes, but after I delete 2000 record,
delete $hash{'recordname'};
the dbm file size still 1M, what's the problem?
I can sure that that the 2000 record are deleted,
there are nothing if I try to print "$hash{'recordname'}";
2nd problem;
while (($key,$val) = each %hash) {
$i++;
print "$key=$val\n";
}
the dbm file should have over 3000 record, but I can print up to 1044
record, the variable $i shows upto 1044 only, how can I print all the
data out of the dbm file?
3nd problem:
should I lock the dbm file if I use the tie function in perl?
use sdbm;
tie ....
untie...
OR
flock(abc,2)
use sdbm;
tie ....
untie...
flock(abc,8)
hope somebody can help me, very very thanks!
------------------------------
Date: Thu, 07 Jan 1999 15:04:31 GMT
From: gattaz@hotmail.com
Subject: Re: Split on whitespace sintax ?
Message-Id: <772idu$scm$1@nnrp1.dejanews.com>
>
> $_ = '01 sss';
> ($a, $b) = split; # default pattern on default $_ variable
> print "$a <***> $b\n";
>
> or supply the actual pattern ... and the default pattern is
> not the same as / /, but you can use the special case of supplying
> a string containing a space to get the default split behavior:
>
> $var = '01 sss';
> ($a, $b) = split ' ', $var;
> print "$a <***> $b\n";
>
Ok, I read on the Perl book that splitting on whitespace is optimized, are
the 2 sintaxes equivalent in this view ?
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 07 Jan 1999 14:11:06 GMT
From: Mike O'Brien <mikeob@itas.net>
Subject: STDIN Read buffer size
Message-Id: <3694C0E3.B0C835E8@itas.net>
This is a multi-part message in MIME format.
--------------983E02536F311857CBB2901F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I want to read information from a file, or capture the information in a
file to display information on a web page. Unfortunatley the file size
can be very large and it seemd that read needs to know how big the file
is. As one file might be 1 k and another may be 20m I do not want to set
the buffer to be 20 m (or bigger) due to sucking resources. Any
suggestion on how to take information from a flat text file without
declaring the size of the file?
read(FILE,$buffer,5000);
--------------983E02536F311857CBB2901F
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Michael O'Brien
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: Michael O'Brien
n: O'Brien;Michael
org: Island Tel Advanced Solutions
adr;dom: 57 Fitzroy Street;;;Charlottetown ;Prince Edward Island;;
email;internet: mikeob@itas.net
title: Business Analyst / EDI Co-ordinator
tel;work: Toll free 1-877-809-8358
x-mozilla-cpt: ;-1
x-mozilla-html: TRUE
version: 2.1
end: vcard
--------------983E02536F311857CBB2901F--
------------------------------
Date: 7 Jan 1999 11:24:38 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: STDIN Read buffer size
Message-Id: <772n46$r9v@panix.com>
In <3694C0E3.B0C835E8@itas.net> Mike O'Brien <mikeob@itas.net> writes:
>This is a multi-part message in MIME format.
>--------------983E02536F311857CBB2901F
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit
Yeeck! Get rid of the MIME format.
>I want to read information from a file, or capture the information in a
>file to display information on a web page. Unfortunatley the file size
>can be very large and it seemd that read needs to know how big the file
>is. As one file might be 1 k and another may be 20m I do not want to set
>the buffer to be 20 m (or bigger) due to sucking resources. Any
>suggestion on how to take information from a flat text file without
>declaring the size of the file?
>read(FILE,$buffer,5000);
Why not read one line at a time?
open FILE, $filename or die "$!\n";
while (<FILE>) {
# do what you have to do...
}
close FILE;
--
Clay Irving
clay@panix.com
------------------------------
Date: Thu, 07 Jan 1999 10:49:31 -0500
From: "Walker, Barry (EXCHANGE:CAR:5J42)" <bwalker@nortel.ca>
Subject: TelNet.pm win95 problem
Message-Id: <3694D78B.4E2541D6@nortel.ca>
HI...
i have a telnet server running on a windows 95 machine...
I am using the Telnet.pm package to make connections and login...The
problem is on the server
side, each telnet connection creates a program/task called
'Winoldap'...Once about 30 of
these are in the program list, i get connections refused...The Server
side also complains
that the conagent.exe cannot find the Apps.inf file ??
ANy ideas..i'm stuck
--
Barry D. Walker
---------------------------------------------------------------------------
Internet and Service Provider Networks
Software Tools Development
Ottawa, Ontario, Canada
ESN: 393-2873 EMAIL: bwalker@nortelnetworks.com
------------------------------
Date: Thu, 07 Jan 1999 09:24:00 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: what's with all the job posts?
Message-Id: <fl_aggie-0701990924010001@aggie.coaps.fsu.edu>
In article <x7ogobll5c.fsf@home.sysarch.com>, Uri Guttman
<uri@home.sysarch.com> wrote:
+ i didn't know that was a rule. i was just trying to get attention to the
+ idea of a new subgroup.
It isn't really a rule, per se. Nettiqutte being what it is...
+ what would you have used for a subject?
RFD - Request for Discussion
James
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 4571
**************************************