[10961] in Perl-Users-Digest
Perl-Users Digest, Issue: 4562 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 6 09:07:29 1999
Date: Wed, 6 Jan 99 06: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, 6 Jan 1999 Volume: 8 Number: 4562
Today's topics:
all trim in perl bpolarsk@my-dejanews.com
Automated site indexing (and more) with perl?! luebbert@sfs-dortmund.de
Re: basic query about command line processing in Perl dave@mag-sol.com
Checking for a Charictor in a Variable <r2-d2@REMOVEbigfoot.com>
Re: Checking for a Charictor in a Variable <sorenso@online.no>
Re: Checking for a Charictor in a Variable <r2-d2@REMOVEbigfoot.com>
Re: Excel to HTML converter? <filip.hosten@alcatel.be>
Re: How do I create a unique (reproducible) identifier? (Jeffrey R. Drumm)
Re: I wanna learn Perl real good..but first dave@mag-sol.com
Re: If Larry Wall's listening out there.... <dpd6@zdnetmail.com>
Re: If Larry Wall's listening out there.... <dickens@dreamgear.com>
Re: If Larry Wall's listening out there.... <todda@lrca.com>
Re: If Larry Wall's listening out there.... <vertigan@iinet.net.au>
is a hash of hashes illegal in a DBM file? <nospam.eam@starfire.mlb.semi.harris.com>
Re: Lists of Lists in Perl 4 dave@mag-sol.com
Newbie With Malformed Header! <pha97wg@sheffield.ac.uk>
Re: Newbie With Malformed Header! <sorenso@online.no>
Re: newline <bcordes@quadri.hlo.dec.com>
Password Encryption <r2-d2@REMOVEbigfoot.com>
Re: Password Encryption <support@counter.w-dt.com>
Re: Perl and the Windows April Fools 2001 bug (Matthew Bafford)
Perl build problem/re-install advice (Solaris build) <mark.c.hamlin@bt.com>
Problem with h2ph? (Clay Irving)
Re: psswrd protect dave@mag-sol.com
Re: SDBM in ActivePerl for Win32 : each() lose key/valu <alain.coetmeur@icdc.caissedesdepots.fr>
Re: subroutine returning an lvalue <B.A.McCauley@bham.ac.uk>
Re: subroutine returning an lvalue <Brett.Diamond@lmco.com>
Re: Web server in perl <matthew.sergeant@eml.ericsson.se>
Windows NT - FrontPage server -- CGI - perl script <rren@cs.ust.hk>
Re: Writing Perl with Notepad <shameluss plug> <trent@jps.net>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 06 Jan 1999 13:39:07 GMT
From: bpolarsk@my-dejanews.com
Subject: all trim in perl
Message-Id: <76vp1s$d34$1@nnrp1.dejanews.com>
On Tue, 6 Jan 1998, Theo den Brinker wrote:
> In article <34ad3433.11292567@news.on-net.net>, djboyd@sam.on-net.net wrote:
>
> > How does one trim a string. That is, like in VB you can issue a
> > command such as ltrim which will remove all spaces etc, on the left
> > hand of the string and same for rtrim. How does one do this in perl.
> > that is remove spaces, tabs and new line on the right hand side of a
> > string.
> Use regular expression substitution
>
> $the_string_you_want_to_trim =~ s/^\s*(.*)\s*$/$1/;
That won'd do what the poster requested. But I think the poster was really
asking a question from the FAQ, which has a perfectly suitable answer.
Don't you agree?
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
--------------------------------------------------------------------------------
Ok it does not work, but what work : Itried
$st1 =~ s/^\s+(.*)\s+$/$1/; but it work only if there is one blank space at
the end. what is the expression if there are more than 1 blank space at the
end
B. Polarski
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 06 Jan 1999 11:14:31 GMT
From: luebbert@sfs-dortmund.de
Subject: Automated site indexing (and more) with perl?!
Message-Id: <76vgim$6h6$1@nnrp1.dejanews.com>
Hi world!
I am quite a Perl newbie ( to warn you ;-))..
I am looking for a perl script that automates the
development and use of a surface for our intranet file system.
The script should scan our intranet file system (novell) and create
index-files from all the directories. The user should be able to insert
descriptions for the index files via WWW (write through CGI into the
index-files)..
And the script should realize if somebody deleted or added a file to a
directory.
Does anyone understand me? ;-)) Does anyone know such a script or even some
fragments that would do the job?
Thanx for your help...
Dorthe
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 06 Jan 1999 09:51:01 GMT
From: dave@mag-sol.com
Subject: Re: basic query about command line processing in Perl
Message-Id: <76vbm5$2j5$1@nnrp1.dejanews.com>
In article <76tsit$ec3$1@news7.svr.pol.co.uk>,
"Tom Morris" <tkkb@morrita.freeserve.co.uk> wrote:
> can someone please help me out here. I'm a bit new to Perl and desparately
> need to know how to process command line args.
>
> eg if I have a program called myprog.plx and called it as
>
> myprog.plx abc def ghi
>
> and I wanted the output to be ..
>
> there were 3 arguments passed
> arg1 = abc
> arg2 = def
> arg3 = ghi
>
> this is using Perl on windows NT 4 (it comes with the resource kit). I hope
> that this is as easy as it would be using the UNIX shell.
You don't make it clear what problems you're having. What do you have so far?
I can't see any reason why a script that did this under Unix wouldn't work in
exactly the same way under NT.
Perl scripts get their command line arguments in the @ARGV array.
hth,
Dave...
--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 6 Jan 1999 12:21:27 -0000
From: "Artoo" <r2-d2@REMOVEbigfoot.com>
Subject: Checking for a Charictor in a Variable
Message-Id: <76vkj1$opn$1@plug.news.pipex.net>
Hi all
How can you check to see if a character exists with-in a variable. ie: I
need to check there is an @ sign anywhere in the variable inorder to
process.
Thanks
Artoo
------------------------------
Date: Wed, 06 Jan 1999 13:40:30 +0100
From: =?iso-8859-1?Q?=D8istein=20S=F8rensen?= <sorenso@online.no>
Subject: Re: Checking for a Charictor in a Variable
Message-Id: <369359BE.62CF7FA4@online.no>
Artoo wrote:
> How can you check to see if a character exists with-in a variable. ie: I
> need to check there is an @ sign anywhere in the variable inorder to
> process.
$foo="my var with some chars \@#!";
$bar="\@";
print "Yess" if ($foo=~ /$bar/);
\sorenso\
--
Xistein Sxrensen - <sorenso@online.no>
<url:http://home.sol.no/home/sorenso/>
"That's my five cents..."
------------------------------
Date: Wed, 6 Jan 1999 13:24:42 -0000
From: "Artoo" <r2-d2@REMOVEbigfoot.com>
Subject: Re: Checking for a Charictor in a Variable
Message-Id: <76voaj$s2h$1@plug.news.pipex.net>
Thanks Sorenso
How can you make it check for several characters?
Thanks
Artoo
Xistein Sxrensen wrote in message <369359BE.62CF7FA4@online.no>...
>
>$foo="my var with some chars \@#!";
>$bar="\@";
>
>print "Yess" if ($foo=~ /$bar/);
>
------------------------------
Date: Wed, 06 Jan 1999 14:23:50 +0100
From: Filip Hosten <filip.hosten@alcatel.be>
To: dhaley@infobeat.com
Subject: Re: Excel to HTML converter?
Message-Id: <369363E6.DBECE1EA@alcatel.be>
Hi,
for those convertors, I have a question :
Is it possible to set up netscape that when you click on a doc-file, the
convertor starts and then the output is given back in netscape browser?
(some kind of plugin)
Filip
"Damon K. Haley" wrote:
>
> Hello,
>
> Is there an excel to html converter out there?
> I found MSWordview which does a great jobs
> of converting Word97 to html.
> http://www.gnu.org/~caolan/docs/MSWordView.html
>
> I also found this page (http://arturo.directmail.org/filters/)
> of MS converters but didn't find an excel2html
> converter that is available yet.
>
> Does anyone know of one or when one will be released?
>
> Thanks
>
> Damon Haley
--
Filip Hosten, Dep. : VE119, Alcatel Design Centre Antwerp Belgium,
Internat. phone : +32 3 240 7769,
Alcanet phone : 2 605 7769, Mail : filip.hosten@alcatel.be
------------------------------
Date: Wed, 06 Jan 1999 11:47:57 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: How do I create a unique (reproducible) identifier?
Message-Id: <36934bde.1785003449@news.mmc.org>
[ posted to comp.lang.perl.misc and a courtesy copy was mailed to the cited
author ]
On Tue, 05 Jan 1999 19:21:04 -0600, Rich Grise
<off-duty@entheosengineering.com> wrote:
(snip)
>Oops! How do you write a hash to a file, and then retrieve it such
>that it's still a hash? Is there a quick way, other than iterating
>through the whole thing, turning it into some kind of array or
>something?
Use a tied hash. See the documentation on tie and/or dbmopen.
$ perldoc -f tie
$ perldoc -f dbmopen
--
Jeffrey R. Drumm, Systems Integration Specialist
Maine Medical Center - Medical Information Systems Group
drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me
------------------------------
Date: Wed, 06 Jan 1999 09:26:08 GMT
From: dave@mag-sol.com
Subject: Re: I wanna learn Perl real good..but first
Message-Id: <76va7e$1j1$1@nnrp1.dejanews.com>
In article <36923492.FBC1CF0F@interlog.com>,
Iain Lowe <ilowe@interlog.com> wrote:
> Hello Perl folks.
>
> I've been dabbling in your dominion for awhile now, wanting to learn how
> to do things -- mostly CGI / Web form processing. I've looked at lots of
> tools and books, but I haven't found anything that really strikes my
> fancy.
>
> Currently, I use PerlBuilder on Win95 to develop pretty basic Perl form
> processors, and then tweak them where I can. Most of the books I've
> looked at only cover very simple forms, and spend most of their time
> explaining how to break up the query string into key/value pairs--the
> brain-dead stuff.
>
> SO, does anybody know of good resources where I can learn to do things
> like split a feedback form across a couple of pages without going all
> the way through the Camel book (that'll come).
What you need is Lincoln Stein's "Official Guide to Programming with CGI.pm"
(you *are* using CGI.pm aren't you?)
Dave...
--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 5 Jan 1999 23:16:27 -1000
From: "dpd6" <dpd6@zdnetmail.com>
Subject: Re: If Larry Wall's listening out there....
Message-Id: <36930e11.0@news.hawaii.rr.com>
Andrew Mayo <andrew@geac.co.nz> wrote in message
news:76urmk$ncd$1@news.akl.netlink.net.nz
...
>
>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)
>
I stopped using Notepad quite a while back. Instead opting for one of the
many freeware to shareware to com'l editors readily available. PLEASE try
NoteTab (shareware for $5 if you keep using it, up to $20 for snazzier
versions.) It's soooo much better, faster, easier, more versatile, etc.
etc. But if your programming -- Check out the Perl Reference page at:
http://reference.perl.com/query.cgi?editors
for a nice list of available editors, from Codewright which is a commercial
$299 programmer's dream editor (demo available -- check it out) to freeware.
>From that page I downloaded a shareware program called UltraEdit-32 and love
it. I plan to purchase it at a reasonable $30. For your "line number
problem" it's got a 'Go' button on the tool-bar. When I run Perl -w and get
the line number for an error, I just click 'Go' and type the line number in,
and I'm there. Ultra-Edit also has syntax highlighting for Perl (and VB,
and C++ and...) as well as customizable word lists for your own Language.
I use it for a keyword list and when I open up email in UltraEdit, keywords
I've choosen are highlighted in different color schemes (again
customizable). It also has automatic indenting -- type a brace '{' and the
next line is indented by however much you have the Tab set up for. Type a
closing brace '}' and the editor automatically aligns it under the opening
statement just as it should be.
'nuff said, but don't keep on using NoteTab for anything!
dpd
------------------------------
Date: Wed, 6 Jan 1999 08:02:57 -0500
From: "Jeff Dickens" <dickens@dreamgear.com>
Subject: Re: If Larry Wall's listening out there....
Message-Id: <76vmip$e3a@news-central.tiac.net>
Andrew Mayo wrote in message <76urmk$ncd$1@news.akl.netlink.net.nz>...
.
.
.
>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)
>
I like PFE (Programmer's File Editor). It's free, and can be had from
winfiles.com.
It can do line numbers, and can also execute your perl script and catch the
output in a buffer...
------------------------------
Date: Wed, 6 Jan 1999 07:24:58 -0600
From: "todda" <todda@lrca.com>
Subject: Re: If Larry Wall's listening out there....
Message-Id: <76vnpg$6gg$1@usenet43.supernews.com>
there are variant of vi which can be found on the web at no cost. vim, vile
and elvis. I believe that these all have win32 versions. I know vim can be
found in win32.
sometimes i just use vi with my shell account from my ISP..
$0.02
Todd
------------------------------
Date: Wed, 06 Jan 1999 13:21:02 GMT
From: Steve Vertigan <vertigan@iinet.net.au>
Subject: Re: If Larry Wall's listening out there....
Message-Id: <36935e0e.8019490@news.omen.com.au>
"Andrew Mayo" <andrew@geac.co.nz> wrote thus:
>Dear Larry and friends,
>
>What a wonderful thing you have wrought.... but there's one small
>detail.....
>
>Those of us working in a Windows environment generally will use notepad as a
>text editor.
No we won't! I don't know anybody who uses notepad for serious work. If
you're going to be doing any sort of serious editing I reccommend you get
the freeware NoteTab from http://www.notetab.ch/. As well as editing
multiple files it also comes with a powerful clipbook library which lets you
paste commonly used text and there are several pre-written Perl ones at
http://www.notetab.ch/clipbooks/perl_clb.zip (saves a lot of time for the
beginner).
--Steve(not affiliated, just a satisfied user :)
------------------------------
Date: Tue, 29 Dec 1998 14:29:27 -0500
From: Software Sciences <nospam.eam@starfire.mlb.semi.harris.com>
Subject: is a hash of hashes illegal in a DBM file?
Message-Id: <36892D97.AA7064C3@starfire.mlb.semi.harris.com>
I wrote a testcase similar to Camel edition 2 p270, wherein I populate a
hash of hashes then display it. I wrote it with just a hash- seems to
work fine. Then I tied it to a dbm (with dbmopen), it discovered that
it now discards the first element of each hashed hash. In the example
below, it discards all of the $h{cat}{ctype} keys and values.
Just like Penny Lane- VERY STRANGE!
This one seems to work fine:
******************************************************************
Hpop();
Hlist();
exit 0;
sub Hlist
{my $cat;
print "toms colour is $h{tom}{colour}\n\n";
foreach $cat (keys %h)
{print "cat: $cat\n";
foreach (keys %{ $h{$cat} })
{print "$_ => $h{$cat}{$_}\n";
}
}
}
sub Hpop
{print "** populating H **\n\n";
$h{tom}{ctype} = "cat";
$h{tom}{colour} = "brown";
$h{tom}{build} = "fat";
$h{tom}{age} = "5";
$h{tom}{owner} = "sara";
$h{powder}{ctype} = "cat";
$h{powder}{colour} = "white";
$h{powder}{build} = "slim";
$h{powder}{age} = "4";
$h{powder}{owner} = "kit";
}
shell> perl hx.pl
cat: tom
build => fat
owner => sara
colour => brown
age => 5
ctype => cat
cat: powder
build => slim
owner => kip
colour => white
age => 4
ctype => cat
*****************************************************************
Everybody is there, looks great. Then I tied it to a DBM file, and all
of the ctypes vanish. The only significant difference is I create the
hash with this function:
sub DBstart
{print "** starting DB **\n\n";
dbmopen %h, $DB, 0766 || die "cant open DBM: $!\n";}
when I run that program I get:
cat: powder
build => slim
owner => kip
colour => white
age => 4
cat: tom
build => fat
owner => sara
colour => brown
age => 5
** Close DB **
Just to be sure I didn't have some boundary error, I copied the DBLIST()
and DBPOPULATE() code over from the working version to the non-working.
Same result.
It seems extra strange that there are no warnings, error messages,
nothing. Just bad data. Is there a constraint on DBM files that they
cannot be used for hashed hashes? I added a dummy entry above ctype that
I didn't care about loosing, and it seemed OK after that, but that's
hardly a satisfying correction.
Thanks,
E
------------------------------
Date: Wed, 06 Jan 1999 09:36:26 GMT
From: dave@mag-sol.com
Subject: Re: Lists of Lists in Perl 4
Message-Id: <76vaqq$21o$1@nnrp1.dejanews.com>
In article <369251BD.57FB76DC@email.sps.mot.com>,
Omar Soto <rp7667@email.sps.mot.com> wrote:
> Hello:
>
> This may seem like a very basic question, but I am trying to
> create a List of lists or an array of arrays, as defined in the
> Perl 5 book p. 257.
>
> The problem is that the definition works in Perl 5 but not in
> Perl 4. Due to the requirements of the job, the on ly Perl
> supported is Perl 4 and not Perl 5.
Get a new job! Perl 4 is *very* out of date and is known to have security
holes. Any company that would still make you use it is asking for trouble.
Dave...
--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 06 Jan 1999 11:43:13 +0000
From: Will Green <pha97wg@sheffield.ac.uk>
Subject: Newbie With Malformed Header!
Message-Id: <36934C51.65ED5757@sheffield.ac.uk>
Hi,
I'm new to PERL, and I apologise if this is a stupid question, but here
goes:
When I run PERL at the command line, it says the syntax of my code is
fine, however when I run it via the web server I get errors about a
malformed header, even with really simple code:
#!/usr/bin/perl
print 'Hello world.';
The error message I get is:
malformed header from script. Bad header=Hello world.:
/usr2/home/will/public_html/cgi-bin/si.cgi
Any advice would be much appreciated :)
Also does anyone have any advice on a good PERL book (I am a C++
programmer).
--
Will Green - The Bits General Editor, Supporting C++Builder
Try out our new C++Builder forum, includes real-time chat!
Point your browser at http://www.cbuilder.dthomas.co.uk
------------------------------
Date: Wed, 06 Jan 1999 13:10:51 +0100
From: =?iso-8859-1?Q?=D8istein=20S=F8rensen?= <sorenso@online.no>
Subject: Re: Newbie With Malformed Header!
Message-Id: <369352CB.2E90046E@online.no>
Will Green wrote:
> When I run PERL at the command line, it says the syntax of my code is
> fine, however when I run it via the web server I get errors about a
> malformed header, even with really simple code:
You have to tell the server which mime-type is coming. This is done by
printing "Content-type: <type>" first i every cgi-script.
> #!/usr/bin/perl
Insert here:
print "Content-type: text/html\n\n";
> print 'Hello world.';
\sorenso\
--
Xistein Sxrensen - <sorenso@online.no>
<url:http://home.sol.no/home/sorenso/>
"That's my five cents..."
------------------------------
Date: 05 Jan 1999 13:37:17 -0500
From: Ben Cordes <bcordes@quadri.hlo.dec.com>
Subject: Re: newline
Message-Id: <xyun23x36si.fsf@quadri.hlo.dec.com>
Herger Peter <peter.herger@swisslife.ch> writes:
> Hi all
>
> I've wrote a script like the following.
[...]
> $ftp->get("config" ,
> "/usr/net/routers/rtconfigs/$storedir/confhgtv1.$date");
[...]
> But in the second last line, there is a problem. The variable $storedir
> always includes a \n at the end. How can I suppress this \n ?
Please note that comp.lang.perl.tk is for Perl questions which
specifically relate to the Tk toolkit. General Perl questions (like
this one) should go to comp.lang.perl.misc. Followups set.
If you're sure that there is always a \n character, you can use
chop($storedir) to remove the last character (no matter what it is).
If you want to be safer, you can use chomp($storedir), which will only
remove the last character if it's a newline. See also the perlfunc
manpage for an extended explanation of these two functions.
- ben
--
Ben Cordes ben.cordes@compaq.com
Hardware Design Engineer, Compaq Computer Corporation
------------------------------
Date: Wed, 6 Jan 1999 12:24:42 -0000
From: "Artoo" <r2-d2@REMOVEbigfoot.com>
Subject: Password Encryption
Message-Id: <76vkp3$ovu$1@plug.news.pipex.net>
Hi All
What is the best way to store passwords encrypted on a server? How do I
encode them and decode them to check on log-in to script?
Thanks for any help
Artoo
------------------------------
Date: Wed, 06 Jan 1999 07:43:09 -0600
From: Mike <support@counter.w-dt.com>
Subject: Re: Password Encryption
Message-Id: <3693686D.24757D41@counter.w-dt.com>
Use perls crypt function. It can't be decrypted, you just crypt both with
the same salt and then compare them.
Artoo wrote:
> Hi All
>
> What is the best way to store passwords encrypted on a server? How do I
> encode them and decode them to check on log-in to script?
>
> Thanks for any help
> Artoo
------------------------------
Date: Wed, 6 Jan 1999 08:44:17 -0500
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: Perl and the Windows April Fools 2001 bug
Message-Id: <MPG.10fd32c1375541cd989776@news.scescape.net>
In article <3692E254.4153E3D@tiac.net>, smiths@tiac.net pounded in the
following:
=> Hello,
[snip]
=> My question, will Win32 Perl programs also fail on April 1, 2001
=> because the Windows Perl interpreter uses the broken Visual C++
=> localtime() function? I am was hoping that someone could write
=> a quick test in Perl for this bug and post the results.
Well, you could directly translate the code in the article, but that's
messy...
How about:
#!/usr/bin/perl -w
print get_time(0x3AC796D0), "\n"; # Sunday, April 1, 2001
print get_time(0x3ACF2B70), "\n"; # Saturday, April 7, 2001
print get_time(0x3AD06EE0), "\n"; # Sunday, April 8, 2001
sub get_time {
my $time = shift;
$_ = localtime($time);
$_ .= (localtime($time))[8] ? " (DST)" : "";
}
__END__
Sun Apr 1 16:00:00 2001
Sat Apr 7 10:00:00 2001
Sun Apr 8 10:00:00 2001 (DST)
---
perl -v :
This is perl, version 5.005_02 built for MSWin32-x86-object
Copyright 1987-1998, Larry Wall
Binary build 508 provided by ActiveState Tool Corp.
http://www.ActiveState.com
Built 16:22:15 Dec 22 1998
...
The above produces the correct results with my Linux based Perl, of
course. :)
=> TIA,
HTH,
=> Richard
--Matthew
------------------------------
Date: Wed, 06 Jan 1999 12:54:57 +0000
From: Mark Hamlin <mark.c.hamlin@bt.com>
Subject: Perl build problem/re-install advice (Solaris build)
Message-Id: <36935D21.AF38B0AD@bt.com>
Dear All,
My build of perl on the local web server is completely shot, so i'm going to
reinstall it. I tried to find Perls source/lib directory - the locations
confirmed with a print -e 'print' "@INC"' did not even exist. When I run
perldoc perldoc
I get the 'can't locate Getopt/Std.pm in @INC at /usr/bin/perldoc line 27
....... Its possible the Perl files on the server in the /bin directory were
simply copied there rather than installed so I only have a bare bones build,
just the 4 files in /bin --
perl, perldoc, perlbug, perl5.004
Definately shot?? Alright then, now about the re-install:
I'm installing on a Sun Sparc box with Solaris 2.6. At Sun's
http://www.sunfreeware.com/ they have two perl builds, one of which is
specifically for a Sparc running 2.6:
"perl-5.005_02-sol26-sparc-local.gz
the Perl system installs in /usr/local. "
& "perl-5.005_02.tar.gz Source Code."
Forget the source code, is the first the one I should go for, using pkgadd to
install it?
The 4 page generic package installation instructions from Sun are very short &
clear, less like the 25 pages of standard installtion instructions from the
CPAN. Does pkgadd negate all the make & configure steps one needs to carry out
normally. Is it really unzip/pkgadd/& play .???? I've already done the
prelimenaries for pkgadd, theres definately enough space in the critical
locations.
Thanks for your help and hopefully a bit of assurance,
Cheers,
Mark Hamlin 01473 646703
Systems Engineer
BT - ACR MCA SIT (don't ask!)
--
___....-----'---'-----....___
=========================================
___'---..._______...---'___
(___) _|_|_|_ (___)
\\____.-'_.---._'-.____//
~~~~'.__'---'__.'~~~~
~~~~~~~
'More speed'
Sisco
Work: mailto:mark.c.hamlin@bt.com
Personal: mailto:mark@dimitrinet.demon.co.uk
------------------------------
Date: 6 Jan 1999 08:34:15 -0500
From: clay@panix.com (Clay Irving)
Subject: Problem with h2ph?
Message-Id: <76voon$ldv@panix.com>
Environment: Solaris 2.6, Perl 5.005.02
Has anyone bumped into this before? -- I received this error message:
Bareword found where operator expected at /usr/local/lib/perl5/site_perl/5.005/sun4-solaris/sys/feature_tests.ph line 20, near """invalid"
(Missing operator before invalid?)
Bareword found where operator expected at /usr/local/lib/perl5/site_perl/5.005/sun4-solaris/sys/feature_tests.ph line 20, near "invalid _FILE_OFFSET_BITS"
(Do you need to predeclare invalid?)
String found where operator expected at /usr/local/lib/perl5/site_perl/5.005/sun4-solaris/sys/feature_tests.ph line 20, near "specified"""
syntax error at /usr/local/lib/perl5/site_perl/5.005/sun4-solaris/sys/feature_tests.ph line 20, near """invalid "
BEGIN failed--compilation aborted at /usr/local/bin/mon line 35.
Looking at line 20 of feature_tests.ph:
15 }
16 unless(defined(&_FILE_OFFSET_BITS)) {
17 eval 'sub _FILE_OFFSET_BITS () {32;}' unless defined(&_FILE_OFFS
ET_BITS);
18 }
19 if((defined(&_FILE_OFFSET_BITS) ? &_FILE_OFFSET_BITS : 0) - 0!= 32 &
& (defined(&_FILE_OFFSET_BITS) ? &_FILE_OFFSET_BITS : 0) - 0!= 64) {
20 die(""invalid _FILE_OFFSET_BITS value specified"");
21 }
22 if((defined( &_XOPEN_SOURCE) && (defined(&_XOPEN_SOURCE_EXTENDED) ?
&_XOPEN_SOURCE_EXTENDED : 0) - 0== 1)) {
23 eval 'sub _XPG4_2 () {1;}' unless defined(&_XPG4_2);
24 }
I changed line 20 to:
die("invalid _FILE_OFFSET_BITS value specified");
and the program now works fine.
There are other files built built by h2ph that have the same problem:
/usr/local/lib/perl5/site_perl/5.005/sun4-solaris
-------------------------------------------------
aio.ph: die(""POSIX Asynchronous I/O is not supported in POSIX.1-1990"");
libelf.ph: die(""large files are not supported by libelf"");
mqueue.ph: die(""POSIX Message Passing is not supported in POSIX.1-1990"");
/usr/local/lib/perl5/site_perl/5.005/sun4-solaris/sys
-----------------------------------------------------
isa_defs.ph: die(""SPARC Versions 8 and 9 are mutually exclusive choices"");
isa_defs.ph: die(""unknown SPARC version"");
isa_defs.ph: die(""ISA not supported"");
model.ph: die(""No DATAMODEL_NATIVE specified"");
old_procfs.ph: die(""Cannot use procfs in the large file compilation environment"");
procfs.ph: die(""Cannot use procfs in the large file compilation environment"");
Is this a bug or a feature? :)
--
Clay Irving
clay@panix.com
------------------------------
Date: Wed, 06 Jan 1999 09:55:03 GMT
From: dave@mag-sol.com
Subject: Re: psswrd protect
Message-Id: <76vbtm$2t3$1@nnrp1.dejanews.com>
In article <01be38eb$62340940$2951d2cc@yoda>,
"Tuppers" <ktupper1@maine.rr.com> wrote:
> I need a script to password protect a directory for my web site. It needs
> to be fairly reliable but easy to configure.
This question would be better asked in the newsgroup that deals with your
specific web server as it has nothing to do with Perl.
--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 6 Jan 1999 10:21:00 +0100
From: "Alain Coetmeur" <alain.coetmeur@icdc.caissedesdepots.fr>
Subject: Re: SDBM in ActivePerl for Win32 : each() lose key/value
Message-Id: <76va3b$61i1@puligny.idt.cdc.fr>
robert a icrit dans le message <76qih6$t3m@charm.il.fontys.nl>...
>I'm making a wild guess here, since I don't use either Windows or SDBM,
>but: could it be that you're somehow adding and/or deleting key/data pairs
>to/from %rubrique in the above while-loop? That's a big nono when dealing
>with hashes, you see (which is also stated in the perlfunc manpage, in the
>section about each()).
good idea in fact, this is not my situation.
as i said, using DB_File make it work fine...
SDBM seems broken or at least limited.
some said that there is no need to use O_BINARY
and my experiences seems to confirm.
I've found no way to make SDBM work
------------------------------
Date: 06 Jan 1999 13:24:47 +0000
From: Brian McCauley <B.A.McCauley@bham.ac.uk>
Subject: Re: subroutine returning an lvalue
Message-Id: <u9iueksfds.fsf@wcl-l.bham.ac.uk>
Brett Diamond <Brett.Diamond@lmco.com> writes:
> I would be implementing this as a method in a package. Since I
> would like to pass parameters, I would rather use a subroutine that
> works as an lvalue rather than use a tied variable or some other
> clever construct. In other words I am not looking for another
> solution, just a "This is how it is done:...", or a "It cannot
> currently be done" (no "just add another parameter", "use the -P
> flag", etc.).
I do not believe that is can be done.
I can think of a way in which the prototype mechanism could be readily
be extended to support this sort of thing exactly as it does in
C++. This would, however, not help in your case as there are no
prototypes for methods in Perl.
I would propose:
sub foo (=\$) { \$bar };
The bit to the left of the equals sign would be interpreted as per
existing prototypes. The bit to the right would imply a dereferencing
on the return value. The parser would therefore treat the bareword
foo as ${&foo}. Obviously =\% and so on would behave analagously.
You'd still need to return a reference to a tied thingy to do anything
very cleaver with this.
Can anyone see any argument (except feeping creaturism) against this
proposal?
--
\\ ( ) No male bovine | Email: B.A.McCauley@bham.ac.uk
. _\\__[oo faeces from | Phones: +44 121 471 3789 (home)
.__/ \\ /\@ /~) /~[ /\/[ | +44 121 627 2173 (voice) 2175 (fax)
. l___\\ /~~) /~~[ / [ | PGP-fp: D7 03 2A 4B D8 3A 05 37...
# ll l\\ ~~~~ ~ ~ ~ ~ | http://www.wcl.bham.ac.uk/~bam/
###LL LL\\ (Brian McCauley) |
------------------------------
Date: Wed, 06 Jan 1999 08:41:21 -0500
From: Brett Diamond <Brett.Diamond@lmco.com>
Subject: Re: subroutine returning an lvalue
Message-Id: <369367FD.41478266@lmco.com>
My problem is that the perl module already exists and is in production.
I want to change the minimal amount of application code while adding
functionality to the module for further implementations. My module,
which again looks nothing like my example, currently uses a scalar to
store and retrieve a particular bit of information. I'd like to replace
that with a subroutine call.
Let's say that the information I'm talking about is called "name" and I
currently use it like this:
====
use NamedThing;
$example = new NamedThing;
$example->name = "bob";
print "The name is ", $example->name, "\n";
====
Now my module is growing and now modifying a member's name now requires
all kinds of stuff behind the scenes. I could just use a tied variable
(I'm making this up on the fly, but you'll get the idea):
====
Package NamedThing;
sub new($$$);
sub UpdateVisibleItemName($$)
sub DatabaseUpdateName($$$)
sub new
{
...
tie $self->name, 'NamedThingName', $self;
...
}
...
Package NamedThingName;
sub TIESCALAR
{ my ($class, $item) = @_;
$item_shell = \$item;
return bless $item_shell $class; }
sub FETCH
{ my $self = shift;
my $item = $$self;
return $item->RealName; }
sub STORE
{ my ($self, $new_value) = @_;
my $item = $$self;
$item->DatabaseUpdateName($new_value);
for $ref ($item->CanSeeMe())
{ $ref->UpdateVisibleItemName($item->name, $new_value); }
# etc.
$item->RealName = $new_value;
return $new_value; }
====
This solution does have the advantage of not breaking any existing
application code as the application code will see $item->name as a scalar
guaranteed. In fact, this will be the way I implement the solution if I
cannot create a subroutine that I can use on the left-hand-side of the
equal sign. The problem is that this solutiuon is a bit complex and does
not permit passing parameters.
I figured that since I can create subroutines that act as lvalues in C++
and Perl is much better that C++ in most respects, there must be a way to
do this in Perl. I suspect, however, that Perl cannot (yet).
Roland Huss wrote:
> Brett Diamond <Brett.Diamond@lmco.com> writes:
> > I'd like to create a subroutine that works like the Perl "substr"
> > builtin,
> > where I can both use it both as an rvalue and an lvalue.
> > .
> > .
> > $my_dept->Budget() = 1000000;
>
> What so bad about
> $my_dept->{Budget} = 1000000;
> or
> $my_dept->Budget(10000);
> ?
>
> ( I know, that's not the answer you are looking for, however I'm
> simply curious...)
>
> --
> ...roland
------------------------------
Date: Wed, 06 Jan 1999 12:03:27 +0000
From: Matt Sergeant <matthew.sergeant@eml.ericsson.se>
Subject: Re: Web server in perl
Message-Id: <3693510F.8D71355D@eml.ericsson.se>
Andy Davidson wrote:
>
> Is there a web server in perl? I am in need of very simple server for
> use on isloated laptops where I would like to add some form processing
> to a set of pages. Has anyone done this? I couldn't find anything
> searching CPAN et al.
There's a small one (not very functional, does in-process, GET only perl
CGI) on my web site. I use it for reading my ActivePerl documentation
because the ice2 perl search engine works rather nicely under it.
Mail me if you want a full setup including search engine.
--
<Matt/>
| Fastnet Software Ltd | Perl in Active Server Pages |
| Perl Consultancy, Web Development | Database Design | XML |
| http://come.to/fastnet | Information Consolidation |
------------------------------
Date: Wed, 6 Jan 1999 19:33:40 +0800
From: "REN, Rui" <rren@cs.ust.hk>
Subject: Windows NT - FrontPage server -- CGI - perl script
Message-Id: <76vhv2$qn1@ustsu10.ust.hk>
Hi,
I am running Frontpage on my PC.
Perl scripts can be run locally , but when they are accessed via the web,
ie. when a perl script is the target of a form in a remote webpage, the
client gets a error :
500 Server Error
The server encountered an internal error or misconfiguration and was unable
to complete your request
FrontPage does have a cgi-bin directory so I supppose CGI is already
installed. My guess is that FrontPage server is not properly configurered
to run perl sctipt, ie. it has not idea how to deal with that file.
What can I do about this ? One possible thing is to define a wrapper
batch file that calls the perl intepreter and the script , but how ?
thanks..
rui
------------------------------
Date: Wed, 06 Jan 1999 01:15:07 -0800
From: Trent <trent@jps.net>
Subject: Re: Writing Perl with Notepad <shameluss plug>
Message-Id: <3693299B.1B5@jps.net>
Try EditPad...
Power without the clutter.
------------------------------
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 4562
**************************************