[17159] in Perl-Users-Digest
Perl-Users Digest, Issue: 4571 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 10 14:10:32 2000
Date: Tue, 10 Oct 2000 11:10:15 -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: <971201415-v9-i4571@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 10 Oct 2000 Volume: 9 Number: 4571
Today's topics:
Re: Newbie ,so sorry if im posting in the wrong place. johndankey@my-deja.com
Re: Newbie ,so sorry if im posting in the wrong place. <madmanz123@hotmail.com>
Re: Perl Books! (Mark-Jason Dominus)
Re: Perl Books! (Mark-Jason Dominus)
Re: Perl Books! <jeff@vpservices.com>
Re: Perl Books! (Al)
Re: Perl Books! <ymeydotcom@hotmail.com>
Re: Perl newbie has questions about CGI <hartleh1@westat.com>
perl resource <admin@news.dynip.com>
Re: perl resource <jondecamp@home.com>
Re: perl resource (Randal L. Schwartz)
Re: perl resource <brian+usenet@smithrenaud.com>
Re: re-start problem <ejw@windsor.igs.net>
Re: send ICQ message via a perl script (Martien Verbruggen)
sorting <noone@dontbother.com>
SQL Parser <jesse.van.oort@home.nl>
Re: SQL Parser (Randal L. Schwartz)
Re: SQL Parser <jesse.van.oort@home.nl>
Re: substring search <hartleh1@westat.com>
Re: substring search <james@NOSPAM.demon.co.uk>
Re: symlink utime and chown <steeve@eps.mcgill.ca>
UNIX/PERL question christophe.conseil@equifax.com
Using OLE and Excel hajir@my-deja.com
Using Win32 in cgi-scripts <fkoene@haagpol.nl>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 10 Oct 2000 15:32:16 GMT
From: johndankey@my-deja.com
Subject: Re: Newbie ,so sorry if im posting in the wrong place.
Message-Id: <8rvcq0$79n$1@nnrp1.deja.com>
In article <cbvE5.85804$4d.12396903@news02.optonline.net>,
"madman" <madmanz123@hotmail.com> wrote:
> Just wanted if it was possible to make a shopping cart, written in
perl or
> already written in perl and modify it so that it can be used in
combination
> with paypal .com
Madman, I'm sure it can be done, I've done something similar myself.
The only question that remains is why would you want to, when there are
so many shopping carts out there nowadays, with ready hookups available
to many services. You would have to be *mad* to write your own!
Dan
--
Try the Craft Supply Exchange, http://craftsupplyexchange, to buy, sell
or trade craft supplies!
Come to Creative Now (http://www.creativenow.com)for Gifts, Art &
Crafts!
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 10 Oct 2000 17:32:45 GMT
From: "madman" <madmanz123@hotmail.com>
Subject: Re: Newbie ,so sorry if im posting in the wrong place.
Message-Id: <1pIE5.90758$4d.12644002@news02.optonline.net>
> so many shopping carts out there nowadays, with ready hookups available
> to many services. You would have to be *mad* to write your own!
Good to know its possible, and god knows I don't want to write my own, im
still on chapter one of learning perl.
The problem is a want paypal intergration. And no cost, a free, or
opensourse utility.
Something like this would dramatically reduce the cost of a full service
e-commerce site, for small buisnesses.
I would be willing to design in trade if someone wanted to mod an exsiting
perl shopping cart to be used with paypal.
thanks.
Madman
------------------------------
Date: Tue, 10 Oct 2000 13:15:15 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: Perl Books!
Message-Id: <39e31663.6998$2e6@news.op.net>
In article <8rrhge$719$1@charm.magnus.acs.ohio-state.edu>,
Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
>C'mon, and a lot of software packages are marked as "if you open this,
>you agree to ...". Whatever the publisher puts after the title page
>is not binding.
The federal copyright statutes, however, are binding on people in the
United States, and other countries have similar laws that apply there.
>You know quite well that in a lot of situations "scanning in text from
>a book without permission from the publisher" it not only legal, it is
>moral too.
This, however, is clearly not one of those cases.
>BTW, I do not know, is putting "Far side" cartoons in the *out side*
>of the door of your office a copyright infringement?
No, because you own the single physical copy of the cartoon that you
paiud for. It is not copyright infringement to lend a book to the
guy in the next cubicle either.
>It is not that far from putting it on Internet...
It is completely different. In one case you are distributing *copies*
to everyone in the world. In the other case you are displaying a
*single* instance.
I am amazed that you cannot tell the difference.
------------------------------
Date: Tue, 10 Oct 2000 10:49:11 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: Perl Books!
Message-Id: <39e31977.69ef$3b5@news.op.net>
Keywords: Westinghouse, lexicon, quarryman, sedition
In article <39E1ADF5.CB57BD5E@hotmail.com>,
YMEY <ymeydotcom@hotmail.com> wrote:
>I posted those books for educational purposes... As the *LAW states. It
>is only piracy when and if I were to take a copy and try to *SELL it.
The University System of Georgia Board of Regents disagrees with you.
(they run the University of Georgia, so they have an interest in this
point and have studied it closely.)
They say:
4. Textbooks
SCENARIO H: A professor wishes to use a textbook he considers
to be too expensive. He makes copies of the book for the
class.
QUESTION: Is this a fair use?
ANSWER: No. Although the use is educational, the professor is
using the entire work, and by providing copies of the entire
book to his students, he has affected the market. This
conduct clearly interferes with the marketing monopoly of the
copyright owner.
http://www.usg.edu/admin/legal/copyright/copy.html
This leaves aside the fact that your use is obviously not
educational---even if it *were* educational, it would be a copyright
infringement.
I don't know why I bothered to mention this, since everyone else with
an informed opinion already knows that you are completely mistaken.
But what they heck, maybe you'll see reason.
Then again, maybe you won't see reason until you're ordered to pay
money damages in federal court.
------------------------------
Date: Tue, 10 Oct 2000 09:23:02 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Perl Books!
Message-Id: <39E34266.7A5EF6C7@vpservices.com>
Al wrote:
>
>
> BTW: replace "book" with "CD" and you see why it's so hard to
> prosecute Napster.
BTW: replace "book" with "software" and see why someday it may be hard
for you to make a living.
--
Jeff
------------------------------
Date: Tue, 10 Oct 2000 16:37:31 GMT
From: nospamapgraham@ispchannel.com--- (Al)
Subject: Re: Perl Books!
Message-Id: <39e4429d.9885199@news.ispchannel.com>
On Tue, 10 Oct 2000 05:27:50 -0400, YMEY <ymeydotcom@hotmail.com>
wrote:
>Before you go preaching about what you think the law should be.... You
>better know what the law is :)
>
>Copy Right::Fair use
>
>/*
>Not with standing the provisions of sections 106 and 106A, the fair use
>of a copyrighted work, including such use by reproduction in copies or
>phonorecords or by any other means specified by that section, for
>purposes such as criticism, comment, news reporting, **teaching
>(including multiple copies for classroom use), scholarship, or research,
>is not an infringement of copyright.
>*/
Before you go preaching about what you wish the law was.... You
better know what the law is :)
Continuing your quote of sec 107:
In determining whether the use made of a work in any particular
case is a fair use the factors to be considered shall include —
(1)the purpose and character of the use,including whether such use is
of a commercial nature or is for nonprofit educational purposes;
(2)the nature of the copyrighted work;
(3)the amount and substantiality of the portion used in relation to
the copy-righted work as a whole;and
(4)the effect of the use upon the potential market for or value of the
copy-righted work.
The fact that a work is unpublished shall not itself bar a finding of
fair use if such finding is made upon consideration of all the above
factors.
Items 3 and 4 are of particular interest here. You've copied the
entire work which seems to indicate a violation (3) (this would also
apply to the proffesor mentioned in a previous post). and making the
presence of these copys known to a large section of the demographic of
likely buyers (PERL prorammers) you have, arguably, cost the
publishers sales. This would indicate a violation (4).
My previously posted argument in your favor holds up much better than
this, but may not hold up under sec 108.
-Al-
------------------------------
Date: Tue, 10 Oct 2000 13:40:03 -0400
From: YMEY <ymeydotcom@hotmail.com>
Subject: Re: Perl Books!
Message-Id: <39E35473.BB7CF22F@hotmail.com>
-cut-
> In determining whether the use made of a work in any particular
> case is a fair use the factors to be considered shall include -
> (1)the purpose and character of the use,including whether such use is
> of a commercial nature or is for nonprofit educational purposes;
> (2)the nature of the copyrighted work;
> (3)the amount and substantiality of the portion used in relation to
> the copy-righted work as a whole;and
> (4)the effect of the use upon the potential market for or value of the
> copy-righted work.
> The fact that a work is unpublished shall not itself bar a finding of
> fair use if such finding is made upon consideration of all the above
> factors.
>
> Items 3 and 4 are of particular interest here. You've copied the
> entire work which seems to indicate a violation (3) (this would also
> apply to the proffesor mentioned in a previous post). and making the
> presence of these copys known to a large section of the demographic of
> likely buyers (PERL prorammers) you have, arguably, cost the
> publishers sales. This would indicate a violation (4).
(LOL, back to your exaimples :)
Lets put section 3 and 4 in a perspective of music... If you bought a CD
and made a copy, would you just make a copy of the lyrics you like or
are you going to copy the whole CD ??
Now say I play my copy on my CD player, is everyone who listens to it in
violation of the law ??.... The answer is "NO"... They would be in
violation if they were to use a recording device to make them self's a
copy. (This is where napster got screwed.) In retrospect, I'm only
allowing the viewing pleasure of material I paid for (Taken from an 8
track and put on CD.).. Only when and if someone goes there to make a
copy for them self's, then they are in violation... Not me!
------------------------------
Date: Tue, 10 Oct 2000 09:11:58 -0400
From: hartley_h <hartleh1@westat.com>
Subject: Re: Perl newbie has questions about CGI
Message-Id: <39E3159E.3577F96@westat.com>
Tharant wrote:
> I need to build a simulator to test the integrity of some CGIs.
>
> Question 1- Can I build build a Perl script to communicate, preferably over
> a network, with my CGIs. (i.e. emulate a web user sending GET and POST URLs)
> I only need to be able to talk with the CGI to initiate different functions.
> I do not need to know how the CGI responds because my CGI logs all of it's
> acivities.
> Question 2- Could someone give me some pointers on how to do this.
> Question 3- Could someone tell me what modules, if any, I will need.
You want to look at the LWP module.
http://search.cpan.org/search?mode=module&query=lwp
--
Henry Hartley
------------------------------
Date: Tue, 10 Oct 2000 12:13:25 -0400
From: "JS/PL" <admin@news.dynip.com>
Subject: perl resource
Message-Id: <su6g7n7ifco9bf@corp.supernews.com>
Hello,
I realize this may be pure begging. I have a list of city names which is
composed of one city per line in a plain text file. There are 42,000 lines
but many duplicate city names (eg. Waco is entered 22 times on 22 lines
between Wacissa and Waconia) I know perl is probably a great tool to remove
all the duplicate names but leaving one name, what I don't have is a script
to do it. I have almost no knowlege of writing scripts (actually none),
could someone show me the way to a resource for finding such a script? Thank
You
------------------------------
Date: Tue, 10 Oct 2000 16:25:38 GMT
From: Jon DeCamp <jondecamp@home.com>
Subject: Re: perl resource
Message-Id: <39E3440B.9EBB521A@home.com>
Not to offend the perl-ism in this newgroup, but why write code when there are
tools that do this for you already?
sort <textfile> | uniq
Some versions of sort offer a -u option which then uniq the file.
This will remove your duplicate lines.
-Jon DeCamp
JS/PL wrote:
> Hello,
> I realize this may be pure begging. I have a list of city names which is
> composed of one city per line in a plain text file. There are 42,000 lines
> but many duplicate city names (eg. Waco is entered 22 times on 22 lines
> between Wacissa and Waconia) I know perl is probably a great tool to remove
> all the duplicate names but leaving one name, what I don't have is a script
> to do it. I have almost no knowlege of writing scripts (actually none),
> could someone show me the way to a resource for finding such a script? Thank
> You
------------------------------
Date: 10 Oct 2000 10:21:05 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: perl resource
Message-Id: <m17l7gwr26.fsf@halfdome.holdit.com>
>>>>> "Jon" == Jon DeCamp <jondecamp@home.com> writes:
Jon> sort <textfile> | uniq
Jon> Some versions of sort offer a -u option which then uniq the file.
Version of sort all the way back to V7 (the One True Unix, published
roughly in 1980) do that.
If a Unix was offered that didn't have sort -u, I'd probably
not call it Unix.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Tue, 10 Oct 2000 13:58:57 -0400
From: brian d foy <brian+usenet@smithrenaud.com>
Subject: Re: perl resource
Message-Id: <brian+usenet-661D2B.13585710102000@news.panix.com>
In article <39E3440B.9EBB521A@home.com>, Jon DeCamp
<jondecamp@home.com> wrote:
> Not to offend the perl-ism in this newgroup, but why write code when there are
> tools that do this for you already?
>
> sort <textfile> | uniq
not everyone is using a flavor of Unix.
--
brian d foy
Perl Mongers <URL:http://www.perl.org>
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Tue, 10 Oct 2000 10:00:01 -0400
From: "theomats" <ejw@windsor.igs.net>
Subject: Re: re-start problem
Message-Id: <8rv7g4$dbg$1@news.igs.net>
Is the bug in line 17 in the Bishops.java file ? or in the .cgi ?
Not in touch lately with programmers so maybe I can fix it myself if you
copy and paste correction.
I am going through the java tutorials and how to make the .jar file but it
is tough for me.
When I extracted the Bishops.jar it made 20 Bishops.class files. ??
Still learning how to resave the Bishops. jar as the Bishops.java can be
changed but then it has to be made into a .jar somehow.
Should I be using Notepad and then Wordpad if file too large ?
or should I use Dos editor?
Maybe the word "volunteer" is the terrible thing, :) but I am on a
shoestring budget until things get rolling with the game.
Anyone know any "banner ads" that would pay to have a banner on a new site?
Or any sponsors?
With the Long game rules programmed and later avitar video or still images
of players in the Corners there could be a lot of traffic to the game. Also
a CD or download with a .exe app like Chessclub would be quicker and more
versitile maybe.
Regards,
www.bishopsthegame.com
Peter Sundstrom <peter.sundstrom@eds.com> wrote in message
news:8rtgh2$76m$1@hermes.nz.eds.com...
>
> Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote in message
> news:slrn8u4938.4h0.tjla@thislove.dyndns.org...
> > I was shocked! How could theomats <ejw@windsor.igs.net>
> > say such a terrible thing:
> > >Hi,
> > >Can someone volunteer to answer why my site "Bishops, A Chess Variant"
> needs
> > >to be re-started quite often. My ISP has done all they can and the
> original
> > >programmer also has done what is needed to get the program (applet)
> running.
> > >The command I have been told to use is : perl5 bishops.cgi &
> >
> > You have a bug in line 17
>
> The general rule of thumb for identifying errors in non specified code is
to
> check any line number that is prime ;-)
>
>
------------------------------
Date: Wed, 11 Oct 2000 01:01:18 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: send ICQ message via a perl script
Message-Id: <slrn8u689e.2tj.mgjv@martien.heliotrope.home>
On Tue, 10 Oct 2000 12:07:41 GMT,
ghorghor@my-deja.com <ghorghor@my-deja.com> wrote:
> In article <8rv01f$san$1@nnrp1.deja.com>,
> ghorghor@my-deja.com wrote:
> > hello
> >
> > I need to know how to send icq message with a perl script, i have
> > search during a long time and i don't find anything
> >
> > i have seen that a net::icq have been a little developp but not finished
> >
> > please can someone help me
>
> i have juste found this for people who are interested :
> http://diabcam.braenet.com.au/example/icq.txt
It took you 13 minutes to find that, judging by the time difference
between your posts. Please, next time, make sure to do a decent search
before you post.
About that thing you found: Make sure to extract just the bit you need
for the ICQ messaging, and throw away the rest. it's cargo-cult
programming, full of mistakes and bad habits. Looks like something Matt
Wright wrote after he had just started, although the code does have some
things correct that matt consistently got wrong.
all the CGI stuff in there should have been done with the CGI module
(would shrink the code to at most half the size).
And actually, it doesn't send an ICQ message. It uses the paging
gateway.
Martien
--
Martien Verbruggen |
Interactive Media Division | In a world without fences, who needs
Commercial Dynamics Pty. Ltd. | Gates?
NSW, Australia |
------------------------------
Date: Tue, 10 Oct 2000 07:44:01 -0700
From: "Robert Lund" <noone@dontbother.com>
Subject: sorting
Message-Id: <su6ao6f22s95fa@corp.supernews.com>
I've tried reading the FAQ's and books, but am still stuck... Here's the
problem...
I want to sort a list of lists, by the second list of the list of lists....
here's the code I'm using.
@newlist = sort { @{$oldlist[1]}[$a] cmp @{$oldlist[1]}[$b] } @oldlist;
The values of the second element of the outer list are strings, that's why
I'm using cmp.... why is this not working?
Thanks in advance!!
--Robert
------------------------------
Date: Tue, 10 Oct 2000 15:08:29 GMT
From: Jesse van Oort <jesse.van.oort@home.nl>
Subject: SQL Parser
Message-Id: <tcb6uskargvkvlb3e4b0msli69p3d9qklk@4ax.com>
Hi All,
I need to write a program that scans a fortran source-file for
sql-statements and returns a hash with column and table usages.
I am able to extract the entire sql-statement, but am quite stuck at
the point where I want to scan for used tables.
To be more specific: I end up with an array consisting of tables and
their aliasses.
Not every table has an alias though, so my array currently looks like
this: 'table1', ',table2','a2',',table3','a3',',table4',',table5',
etc, where the tables are preceded by a comma, except for the first
one.
Can someone advise me on writing a good consistant algorithm for this?
What I want is a hash like: table => alias (or empty if there isn't an
alias).
Thanks,
Jesse
------------------------------
Date: 10 Oct 2000 09:41:34 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: SQL Parser
Message-Id: <m1em1owsw1.fsf@halfdome.holdit.com>
>>>>> "Jesse" == Jesse van Oort <jesse.van.oort@home.nl> writes:
Jesse> Hi All,
Jesse> I need to write a program that scans a fortran source-file for
Jesse> sql-statements and returns a hash with column and table usages.
Jesse> I am able to extract the entire sql-statement, but am quite stuck at
Jesse> the point where I want to scan for used tables.
Jesse> To be more specific: I end up with an array consisting of tables and
Jesse> their aliasses.
Jesse> Not every table has an alias though, so my array currently looks like
Jesse> this: 'table1', ',table2','a2',',table3','a3',',table4',',table5',
Jesse> etc, where the tables are preceded by a comma, except for the first
Jesse> one.
Jesse> Can someone advise me on writing a good consistant algorithm for this?
Jesse> What I want is a hash like: table => alias (or empty if there isn't an
Jesse> alias).
You can look at SQL::Statement in the CPAN, presuming you can isolate
what parts of your intput text are SQL and what parts are Fortran.
If that's the wrong weight, you can construct your own parser
with Parse::RecDescent (also in the CPAN).
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Tue, 10 Oct 2000 18:01:40 GMT
From: Jesse van Oort <jesse.van.oort@home.nl>
Subject: Re: SQL Parser
Message-Id: <bnl6ussk78pqh2shir3k5le0be1003u9r4@4ax.com>
On 10 Oct 2000 09:41:34 -0700, merlyn@stonehenge.com (Randal L.
Schwartz) wrote:
>>>>>> "Jesse" == Jesse van Oort <jesse.van.oort@home.nl> writes:
>
>Jesse> Hi All,
>Jesse> I need to write a program that scans a fortran source-file for
>Jesse> sql-statements and returns a hash with column and table usages.
>Jesse> I am able to extract the entire sql-statement, but am quite stuck at
>Jesse> the point where I want to scan for used tables.
>Jesse> To be more specific: I end up with an array consisting of tables and
>Jesse> their aliasses.
>Jesse> Not every table has an alias though, so my array currently looks like
>Jesse> this: 'table1', ',table2','a2',',table3','a3',',table4',',table5',
>Jesse> etc, where the tables are preceded by a comma, except for the first
>Jesse> one.
>Jesse> Can someone advise me on writing a good consistant algorithm for this?
>Jesse> What I want is a hash like: table => alias (or empty if there isn't an
>Jesse> alias).
>
>You can look at SQL::Statement in the CPAN, presuming you can isolate
>what parts of your intput text are SQL and what parts are Fortran.
>
>If that's the wrong weight, you can construct your own parser
>with Parse::RecDescent (also in the CPAN).
Thanks, at first glance it looks pretty usefull.
You see, we have to insert a lot of information into the Oracle
Designer repository, including the table- and column usages from a few
hundred PROFortran modules.
The idea is to analyse them with my perl program and then
automagically insert al the info in Designer.
It will save us a few weeks work this way.
Viva Perl!!!
Jesse
perl -e 'print "just another perl hacker\n";'
------------------------------
Date: Tue, 10 Oct 2000 09:56:32 -0400
From: hartley_h <hartleh1@westat.com>
Subject: Re: substring search
Message-Id: <39E32010.36C7617D@westat.com>
Bart Lateur wrote:
>
> The problem here is that this counts the lines where the string is
> found, not the number of occurences of that string.
>
> This will do that (I hope):
>
> while (<FILE>) {
> $count++ while m/$matchregex/g;
> }
One question for the OP is whether he needs to find occurences of the
phrase that span lines. Imagine the following file:
This is a test to see if we can count how many times
the phrase Runner is done shows up in a text file. I
know we can count how many times it is on single lines
but what if it spans two lines? For instance, Runner
is done printed like that? Will it find Runner is
done if it looks like that or will it only find the
phrase Runner is done when on a single line.
Using that as a test file, the simple test only found it twice (lines 2
and 7).
So, I read the entire file into a scaler
undef $/ ;
my $filestring = <FILE> ;
Then, replace any newlines "\n" with white space
$filestring =~ tr/\n/ / ;
and do the match test, ignoring the fact that there may be more than one
space between words.
$count++ while $filestring =~ m/Runner +is +done/g ;
Naturally, I expect someone to tell me a better way of doing that but at
least I cought the two extra instances of the string.
--
Henry Hartley
------------------------------
Date: Tue, 10 Oct 2000 17:11:39 +0100
From: James Taylor <james@NOSPAM.demon.co.uk>
Subject: Re: substring search
Message-Id: <ant101639b49fNdQ@oakseed.demon.co.uk>
In article <39E32010.36C7617D@westat.com>, hartley_h wrote:
>
> One question for the OP is whether he needs to find occurences of the
> phrase that span lines.
[snip]
> I read the entire file into a scaler
>
> undef $/ ;
> my $filestring = <FILE> ;
>
> Then, replace any newlines "\n" with white space
>
> $filestring =~ tr/\n/ / ;
Surely that's not necessary if you use single line mode on the match
operator like this: m/Runner\s+is\s+done/sg;
> and do the match test, ignoring the fact that there may be more than one
> space between words.
Actually, it looks to me like you're not ignoring the possibility of
more than one space between words.
> $count++ while $filestring =~ m/Runner +is +done/g ;
It ought to be possible to count matches using m//g in a scalar context,
but according to the docs scalar m//g only returns a truth value in scalar
context. Does anyone know a better idiom than: $count++ while m//g; ?
--
James Taylor <james (at) oakseed demon co uk>
PGP key available ID: 3FBE1BF9
Fingerprint: F19D803624ED6FE8 370045159F66FD02
------------------------------
Date: Tue, 10 Oct 2000 14:04:40 GMT
From: Steeve <steeve@eps.mcgill.ca>
Subject: Re: symlink utime and chown
Message-Id: <39E321F8.31EB26BE@eps.mcgill.ca>
Alan Barclay wrote:
>
> In article <H9kE5.1296$X76.39282@carnaval.risq.qc.ca>,
> Steeve McCauley <steeve@pebbles.eps.mcgill.ca> wrote:
> >How can I set atime, mtime and uid,gid for a symlink.
> >chown() and utime() operate on the link target and
> >not the symlink itself.
>
> You can't, and there isn't any point in even trying to do so anyway.
>
> symlinks aren't updated with atime when accessed. They always have
> permission of 777, so anyone can follow them, and they can't be
> modified except by deleting and recreating. The only reason that
> they use the same inode structure as other files is because it
> would be unnecessary complex to do otherwise.
Hmmm, I can see how atime, mtime and ctime would
never apply to a symlink as well as permissions
(which is why I never asked how to set mode) but
I always figured that symlink ownership was
enforced. Learn somefin new every day.
Thanks,
steeve
--
steeve SysAdmin EPS McGill University Mtl Qc
:wq
------------------------------
Date: Tue, 10 Oct 2000 17:45:18 GMT
From: christophe.conseil@equifax.com
Subject: UNIX/PERL question
Message-Id: <8rvkjb$eo6$1@nnrp1.deja.com>
Hi guys:
Just trying to understand the following:
I have a perl test program:
first line: #!/usr/local/bin/perl -w
I made sure it is executable.
Now when I type test file1>file2 no error but nothing is written
to file 2.
On the otherhand: perl test file1>file2 works fine.
I made sure of the following:
typing "which perl" i get: /usr/local/bin/perl
Also, I made sure that this path and also the . path are in my
path variable, in my .cshrc file.
Any idea why it does not work the first way.
Thank you all for your time and help.
Christophe
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 10 Oct 2000 17:37:09 GMT
From: hajir@my-deja.com
Subject: Using OLE and Excel
Message-Id: <8rvk44$e78$1@nnrp1.deja.com>
I want to know how to INSERT a row into the worksheet for excel.
Thanks
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 10 Oct 2000 15:18:25 +0200
From: "Fred Koene" <fkoene@haagpol.nl>
Subject: Using Win32 in cgi-scripts
Message-Id: <8rv597$kth$1@porthos.nl.uu.net>
Hi,
I work since a week with the Win32 library. Everything works nicely. However
when i use this library in a cgi script it works nicely from the command
line but not in my browser. The generated html is undoubtedly correct. I
want to list the properties of a service running on a NT-server using use
Win32::Services.
please help me !
kind regards,
Jan Gerritse
------------------------------
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 4571
**************************************