[6980] in Perl-Users-Digest
Perl-Users Digest, Issue: 605 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 12 08:17:18 1997
Date: Thu, 12 Jun 97 05:00:41 -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 Thu, 12 Jun 1997 Volume: 8 Number: 605
Today's topics:
­ was Re: global regex in an "if" statement <flavell@mail.cern.ch>
Re: Accumulating statistics (Tad McClellan)
Re: Better way to split long strings into equal length (Tony Bass)
Re: Better way to split long strings into equal length (Tony Bass)
Re: Code examples: right justify text? <matkin@zeke.update.uu.se>
Re: Debugging Extensions -- cgidebug.pm <sanford@halcyon.com>
Re: Disk Space and Free INODES ( Thomas Lachlan XMS x4206 )
Re: Does print() buffer output? (Kyzer)
Re: how to make a script executable on DOS <tschutj@xmission.com>
how-to recognize numeric input? <hkchan@singnet.com.sg>
long file names and perl NLM - Novell IntranetWare? (Thom Bunting)
Matching & Design Approach <eric@hilding.com>
Re: Need help with PERL! (marc spitzer)
New Intel v. Randal Schwartz Web Site (Jeffrey Kegler)
Nude Cheerleaders over there? jimdec@internetix.net
Re: OO perl slow? (Peter Lees)
Open2 Example? (Michael Caver)
Page Break command in Perl? <eric@hilding.com>
Re: Page Break command in Perl? <joshua@mongoose.demon.co.uk>
Re: Passwording (on UNIX) (Kyzer)
Re: Problems with dynamic linking Perl 5 on Solaris 2.5 (DUTKA-MALEN Ivan)
Re: Problems with dynamic linking Perl 5 on Solaris 2.5 (Casper H.S. Dik - Network Security Engineer)
Re: strings <rra@stanford.edu>
test <hkchan@singnet.com.sg>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 12 Jun 1997 10:14:23 GMT
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: ­ was Re: global regex in an "if" statement
Message-Id: <Pine.A41.3.95a.970612115834.94516F-100000@sp054>
Excuse me for picking up a totally off-topic point for clpm here...
On Wed, 11 Jun 1997, Tad McClellan wrote:
> __DATA__
> <P>Curriculum requirements are being reviewed by the faculty. A list of
> requirements for 1997­98
This appears to be HTML. Double apologies if that assumption is wrong.
HTML defines ­ (­) to be the soft-hyphen. That is to say, a
point at which it might be appropriate to break the line, in which case
a hyphen should be displayed before the break, otherwise nothing should
be displayed. Ref: RFC2070. It's intended for suggesting hyphenation
points in long words. I.e a properly compliant browser would render the
above as either (if the line didn't break at that point)
... A list of requirements for 199798 ...
or, if the line happened to break at that point
... A list of requirements for 1997-
98 ...
(Few browsers support this yet, though, and there's a popular
misconception floating around that this is some kind of straightforward
dash character, although I know of no standards document that ever said
so.)
--
Best wishes to the residents of Eigg, hope it all goes well for you.
------------------------------
Date: Wed, 11 Jun 1997 23:49:06 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Accumulating statistics
Message-Id: <24vnn5.0ia.ln@localhost>
Joseph Weinman (josephw@tamu.edu) wrote:
: I am trying to use perl to keep track of a type of database "fulltext".
: This type can be almost anything, an Article, Review, Editorial, etc.
: Since I do not know all the different elements "type" can have, I was
: wondering if it were possible to have perl accumulate the ones that
: appear in a log.
: For example, say the first fulltext type is an Article. That is easy
: enough to store. The next time the type is a Review. A simple if
: statement to see if the second==first would be easy. The thrid is an
: Editorial. The simple if statement would work again. But the fourth
: time say it is a Review. If these are the only 4 entries, I would want
: to be able to say "There are 1 Article(s) viewed, 2 Review(s) viewed,
: and 1 Editorial(s) viewed."
: Is there a function of perl that would allows this easily? I assume
: some kind of array and one would search the array to see if the new
^^^^^^^^^^^^^^^^^^
An "associative array", also known as a "hash".
: "type" was already seen before. Can this be done? Any help in syntax
: would be greatly appreciated.
Can't help with the syntax much, because you haven't told us how
to identify the different "types"...
So, I'll assume that a line starting with a "type" name indicates
the type.
UNTESTED:
while (<>) {
$viewed{$1}++ if /^(Article|Review|Editorial)/;
}
foreach (sort keys %viewed) {
print "There are $viewed{$_} $_(s) viewed\n";
}
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 12 Jun 1997 09:40:59 +0100
From: aeb@brains.cartoon.bt.co.uk (Tony Bass)
Subject: Re: Better way to split long strings into equal length parts?
Message-Id: <5nocmr$js9$1@brains.cartoon.bt.co.uk>
>From article <5nmq1q$fdh$1@ratatosk.uio.no>, by kjetil.skotheim@usit.uio.no (Kjetil Skotheim):
>
> What is the fastest and/or most elegant way to split a long
> string into equal length parts into a list.
calf$ cat divi
#! /usr/local/bin/perl -w
#use strict;
my $partlength = 3;
grep { print "$_\n"; } ('abcdefghijklmnopqrstuvwxyz' =~ m/.{1,$partlength}/g);
exit 0;
calf$
calf$ divi
abc
def
ghi
jkl
mno
pqr
stu
vwx
yz
calf$
or just m/.{$partlength}/g depending on how one wants to deal with
anything left over at the end.
This technique assumes that the string is not too binary - one can do
better than /./ but I am not sure if one can handle entirely binary
material like this.
Tony Bass
--
# A E Bass Tel: (01473) 645305
# MLB 3/19, BT Laboratories e-mail: aeb@saltfarm.bt.co.uk
# Martlesham Heath, Ipswich, Suffolk, IP5 7RE DO NOT e-mail to From: line
# Opinions are my own
------------------------------
Date: 12 Jun 1997 09:56:36 +0100
From: aeb@brains.cartoon.bt.co.uk (Tony Bass)
Subject: Re: Better way to split long strings into equal length parts?
Message-Id: <5nodk4$k37$1@brains.cartoon.bt.co.uk>
>From article <5nmq1q$fdh$1@ratatosk.uio.no>, by kjetil.skotheim@usit.uio.no (Kjetil Skotheim):
>
> What is the fastest and/or most elegant way to split a long
> string into equal length parts into a list.
calf$ cat divi
#! /usr/local/bin/perl -w
#use strict;
my $x = 'abcdefghijklmnopqrstuvwxyz';
my $partlength = 3;
grep { print "$_\n"; }
map { substr $x, $_*$partlength, $partlength; }
0..int((length($x)-1)/$partlength);
exit 0;
calf$
calf$ divi
abc
def
ghi
jkl
mno
pqr
stu
vwx
yz
calf$
The .. costs space.
Tony Bass
--
# A E Bass Tel: (01473) 645305
# MLB 3/19, BT Laboratories e-mail: aeb@saltfarm.bt.co.uk
# Martlesham Heath, Ipswich, Suffolk, IP5 7RE DO NOT e-mail to From: line
# Opinions are my own
------------------------------
Date: 12 Jun 1997 10:52:38 +0200
From: Matz Kindahl <matkin@zeke.update.uu.se>
Subject: Re: Code examples: right justify text?
Message-Id: <yf5oh9c5hk9.fsf@Zeke.Update.UU.SE>
frelbel@csn.net (Fred Elbel) writes:
>
>> In article <33946969.11658356@news-2.csn.net>
>> frelbel@N0SPAMcsn.net (Fred Elbel) writes:
>>
>>> I'm about to design a routine to right justify text paragraphs, but
>>> perhaps it's already been done...
>
> On 4 Jun 1997 16:08:14 GMT, Ronald.J.Kimball@dartmouth.edu (Chipmunk)
> wrote:
>
>> Do you want all the lines to be exactly 55 characters long (with added
>> spaces between words to get the necessary length) or at most 55
>> characters long?
>
> At most 55 chars. "Ragged right" margins would be fine.
>
>> Is it okay to join shorter lines together, or do you only want to split
>> long lines?
>
> Yes, lines should be joined..
>
>> What should be done if there is a string of consecutive non-white space
>> characters longer than 55 characters?
>
> Ideally, it should not happen. If such a string occurs, I'd probably
> insert a hyphen and \n.
[snip]
If all you need is ragged right and joined lines, the following
one-liner might be of help. It wraps at the last whitespace found in
the interval 50-72. You can change that to any inverval you like.
perl5 -p000e 'tr/ \t\n\r/ /s;s/(.{50,72})\s/$1\n/g;$_.="\n"x2'
As an ordinary perl-program it appears as:
$/ = '';
while (<>) {
# Replace sequences of whitespace with one space.
tr/ \t\n\r/ /s;
# Replace last whitespace found at between 50 to 72
# characters from the beginning of the string or from
# the end of the last match
s/(.{50,72})\s/$1\n/g;
# Add two newlines to make it a paragraph again.
$_. = "\n" x 2;
}
It doesn't handle words longer than 72 letters though, and it doesn't
insert spaces to get the lines to 72 characters either.
Just my five cents.
Regards,
Mats Kindahl / Department of Computer Systems, Uppsala University, Sweden
"People do strange things when you give them money."
-- Simple Minds
------------------------------
Date: 11 Jun 1997 22:36:33 -0700
From: Sanford Morton <sanford@halcyon.com>
To: cameron@advancedsw.com
Subject: Re: Debugging Extensions -- cgidebug.pm
Message-Id: <m3wwo0wffi.fsf@darkstar.frop.org>
"Cameron W. Skinner" <cameron@advancedsw.com> writes:
> Just wondering how one would go about debugging a perl extension in context
> with the C++ app that is calling subroutines in that extension. What would
> REALLY be cool, is if the debugger would pop up, causing the calling app to
> stop processing while we step through the perl debugger.
If you are running a web server on localhost, the following launches
an xterm with the perl debugger running your cgi script. Perhaps you
can adapt these ideas.
--------
Sanford Morton, Ph.D. CGI Resources
sanford@halcyon.com http://www.halcyon.com/sanford/cgi/
# Perl/CGI debugging module: cgidebug.pm
# usage: In your cgi script say
# use cgidebug;
# near the top, in particular, before calls to
# CGI.pm or cgi-lib.pl or whatever reads the form data.
package cgidebug;
# Have we already turned on the debugger?
# If so, let's not launch another one
return 1 if $ENV{'CGI_DEBUG'} eq 'on';
# For methods POST and GET, read in all the form data.
if ($ENV{'REQUEST_METHOD'} eq 'POST') {
$_ = join ('', <STDIN>);
} elsif ($ENV{'REQUEST_METHOD'} eq 'GET') {
$_ = $ENV{'QUERY_STRING'};
} else {
print "Content-type: text/html\n\nThis debugging
technique only supports POST or GET";
exit;
}
# Turn DEBUG off so debugger won't execute this block of code
# and run another dubugger
$ENV{'CGI_DEBUG'}='on';
# Turn REQUEST_METHOD off so cgi-lib.pl will use command line
# debugging mode. Needed for the debugger and also after this block.
# Then separate the form data into distinct arguments
$ENV{'REQUEST_METHOD'}='';
s/&/ /g;
# Get file name without path. Without a path, the pwd of the debugger
# will be the script's directory. This is useful to find relative
# libraries or modules. Also remove query string and path info,
# which will be passed in the environment.
my $script = $ENV{'SCRIPT_FILENAME'};
$script =~ s/\?$ENV{'QUERY_STRING'}$// if $ENV{'QUERY_STRING'};
$script =~ s/$ENV{'PATH_INFO'}$// if $ENV{'PATH_INFO'};
$script =~ s#.*/([^/]*)$#$1#;
# Launch an rxvt with perl -d in it on this script file.
# Pass space-separated form data as command line arguments.
# The environment is also passed implicitly.
system "/usr/X11R6/bin/rxvt -e perl -d $script $_";
# When debugger is finished, allow the server-run script to
# continue. (If it hasn't already timed out.) Set the form data in
# @ARGV so it will think it's reading data from the command line.
@ARGV = split (/ /);
return 1;
------------------------------
Date: 12 Jun 1997 08:20:00 GMT
From: etltsln@etlxd30.ericsson.se ( Thomas Lachlan XMS x4206 )
Subject: Re: Disk Space and Free INODES
Message-Id: <5nobfg$4st@newstoo.ericsson.se>
Tom Phoenix (rootbeer@teleport.com) wrote:
: On Wed, 11 Jun 1997, The Old Wolf wrote:
: > I need a platform independent method of determining free space in a file
: > system (Preferably faster then writing a test file till it fails ;) )
: There isn't one. :-( But you could make people happy by making an
: extensible module which works on as many systems as possible. On many
: systems, it could run a program like df and parse the output. Good luck!
: -- 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/
Hi,
Although you said UNIX independent. The UNIX dependent command
'pstat -T', should give you the inode info. you require. I know
I'm not answering your question. But there is the vaguest ? outside
chance that this info. may assist.
Regards Tam
------------------------------
Date: 11 Jun 1997 16:01:07 GMT
From: junkmail@sysc.abdn.ac.uk (Kyzer)
Subject: Re: Does print() buffer output?
Message-Id: <5nmi43$i88@info.abdn.ac.uk>
Anthony J Terlecki, while smelling of fish, wrote:
: Can anyone tell me why this is and how I might get around it?
"Does print() buffer output?"
Depends on the value of the $| variable - see the perlvar manpage for more
info.
--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac |My opinions aren't those of Aberdeen |Amiga -
kyzer@4u.net kyzer@hotmail.com |University or AUCC, thankfully.***** |always!
--
Random sig of the day:
Warning: .sig copier in use - will your sig be next?!
------------------------------
Date: Wed, 11 Jun 1997 08:02:11 -0600
From: Tyler Schutjer <tschutj@xmission.com>
Subject: Re: how to make a script executable on DOS
Message-Id: <339EAFE3.F38@xmission.com>
This has always worked for me
C:\PERL\PERL PERLFILE
(the sole contents of a file called "master.bat" - "PERLFILE" being the
perl code, of course...)
Ray McVay wrote:
>
> Larry D'Anna wrote:
> >
> > Does anyone know how to make a pearl script executable on a dos machine?
>
> You turn it into a batch (*.BAT) file that invokes perl and passes the
> batch file as the perl program. Every DOS perl I've seen came with
> something like a pl2bat or perl2bat perl program for doing this
> conversion.
------------------------------
Date: Thu, 12 Jun 1997 16:31:53 +0800
From: hkchan <hkchan@singnet.com.sg>
Subject: how-to recognize numeric input?
Message-Id: <339FB3F9.3BE0@singnet.com.sg>
Hi,
I'm a beginner of Perl. Currently I'm facing a problem of wrinting cgi
program, that is trying to differentiate the input data is numeric
integer but not string literals.
Can anyone teach me how-to ?
Thanks, and much appreciate.
HK Chan
------------------------------
Date: Thu, 12 Jun 1997 08:51:22 +0100
From: thom@tcb-consulting.com (Thom Bunting)
Subject: long file names and perl NLM - Novell IntranetWare?
Message-Id: <thom-1206970851220001@thomb.demon.co.uk>
Although the Novell web site's faq says that long file name support
"is fixed in PERL.NLM ver. 4.60w (and later)," we're finding that long
file names are not being recognized in version 4.60x.
We've tried a clean re-install of Netware 4.11 and the perl NLM 4.60x on
server volume with long filename support enabled. Perl NLM 4.60x still
does recognize long file names.
In a readdir call, all file names are listed in 8.3 format and long
filenames in the directory are truncated.
This creates a severe limitation when working on html files that don't
conform to 8.3 name conventions.
If anyone does have experience with perl running under netware and can
give some pointers, we'll be grateful.
Thom Bunting
------------------------------
Date: Thu, 12 Jun 1997 03:40:52 -0700
From: Eric Hilding <eric@hilding.com>
Subject: Matching & Design Approach
Message-Id: <339FD234.1781@garlic.com>
I could sure use an added jump start to try and move
ahead past this point where I'm stuck...on matching
and how to finalize an approach to this problem.
Objective: Read in a (rawtext) file and skip some
initial lines until a 'clientname line' which starts
flush left but will have at least 30 blank spaces
from flush right. Somehow, write each record to
an array or temp file, keyed to 'clientname', so as
to be able to rewrite the unsorted records in a sorted
fashion to the (results) file in clientname sequence
for eventual printing.
There will only be about 5 and maybe 50 records maximum
during any one conversion "session", with about 25 lines
of text per each record. The (rawtext) data is in a real
kludge-o format coming out of a mainframe.
Also, parse out/extract the 'clientname' and several other
pieces of info to write to a separate ascii .csv file for
use with another program. I can do this okay I think.
Here's my start, but based upon simply writing the
wanted lines in sequence to the (results) file. I
can't seem to figure out the matching for the 'clientname'
line in order to move ahead...ummh, crawl ahead.
#Start of actual .pl file - WIN95 Ported
open (INFILE, "rawtext");
while ($line = <INFILE>)
{
if ($line != m/^\s+/ && $line =~ m/\s{30,}$/)
{
&resultstextfile;
}
}
# code for writing additional rawtext lines to file
# until the last wanted line --- then repeat loop
# put individual records by 'clientname' to array?
# parse out variables for writing to ascii .csv file
close (INFILE);
# temporary file for testing output
sub resultstextfile
{
open (OUTFILE, ">>results");
print OUTFILE "$line";
close (OUTFILE);
}
Thanks for any insights and/or suggestions.
Eric
------------------------------
Date: 12 Jun 1997 06:33:25 GMT
From: spitzerm@ws14.ug.cs.sunysb.edu (marc spitzer)
Subject: Re: Need help with PERL!
Message-Id: <5no57l$sfs$1@abel.ic.sunysb.edu>
Well here is my 2 cents:
open(DATA, "your.data");
print grep(/$what/i, <DATA>);
if grep returns a empty array then print has nothing
to print.
marc
------------------------------
Date: 12 Jun 1997 10:00:38 GMT
From: cybersalem@algorists.no.spam.com (Jeffrey Kegler)
Subject: New Intel v. Randal Schwartz Web Site
Message-Id: <5nohc6$nsc@samba.rahul.net>
There is a new Web Site on Oregon's prosecution of Randal Schwartz at
the behest of Intel: <URL:http://www.rahul.net/jeffrey/ovs/>. The top
level page features an up-to-date, brief but reasonably comprehensive
description of the matter.
For those who don't know, the well-known Perl expert Randal Schwartz is
also a convicted triple felon, under what will hopefully remain very
unusual circumstances.
Cheers!
Jeffrey Kegler
cybersalem@algorists.com
------------------------------
Date: 12 Jun 1997 06:36:48 GMT
From: jimdec@internetix.net
Subject: Nude Cheerleaders over there?
Message-Id: <5no5e0$4hl$63@nw001.infi.net>
Hey, just thought i'd share with everyone,
I found a site with loads of nude CHEERLEADERs. The
address is:
http://www.mid-night.com/cheer.htm
--Jason--
(Sorry for the intrusion, everyone needs some short skirts in their life)
P.S. They also have a few thounsand celebrities but im not into that.
------------------------------
Date: 12 Jun 1997 06:43:26 GMT
From: peter@junior.next.com.au (Peter Lees)
Subject: Re: OO perl slow?
Message-Id: <5no5qe$qbj@inferno.mpx.com.au>
On Tue, 10 Jun 1997 10:00:51 -0700, Tom Phoenix (rootbeer@teleport.com) wrote:
> On 10 Jun 1997, Peter Lees wrote:
> > i've been writing a few perl programs using fairly strict OO,
> > and am concerned that they run verrrrry slowly.
> Could you tell us what version of Perl you're running? I don't recall any
> recent speed enhancements, but the latest is 5.004. (You can find the
> version with 'perl -v'.) Hope this helps!
well , perl5.003 and perl5.004 both demonstrate relative slowness...
i think it's more the technique i am using than the actual binary.
p
--
Peter Lees (peter@next.com.au) - Technical Manager, Next Online
tel: +61 2 9310 1433 * fax: +61 2 9310 1315 * http://www.next.com.au
"You can have a day off when you're dead, Baldrick, and not before..."
------------------------------
Date: Thu, 12 Jun 1997 04:44:23 GMT
From: ratboy@cyberenet.net (Michael Caver)
Subject: Open2 Example?
Message-Id: <5nnv1t$peb@news.tamu.edu>
Can someone give me an example of how the open2() function works?
I've checked every Perl WWW site and FAQ I can find, but I still
can't find an example that helps me much.
What I'm trying to do is print to a program on my system, which will
result in output that I want the script to read and manipulate. I
know that open(FILE, '| program |') won't work, so I'm a bit stuck.
Thanks,
Michael
------------------------------
Date: Thu, 12 Jun 1997 00:46:12 -0700
From: Eric Hilding <eric@hilding.com>
Subject: Page Break command in Perl?
Message-Id: <339FA944.4159@hilding.com>
I've searched the indexes in 3 Perl books but can't find a listing
for a 'page break' command.
Just porting Perl to WIN95, I need to read in a large file of
text, and parse out records into another text file for later
printing. The *length* of each record will vary, but 2 to a
page will fit. If there is only 1 record "per person", then
I must print only 1 per page. This will be a daily process.
I can not establish a firm print format in Perl, because the
format of the record data is too volatile and changes ;(
Is there *any* way to add a 'page break' command that will be
picked up by most printers? The written-to-file must be printed
out via another program, and I need to use Perl to parse out data.
Thank you.
Eric Hilding
eric@hilding.com
------------------------------
Date: Thu, 12 Jun 1997 10:18:46 +0100
From: Joshua <joshua@mongoose.demon.co.uk>
Subject: Re: Page Break command in Perl?
Message-Id: <339FBEF6.860@mongoose.demon.co.uk>
Eric Hilding wrote:
> Is there *any* way to add a 'page break' command that will be
> picked up by most printers? The written-to-file must be printed
> out via another program, and I need to use Perl to parse out data.
>
> Eric Hilding
Maybe a form feed?
print FILE "\x0c\n";
--
Joshua Swink
joshua@mongoose.demon.co.uk
------------------------------
Date: 11 Jun 1997 19:14:41 GMT
From: junkmail@sysa.abdn.ac.uk (Kyzer)
Subject: Re: Passwording (on UNIX)
Message-Id: <5nmtf1$r5l@info.abdn.ac.uk>
Hurrah, for 'tis said that TechMaster Pinyan did write:
: Is there a way to NOT show what characters a user is typing for the
: purpose of entering passwords? Thanks in advance, even if no one knows.
^^^^^^^^^^^^^^^^^^^^
That's the bit I like best :)
Anyway, you're a pretty clever guy, so you'll have no trouble finding the
answer in the docs that came with perl - you were talking about perl, yes?
See perlfaq8 (System Interaction) "How do I ask the user for a password" -
The general idea is to use the stty command, although this is a unix command -
for other systems without this handy command, you'll need to look up the
appropriate Control Sequences table.
--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac |My opinions aren't those of Aberdeen |Amiga -
kyzer@4u.net kyzer@hotmail.com |University or AUCC, thankfully.***** |always!
--
Random sig of the day:
DC.W f+++ s+++ df h++++ Csilv a+ $+++ m d--- WL++ Fr---- Bslobber
------------------------------
Date: 12 Jun 1997 11:50:33 +0200
From: dutka@rantanplan.dr.gdf.fr (DUTKA-MALEN Ivan)
Subject: Re: Problems with dynamic linking Perl 5 on Solaris 2.5.1
Message-Id: <xllwwo0jgk6.fsf@rantanplan.dr.gdf.fr>
In article <339401eb.522961201@nntp> jeaton@galt.com (jeaton) writes:
> I'm getting really desperate now. Any hep at all would be greatly
> appreciated...
>
> The facts: Solaris 2.5.1. GCC 2.7.2.1. Perl 5.003.
>
> I made sure not to use GNU ld or as when compiling. I'm calling gcc
> with -shared to compile dynamic libraries. I don't know what else to
> do... I'm still getting these errors when running "make test":
>
> lib/anydbm.....Can't load '../lib/auto/Fcntl/Fcntl.so' for module
> Fcntl: ld.so.1: ./perl: fatal: relocation error: symbol not found:
> Perl_markstack_ptr: referenced in ../lib/auto/Fcntl/Fcntl.so at
> ../lib/DynaLoader.pm line 140.
>
[...] skipping
>
>
> # ./perl -v
>
> This is perl, version 5.003 with EMBED
> built under solaris at Jun 2 1997 13:21:44
> + suidperl security patch
>
> Copyright 1987-1996, Larry Wall
>
> Perl may be copied only under the terms of either the Artistic License
> or the
> GNU General Public License, which may be found in the Perl 5.0 source
> kit.
>
> # ./perl -V
> Summary of my perl5 (5.0 patchlevel 3 subversion 0) configuration:
> Platform:
> osname=solaris, osver=2.5.1, archname=sun4-solaris
> uname='sunos ts0.galt.com 5.5.1 generic sun4u sparc sunw,ultra-1 '
> hint=recommended, useposix=true, d_sigaction=define
> Compiler:
> cc='gcc', optimize='-O', gccversion=2.7.2.1
> cppflags='-I/usr/local/include'
> ccflags ='-I/usr/local/include'
> stdchar='unsigned char', d_stdstdio=define, usevfork=false
> voidflags=15, castflags=0, d_casti32=define, d_castneg=define
> intsize=4, alignbytes=8, usemymalloc=y, randbits=15
> Linker and Libraries:
> ld='gcc', ldflags =' -L/usr/local/lib'
> libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
> libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
> libc=/lib/libc.so, so=so
> Dynamic Linking:
> dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=, ccdlflags=' '
> cccdlflags='-fpic', lddlflags='-G -L/usr/local/lib'
>
> @INC: /usr/local/lib/perl5/sun4-solaris/5.003 /usr/local/lib/perl5
> /usr/local/lib/perl5/site_perl/sun4-solaris
> /usr/local/lib/perl5/site_perl .
I have exactly the same problem, but I think it won't help you much...
my configuration is very close to yours, and I can't have PERL passing
the test successfully.
I've tried the SUN cc compiler version 4.0 and the gcc compiler without
success (though the errors aren't the same).
Could anybody give us some clue ?
Any help appreciated.
Here is my configuration:
- Sun ultra with solaris 2.5.1
- cc compiler v4.0
- gcc compiler v2.7.2.2
- perl 5.004
(dutka)[/export/home/dutka/perl5.004] $ ./perl -I ./lib -V
Summary of my perl5 (5.0 patchlevel 4 subversion 0) configuration:
Platform:
osname=solaris, osvers=2.5.1, archname=sun4-solaris
uname='sunos rantanplan 5.5.1 generic sun4u sparc sunw,ultra-1 '
hint=recommended, useposix=true, d_sigaction=define
bincompat3=n useperlio= d_sfio=
Compiler:
cc='gcc', optimize='-O -g', gccversion=2.7.2.2
cppflags='-DDEBUGGING -I/usr/local/include'
ccflags ='-DDEBUGGING -I/usr/local/include'
stdchar='unsigned char', d_stdstdio=define, usevfork=false
voidflags=15, castflags=0, d_casti32=define, d_castneg=define
intsize=4, alignbytes=8, usemymalloc=y, randbits=15
Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
libc=, so=so
useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=, ccdlflags=' '
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: DEBUGGING
Built under solaris
Compiled at Jun 12 1997 11:21:46
@INC:
./lib
/usr/local/lib/perl5/sun4-solaris/5.004
/usr/local/lib/perl5
/usr/local/lib/perl5/site_perl/sun4-solaris
/usr/local/lib/perl5/site_perl
.
Thanks in advance.
--Ivan
PS: I did use '-shared' option of GCC instead of '-G'...
--
------------------------------------------------------------------------------
Ivan DUTKA-MALEN
dutka@dr.gdf.fr
------------------------------
Date: 12 Jun 1997 11:18:10 GMT
From: Casper.Dik@Holland.Sun.COM (Casper H.S. Dik - Network Security Engineer)
Subject: Re: Problems with dynamic linking Perl 5 on Solaris 2.5.1
Message-Id: <casper.866114425@uk-usenet.uk.sun.com>
dutka@rantanplan.dr.gdf.fr (DUTKA-MALEN Ivan) writes:
>In article <339401eb.522961201@nntp> jeaton@galt.com (jeaton) writes:
>> The facts: Solaris 2.5.1. GCC 2.7.2.1. Perl 5.003.
>>
>> lib/anydbm.....Can't load '../lib/auto/Fcntl/Fcntl.so' for module
>> Fcntl: ld.so.1: ./perl: fatal: relocation error: symbol not found:
>> Perl_markstack_ptr: referenced in ../lib/auto/Fcntl/Fcntl.so at
>> ../lib/DynaLoader.pm line 140.
>>
This looks like parts have been compiled w/ perl5.003 compatibility and
other parts haven't. The Perl_markstack_ptr is the new name for the
markstack_ptr symbol.
This looks like some sort of perl5.003/perl5.004 combination.
>I have exactly the same problem, but I think it won't help you much...
>my configuration is very close to yours, and I can't have PERL passing
>the test successfully.
>I've tried the SUN cc compiler version 4.0 and the gcc compiler without
>success (though the errors aren't the same).
So what are your errors? I had no problem whatsover with 5.00393 on
2.5.1 (x86 & SPARC) w/ Sun's 4.2 compilers.
Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
------------------------------
Date: 12 Jun 1997 04:39:37 -0700
From: Russ Allbery <rra@stanford.edu>
To: trit@olympic.seas.ucla.edu (Tri Duy Tram)
Subject: Re: strings
Message-Id: <m34tb4kq2u.fsf@windlord.Stanford.EDU>
[ Posted and mailed. ]
Tri Duy Tram <trit@olympic.seas.ucla.edu> writes:
> I am wondering how do I go about modifying strings in perl? In
> particular, I want to do something like changing:
> [CODE1] (options1)
> [CODE2 (options2)]
> [CODE3(options3)]
> to
> [CODE1] (options1)
> [CODE2] (options2)
> [CODE3] (options3)
#!/usr/bin/perl -w
while (<DATA>) {
s/^\[ # Find the initial open bracket.
([^\s(\]]+) # Grab the code (everything up to whitespace,
# an open paren, or a close bracket).
[\]\s]* # Skip over any close brackets or whitespace.
\( # Find the beginning of the options list.
([^)]+) # Pick up the options (anything to a close
# paren).
\) # Find the close paren of the options.
\]? # Ignore a close brace, if present.
/[$1] ($2)/x; # Rewrite into canonical form.
print;
}
__END__
[CODE1] (options1)
[CODE2 (options2)]
[CODE3(options3)]
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Thu, 12 Jun 1997 16:24:48 +0800
From: hkchan <hkchan@singnet.com.sg>
Subject: test
Message-Id: <339FB250.67C2@singnet.com.sg>
test
------------------------------
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 605
*************************************