[9284] in Perl-Users-Digest
Perl-Users Digest, Issue: 2879 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 15 23:18:14 1998
Date: Mon, 15 Jun 98 20:00:30 -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 Mon, 15 Jun 1998 Volume: 8 Number: 2879
Today's topics:
Re: $a: numeric or NOT ? (Keith Thompson)
Accessing an NT share via CGI Perl Script <vdaniels@nji.com>
Re: Array analogue of scalar 0? (Jason D Gloudon)
Re: double newbie pid problem <rootbeer@teleport.com>
Finding one's own answers (was: Re: Preventing file con <rootbeer@teleport.com>
Finding size of JPEG images in Perl (Mark Thompson)
Re: Finding size of JPEG images in Perl (Chris Nandor)
getting first letter of a string <ritche@san.rr.com>
Re: getting first letter of a string <lanier@shell6.ba.best.com>
Re: getting first letter of a string <*@qz.to>
Re: Have we got a good free Perl manual? birgitt@my-dejanews.com
Re: Have we got a good free Perl manual? (Paul David Fardy)
Re: Have we got a good free Perl manual? (Paul David Fardy)
Re: Large files (>2GB) on Solaris 2.6 (Brandon S. Allbery KF8NH)
Re: MAPI commands <rootbeer@teleport.com>
Re: New module/pragma "enum.pm" (was "fields.pm") (Kevin Reid)
Re: NEWBIE: CPAN module install location <rootbeer@teleport.com>
NT and Perl problems <kjones@inforamp.net>
Re: NT and Perl problems (Bob Trieger)
Perl 5 Install with GDBM support monica@qmaster.com
Re: Perl and Files <rootbeer@teleport.com>
perl cgi generated html with java app "class not found" (David Innes)
Re: perlre - %02x????? (Keith Thompson)
Re: REVIEW: Perl CGI Programming - No Experience Requir <tchrist@mox.perl.com>
Re: run as root, setuid to another id <rootbeer@teleport.com>
Simple Q - Splitting Array by Spaces <jesse@savalas.com>
Re: strange error message .. "value of <handle> ..." <rootbeer@teleport.com>
Re: Syntax error string when embedding in C++ (Ken Fox)
Using a file association for perl on NT 4.0 (susan cassidy)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 16 Jun 1998 02:42:45 GMT
From: kst@king.cts.com (Keith Thompson)
Subject: Re: $a: numeric or NOT ?
Message-Id: <897964963.67645@wagasa.cts.com>
Here's something I wrote for a calculator program. I have no idea how
efficient it is; it's quick enough for the interactive use to which I
put it, so I haven't bothered to benchmark it.
One advantage is that it uses Perl's own internal processing rather than
trying to second-guess it with a regular expression.
sub Is_Numeric {
my $arg = $_[0];
my $warning = undef;
{
local $SIG{'__WARN__'} = sub { $warning = $_[0] };
my $tmp = $arg + 0;
}
if (defined $warning) {
if ($warning =~ /numeric/) {
return 0; # non-numeric
}
else {
warn $warning; # some other warning (?)
return 0;
}
}
else {
return 1; # numeric
}
} # Is_Numeric
(I just realized that this doesn't work unless warnings are enabled;
since I always use "-w", I hadn't bothered to check this. Probably it
should locally set $^W to 1.)
An interesting note: This, like most solutions I've seen, doesn't accept
numbers with underscores. As far as I can tell, Perl accepts underscores
in numeric literals only in Perl source, not in data (unless it's passed
to eval). So, for example, in
$x = '99999';
$x ++;
$x is treated as a number and is incremented numerically to 100000, but in
$x = '99_999';
$x ++;
$x is treated as a string and is incremented to "100" (see the rules
for ++ on strings).
I couldn't find any mention of this issue in the Perl documentation;
perhaps it should be mentioned in perltrap.
--
Keith Thompson (The_Other_Keith) kst@cts.com <http://www.ghoti.net/~kst> <*>
Qualcomm, San Diego, California, USA <http://www.qualcomm.com>
It takes a Viking to raze a village.
------------------------------
Date: Tue, 16 Jun 1998 01:41:10 GMT
From: Vince Daniels <vdaniels@nji.com>
Subject: Accessing an NT share via CGI Perl Script
Message-Id: <3585CD36.A8D21C20@nji.com>
I have a CGI that needs to access a file by way of a shared directory.
When the
program is executed from a browser the file (and infact the drive
mapping or network path) is
not found. I understand that the difficulty lies in the fact that the
script is being executed by
a user that is not actually logged in and therefore has no network
access. My question is
how does one get around this?
Vince Daniels
------------------------------
Date: Mon, 15 Jun 1998 23:21:01 GMT
From: jdg@world.std.com (Jason D Gloudon)
Subject: Re: Array analogue of scalar 0?
Message-Id: <slrn6obb2r.hid.jdg@world.std.com>
Austin Schutz <spamsux-tex@habit.com> wrote:
..
..
>
> I guess my question is is there a way to have the null array
>() passed to a subroutine and not have the subroutine receive undef,
>as a 0 is null yet defined?
..
If you read the docs on defined() in the perlfunc manpage you will see
a warning about using defined on arrays and hashes.
You might want to try passing a reference to your array, and testing
whether or not it is empty instead.
thesub (\@thearray);
sub thesub {
if (@{$thesub}){ }
else { }
}
or
Since you aren't using & to call your subroutine you could define your
subroutine using a prototype so that the reference is automatically created.
#prototype
sub thesub(\@);
thesub (@thearray);
sub thesub {
if (@{$thesub}){ }
else { }
}
--
Jason Gloudon
------------------------------
Date: Tue, 16 Jun 1998 02:13:12 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: double newbie pid problem
Message-Id: <Pine.GSO.3.96.980615191000.17943L-100000@user2.teleport.com>
On Sun, 14 Jun 1998, Philip Antoniades wrote:
> Subject: double newbie pid problem
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> i am having trouble getting child process id's in a perl script.
It's the value returned to the parent process by a successful fork or open
on a pipe.
> but invoking with system() does not return the pid,
And it shouldn't need to, since system waits for the process to finish.
> and fork() does not let me run a process in the new pid.
It doesn't let you? What good is it, then? :-) Maybe you're not checking
fork's return value. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 16 Jun 1998 01:56:31 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Finding one's own answers (was: Re: Preventing file conflicts)
Message-Id: <Pine.GSO.3.96.980615183933.17943K-100000@user2.teleport.com>
On Sun, 14 Jun 1998 topmind@technologist.com wrote:
> > ...so I [sarcasm] will just ask for free consulting
> > help instead of looking things
> > up things in the docs on my own system."
> How about you set a threashold. How long should one spend lurking around
> in the manuals or included doc before they turn to a newsgroup? Please
> give an answer in minutes or hours. This should make it clear where
> "selfishness" ends.
If you have a Perl question and grepping the docs for the obvious keywords
fails, your question is welcome here. (Of course, we reserve the right to
point out some keywords more obvious than yours. :-)
Grepping the docs should take (roughly) no more time than posting a
message. Say, two minutes, tops, even if you're slow at thinking up words
to search for. :-) But typically, you should have answers within seconds.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 16 Jun 1998 00:19:05 GMT
From: mark-lists@webstylists.com (Mark Thompson)
Subject: Finding size of JPEG images in Perl
Message-Id: <3585b85c.6545273@news.alt.net>
Hi,
Is there a publically available routine that would allow me to find the
height and width of a JPEG image in Perl?
Thanks,
Mark
------------------------------
Date: Tue, 16 Jun 1998 02:02:03 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Finding size of JPEG images in Perl
Message-Id: <pudge-1506982159190001@dynamic404.ply.adelphia.net>
In article <3585b85c.6545273@news.alt.net>, mark-lists@webstylists.com
(Mark Thompson) wrote:
# Is there a publically available routine that would allow me to find the
# height and width of a JPEG image in Perl?
Try Image::Size on CPAN.
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: Tue, 16 Jun 1998 00:27:05 GMT
From: "Ritche Macalaguim" <ritche@san.rr.com>
Subject: getting first letter of a string
Message-Id: <tZih1.3127$pr4.1564214@proxye1.san.rr.com>
How can I get the first letter of a string in Perl?
Ritche
ritche@san.rr.com
------------------------------
Date: Mon, 15 Jun 1998 17:41:36 -0700
From: "matthew d. p. k. lanier" <lanier@shell6.ba.best.com>
Subject: Re: getting first letter of a string
Message-Id: <Pine.BSF.3.96.980615174002.1639M-100000@shell6.ba.best.com>
take a look at the camel book, p 227
i might do something like this:
$first_letter = substr ($string, 0, 1);
hope this helps!
On Tue, 16 Jun 1998, Ritche Macalaguim wrote:
> How can I get the first letter of a string in Perl?
>
> Ritche
> ritche@san.rr.com
matt =)
........................................................
: matthew d. p. k. lanier : sf perl user's group :
: matt@lanier.org : sfpug-request@pootpoot.com :
: matt@saturn5.com : http://www.pm.org :
........................................................
------------------------------
Date: 16 Jun 1998 02:06:31 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: getting first letter of a string
Message-Id: <eli$9806152138@qz.little-neck.ny.us>
Ritche Macalaguim <ritche@san.rr.com> wrote:
> How can I get the first letter of a string in Perl?
Five ways that I can think of off the top of my head.
($first)=$string=~/(.)/
$first=chr(ord($string))
(undef,$first)=split/(.)/,$string
$first=substr($string,0,1)
$first=unpack("A",$string)
Benchmark: timing 500000 iterations of RE, chr-ord, split, substr, unpack...
RE: 24 secs (18.55 usr 2.23 sys = 20.78 cpu)
chr-ord: 7 secs ( 6.30 usr 0.80 sys = 7.10 cpu)
split: 49 secs (32.82 usr 3.18 sys = 36.00 cpu)
substr: 7 secs ( 5.81 usr 0.47 sys = 6.28 cpu)
unpack: 17 secs (12.17 usr 1.26 sys = 13.43 cpu)
The chr-ord one is surprisingly fast.
Elijah
------
and split amusingingly slow
------------------------------
Date: Mon, 15 Jun 1998 23:15:12 GMT
From: birgitt@my-dejanews.com
Subject: Re: Have we got a good free Perl manual?
Message-Id: <6m49tv$v6d$1@nnrp1.dejanews.com>
In article <6m34u4$ohq@mozz.unh.edu>,
pas@unh.edu wrote:
>
> Is there some reason to pretend that RMS *doesn't*, at base, view this
> as a moral issue? I suppose it's easy to forget that, or not know it in
> the first place. A few weeks back, Barry Margolin reminded me (gently)
> that:
>
> In RMS's ideal world, people wouldn't feel the need to own
> software, so they wouldn't consider the above right an interesting
> thing to have. Just as 200 years ago slavery was considered normal
> by many people, but now it's considered abhorent. RMS wishes for a
> society in which intellectual property is considered as wrong as
> human property.
>
I would then remind you all gently that RMS ideal world where human
and intellectual property is considered wrong, has been tested
out in real life in the former German Democratic Republic for some
forty years or so.
I heard some rumors that this paradise 'didn't quite live up
to its potential'. 8-).
In the words of a former Eastgerman singer (Bierman), ...
"it all ends up it's socialistid way". (Es geht alles seinen
sozialistischen Gang). In case you don't know
what that means, ask other German posters here who are real
experts.
Birgitt Funk
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 16 Jun 1998 00:19:48 GMT
From: pdf@morgan.ucs.mun.ca (Paul David Fardy)
Subject: Re: Have we got a good free Perl manual?
Message-Id: <6m4dn4$uk7$1@coranto.ucs.mun.ca>
David Kastrup <dak@mailhost.neuroinformatik.ruhr-uni-bochum.de> writes:
>> Please come up with an actual quote to underline your wild
>> accusations.
lehman@visi.com (Todd Lehman) writes:
>Gee, David, you managed to snip my second paragraph, where I wrote, "I may
>be guilty of reading between the lines too much in RMS's post (which started
>this thread). But even after 5 readings, I still sensed snide and arrogant
>undertones..."
>I don't want to make any accusations, but to state opinions and observations,
>and I was hoping that RMS himself might be able to clarify a couple points.
>Be that as it may, here are the specific RMS passages which seemed dis-
>respectful (IMHO)... Feel free to point out any specific misinterpreta-
>tions I may have had.
I don't think that "specific misinterpretations" are the problem.
I think it's a basic philosophical disagreement. It's seems to me
that RMS's position on "free documentation" is simply consistent
with his views on "free software". If you think about it, many
would react to the idea of "free software" as you have reacted to
his advocating "free documentation".
Software needs documentation to be useful. One could infer that
good free software needs good free documentation, else strings
are attached to the software and the software isn't quite so
free after all.
Is the concept so radical? Is it such a stretch?
Senator: Do you mean to tell this committee that you give out
information over the phone to _anyone_ who calls in?
Witness: Yes, sir. I do.
Senator: What kind of information do you give out?
Witness: All kinds.
Senator: And does this organization you work for have a name?
Witness: Yes, sir, it does. It's called the Public Library.
-- from my memory of a TV ad broadcast after the Watergate hearings.
[ Does anyone remember if this played in the States?
Did it originate there, perhaps? ]
Sometimes it's just a matter of perspective.
**
It apears that the opinion expressed in the FSF documentation
list may just be stale: Richard Stallman's opinion that the docs
were "simply unreadable" may not apply--and should not--to the new
man pages. (I think that the "freedom to modify" issue is not
as significant.) He won't use non-free manuals; some people won't
eat meat; they are free not to do what they do not want to do,
free to talk about it, and free to advocate. I don't think
that RMS has gone beyond that.
"Give the software away, sell the book" is a good plan and a fair
one, but it's not as generous as "give the software, give the
documentation". It's hard to fault Richard Stallman for his
generous ideals--or his ideals of generosity--though you're free
to disagree with him. I think he writes from conviction. I don't
think he was antagonistic, sarcastic, or snobbish. He was simply
expressing his opinion; this is Usenet, after all.
It seems to me that Tom's complaint still stands unanswered,
though. The web page appears to ignore the Perl man pages: if
they are believed unfit, then the FSF tasks list should say so,
... and why. Is the web page simply stale? And it is a bit
strange that the page notes "There are propriety books" for Perl,
but does not make the same comment for the C reference manual
or for X-Windows. Maybe they simply expect more from the
Perl community.
**
I assume that Perl programmers agree that "free software" works:
that good free software, like the GNU apps and Perl, will be
created even without the monetary incentive. But I'm not so sure
that "free documentation" works. How many of those O'Reilly books
would have been produced if they were "free"? It's easy to see
how the software gets produced by people who just love to program,
but too many programmers hate to document and too few programmers
are any good at it; how many would write books or could afford to?
Paul Fardy
--
If you can't find something here you disagree with, then maybe
I left something out. :-)
------------------------------
Date: 16 Jun 1998 00:38:43 GMT
From: pdf@morgan.ucs.mun.ca (Paul David Fardy)
Subject: Re: Have we got a good free Perl manual?
Message-Id: <6m4eqj$t90$1@coranto.ucs.mun.ca>
In article <6m34u4$ohq@mozz.unh.edu>, pas@unh.edu wrote:
>> In RMS's ideal world, people wouldn't feel the need to own
>> software, so they wouldn't consider the above right an interesting
>> thing to have. Just as 200 years ago slavery was considered normal
>> by many people, but now it's considered abhorent. RMS wishes for a
>> society in which intellectual property is considered as wrong as
>> human property.
birgitt@my-dejanews.com writes:
>I would then remind you all gently that RMS ideal world where human
>and intellectual property is considered wrong, has been tested
>out in real life in the former German Democratic Republic for some
>forty years or so.
Funny, I thought that was an rather colonial authoritarian government
with an excessive military presence that treated its own citizens as
the enemy. Marx would probably have predicted its collapse.
But aren't we drifting off topic, just a bit.
Paul Fardy
--
Marx never read Chomsky. Naturally, he was more optimistic.
------------------------------
Date: 15 Jun 1998 19:53:39 -0400
From: allbery@kf8nh.apk.net (Brandon S. Allbery KF8NH)
Subject: Re: Large files (>2GB) on Solaris 2.6
Message-Id: <6m4c63$6ek$1@rushlight.kf8nh.apk.net>
Also sprach smcdow@arlut.utexas.edu (Stuart McDow) (<6m3bbp$dr4$1@ns1.arlut.utexas.edu>):
+-----
| Barry Roomberg <broom@voicenet.com> writes:
| > Issue:
| > Large file access (>2GB) via PERL on Solaris 2.6.
| This might be a system limitation (nothing to do with perl). Maximum
| file size is 2GB under Solaris 2.5.1. Haven't checked on 2.6 yet.
+--->8
You have to use a different system call for large file access: lseek()
uses an (unsigned long), llseek() takes an (unsigned long long). Perl
needs to be taught about llseek() on 2.6.
Note that stdio doesn't comprehend (long long) offsets.
Also note (taken from the llseek() man page):
LIMITATIONS
Although each file has a 64-bit file pointer associated with
it, existing file system types do not support the full range
of 64-bit offsets. In particular, non-device files remain
limited to offsets of less than two gigabytes. Device
drivers may support offsets of up to 1024 gigabytes for dev-
ice special files.
(Which means you're right: it's still a system limitation.)
--
brandon s. allbery [team os/2][linux][japh] allbery@kf8nh.apk.net
system administrator, ece facilities allbery@ece.cmu.edu
carnegie mellon university (bsa@kf8nh is still valid.)
------------------------------
Date: Tue, 16 Jun 1998 02:56:39 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: MAPI commands
Message-Id: <Pine.GSO.3.96.980615194942.17943Q-100000@user2.teleport.com>
On Mon, 15 Jun 1998, Guillaume Buat-Menard wrote:
> I have to put this up a soon as possible and I need to know the command
> and the options for MAPI. I'm trying to find something in the NT help
> but its really a waiste of time.
Maybe you should install a system with adequate documentation. But it
sounds as if you should check the docs, FAQs, and newsgroups about MAPI
and related topics. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 15 Jun 1998 22:25:10 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: New module/pragma "enum.pm" (was "fields.pm")
Message-Id: <1dao8rf.14fh37711qu5kwN@slip-32-100-246-88.ny.us.ibm.net>
REUBEN LOGSDON <rlogsdon@io.com> wrote:
> On Sat, 13 Jun 1998, [ISO-8859-1] Frangois Pinard wrote:
> > Zenin <zenin@bawdycaste.org> writes:
> >
> > > Speaking of which, anyone know an efficient way to see if a number
> > > is a power of 2 without needing a lookup table?
> >
> > Here is a fairly common idiom:
> >
> > unless ($n & ($n - 1)) {
> > # $n is an exact power of 2
> > }
>
> Pretty cool - how does that work?? What does the single ampersand
> operator do?
RTM, but I'll tell you the first time: & is bitwise and.
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: Tue, 16 Jun 1998 02:24:27 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: NEWBIE: CPAN module install location
Message-Id: <Pine.GSO.3.96.980615192304.17943N-100000@user2.teleport.com>
On 14 Jun 1998, nobi wrote:
> I'm searching for a way to install the CPAN module to
> my home directory. I don't have root access to install
> CPAN module to system.
I believe that there's good information on that in section eight of the
FAQ. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 15 Jun 1998 23:05:25 GMT
From: "Kevin Jones" <kjones@inforamp.net>
Subject: NT and Perl problems
Message-Id: <VMhh1.7$zQ1.486055@NewsRead.Toronto.iSTAR.net>
I spent all last week trying to find the answers to why I can't get
perl scripts to run over the web from our NT4 server.
I've drawn some conclusions but couldn't find anything 100% specific.
Can anyone shed any light on the following:
1. With NT 4, do I have to also install HTTPS.EXE?
2. The "POST" method in forms, gets the http error 405 "Method Not
Allowed". Is this because HTTPS is not installed? or am I missing
something.
3. If I install HTTPS on NT4, do I need to edit the registry, or just
map the MIME type.
4. What should be entered for the MIME settings, I guess PL would
obviously be the extension, but what about the rest?
Any help would be appreciated.
Thanks in advance.
------------------------------
Date: Mon, 15 Jun 1998 23:23:49 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: NT and Perl problems
Message-Id: <6m4ahd$qkt$2@strato.ultra.net>
[ posted and mailed ]
note change to follow-up
"Kevin Jones" <kjones@inforamp.net> wrote:
-> I spent all last week trying to find the answers to why I can't get
-> perl scripts to run over the web from our NT4 server.
->
-> I've drawn some conclusions but couldn't find anything 100% specific.
-> Can anyone shed any light on the following:
->
->
-> 1. With NT 4, do I have to also install HTTPS.EXE?
->
-> 2. The "POST" method in forms, gets the http error 405 "Method Not
-> Allowed". Is this because HTTPS is not installed? or am I missing
-> something.
->
-> 3. If I install HTTPS on NT4, do I need to edit the registry, or just
-> map the MIME type.
->
-> 4. What should be entered for the MIME settings, I guess PL would
-> obviously be the extension, but what about the rest?
You are way off base with this post. It has absolutely nothing to do with
perl. The groups that you should post your question to if you do not find your
answers in their FAQs are:
news:comp.infosystems.www.servers.ms-windows
news:microsoft.public.inetserver.iis
Good Luck
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-239-0341
and hang up when the recording starts. "
------------------------------
Date: Mon, 15 Jun 1998 19:42:00 GMT
From: monica@qmaster.com
Subject: Perl 5 Install with GDBM support
Message-Id: <358577ee.14796656@calicool>
Ok, so I'm installing perl 5.004_04
First thing I do is make a 'sh Configure -des' command (accept all
defaults)
I do a 'make', 'make test', and 'make install', but it doesn't work
right because there are no files in the installation directories.
At the end of the first make, I get:
--------------------------------------------------------------------------------------------------------------------
...
make config failed, continuing anyway...
Skip ../../lib/GDBM_File.pm (unchanged)
../../miniperl -I../../lib -I../../lib
./../lib/ExtUtils/xsubpp -noprototypes -typemap
./../lib/ExtUtils/typemap -typemap typemap GDBM_File.xs >GDBM_File.tc
&& mv GDBM_File.tc GDBM_File.c
cc -c -D_HPUX_SOURCE -Aa -I/usr/local/include -O
-DVERSION=\"1.00\" -DXS_VERSION=\"1.00\" +z -I../.. GDBM_File.c
Running Mkbootstrap for GDBM_File ()
chmod 644 GDBM_File.bs
LD_RUN_PATH="/usr/local/lib" ld -o
./../lib/auto/GDBM_File/GDBM_File.sl -b -L/usr/local/lib GDBM_File.o
-L/usr/local/lib -lgdbm
ld: DP-Relative Code in file /usr/local/lib/libgdbm.a(gdbmopen.o) -
Shared Library must be Position-Independent
*** Error exit code 1
Stop.
*** Error exit code 1
Stop.
--------------------------------------------------------------------------------------------------------------------
What does "Shared Library must be Position-Independent" for libgdbm.a
mean?
Please Help!
Monica Lillico
monica@qmaster.com
P.S. It's Perl v5.004_04 and GDBM v1.7.3
------------------------------
Date: Tue, 16 Jun 1998 01:35:11 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Perl and Files
Message-Id: <Pine.GSO.3.96.980615183406.17943I-100000@user2.teleport.com>
On Sat, 13 Jun 1998, Brent Verner wrote:
> if you open a file to write [ open (FILE, ">$filename"); ] the file will
> be created automatically.
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
Of course, the return value may show failure if the file can't be
created here. Thanks!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 15 Jun 1998 20:26:42 -0400
From: news@ravenstar.com (David Innes)
Subject: perl cgi generated html with java app "class not found"
Message-Id: <MPG.fef85c83b27a1c8989680@news.telerama.com>
Could use some help on this one, relatively new to perl.
I have a perl script which reads an existing html document and creates
another one from it, with minor changes. The newly created html document
can not find the Lake.class (which the java needs) while running in the
perl script. The new html doc runs fine on it's own with the Lake.class
in the same directory.
Any suggestions would be appreciated.
Thanks
------------------------------
Date: 16 Jun 1998 01:34:16 GMT
From: kst@king.cts.com (Keith Thompson)
Subject: Re: perlre - %02x?????
Message-Id: <897960856.50337@wagasa.cts.com>
Rich Grise (Rich.Grise@pemail.net) wrote:
> Is there a "stock" perlre that will substitute "%xx" for non-
> word characters? I have to pass a query string from one script
> to another, and re's are beyond my comprehension. I can write
> a 6-line script that'll do it, but is there an easier way?
Tom Phoenix mentioned URI::Escape (which I'm not familiar with), but
here's a regular expression substitution that should do the trick:
$s =~ s/\W/sprintf("%%%02x", ord($&))/eg;
A more general note: regular expressions, especially Perl regular
expressions, are very powerful. This makes it tempting to use them to
solve problems for which other tools may be more appropriate. You said
you had a 6-line script that solved your problem. Sometimes a 6-line
script just as good as, if not better than, a 1-line regular expression
that may look like modem line noise until you've studied it for 10
minutes. I don't think this is *quite* such a case, but it may be close
to the boundary line (depending on what your 6-line script looks like).
--
Keith Thompson (The_Other_Keith) kst@cts.com <http://www.ghoti.net/~kst> <*>
Qualcomm, San Diego, California, USA <http://www.qualcomm.com>
It takes a Viking to raze a village.
------------------------------
Date: 15 Jun 1998 22:59:57 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: REVIEW: Perl CGI Programming - No Experience Required
Message-Id: <6m491d$r8a$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
cberry@cinenet.net (Craig Berry) writes:
:: # On the array vs. list question: Would it be accurate to say that an array
:: # is an lvalue (in the C parser sense), a list an rvalue, and that the usual
:: # lvalue -> rvalue transformation is available?
Don't think so. The AV is the key.
Consider:
\(1,2,3)
vs
\@a
--tom
--
If you want to program in C, program in C. It's a nice language. I
use it occasionally... :-)
--Larry Wall in <7577@jpl-devvax.JPL.NASA.GOV>
------------------------------
Date: Tue, 16 Jun 1998 01:37:57 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: run as root, setuid to another id
Message-Id: <Pine.GSO.3.96.980615183712.17943J-100000@user2.teleport.com>
On Sat, 13 Jun 1998, Brian J. Murrell wrote:
> Running perl 5.004 (or nearso) I want to have a script which is running
> as root, setuid itself to another id.
Sounds as if you'll be working with $< and its cousins, documented in
perlvar. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 15 Jun 1998 18:51:38 -0700
From: Jesse Rosenberger <jesse@savalas.com>
Subject: Simple Q - Splitting Array by Spaces
Message-Id: <3585CFAA.AABB29E0@savalas.com>
I have a real simple question...(I think)...and I know that I know how
to do this, but I have not done it for sometime now. I have an array
called @options, it contains several numbers seperated by spaces (i.e.
62 63 65 67 69 70 81 96) the numbers may vary everytime. I need to be
able to have the script print an <option> tag for each one:
<option>62
<option>63
<option>65
<option> etc, etc...
I know this will be done with a foreach command, but I am just not
positive on how to do it. I'm sure it would only take a few lines of
code. I know about 90% of you are going to say, "look at the FAQ,
that's what it's for" or "read a tutorial". But, If someone could just
e-mail me a quick example...I would really appreciate it a lot. Thanks
in advance.
Jesse Rosenberger
------------------------------
Date: Tue, 16 Jun 1998 02:46:03 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: strange error message .. "value of <handle> ..."
Message-Id: <Pine.GSO.3.96.980615194533.17943P-100000@user2.teleport.com>
On 15 Jun 1998, Allan M. Due wrote:
> while ($tmp = defined <TMP>)
I do not think that that is what you meant.... :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 15 Jun 1998 23:23:01 GMT
From: kfox@pt0204.pto.ford.com (Ken Fox)
Subject: Re: Syntax error string when embedding in C++
Message-Id: <6m4acl$ctv6@eccws1.dearborn.ford.com>
David Brock <dwbrock@veribest.com> writes:
> If there is a syntax error in the script when I call perl_parse() I
> would like to display the text of the syntax error to the user.
You must slightly alter your program so that the code passed to
perl_parse() is completely under your control. Try to make this code
as solid as possible. If perl_parse() fails there isn't any way
to recover.
Once perl_parse() finishes, you can use perl_call_sv() to call a
custom eval function. Use this as your eval function:
my $warning_message;
sub warnhook {
$warning_message .= $_[0];
}
sub eval_with_warning {
my $code = shift;
$warning_message = '';
$SIG{'__WARN__'} = \&warnhook;
my $return_value = eval $code;
$SIG{'__WARN__'} = undef;
if (wantarray) {
return ($return_value, $warning_message);
}
return $return_value;
}
sub get_warning () {
return $warning_message;
}
Use perl_get_cv() to get the CV * of eval_with_warning(). You can
get the warning message (if any) using either array context or the
function get_warning().
If you'd like to read the warning message directly, $warning_message
must be a local variable (so it gets a symbol table entry). Use
perl_get_sv() to lookup the SV * from C and then fetch the warning
message the same way you would any other scalar.
It's unlikely that you have an existing __WARN__ handler, but you might
want to save the handler if you feel like being sociable with other
code.
Here's some simple Perl code to test eval_with_warning().
my $r;
$r = eval '$x oops';
print 'return=<<', $r, ">>\n";
print '$@=<<', $@, ">>\n";
$r = eval_with_warning '$x oops';
print 'return=<<', $r, ">>\n";
print '$@=<<', $@, ">>\n";
print 'warning=<<', get_warning, ">>\n";
Hope this helps.
- Ken
--
Ken Fox (kfox@ford.com) | My opinions or statements do
| not represent those of, nor are
Ford Motor Company, Powertrain | endorsed by, Ford Motor Company.
Analytical Powertrain Methods Department |
Software Development Section | "Is this some sort of trick
| question or what?" -- Calvin
------------------------------
Date: 15 Jun 1998 12:54:06 -0700
From: susanc@news.SanDiegoCA.ncr.COM (susan cassidy)
Subject: Using a file association for perl on NT 4.0
Message-Id: <6m3u4u$qlr@ssd3450.SanDiegoCA.NCR.COM>
I have not seen this advice before, but I have been using this setup
to enable me to run perl programs from the command line under NT 4.0
without having to say "perl xxx" or use pl2bat or runperl, etc.
In Explorer, under View, Options, File Types, associate perl so that
the action is set to "open", and the "application used to perform action" is:
path_to_perl "%1" %*
where path_to_perl is wherever your perl.exe is.
So far I can use any number of parameters and just say:
myscript a b c d e f
and have it work just like under unix.
--
Susan Cassidy
Remove xxx in replyto address when replying.
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 2879
**************************************