[8503] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2120 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 17 18:09:25 1998

Date: Tue, 17 Mar 98 15:00:32 -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           Tue, 17 Mar 1998     Volume: 8 Number: 2120

Today's topics:
    Re: ? retrieve meta tag information from a HTML documen (Martin Vorlaender)
    Re: calculating distance between strings (fortune cooki (Josh Kortbein)
    Re: Chicago Perl Mongers (Andy Lester)
        Extracting HTML <TITLE>...</TITLE> using Perl? <u5ms@csc.liv.ac.uk>
    Re: Extracting HTML <TITLE>...</TITLE> using Perl? <brian@rickjames.sapien.net>
    Re: Extracting HTML <TITLE>...</TITLE> using Perl? (brian d foy)
    Re: file age, the continuing story <kapur@cbl.ncsu.edu>
        Get full-name of user account <oostveen@synnetry.nl>
        IS perl .DBM files EQU to access .MDB files?? <destroy@none.of.businness>
    Re: Is there a "Newsgroup" for Newbies to Perl? (I R A Aggie)
        libnet/Net::FTP-- accessing FTP within an intranet... <cortez@tfn.com>
        module not working from cgi? (Martin Brown)
    Re: Multiple substitues <uri@sysarch.com>
    Re: My first Perl Post I tried to make it worthy. <ptimmins@netserv.unmc.edu>
        Need a perl function wsayegh@lynx.neu.edu
    Re: Need a perl function (brian d foy)
    Re: Need some help converting a string into an array (Kevin B Cohen)
    Re: net use G: \\foo\c$ <jim.michael@gecm.com>
    Re: Perl system() calls on NT w/IIS (Martin Vorlaender)
    Re: Perl5 compile error ByrneJB@Harte-Lyne.ca
    Re: Perl5 compile error ByrneJB@Harte-Lyne.ca
        Posting to UseNet groups from Perl? (Mick Knutson)
        Posting to UseNet groups from Perl? (Mick Knutson)
    Re: Posting to UseNet groups from Perl? (A. Deckers)
        Q about printf (Stan Horwitz)
    Re: Q about printf (Mike Heins)
    Re: Q about printf (brian d foy)
    Re: splitting by one or more spaces <adam@pacific-artists.demon.co.uk>
    Re: stripping "special" characters from string (Craig Berry)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 17 Mar 1998 21:34:24 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: ? retrieve meta tag information from a HTML document with Perl ?
Message-Id: <350ede50.524144494f47414741@radiogaga.harz.de>

Peter Perchansky (fp@pmpcs.com) wrote:
: I'm using the LWP modules to retrieve the actual HTML in a given HTML
: document.  My goal is to go through the document and pull out the "content"
: portion of certain META tags.

[...]

: Meaning, if I found the line by looking at "keywords" is there a way to just
: get the content?

It might be overkill for this purpose, but have a look at the
HTML::Parser module, which is part of the LWP.

cu,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


------------------------------

Date: 17 Mar 1998 21:51:29 GMT
From: kortbein@iastate.edu (Josh Kortbein)
Subject: Re: calculating distance between strings (fortune cookies)
Message-Id: <6emr91$a78$1@news.iastate.edu>

Ronald J Kimball (rjk@coos.dartmouth.edu) wrote:
: Simon Oosthoek wrote:
: > 
: > I'm looking for a program/script/whatever that can calculate the distance
: > between two text-strings. By distance I mean that I want to find strings that
: > human beings can identify as "the same", but a computer would not directly
: > consider equal in the sense: ($StrX eq $StrY)

: This sounds interesting.  Could you be more specific about what you mean by
: "distance"?  In particular, what ideas do you have for calculating the
: distance?  You could do something with the lengths of the strings and the
: number of non-matching characters.  But you'd also have to allow for offets,
: such as "bar" and "  bar"...

At a talk I heard last year on this and related topics, one thing they
[the speaker and his grad-student slaves] treated strings of length
n as n-dimensional vectors, and then used a more (mathematically)
standard means of computing the distance between vectors. This was used
to provide some sort of fuzzy-matching code - the same string would be
distance 0 from itself, a string differing by one character would be
farther away than one differing by 10, etc.

I can't recall exactly how they chose to represent vectors. Maybe it
was something like

take each letter's position in the string to correspond to the
appropriate unit vector in n-space

take the ASCII code of the letter to represent the magnitude of the
component of the n-vector in the direction of the unit vector from
the last step

Interesting stuff! I wish I had more time for it.

Josh

--
_______________________________________________
Missing a kick
 at the icebox door         - Jack Kerouac
It closed anyway.



------------------------------

Date: 17 Mar 1998 22:30:45 GMT
From: petdance@maxx.mc.net (Andy Lester)
Subject: Re: Chicago Perl Mongers
Message-Id: <6emtil$22k$1@usenet76.supernews.com>

: it's about time to set up a group in Chicago. I've made tentative
: contact with a couple people, but now I'm officially announcing my
: intent. All you Windy City Perl M(o|u)ngers interested in participating,

You didn't mention the donuts and dancing girls.  How do you expect us to
get any members if you don't?  Duh.

DONUTS AND DANCING GIRLS!  At EVERY meeting!

xoxo,
Andy

--
--
Andy Lester:        <andy@petdance.com>       http://tezcat.com/~andy/
Chicago Shows List: <shows@ChicagoMusic.com>  http://ChicagoMusic.com/



------------------------------

Date: Tue, 17 Mar 1998 16:25:51 GMT
From: Matt Sephton <u5ms@csc.liv.ac.uk>
Subject: Extracting HTML <TITLE>...</TITLE> using Perl?
Message-Id: <350EA40F.302F@csc.liv.ac.uk>

How would I go about extracting the HTML tag <TITLE>...</TITLE> using
Perl? Would a regular expression suffice?

Any help appreciated,
Matt Sephton
-- 
u5ms@csc.liv.ac.uk
http://www.csc.liv.ac.uk/~u5ms/


------------------------------

Date: Tue, 17 Mar 1998 16:31:30 -0500
From: "Brian J.S. Miller" <brian@rickjames.sapien.net>
To: Matt Sephton <u5ms@csc.liv.ac.uk>
Subject: Re: Extracting HTML <TITLE>...</TITLE> using Perl?
Message-Id: <350EEBB2.C6B47F87@rickjames.sapien.net>

Matt Sephton wrote:
> How would I go about extracting the HTML tag <TITLE>...</TITLE> using
> Perl? Would a regular expression suffice?

provided all your pages have the <title>(.*)</title> on one line, it'll
be very easy to do this with a regular expression.

find the title line... then
$line=~/<TITLE>(.*)<\/TITLE>/;
$title=$1;

or something to that effect...i'm not a guru, so I'm sure there are 100
easier ways to do that...but, that's how I'd do it.
Brian


------------------------------

Date: Tue, 17 Mar 1998 16:48:38 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Extracting HTML <TITLE>...</TITLE> using Perl?
Message-Id: <comdog-ya02408000R1703981648380001@news.panix.com>
Keywords: from just another new york perl hacker

In article <350EEBB2.C6B47F87@rickjames.sapien.net>, "Brian J.S. Miller" <brian@rickjames.sapien.net> posted:

>Matt Sephton wrote:
>> How would I go about extracting the HTML tag <TITLE>...</TITLE> using
>> Perl? Would a regular expression suffice?
>
>provided all your pages have the <title>(.*)</title> on one line, it'll
>be very easy to do this with a regular expression.

>$line=~/<TITLE>(.*)<\/TITLE>/;

you don't even have the multiline concerns with the addition of a 
certain modifier, but your regex won't match <title>(.*)</title>, 
although another modifier could fix that up too.

but if you want to parse HTML correctly, you need an HTML Parser like
the one you will find at CPAN.  that will take care of the other
fatal flaws with your technique (all of which have appeared in
previous threads and flames on the subject).

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>


------------------------------

Date: 17 Mar 1998 16:17:08 -0500
From: Nevin Kapur <kapur@cbl.ncsu.edu>
To: Haaino Beljaars <Beljaars@fys.ruu.nl>
Subject: Re: file age, the continuing story
Message-Id: <tyvhtddnl7.fsf@cbl.ncsu.edu>

[posted and mailed]

Haaino Beljaars <Beljaars@fys.ruu.nl> writes:

[snip]

> The problem now is, the it leaves behind a 'tree' full of empty
> directories and not empty directories.
> How can I delete all empty directories too?

This is explained well in column 16 of the Randal Schwartz's 
Unix Review Perl Columns:

http://www.stonehenge.com/merlyn/UnixReview/col16.html

-- 
Nevin


------------------------------

Date: 17 Mar 1998 22:17:15 GMT
From: "Rob van Oostveen" <oostveen@synnetry.nl>
Subject: Get full-name of user account
Message-Id: <01bd51f2$6fe228f0$010a10ac@rob-home>

I'm trying to extract the full-name during logon into the NT 4 domain from 
WinNT and Win95 clients.
The GetUserAttributes works only for the comment and others fields, but not
the full-name. Does anyone know another way around this ? 
BTW, the above function does not work on Win95, is there an alternative ?

Thanks.

-- 
Rob van Oostveen
Work : oostveen@synnetry.nl
Private : oostveen@euronet.nl



------------------------------

Date: Tue, 17 Mar 1998 22:22:57 GMT
From: Henry Voyer <destroy@none.of.businness>
Subject: IS perl .DBM files EQU to access .MDB files??
Message-Id: <350F1FB1.9756DF49@none.of.businness>

Thanks

hevo


------------------------------

Date: Tue, 17 Mar 1998 16:19:04 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <fl_aggie-1703981619040001@aggie.coaps.fsu.edu>

In article <slrn6gt6il.jc0.harrison@localhost.localdomain>,
harrison@pixi.com wrote:

+ On 17 Mar 98 10:47:14 GMT, Robert F. Harrison <harrison@pixi.com> wrote:
+ > 
+ > How dare he give something away free, with instructions,  not to
+ > mention coercing many people into aiding and abetting without
+ > rendering it harmless first. 

+ I apologize to all for this message.

Darn tooting! I nearly slipped in the dripping sarcasm. That would
have been icky!

+ It was meant in jest but sadly failed on all counts.

Fortunately for you, I did not fall on my jest.

+ smiley to indicate jest and have paid the price for my ommission.

Heh! Here's a mop, and wipe up that mess!
 
+ Robert F. Harrison [as bad a perl hacker as he is a comedian.]

Hopefully, you're better with a mop!! :)

James

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>


------------------------------

Date: Tue, 17 Mar 1998 16:13:26 -0500
From: Frank Cortez <cortez@tfn.com>
Subject: libnet/Net::FTP-- accessing FTP within an intranet...
Message-Id: <350EE776.4FBB@tfn.com>

I'm running Perl (v5.004_02) with libnet (v1.0605) on a Windows NT
4.0 platform.  My question (and it may or may not be Windows-specific):

I'm setting up an intranet and I'd like to be able to FTP files
between client machines and a server (Server's running Apache 1.3b3,
BTW).  Each of these machines has a local name (Pong, Jax, etc.)
that's usually used to refer to them for standard FTP packages.
However, I'd like to be able to FTP using Net::FTP and haven't
the foggiest idea of how to refer to the individual machines without
causing an error.

I'm no guru to the internal workings of FTP (or Net::FTP, for that
matter), but I'm keen to the fact that *somehow* these names get
mapped over via some DSN-like utility-- but the docs on Net::FTP
don't make mention of this (or how to "fudge it").

Help?

-Frank


------------------------------

Date: 17 Mar 1998 15:11:00 -0700
From: mjbjr@primenet.com (Martin Brown)
Subject: module not working from cgi?
Message-Id: <6emsdk$k2p@nntp02.primenet.com>

[Caldera OpenLinux v1.1, kernel 2.0.29,  perl v.5.004_03, Netscape Fasttrack
Server]

I have a problem with getting a module to work with cgi programs.  The module,
Adabas.pm, is for interfacing to the Adabas database program.

It works when used as a perl program run from the command line.

It works when it is used as a cgi program run from the command line.

It does NOT work when the Fasttrack server runs it, though it does not appear
to be an access problem.  The Fasttrack server can find it and run it.

The Fasttrack Server has no problem running cgi programs ending in '.cgi', and
can find and execute the program in question, 'rolodex_add.cgi':

(note: I am not actually using code in the Adabas.pm module at this point)

--------- rolodex_add.cgi starts below ------------

#!/usr/bin/perl -I/usr/local/adabas/lib/perl

use strict;
use diagnostics;

use CGI;

#BEGIN {@INC = (@INC, "$ENV{DBROOT}/lib/perl");}
#BEGIN {@INC = (@INC, "/usr/local/adabas/lib/perl");}

use Adabas;

my $query = new CGI;

$|=1;

   print $query->header;
   print $query->start_html("ADABAS ERROR");
   print "Adabas ERROR!yes22:\n";
   print $query->end_html;


--------- rolodex_add.cgi ends above ----------


When the above is accessed as part of POST action from a simple form, the
Fasttrack server returns the following error:


[17/Mar/1998:12:52:47] failure: for host beau.(none) trying to POST    
/cgi-bin/rolodex_add.cgi, cgi-parse-output reports: the CGI program 
/home/httpd/cgi-bin/rolodex_add.cgi did not produce a valid header (program
terminated without a valid CGI header. Check for core dump or other abnormal
termination)


If I access the cgi directly from the command line it works:

------- CLI action starts below --------

[mjbjr@beau cgi-bin]$ rolodex_add.cgi
(offline mode: enter name=value pairs on standard input)
name=mjb
Content-type: text/html

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML><HEAD><TITLE>ADABAS ERROR</TITLE>
</HEAD><BODY>Adabas ERROR!yes22:
</BODY></HTML>[mjbjr@beau cgi-bin]$ 

------- CLI action ends above ----------

If I comment out line 11 in rolodex_add.cgi:

   use Adabas;
   
becoming:

   # use Adabas;
   
The cgi program now works, and the server dishes out the "$query" web page at
the end of rolodex_add.cgi.

Could it be that the error code be returned by the Fasttrack server is it's way
of saying it can't find the module?  Though if I change the first line:

   #!/usr/bin/perl -I/usr/local/adabas/lib/perl
 
to

   #!/usr/bin/perl -I/usr/local/adabas/
  
and

   #use Adabas;
   
to

   use Adabas;

so that the server shouldn't be able to find the module, it returns the
following error code:


[17/Mar/1998:13:33:40] failure: for host beau.(none) trying to POST
/cgi-bin/rolodex_add.cgi, cgi-parse-output reports: the CGI program
/home/httpd/cgi-bin/rolodex_add.cgi did not produce a valid header
(name without value: got line "      eval {...} called at adabas.pm line 11")

Hmm... it seems to find the module even though it shouldn't be able to


The first few lines of Adabas.pm are:


------- Adabas.pm starts below --------

package Adabas;

use strict;
use vars qw($VERSION @ISA @EXPORT);

require Exporter;
require DynaLoader;

@ISA = qw(Exporter DynaLoader);
# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.
@EXPORT = qw(
	
);
$VERSION = '0.01';

bootstrap Adabas $VERSION;


------- end of top part of Adabas.pm --------


You can also see that I have had to resort to using
'-I/usr/local/adabas/lib/perl' as I couldn't get the 'BEGIN' code to work,
though I'm not sure that it is correctly written.


I'm stumped!  I've been going over and over this for days, 
and I can't figure it out.


Any solution or suggestions would be greatly appreciated!

Thanx.








--
                            - Martin J. Brown, Jr. -  

                               mjbjr@primenet.com
                      PGP public key available via finger


------------------------------

Date: 17 Mar 1998 17:15:27 -0500
From: Uri Guttman <uri@sysarch.com>
To: dfrench@aig.vialink.com
Subject: Re: Multiple substitues
Message-Id: <x7yay9hslc.fsf@sysarch.com>

dfrench@aig.vialink.com writes:

> As I stated in the original posting, the content of the substitutes were just
> an example.  What I am trying to do is perform multiple substitutes IN A
> SINGLE PASS through a target file/array.

so what is the problem? perl can do it with multiple statements on the
same string or line from a file. the answers you got previously were
correct. 

> To restate the question, does anybody know how to perform multiple substitutes
> in a single command (one pass through a file/array).
> 
> sed -e "s/this/that/g;s/and/the/g;s/other/thing/g" filename

this is NOT a single command but 3 commands in a sed script. perl can do
the exact same thing. use s2p (sed to perl) if you want to write in sed.

perl -pe 's/this/that/g;s/and/the/g;s/other/thing/g' filename 

is the SAME thing in perl. the -p does an sed like loop for you.

in script it would be

#/path/to/perl -p

s/this/that/g;
s/and/the/g;
s/other/thing/g ;

big deal. they all work on $_ for all lines in the files in ARGV

> The above example would perform multiple substitues in a single pass through a
> file.  Does anybody know how to do this from within a perl script (NOT from a
> command line)?

yes many of us do. so what is the problem?

uri

-- 
Uri Guttman                     SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----  8 years of Perl experience, Available Immediately
uri@sysarch.com              Resume and Sample code at http://www.sysarch.com
Try the Best Search Engine on the Net -------->  http://www.northernlight.com


------------------------------

Date: Tue, 17 Mar 1998 15:22:42 -0600
From: Patrick Timmins <ptimmins@netserv.unmc.edu>
Subject: Re: My first Perl Post I tried to make it worthy.
Message-Id: <350EE9A1.B83@netserv.unmc.edu>

No it's not ... on both counts.

Try comp.infosystems.www.authoring.cgi or
comp.infosystems.www.authoring.misc
Hope that helps. It's not a stupid question ... just the wrong place.
--
Patrick Timmins
U. Nebraska Medical Center


ALz wrote:
> 
> Gang,
> 
>  I have a question regarding Perl and htaccess. In a directory I have 
 ... snip ...
> 
> Think it over and let me know. If this is a stupid question please flame
> accordingly.
> 
> Billy Ailshire


------------------------------

Date: Tue, 17 Mar 1998 15:17:21 -0600
From: wsayegh@lynx.neu.edu
Subject: Need a perl function
Message-Id: <6emp5p$76k$1@nnrp1.dejanews.com>

Does anyone have a PERL function that reads the directory and lists all the
files which are not hidden, ie the files which do not start with a ".", then
stores them in an array

Waseem Sayegh
wsayegh@lynx.neu.edu

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


------------------------------

Date: Tue, 17 Mar 1998 16:50:41 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Need a perl function
Message-Id: <comdog-ya02408000R1703981650410001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6emp5p$76k$1@nnrp1.dejanews.com>, wsayegh@lynx.neu.edu posted:

>Does anyone have a PERL function that reads the directory and lists all the
>files which are not hidden, ie the files which do not start with a ".", then
>stores them in an array

you could make such a function using built-ins such as opendir, readdir,
and grep.

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>


------------------------------

Date: 17 Mar 1998 16:11:33 -0500
From: kcohen@julius.ling.ohio-state.edu (Kevin B Cohen)
Subject: Re: Need some help converting a string into an array
Message-Id: <6emou5$o01@julius.ling.ohio-state.edu>

In article <350EE0AB.63DE@elk.cray.com>,
Mark P Stackhouse  <stackhou@elk.cray.com> wrote:
>Actually, I need to look at the first and last word in each string but
>writing each line into an array as it comes in might be easier than the
>way I was going at it.  Will the extra spaces and tabs end up being
>array elements also?

no, the extra tabs and spaces will disappear.

if all you want to do is muck about with the first and last words,
then you can (if you've read in the data as i suggested, i.e.
line-by-line) get access to those words with perl's marvelous match
operator:

$_ = $line; #make sure that you're matching against what you think you
#are

($first, $last) = /^(\w+).*(\w+)$/; # now $first contains the first
#word on the line, and $last contains the last.

2 points: (1) the first and last words are still part of the
line---you haven't removed them (2) i've assumed that \w+ is an
adequate definition of "word."  this may not be true of your data.
replace it with something that works for your stuff.

if unclear about why that line of code does what i say it does, see
Jeffrey Friedl's "Mastering Regular Expressions," pp. 252-253.

kevin



------------------------------

Date: Tue, 17 Mar 1998 15:51:54 -0500
From: Jim Michael <jim.michael@gecm.com>
Subject: Re: net use G: \\foo\c$
Message-Id: <350EE26A.2579@gecm.com>

paulc wrote:
>     I'm trying to execute net use G: \\foo\c$  without
> success. I did try to print out the command before

Try net use G: \\\\foo\\c$

HTH.


------------------------------

Date: Tue, 17 Mar 1998 22:12:35 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Perl system() calls on NT w/IIS
Message-Id: <350ee743.524144494f47414741@radiogaga.harz.de>

Tom Adriaenssen (tom@imagic.be) wrote:
: Charlie Hatton wrote in message <350E9A65.D7BF4890@dfdis.com>...
: >I'm having a problem getting Perl system() calls to return output on NT
: >4.0 using IIS. I can run my scripts from the command line and get
: >appropriate output, but nothing using a WWW browser. [...]
:
: Yeah, i've got the same problem. [...]
: Our configuration is about the same as the one specified by Charlie.

I/O redirection might be your problem, as it's broke in IIS (all versions).
With IIS4, find adsutil.vbs (somewhere in inetsrv\adminsamples) and execute

adsutil set w3svc/CreateCGIWithNewProcess True

(all from memory, so don't nail me down on it - I've got it at the office.
There was a post to clpm some time ago - you could look for it at DejaNews).

cu,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


------------------------------

Date: Tue, 17 Mar 1998 15:14:38 -0600
From: ByrneJB@Harte-Lyne.ca
Subject: Re: Perl5 compile error
Message-Id: <6emp08$6q0$1@nnrp1.dejanews.com>

In article <6em814$i5l$1@nnrp1.dejanews.com>,
  ByrneJB@Harte-Lyne.ca wrote:
>
> I am trying (vainly) to get perl5.004_04 to build on HP-UX 11.00 using gcc
> 2.8.1.  I am getting this error towards the end of the make file.
>
> AutoSplitting perl library
> AutoSplitting Text::ParseWords (lib/auto/Text/ParseWords)
> sh: 151 Memory fault(coredump)
> *** Error exit code 139
>

I have done some further investigation and the problem may have something to
do with the flip extention.  When I run t/perl t/op/flip.t I get the
following:

# ./perl op/flip.t
1..9
Memory fault(coredump)

Does anyone have any ideas as to where to go from here?

Regards,
Jim

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


------------------------------

Date: Tue, 17 Mar 1998 16:15:26 -0600
From: ByrneJB@Harte-Lyne.ca
Subject: Re: Perl5 compile error
Message-Id: <6emsi8$bb8$1@nnrp1.dejanews.com>

In article <6em814$i5l$1@nnrp1.dejanews.com>,
  ByrneJB@Harte-Lyne.ca wrote:
>
> I am trying (vainly) to get perl5.004_04 to build on HP-UX 11.00 using gcc
> 2.8.1.  I am getting this error towards the end of the make file.
>
> AutoSplitting perl library
> AutoSplitting Text::ParseWords (lib/auto/Text/ParseWords)
> sh: 151 Memory fault(coredump)
> *** Error exit code 139
>

I found the solution.  One needs to turn off the optimizer in gcc and it will
build fine.

Regards,
Jim

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


------------------------------

Date: Tue, 17 Mar 1998 13:04:03 -0800
From: mknutson@websolution.com (Mick Knutson)
Subject: Posting to UseNet groups from Perl?
Message-Id: <MPG.f78851951db0cfe989682@news.greatbasin.net>

How would this be done?


------------------------------

Date: Tue, 17 Mar 1998 14:01:20 -0800
From: mknutson@websolution.com (Mick Knutson)
Subject: Posting to UseNet groups from Perl?
Message-Id: <MPG.f78927f43b0abf2989685@news.greatbasin.net>

Can This be done?
-- 

***************************************
* Mick Knutson
***************************************
*** Support Legal B.A.S.E. Jumping! ***
***************************************
*
* The B.A.S.E. Board *
* http://www.websolution.com/base/board/index.shtml
*
***************************************
*
* Add yourself to The B.A.S.E. Mailer at:
* http://www.websolution.com/base/mail/index.shtml
***************************************


------------------------------

Date: 17 Mar 1998 21:04:36 GMT
From: Alain.Deckers@man.ac.uk (A. Deckers)
Subject: Re: Posting to UseNet groups from Perl?
Message-Id: <slrn6gtpb4.7s7.Alain.Deckers@bashful.rediris.es>

In <MPG.f78851951db0cfe989682@news.greatbasin.net>,
	Mick Knutson <mknutson@websolution.com> wrote:
>How would this be done?

use News::NNTPClient;

Alain
-- 
Perl reference: <URL:http://reference.perl.com/>
 Perl language: <URL:http://language.perl.com/>
  Perl archive: <URL:http://www.perl.com/CPAN/>
      Perl FAQ: <URL:http://www.perl.com/CPAN/doc/FAQs/FAQ/>


------------------------------

Date: 17 Mar 1998 21:15:35 GMT
From: stan@thunder.temple.edu (Stan Horwitz)
Subject: Q about printf
Message-Id: <6emp5n$fgv$1@cronkite.ocis.temple.edu>

Perhaps someone can help me figure out what wrong with a printf statement
I am using. I am a newbie Perl 5 programmer and I have read through the
various Perl docs including the FAQ and other resources on the wonderful
Web site at http://www.perl.com, but nothing there seemed appropriate for
my situation. I looked through my Perl Programming manual and a book I
have on learning Perl, all to no avail. 

The problem is so simple, I am sure I must be missing something incredibly
obvious. I can't seem to get a two digit number to print out as two digits
with printf regardless of whether I treat it as a string or as an integer.
The number always prints with 3 leading zeros.  I have tried treating the
number as a string, as in: 

  $x = "03";
  printf OUTFILE ("%2s", $x);

I have tried treating it as an integer as in:

  $x = 3;
  printf OUTFILE ("02%d", $x);

I also tried using the standard unformatted print with x$ as a string and
integer. No matter which way I print the $x, the result always comes out
as "0003" when it should be "03" in my output file. I even tried adding
some junk characters onto the right of the string as a test as in $x =
"03ss" and those extra zeroes still appear in the output file. When I
print to STDOUT, the output is correct, but not when I print to a text
file. 

Does anyone have any ideas why?

--
This message was written by Stan Horwitz. 
My views are my own and not necessarily those of my employer. 


------------------------------

Date: 17 Mar 98 21:45:25 GMT
From: mikeh@minivend.com (Mike Heins)
Subject: Re: Q about printf
Message-Id: <350eeef5.0@news.one.net>

Stan Horwitz <stan@thunder.temple.edu> wrote:
> Perhaps someone can help me figure out what wrong with a printf statement
> I am using. I am a newbie Perl 5 programmer and I have read through the
> various Perl docs including the FAQ and other resources on the wonderful
> Web site at http://www.perl.com, but nothing there seemed appropriate for
> my situation. I looked through my Perl Programming manual and a book I
> have on learning Perl, all to no avail. 

> The problem is so simple, I am sure I must be missing something incredibly
> obvious. I can't seem to get a two digit number to print out as two digits
> with printf regardless of whether I treat it as a string or as an integer.
> The number always prints with 3 leading zeros.  I have tried treating the
> number as a string, as in: 

>   $x = "03";
>   printf OUTFILE ("%2s", $x);

> I have tried treating it as an integer as in:

>   $x = 3;
>   printf OUTFILE ("02%d", $x);

> I also tried using the standard unformatted print with x$ as a string and
> integer. No matter which way I print the $x, the result always comes out
> as "0003" when it should be "03" in my output file. I even tried adding
> some junk characters onto the right of the string as a test as in $x =
> "03ss" and those extra zeroes still appear in the output file. When I
> print to STDOUT, the output is correct, but not when I print to a text
> file. 

> Does anyone have any ideas why?

It works fine for me. You might try

    - running with the -w switch.
    - telling us your operating system. Some differentiate
      binary files from text files, in which case binmode(OUTFILE)
      might be appropriate.
    - Show how you are opening the file.

-- 
Mike Heins                          http://www.minivend.com/  ___ 
                                    Internet Robotics        |_ _|____
Just because something is           131 Willow Lane, Floor 2  | ||  _ \
obviously happening doesn't         Oxford, OH  45056         | || |_) |
mean something obvious is           <mikeh@minivend.com>     |___|  _ <
happening. --Larry Wall             513.523.7621 FAX 7501        |_| \_\


------------------------------

Date: Tue, 17 Mar 1998 16:56:23 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Q about printf
Message-Id: <comdog-ya02408000R1703981656230001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6emp5n$fgv$1@cronkite.ocis.temple.edu>, stan@thunder.temple.edu (Stan Horwitz) posted:


>The problem is so simple, I am sure I must be missing something incredibly
>obvious. I can't seem to get a two digit number to print out as two digits
>with printf regardless of whether I treat it as a string or as an integer.

>I have tried treating it as an integer as in:
>
>  $x = 3;
>  printf OUTFILE ("02%d", $x);

perhaps this is just a typo that escaped your attention, but it should
be

   printf OUTFILE ("%02d", $x);

the printf(3) man page might be illuminating if you don't have much
experience with the function.

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>


------------------------------

Date: Tue, 17 Mar 1998 22:45:44 -0000
From: "Adam Carden" <adam@pacific-artists.demon.co.uk>
Subject: Re: splitting by one or more spaces
Message-Id: <890174932.12751.0.nnrp-09.c2de97e4@news.demon.co.uk>

Why not just use @datele = split (/ /, localtime);
Then remove and leading or trailing spaces from each element in the array?


Adam Carden
---------------------------------------
Pacific Artists
adam@pacific-artists.demon.co.uk

Oosterom wrote in message <01bd4d3f$bf439e40$0781f1c3@thijs>...
>Hi,
>
>I am trying to extract the date from the localtime value. I have to split
>this value, but if the daynumber is smaller than 10, there are two spaces
>before this number in the localtime value. This means I have to split by
>one or more spaces. The codes below don't work:
>
>($day, $month, $daynr, $time, $year) = split (/*\s/, localtime);
>
>Any suggestions anyone? Thanks.
>
>Thijs.
>
>




------------------------------

Date: 17 Mar 1998 22:41:56 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: stripping "special" characters from string
Message-Id: <6emu7k$3tv$1@marina.cinenet.net>

Michael Shavel (mshavel@erols.com) wrote:
: I am trying to rename a file called   PADM.ATEX.LGLGMP(+1) to
: PADM.ATEX.LGLDMP.dayofmonth
: 
: the code I am using is as follows:
: 
: use File::Copy;
: $fname = "PADM.ATEX.LGLDMP(+1)";
: 
: (undef,undef,undef,$mday) = localtime(time);

Might suggest this instead:

  my $mday = localtime(time)[3];

: #copy file to archive dir with day of week appended to filename
: $archive_name = "$fname.$mday";
: print "Archive name is $archive_name\n";
: 
: #THIS IS THE PROBLEM LINE
: #HOW DO I MATCH THE STRING  (+1)  ??
: $archive_name =~ s/[(+1)]//g;

To replace (+1) with the value of $mday, use

  $archive_name =~ s/\Q(+1)\E/$mday/;

With three out of four characters being 'special', it's easier to just let
quotemeta (\Q...\E) do the job. 

: Ps.. I am going to pick up the book  "Mastering Regular Expressions" but
: have not had the chance yet.

Run, do not walk.  (And get the Camel too, if you haven't already, and 
the Llama if you're still a bit uncertain on the basic-to-intermediate 
stuff.)

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


------------------------------

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 2120
**************************************

home help back first fref pref prev next nref lref last post