[13559] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 969 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 1 20:07:13 1999

Date: Fri, 1 Oct 1999 17:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <938822710-v9-i969@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 1 Oct 1999     Volume: 9 Number: 969

Today's topics:
    Re: Advice from the Wise <cassell@mail.cor.epa.gov>
        Blessing nodes in a C++-created tree <pjl@NOSPAM.com>
    Re: Browser Toolbar Buttons (Larry Rosler)
    Re: Bye Tom? (WAS: Re: injecting "my" varibales into ca (Larry Rosler)
    Re: Bye Tom? (WAS: Re: injecting "my" varibales into ca (Ilya Zakharevich)
    Re: Bye Tom? (WAS: Re: injecting "my" varibales into ca (Craig Berry)
    Re: Bye Tom? (WAS: Re: injecting "my" varibales into ca <elaine@chaos.wustl.edu>
    Re: Bye Tom? (WAS: Re: injecting "my" varibales into ca (Matthew Bafford)
    Re: Deformatting records (Bill Moseley)
    Re: Deformatting records <ltl@rgsun5.viasystems.com>
    Re: Getting the first occurence of a string <cassell@mail.cor.epa.gov>
    Re: HTML to ASCII (David H. Adler)
    Re: Processing a comma delimited file <cassell@mail.cor.epa.gov>
    Re: Q: Perl, win32::ODBC, Oracle and NLS setting <cassell@mail.cor.epa.gov>
    Re: RegEx for html->plain text <cassell@mail.cor.epa.gov>
        Regexp question <jbossert@dazel.com>
        Simple newbie problem... jon@osfn.org
    Re: Sys::Syslog on Solaris 2.7 <shawn@unifygroup.com>
    Re: Sys::Syslog on Solaris 2.7 <shawn@unifygroup.com>
    Re: Trouble w/ Regex in ActivePerl for Win32 <cassell@mail.cor.epa.gov>
        Values of thousand (Christopher)
    Re: webfetch <cassell@mail.cor.epa.gov>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 01 Oct 1999 16:32:51 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Advice from the Wise
Message-Id: <37F544A3.ABC8BBDD@mail.cor.epa.gov>

whos_john_galt@my-deja.com wrote:
[snip]
> I have not sold myself for more than I am, but I have sold my vigor.
> With this, the IT Manager explained his vision of reporting the
> information gathered on the SQL servers to the companies intranet on an
> NT system. I am clueless to NT except from a users point of view.
[snip]

You can download Perl for win32 from www.activestate.com .  It runs
on NT, win95, win98, and presumably on win19100^H win2000 as well.
If you're going to be accessing SQL servers, you'll want to learn
about the DBI and DBD::ODBC modules too.  They have nice docs, and
there are plenty of web tutorials on using Perl for CGI and databases
simultaneously.  You can find some URLs just by going to www.perl.com
and using the Search facility to look for 'database' or 'tutorial'
or even 'CGI'.

> I will need to access the SQL servers and manage MS Access files and
> output the results via HTML and JavaScript, the latter I am fairly
> fluent.

MS Access is not a good choice for a web database.  You'd be better
off with another of Microsoft's databases, such as SQL server, if
your IT chief insists on MS-databases only.

> I've tasted some of the Microsoft products, but believe that Perl is my
> answer for this.

I've only tested some of them.  But Perl does work in this milieu,
and ActiveState has other Perl help for you.  Look at their
PerlEx product too.
 
> I would greatly appreciate any advice the wise could offer on where I

Well, you're stuck with me instead of another of the wiseguys
around here.  for now, anyway.

> should start reading...I frequently reference many different books on
> Perl, but I am clueless on NT and the installation and operation of
> Perl on NT. I am not even able, though only tried halfheartedly, to

After you run ActiveState's install program, you'll be able to
read their intro material just by clicking on the entry it drops
into your Start Menu.  One thing to look for is the perlport 'page'
which talks about difference in Perl functionality between OSes.
Also read the ActivePerl FAQ, which has a section on the parts of
Perl which do not run on win32 yet.  Like fork() and alarm(),
and some of the signal handling.

> perform Perl executions on my Win 98 PC. I expect reading to provide
> guidance as I dive head first into this project.

I find that Perl on a win98 box works surprisingly like Perl
on a linux box or Perl on a Solaris box [except for that little
fork() and alarm() and signals deal].  And ActiveState is striving
to add a fork() to their Perl.  Real Soon Now, as Jerry Pournelle
says.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 01 Oct 1999 23:09:38 GMT
From: "Paul J. Lucas" <pjl@NOSPAM.com>
Subject: Blessing nodes in a C++-created tree
Message-Id: <37f53f32$0$225@nntp1.ba.best.com>

	OK, so I've written a Perl extension in C++ that creates a tree
	data structure using C++ objects as nodes in the tree.  A C++
	node's destructor, when called, destroys all of its child nodes
	and also removes itself from its parent's (if any) list of
	child nodes.

	I now want to make any object in the tree available to a Perl
	program as a blessed object.

	I have a Perl function reference that my C++ code uses as a
	callback.  I convert a pointer to a C++ object to a blessed
	reference and put it on the stack with:

		SV *sv = newSVsv( &sv_undef );
		SV *rv = newRV( sv );
		sv_setref_pv( rv, "myclass", (void*)ptr_to_object );
		XPUSH( rv );
		// ...
		result = perl_call_sv( func, G_SCALAR );
		// ...

	As one "walks" the tree, blessed references get created for
	nodes in the tree.  When an SV goes out of scope, Perl calls
	the DESTROY() method for the blessed object that, in the .xs
	file, is simply:

		void
		myclass::DESTROY()

	The problem is that the destructor for the C++ object, as
	described above, *ALSO* destroys its child nodes (and their
	child nodes, and so on) and the bless referneces become
	"dangling" references and Perl issues:

		Bad free() ignored during global destruction.

	messages.

	The design of the C++ classes should not change.  What I've
	found as a workaround is to modify the DESTROY() method to be:

		void
		myclass::DESTROY()
		CODE:
			if ( !THIS->parent() )
				delete THIS;

	that effectively ignores DESTROY() unless it's called for the
	root node of the tree.

	Is this analysis most likely correct?  Is the work-around good?
	Is there a better one?

	Another, somewhat related problem: it's possible that the
	callback will be called more than once for a given node.  This
	means that more than one blessed reference will be created for
	the same node.  This means that the DESTROY() method will be
	called more than once which will say "delete THIS" more than
	once for the *SAME* node (also yielding a "Bad free()"
	message).

	Any work-arounds for this?  Is there a way, given a pointer to
	a node, to determine if it's already been blessed into a
	reference and, if so, to get a hold of said reference (thus
	avoiding creating more than one reference to the same C++
	object)?

	- Paul


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

Date: Fri, 1 Oct 1999 16:09:37 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Browser Toolbar Buttons
Message-Id: <MPG.125edf0c383121bd98a023@nntp.hpl.hp.com>

In article <MF8J3.1810$jg2.1949@news20.bellglobal.com> on Fri, 01 Oct 
1999 20:17:48 GMT, Kanux <kanux@caux.art> says...
> I'm newbie in CGI script.
> Is there a way to access the "Back/Forward" buttons on IE/NC browser toolbar
> using CGI script ?

No.  A Perl program launched through the CGI interface and running on 
the server cannot directly control the browser.  There may be Javascript 
solutions, though.

Next time you have a question, use your newsreader's cross-posting 
capability instead of posting independently to more than one newsgroup.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Fri, 1 Oct 1999 16:06:16 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Bye Tom? (WAS: Re: injecting "my" varibales into callers scope)
Message-Id: <MPG.125ede479b464a5698a021@nntp.hpl.hp.com>

In article <37F5346A.21637A5D@chaos.wustl.edu> on Fri, 01 Oct 1999 
18:25:00 -0400, Elaine -HFB- Ashton <elaine@chaos.wustl.edu> says...
> Ilya Zakharevich wrote:
> > You could not be more wrong.  I think the *total* effect of Tom on Perl
> > is *very* negative.  Just observe p5p meltdown...
> 
> Well, we could digress into a philosophical discussion of cause and
> effect, but why should Tom be singled out when many others join in? I'm
> not saying you are wrong or right, just that I'm not part of the victim
> society we seem to inhabit in the late 20th century. 
> 
> If Aquinas was correct in the Summa, then we as humans have free will
> and with free will comes choice and with choice comes a wide range of
> options. 
> 
> My mentor many moons ago illustrated a very important lesson, silence.
> Silence is the most powerful weapon or statement when dealing with an
> opponent as it is often a reaction they seek. 

Just to dive in as this thread is dying -- I hope.

I'm amused by the image of Tom reading all these posts (as I'm sure he 
is doing :-), comparing it to the old fantasy of attending one's own 
funeral and hearing what is said and what is whispered.  But in this 
newsgroup, nothing is whispered!

And Tom's ghost is still with us, in the form of the periodic anti-
Jeopardy posts.

PS:  Not that it matters much -- my personal history.  After a rocky 
first round of interactions about 18 months ago, we reached an 
accommodation of tolerant and respectful mutual interaction and help -- 
much more help from him to me, of course, though I was privileged to 
lend a very small hand to the Cookbook -- and even multilingual fun on 
occasion.  I hope and assume that he will resurrect himself soon.  His 
level of charm is much higher than Abigail's.  :-)

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 1 Oct 1999 23:46:34 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Bye Tom? (WAS: Re: injecting "my" varibales into callers scope)
Message-Id: <7t3h4q$jsu$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to Elaine -HFB- Ashton 
<elaine@chaos.wustl.edu>],
who wrote in article <37F5346A.21637A5D@chaos.wustl.edu>:
> > You could not be more wrong.  I think the *total* effect of Tom on Perl
> > is *very* negative.  Just observe p5p meltdown...

> If Aquinas was correct in the Summa, then we as humans have free will
> and with free will comes choice and with choice comes a wide range of
> options. 

Nobody will object that it is an option to yell "you are a piece of
shit" when you are proven wrong in technical arguments.  What I was
discussing was the *result* of exercising these options.

Ilya


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

Date: Fri, 01 Oct 1999 23:44:37 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Bye Tom? (WAS: Re: injecting "my" varibales into callers scope)
Message-Id: <rvahr5lp3i576@corp.supernews.com>

Elaine -HFB- Ashton (elaine@chaos.wustl.edu) wrote:
: Craig Berry wrote: 
: > detered me, I mused on the timing of my shift in emphasis and the
: > possibility that my slight distaste for Perl -- due to Tom C.'s large and
: > prominent role as documentor and advocate for the language -- had played a
: > role in the type of work I ended up pursuing more avidly.
: 
: Right, so one person, as a personification of a language helped you move
: on to something else? I find that, perhaps, rather weak minded. Perhaps
: I am stubborn or something, but I just don't see how that could or
: should happen.

Perhaps he did me a favor, the time being right for a change; who knows?
I don't tend to build up strong fixations on languages, having coded in
too many.  The annoyance factor in working with a prominent member of the
Perl community was, as I mentioned, just one factor.  I merely suggest it
was a shame that this factor was present, and strong enough for me to
notice it in hindsight.

: > I'll tend to pick Java.  That wasn't true a year ago, and my intuition
: > tells me Tom C. had a hand in changing my preferences in this area.
: 
: Pure speculation.

Of course, and what's more, speculation about the state of the inside of
my head, where the rest of you will be still less qualified to offer an
opinion. :)  My post was intended more in the 'opinion/impression' than
the 'hard fact' mode, as I tried to make clear. 

: I don't get warm fuzzies from Tom either, but
: certainly not he or anyone else would influence my choice of Perl vs.
: another language. I live in New England so maybe I'm used to crusty
: bastards and cold winters.

Perhaps that's it; my long years in southern California, basking in the
warm Santa Anas in January, sitting in my hot tub sipping white wine, have
left me unsuited to intellectual rigor and stubborn tenacity.  If so, I'll
take the tradeoff... :) 

: Are you suggesting, perhaps, that the Java
: community, if there is one, is full of love for you?

Well, a few of them. :)  But seriously speaking, I've yet to meet anyone
with the combination of rudeness, loudness, and centrality in the language
community that Tom has wrt Perl.

: > This is the grand mistake.  Email and Usenet are, or can be, quite
: > personal.  Communication through words typed at a terminal can be every
: > bit as inflammatory, hateful, and damaging as words spoken in person.
: 
: This is a fallacy of the 'new to the net set'.

Not to get into a 'war of the oldbies', but I've been using the net since
around 1981.  And I stick by my assertion, based on that length of
experience.

[snip]
: Which is not to say, however, that the medium is completely impersonal,
: but vapid tirades between strangers via email/usenet is pretty silly. It
: ultimately means nothing.

It means no more nor less than the emotional/irrational components of life
in general.  Saying that medium of interaction X causes the messages it
carries to 'mean' more or less than those carried on medium Y strikes me
as an odd argument, McLuhan (sp?) to the contrary of course.

: People insult each other every day without taking it so personally.

I take both the giving and receiving of insults personally.  How else is
one to take it?  "Hi Bob, you disgusting loathesome illiterate scumball."
"Hi, Craig, how was the weekend?"  What possible purpose or meaning do
insults have, if not on the personal level?

: Maybe it is because I'm a woman and have had to endure a lot more crap
: than the average guy in technology, but may I recommend that you get
: over it and move on with life? I'm sure Tom has insulted me on a number
: of occasions though, honestly, I can't remember any of them. 

More power to you.  I ignored Tom for quite a while but eventually some
sort of threshhold was passed and I became actively annoyed with his
antics.  And I have gotten over and moved on, learning lots of cool tech
in the last year and so forth, while not completely abandoning Perl by any
means (wrote a couple of little log analyzers just this week, in fact). 

: > Sounds like a good idea.  Um, how do you strip whitespace from the front
: > and back of a string?
: 
: Scissors :)

<cue rimshot>

-- 
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "There it is; take it."  - William Mulholland


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

Date: Fri, 01 Oct 1999 19:51:46 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: Bye Tom? (WAS: Re: injecting "my" varibales into callers scope)
Message-Id: <37F548BE.748673C7@chaos.wustl.edu>

"Paul J. Lucas" wrote:
>         "Programming Perl" book as a reference and changed the authors
>         from "Wall, Chrisiansen, and Swartz" to simply "Wall, et al."

Sorry, I just cannot fathom that. 

>         I dislike the idea of crediting an asshole despite his
>         technical achievements.  (Sorry, Randal, since you're the baby
>         that got thrown out with the bathwater.)

I've seen Randal be as much of an ass, if not moreso, as Tom, but
because he hasn't attacked you personally.... bias and perspective. I
just don't see the point in this action other than petty revenge.
 
>         I also dislike the idea of recommending said book (but not to
>         the point of actually not recommending it) knowing Tom will get
>         royalty money from it.

This goes beyond the irrational and into the professionally negligent.
There are a lot of people I have no love for in this world but if their
product is the best, I recommend it. 

Life is so short, why waste time on crap like this when you could be
doing something enjoyable or even *gasp* productive? 

e.


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

Date: Fri, 01 Oct 1999 23:54:12 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: Bye Tom? (WAS: Re: injecting "my" varibales into callers scope)
Message-Id: <slrn7vahim.242.*@dragons.duesouth.net>

On Fri, 1 Oct 1999 16:06:16 -0700, lr@hpl.hp.com (Larry Rosler) enriched
us with: 
: I'm amused by the image of Tom reading all these posts (as I'm sure he 
: is doing :-), comparing it to the old fantasy of attending one's own 
: funeral and hearing what is said and what is whispered.  But in this 
: newsgroup, nothing is whispered!

 ...
One poor chap, who had no oher grandeur to offer, said with tolerably
manifest pride in the remembrance:

    "Well, Tom Christiansen he flamed me once."

But that bid for glory was a failure.  Most of the posters could say
that, and so that cheapened the distinction too much.
 ...
 
: (Just Another Larry) Rosler

--Matthew


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

Date: Fri, 1 Oct 1999 16:04:44 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Deformatting records
Message-Id: <MPG.125edde8eb9a18ca9897b4@206.184.139.132>

Jason Brooks (jason.nospam@pointshare.com) seems to say...
> I am trying to parse records sent to me.  the format is comma delimited, but
> most of the fields are also encased in double quotes.  here's the rub:  I
> can't just split on commas, because there are commas inside the data fields
> also.

perlfaq4

How can I split a [character] delimited string except when inside 
[character]?
(Comma-separated files)

-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


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

Date: 1 Oct 1999 22:54:42 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: Deformatting records
Message-Id: <7t3e3i$cb1$1@rguxd.viasystems.com>

Jason Brooks <jason.nospam@pointshare.com> wrote:
:>Hi, my name is Jason.

We can see that from your header.

:>I am trying to parse records sent to me.  the format is comma delimited, but
:>most of the fields are also encased in double quotes.  here's the rub:  I
:>can't just split on commas, because there are commas inside the data fields
:>also.

Been done a few times before.  Try 
perldoc Text::ParseWords

or you may want to look on CPAN.  Search for "CSV".  Both
Text::CSV and DBD::CSV have been recommended here before.


-- 
// Lee.Lindley   /// I used to think that being right was everything.
// @bigfoot.com  ///  Then I matured into the realization that getting
////////////////////   along was more important.  Except on usenet.


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

Date: Fri, 01 Oct 1999 16:06:26 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Getting the first occurence of a string
Message-Id: <37F53E72.BAB9A7E9@mail.cor.epa.gov>

Danh Dang wrote:
[snip]
> LOOP: while (<>) {
>    if (/^STATIM(.*)$/) {
>           $string = $1 ;
>           last LOOP;
>    }
> }

Umm, is there a reason you answered this long after it was
answered with a preferable and more Perlish response?  If the
problem is that your newsfeed is erratic and you saw no other
replies, then take this as only a hint that you should get 
a better newsfeed.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 1 Oct 1999 19:22:45 -0400
From: dha@panix.com (David H. Adler)
Subject: Re: HTML to ASCII
Message-Id: <slrn7vagi4.8gm.dha@panix.com>

On Thu, 30 Sep 1999 15:10:56 -0700, David Cassell
<cassell@mail.cor.epa.gov> wrote:

>Are we far enough off-topic yet?

Nah.  And I think the Daleks were probably coded in Fortran...

:_)

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
I'm occasionally callous and strange.	- Willow


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

Date: Fri, 01 Oct 1999 16:09:43 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Processing a comma delimited file
Message-Id: <37F53F37.4E7284C3@mail.cor.epa.gov>

Jeff Gordon wrote:
> 
> I'm very new at perl, but I've read through the books, FAQs, etc to the best
> of my ability and I'm having a problem that I hope someone can give me some
> guidance on.  I'm trying to process a CSV file that's in the form of:

Then let me tell you about Perl modules.  Perl has more than
one module which will parse CSV files for you, saving you the
headaches of wrestling with your own parsing and regexen.

Check out one or more of Text::CSV_XS and DBD::CSV , both of which
come with nice documentation.  The DBD module will also need
the DBI module.  Both can be acquired at CPAN [www.cpan.org]
or, if you use a win32 system, via the ppm program which ships
with ActiveState Perl.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Fri, 01 Oct 1999 16:21:30 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Q: Perl, win32::ODBC, Oracle and NLS setting
Message-Id: <37F541FA.45E2D628@mail.cor.epa.gov>

Suriawan Limantara wrote:
> 
> Hi,
> 
> I make a select a field of numeric type and fetch the data with the
> method Data(). I always get the value with a "." at the end, e.g. 1427.
> In this case I have FRANCE as Oracle NLS_LANGUAGE setting in registry.
> If I change this setting to AMERICA, the returned value is correct, i.e.
> without "." at the end.

If this occurs merely by changing the NLS_LANGUAGE setting
for Oracle, then isn't this most likely to be an Oracle problem?

But OTOH, if you are also changing the perllocale by doing
this [or something analogous], then you have some part of your
code which is more fragile than you thought.  Can you cut
your program down to 20 lines of working code which illustrate
the problem, with error messages also cut-and-pasted into your
message?

I hope it isn't that Oracle finally realized there is no point
in keeping periods at the ends of sentences for the AMERICAN
setting because we cannot compose grammatical sentences anymore.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Fri, 01 Oct 1999 16:17:44 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: RegEx for html->plain text
Message-Id: <37F54118.898BF4EF@mail.cor.epa.gov>

Uri Guttman wrote:
> 
> >>>>> "s" == sam  <sam@samredman.com> writes:
> 
>   s> Sorry for my posts here.  I did not realize this was a perl conference.
>   s> Some kind fellow named Uri sent me an email to that effect.
> 
> hey, i am a kind fellow!

He just doesn't know you well yet.  :-)
<grumbling>
 ...grumble...Gouda...grumble...Limburger... oh yeah?...
</grumbling>
 
[snip]
>   s> I am new to Deja so I didn't realize that this had nothing to do with
>   s> Python assuming that if I linked from Python.org it had to be "on
>   s> subject".  So, sorry about the posts, I will attempt to find a similar
>   s> Python forum.
> 
> we are in trouble now. deja is sending python newbies here!!

They've been sending all kinds of newbies here for some time.
As you've no doubt noticed.  But I find it scary that people
can end up here with no knowledge that:
[1] this is a newsgroup, and not a chatroom or conference or webpage;
[2] this is a newsgroup with a specific charter about Perl
    programming; and
[3] our complaining to deja.com is unlikely to make any difference
    to them whatsoever.

I can't wait until we start getting questions from deja.com
users who are looking for Brittney Spears chatrooms.

Or maybe Pearl Jam.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Fri, 01 Oct 1999 16:36:24 -0500
From: John Bossert <jbossert@dazel.com>
Subject: Regexp question
Message-Id: <37F52957.327DFDE@dazel.com>

Regexp newbie question - how can I match everything between the first
and last occurence of a character?  Specifically, for the string:

"abcdef "123456" foobarblech"

I want to get

abcdef "123456" foobarblech

in other words, lose the first and last '"'

Thanks in advance

-- 
John Bossert                           email: jbossert@dazel.com
Systems Engineer                mobile/pager: 425.269.5172
DAZEL Corporation                     office: 425.462.2060
800 Bellevue Way NE, Suite 400           fax: 425.462.2064
Bellevue, WA  98004                      URL: http://www.dazel.com


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

Date: Fri, 01 Oct 1999 23:39:42 GMT
From: jon@osfn.org
Subject: Simple newbie problem...
Message-Id: <2DbJ3.4071$L4.227540@typ12.nn.bcandid.com>

Hi,

I need to replace one string with an other in multiple .html documents
I've gotten this far

	#!/usr/bin/perl

	@files = `ls`;

	foreach $file (@files) {
	  if ($file =~ /.html/ {

how do I now edit these files (I want the changed file to have the
original name??

	    open CURRENT, $files;
            while (<CURRENT>) {
              s/x/y/I;		#??????????????

This is where I'm just puzzled....

TIA,
Jon

-- 
Email jon@osfn.org			Web
       jdp@efn.org			http://users.ids.net/~tuan/


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

Date: 01 Oct 1999 16:17:02 PDT
From: shawn fang <shawn@unifygroup.com>
Subject: Re: Sys::Syslog on Solaris 2.7
Message-Id: <37F54171.4D62248A@unifygroup.com>

Do you have to run h2ph from /usr/include first ?

thanks.

-shawn

Elaine -HFB- Ashton wrote:

> shawn fang wrote:
> > Does anybody know whether Sys::Syslog works on Sun Solaris2.7 64bit OS.
> > I am having this error:
>
> It works fine for me on Solaris 7. Have you run it through the debugger?
> Possibly post a bit of code you think might be a problem. Otherwise,
> that error could be any number of things.
>
> e.



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

Date: 01 Oct 1999 16:50:00 PDT
From: shawn fang <shawn@unifygroup.com>
Subject: Re: Sys::Syslog on Solaris 2.7
Message-Id: <37F54929.2DFDFAB@unifygroup.com>

Here is the code:

use Sys::Syslog;
use Sys::Syslog qw(:DEFAULT setlogsock);

my $program = "Test";
openlog($program, 'cons,pid', 'user');
syslog('local0', 'this is another test');
syslog('local0|warning', 'this is a better test: %d', time);
closelog();


When I first ran, I have error saying the ph file not found.  I then ran "h2ph
* sys/*" from /usr/include.
Then I got the error saying a bunch of syntax error of couple of .ph files.
For some reason those couple of .ph files has ""some string"".  So I removed
the duplicate quotes.
After that I ran perl -c foo.pl and it complains
    ISA not supported at
/usr/local/lib/perl5/site_perl/5.005/sun4-solaris/sys/isa_defs.ph line 82.

Please help.

-shawn

shawn fang wrote:

> Do you have to run h2ph from /usr/include first ?
>
> thanks.
>
> -shawn
>
> Elaine -HFB- Ashton wrote:
>
> > shawn fang wrote:
> > > Does anybody know whether Sys::Syslog works on Sun Solaris2.7 64bit OS.
> > > I am having this error:
> >
> > It works fine for me on Solaris 7. Have you run it through the debugger?
> > Possibly post a bit of code you think might be a problem. Otherwise,
> > that error could be any number of things.
> >
> > e.



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

Date: Fri, 01 Oct 1999 16:12:28 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Trouble w/ Regex in ActivePerl for Win32
Message-Id: <37F53FDC.C431C22@mail.cor.epa.gov>

Andrew Park wrote:
> 
> Hi, I have a text file created on a Wintel PC w/ CR & LF embedded in
> them. I would like to strip out the CR and leave the LF to turn this
> into a Unix text file. Using ActivePerl build 519, I've tries all of the
[snip]
> In every case, either the lines get concatenated into one long line or
> the carriage return remains. What am I doing wrong? After every change,
> I am copying the file to an NFS mounted machine and running VI from w/i
> the Unix Shell to see if the ^M were still there...

You already received one suggestion.  Let me make a non-Perl
one.  Either use ftp to transfer the file so that the newlines
are handled correctly in transit, or else copy the file to
the unix box and use a program like dos2unix to make the 
changes for you.

For extra credit, you could even use the Perl module Net::FTP
to copy the file via ftp and do any other manipulations you want.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Fri, 01 Oct 1999 23:03:50 GMT
From: cer@drusch.com (Christopher)
Subject: Values of thousand
Message-Id: <37f53cc1.3845763@PersonalNews.de.uu.net>

Hi,
I am searching for a way to display values of thousand in a country
typcial manner, eg.:
- 125,000 or 12,900,000 for america (comma)
- 125.000 or 12,900,000 for europe (point)

Any hint would be nice,
Christopher.


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

Date: Fri, 01 Oct 1999 16:35:26 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: webfetch
Message-Id: <37F5453E.7C84FB1F@mail.cor.epa.gov>

skorpion84@my-deja.com wrote:
> 
> I'm looking for a perl script that gets news headline from multiple
> websites and organizes those news headline into a page and place it on
> another website. The script I'm looking for is the one that
> www.newsnow.co.uk and www.linuxtoday.com uses.

Have you checked whether those companies will give you a copy
of their programs?  If not, then it may be because it is 
actually a much larger and more complex task than you have
envisioned.  

If all you want to do is snag a web page, then look into the 
Perl modules LWP::Simple and LWP::UserAgent .  For CGI at 
your end, use the CGI.pm module.  

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V9 Issue 969
*************************************


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