[24505] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6685 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 12 21:05:35 2004

Date: Sat, 12 Jun 2004 18:05:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 12 Jun 2004     Volume: 10 Number: 6685

Today's topics:
    Re: Beginner needs help with script :) <notachance@inhell.com>
    Re: Beginner needs help with script :) <ceo@nospam.on.net>
    Re: Beginner needs help with script :) <ceo@nospam.on.net>
        Extracting Metadata from Microsoft Office documents (nodata)
    Re: Extracting Metadata from Microsoft Office documents <usenet@morrow.me.uk>
    Re: Extracting Metadata from Microsoft Office documents <usenet@morrow.me.uk>
        foreach ($a, $b, $c)... <ken_sington@nospam_abcdefg.com>
    Re: How to test a variable to see if it is a valid rege <usenet@morrow.me.uk>
    Re: loop in loop takes too much time <usenet@morrow.me.uk>
    Re: loop in loop takes too much time (Anno Siegel)
    Re: loop in loop takes too much time <usenet@morrow.me.uk>
    Re: loop in loop takes too much time (Anno Siegel)
    Re: Microsoft Word and Perl (Ilaiyarasan)
    Re: MIDI streaming <usenet@morrow.me.uk>
    Re: perl -e '%h=(a=>1,b=>2); for (keys %h) { s/a/b/ };  (A. Farber)
    Re: Perl cgi on Windows 2003 Server fails <eric@thestanfields.com>
    Re: Perl cgi on Windows 2003 Server fails <ceo@nospam.on.net>
        using constant array (A. Farber)
    Re: using constant array <usenet@morrow.me.uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 12 Jun 2004 23:48:46 +0100
From: "Player" <notachance@inhell.com>
Subject: Re: Beginner needs help with script :)
Message-Id: <cag18a$hii$1@newsg2.svr.pol.co.uk>


<nobull@mail.com> wrote in message
news:4dafc536.0406090413.2106b642@posting.google.com...
> "Andrew DeFaria" <Andrew@DeFaria.com> wrote in message
news:<89626$40c66fea$c09cfc9$23187@msgid.meganewsservers.com>...
> > "Player" <notachance@inhell.com> wrote in message
> > news:ca5p3a$di0$1@newsg4.svr.pol.co.uk...
> > >
> > > > Sorry Tad I can't let that go unchallnged.
> > > >
> > > > On entering any new social situation (club, workplace, country) one
is
> > > > expected to research (or at least try to observe) what is accepted
> > > > behaviour.  Not doing so would be classed as bein rude by any normal
> > > > person.
> > > >
> > > > Usenet is no different at all.  We should not give 'Player' the get
> > > > out clause of preteding that what he did would not be seen as rude
in
> > > > the 'real world'.
> > >
> > > I wouldn't, many a person says, "I beg your pardon" or words to
similar
> > > effect when confronted with replies similar to what experienced, and
that
> > > is more or less how I replied.
> >
> > Or perhaps, "Excuse me, where's the bathroom".
>
>
> Note for non-English speakers (and people unable to read intonation in
> plaintext :-) )...
>
> In English (and especially American English, IIRC) the phrase "I beg
> your pardon" has two distinct meanings depending on tone of voice.  In
> one tone it means "I'm sorry, what have I done wrong?".  In another it
> is roughly equivalent to "screw you!".
>
> Andrew, I suspect you are mis-reading Player's statement that his
> response was '"I beg your pardon" or words to similar effect' as
> meaning that he politely enquired what he had done wrong (which would,
> of course, have been acceptable[1]).
>
> This indeed is how I initially read his statement and I thought: how
> can this guy think he can get away with making such obviously false
> assertions about his previous behaviour when the truth is archived for
> all to see?
>
> If you go back look at Player's response you'll realise that when he
> says that his words were to similar a effect as "I beg your pardon" he
> is, in fact, referring to the use of this phrase in the tone of voice
> where it means "screw you!".
>
> So Player is being quite honest when he says that his response to
> being advised that had acted in a way contray to local custom was
> words to the effect of "screw you!".  He is also right that there many
> people who react will like that.  He is wrong in his assertion
> (delusion?) that those people are not generally considered rude[2].

 You could not be further from the truth.

>
> [1] Barely acceptable - it is better to take a step back, look around
> you and try to figure out what you'd done wrong and then just say
> sorry.

Were I come from, England - Lancashire, when someone ask's you,
"I beg Your Pardon"
or words to similar effect, the general response is something along the
lines of a better explanation of
what was said before hand.
 What doesn't happen often, unless like here people can get away with
virtual murder because of anonymity, is a bunch of people surrendering to a
hostile group mentality and behaving like huligans all be virbally, and
bullying someone who is very new to the sce, area, group, place -whatever.

>
> [2] I'm sure there are specialised cultures where it is considered
> acceptable.

Well it is obvious to me that for one to accepted within these walls, all
one has to do is surrender to the yobbish mob like group mentality and
proceed to abuse every newcomer or person who is deemed by more than one or
other of the said group, as victim material.


Player



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.704 / Virus Database: 460 - Release Date: 12/06/2004




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

Date: Sun, 13 Jun 2004 00:16:47 GMT
From: ChrisO <ceo@nospam.on.net>
Subject: Re: Beginner needs help with script :)
Message-Id: <P1Nyc.25385$1x7.14913@newssvr31.news.prodigy.com>

Player wrote:

> Hello all
> 
>  I am teaching myself perl, with the help of a few texts/tutorials and a
> book.
> I have installed the latest Activestate perl build ActivePerl 5.8 on my
> WindowsXP Pro machine.
> Everything seemed to be going alright with the first few scripts, up untill
> I did this one.
> 
> %grades=();
> 
> print "Enter students names (press <CTRL>+D when done): ";
> @names = <STDIN>;
> chomp @names;
> print "\n\n";
> print "Enter associated grades (press <CTRL>+D when done): ";
> @scores = <STDIN>;
> 
> @grades{@names} = @scores
> 
> The problem is when I am inside the command prompt window and run the
> script, i called it gradehash.pl, it runs fine to the first stdin line were
> after I have finished entering the names to go into the @names list, I have
> to press <CTRL>+D in order to stop that stdin and the script to go onto the
> next line.
> By pressing <CTRL>+D alls I get is this  ^D    coming up insteadof it
> stopping the stdin and going to run the next line of the script.
> 

To answer your question directly, use Ctrl/Z on Windoze and Ctrl/D on 
Unix.  I would assume your tutorial is somewhat "Unix" based as indeed 
this is where Perl had its roots, so it stands to reason.  ActiveState 
Perl on Windows is about a fabulous an implementation of Perl as you are 
ever going to get in that environment, yet still it doesn't translate 
over 100% esp. from examples given on books like O'Reilly books (unless 
specifically Win32 oriented.)

If you'd like to get an even closer "Unix feel" under Windows, including 
using Perl (and which WOULD let you use Ctrl/D as an EOT), check into 
installing Cygwin on your Windows machine.  Highly recommended: 
http://www.cygwin.com.

Some of the points you made in your diatribe in other parts of this 
thread are understandable.  There are quite a few people here that tend 
to get a little "uppity" in my opinion and answer questions with their 
noses somewhat in the air.  Still... you are dealing with some of the 
most intellegient people on the internet in this NG and to push your 
points as you have done, as many as might agree with you in some measure
on some points is only going to land you in kill files and future 
questions you post won't even make it onto the screens of many that 
would have helped.  I don't like to be pushed around either.  Neither do 
people here nor WILL they.  (As a case in point, you totally MISSED the 
point one person was making because you got your feathers ruffled a bit 
prematurely...)  You have a right to post here -- they have a right to 
ignore you in the future by inserting you into their kill files.  It's 
that simple; you WILL end up loosing in the end if it's Perl you really 
want to learn.

You might want to consider asking yourself which thing you want to do 
the most in c.l.p.m: establish your "rights" or learn Perl? ;-)  If you 
choose "learning Perl," then even though you might have to overlook some 
"attitudes" here and there, I can guarantee you you'll be learning from 
the best in this NG.  (Most of the time, I lurk and learn myself even 
though I've been doing this for a while.)

Anyway, try Ctrl/D, champ...

-ceo


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

Date: Sun, 13 Jun 2004 00:48:53 GMT
From: ChrisO <ceo@nospam.on.net>
Subject: Re: Beginner needs help with script :)
Message-Id: <VvNyc.1520$0k3.1144@newssvr16.news.prodigy.com>

ChrisO wrote:

> Player wrote:
> 
>> Hello all
>>
>>  I am teaching myself perl, with the help of a few texts/tutorials and a
>> book.
>> I have installed the latest Activestate perl build ActivePerl 5.8 on my
>> WindowsXP Pro machine.
>> Everything seemed to be going alright with the first few scripts, up 
>> untill
>> I did this one.
>>
>> %grades=();
>>
>> print "Enter students names (press <CTRL>+D when done): ";
>> @names = <STDIN>;
>> chomp @names;
>> print "\n\n";
>> print "Enter associated grades (press <CTRL>+D when done): ";
>> @scores = <STDIN>;
>>
>> @grades{@names} = @scores
>>
>> The problem is when I am inside the command prompt window and run the
>> script, i called it gradehash.pl, it runs fine to the first stdin line 
>> were
>> after I have finished entering the names to go into the @names list, I 
>> have
>> to press <CTRL>+D in order to stop that stdin and the script to go 
>> onto the
>> next line.
>> By pressing <CTRL>+D alls I get is this  ^D    coming up insteadof it
>> stopping the stdin and going to run the next line of the script.
>>
> 
> To answer your question directly, use Ctrl/Z on Windoze and Ctrl/D on 
> Unix.  I would assume your tutorial is somewhat "Unix" based as indeed 
> this is where Perl had its roots, so it stands to reason.  ActiveState 
> Perl on Windows is about a fabulous an implementation of Perl as you are 
> ever going to get in that environment, yet still it doesn't translate 
> over 100% esp. from examples given on books like O'Reilly books (unless 
> specifically Win32 oriented.)
> 
> If you'd like to get an even closer "Unix feel" under Windows, including 
> using Perl (and which WOULD let you use Ctrl/D as an EOT), check into 
> installing Cygwin on your Windows machine.  Highly recommended: 
> http://www.cygwin.com.
> 
> Some of the points you made in your diatribe in other parts of this 
> thread are understandable.  There are quite a few people here that tend 
> to get a little "uppity" in my opinion and answer questions with their 
> noses somewhat in the air.  Still... you are dealing with some of the 
> most intellegient people on the internet in this NG and to push your 
> points as you have done, as many as might agree with you in some measure
> on some points is only going to land you in kill files and future 
> questions you post won't even make it onto the screens of many that 
> would have helped.  I don't like to be pushed around either.  Neither do 
> people here nor WILL they.  (As a case in point, you totally MISSED the 
> point one person was making because you got your feathers ruffled a bit 
> prematurely...)  You have a right to post here -- they have a right to 
> ignore you in the future by inserting you into their kill files.  It's 
> that simple; you WILL end up loosing in the end if it's Perl you really 
> want to learn.
> 
> You might want to consider asking yourself which thing you want to do 
> the most in c.l.p.m: establish your "rights" or learn Perl? ;-)  If you 
> choose "learning Perl," then even though you might have to overlook some 
> "attitudes" here and there, I can guarantee you you'll be learning from 
> the best in this NG.  (Most of the time, I lurk and learn myself even 
> though I've been doing this for a while.)
> 
> Anyway, try Ctrl/D, champ...

Uhh... Ctrl/Z is what I meant.  (Which I see you already found.)

-ceo


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

Date: 12 Jun 2004 14:33:58 -0700
From: groups@nodata.co.uk (nodata)
Subject: Extracting Metadata from Microsoft Office documents
Message-Id: <aabe2b81.0406121333.675d3b2c@posting.google.com>

How can I extract Metadata from a range of Office documents, on a Linux box?


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

Date: Sat, 12 Jun 2004 23:05:31 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Extracting Metadata from Microsoft Office documents
Message-Id: <cag27r$dm7$1@wisteria.csv.warwick.ac.uk>


Quoth groups@nodata.co.uk (nodata):
> How can I extract Metadata from a range of Office documents, on a
> Linux box?

The easiest way, if you can manage it, is to save the docs as HTML with
a recent version on Office on a Windows box. New (since 2k-ish) versions
of Office actually produce XML, with pretty much everything in the
original file intact (and, of course, the file is about one tenth the
size...). You can then parse this with, say, XML::LibXML and get out the
data you need.

If you have access to a win32 box over the network it wouldn't be too
hard to write a perl script for the win32 box which would receive a
document, open it in Office using Win32::OLE, save it as HTML and send
it back.

If you don't, you're into parsing the binary file yourself; a quick look
at CPAN doesn't show up anything useful. You could try creating
documents with known metadata and grovelling around in the files with a
hex editor to see if you can reverse engineer the format sufficiently;
or you could try your luck with Abiword or OOffice to see if you can get
them to convert the files into something you can read.

Ben

-- 
        I must not fear. Fear is the mind-killer. I will face my fear and
        I will let it pass through me. When the fear is gone there will be 
        nothing. Only I will remain.
ben@morrow.me.uk                                          Frank Herbert, 'Dune'


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

Date: Sat, 12 Jun 2004 23:18:13 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Extracting Metadata from Microsoft Office documents
Message-Id: <cag2vl$dm7$3@wisteria.csv.warwick.ac.uk>


Quoth Ben Morrow <usenet@morrow.me.uk>:
> 
> Quoth groups@nodata.co.uk (nodata):
> > How can I extract Metadata from a range of Office documents, on a
> > Linux box?
> 
> If you have access to a win32 box over the network it wouldn't be too
> hard to write a perl script for the win32 box which would receive a
> document, open it in Office using Win32::OLE, save it as HTML and send
> it back.

I meant to add that 'over the network' can include VMware, if you are in a
position to afford it (and a windows license, and an office licence)...

Ben

-- 
  Joy and Woe are woven fine,
  A Clothing for the Soul divine       William Blake
  Under every grief and pine          'Auguries of Innocence'
  Runs a joy with silken twine.                                ben@morrow.me.uk


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

Date: Sat, 12 Jun 2004 20:52:49 -0400
From: Ken Sington <ken_sington@nospam_abcdefg.com>
Subject: foreach ($a, $b, $c)...
Message-Id: <qDOdncluqdz9OFbdRWPC-g@speakeasy.net>

has anyone tried:

foreach ($a, $b, $c){
     ...
}

well, it doesn't work.

but what if I wanted to do that?


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

Date: Sat, 12 Jun 2004 18:17:40 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: How to test a variable to see if it is a valid regexp pattern?
Message-Id: <cafhc4$7hk$2@wisteria.csv.warwick.ac.uk>


Quoth "Kjetil Skotheim" <kjetilskotheim@yahoo.com>:
> On 11 Jun 2004 05:04:30 -0700, Leif Wessman <leifwessman@hotmail.com>  
> wrote:
> 
> > How do I test a variable to see if it contains a valid regexp pattern?
> > Is it possible?
> 
> Using eval (like those earlier replies suggest) is probably the easyest  
> way to go.
> But be awary of the security implications!

You are missing the crucial difference between eval "" and eval {}. They
are completely different operations, and shouldn't really have the same
keyword. eval "" is a runtime-evaluation operator, with all the security
risks that implies; eval {} is simply how Perl spells 'catch' (as in
exceptions), and poses no risk whatever.

Ben

-- 
And if you wanna make sense / Whatcha looking at me for?          (Fiona Apple)
                            * ben@morrow.me.uk *


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

Date: Sat, 12 Jun 2004 18:14:57 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: loop in loop takes too much time
Message-Id: <cafh71$7hk$1@wisteria.csv.warwick.ac.uk>


Quoth anno4000@lublin.zrz.tu-berlin.de (Anno Siegel):
> Iain  <spamtrap@deepsea.force9.co.uk> wrote in comp.lang.perl.misc:
> > massion@gmx.de (FMAS) wrote in news:f0b3f4c9.0406112239.7c53b9c4
> > @posting.google.com:
> > 
> > > I am comparing 2 lists of words and want to output the words in list 1
> > > which are not available in list 2. Both lists have a different number
> > > of entries.
> > 
> > If you're merely trying to find words in file1 that aren't in file2 I 
> > wouldn't bother with arrays at all.
> 
> That's what OP said, but the code shows the matches are supposed to
> be case-insensitive.
> 
> A hash can still be used, but some case normalization must be done:
> 
>     my ( $f1, $f2);
>     open $f1, $_ or die "Can't read $_: $!" for '/tmp/a';
>     open $f2, $_ or die "Can't read $_: $!" for '/tmp/b';
>     my %file2words = map { uc() => 1 } <$f2>;

Just a minor nit: in a Unicode environment it is better to use lc for
case-folding than uc, as Unicode has three cases: upper, lower and
title, with mappings upper <-> lower and title <-> lower.

Ben

-- 
        I must not fear. Fear is the mind-killer. I will face my fear and
        I will let it pass through me. When the fear is gone there will be 
        nothing. Only I will remain.
ben@morrow.me.uk                                          Frank Herbert, 'Dune'


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

Date: 12 Jun 2004 21:06:44 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: loop in loop takes too much time
Message-Id: <cafr94$3h$1@mamenchi.zrz.TU-Berlin.DE>

Ben Morrow  <usenet@morrow.me.uk> wrote in comp.lang.perl.misc:
> Quoth anno4000@lublin.zrz.tu-berlin.de (Anno Siegel):

[...]

> > A hash can still be used, but some case normalization must be done:
> > 
> >     my ( $f1, $f2);
> >     open $f1, $_ or die "Can't read $_: $!" for '/tmp/a';
> >     open $f2, $_ or die "Can't read $_: $!" for '/tmp/b';
> >     my %file2words = map { uc() => 1 } <$f2>;
> 
> Just a minor nit: in a Unicode environment it is better to use lc for
> case-folding than uc, as Unicode has three cases: upper, lower and
> title, with mappings upper <-> lower and title <-> lower.

Ah, thanks for that (I knew about title case, but never drew this
conclusion).  It is good to have a general default for the uc/lc
choice, when there is no other preference.

As I look at that line again, I notice that the map block
"{ lc() => 1 }" looks exactly like a one-pair hashref.  Prefixed
with a "+", or in a different context, it is one.  Would

    map { ( lc() => 1) } <$f2>;

be clearer?  I don't consider unnecessary parentheses often, but
this may be a case.  What does the style pol^Wpanel say?

Anno


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

Date: Sat, 12 Jun 2004 22:53:45 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: loop in loop takes too much time
Message-Id: <cag1hp$dat$1@wisteria.csv.warwick.ac.uk>


Quoth anno4000@lublin.zrz.tu-berlin.de (Anno Siegel):
> Ben Morrow  <usenet@morrow.me.uk> wrote in comp.lang.perl.misc:
> > Quoth anno4000@lublin.zrz.tu-berlin.de (Anno Siegel):
> 
> > >     my %file2words = map { uc() => 1 } <$f2>;
> 
> As I look at that line again, I notice that the map block
> "{ lc() => 1 }" looks exactly like a one-pair hashref.  Prefixed
> with a "+", or in a different context, it is one.  Would
> 
>     map { ( lc() => 1) } <$f2>;
> 
> be clearer?  I don't consider unnecessary parentheses often, but
> this may be a case.  What does the style pol^Wpanel say?

I would probably omit the block altogether, and write

my %file2words = map +( (lc) => 1 ), <$f2>;

or forget the 1 and just use

my %file2words;
@file2words{ map lc, <$f2> } = ();

The first is a case for not using =>:

my %file2words = map +(lc, 1), <$f2>;

Hmm, I think I like that best, modulo my standard irritation at the need
for the '+' (one of my projects for when-I-get-round-tuit is writing a
pragma to make whitespace between function-name and '(' significant (or
maybe even get rid of 'function(args)' altogether, in favour of
'(function args)' where necessary), along with allowing methods to be
called as list operators).

Ben

-- 
Musica Dei donum optimi, trahit homines, trahit deos.    |
Musica truces molit animos, tristesque mentes erigit.    |   ben@morrow.me.uk
Musica vel ipsas arbores et horridas movet feras.        |


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

Date: 13 Jun 2004 00:27:01 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: loop in loop takes too much time
Message-Id: <cag70l$6tj$1@mamenchi.zrz.TU-Berlin.DE>

Ben Morrow  <usenet@morrow.me.uk> wrote in comp.lang.perl.misc:
> 
> Quoth anno4000@lublin.zrz.tu-berlin.de (Anno Siegel):
> > Ben Morrow  <usenet@morrow.me.uk> wrote in comp.lang.perl.misc:
> > > Quoth anno4000@lublin.zrz.tu-berlin.de (Anno Siegel):
> > 
> > > >     my %file2words = map { uc() => 1 } <$f2>;
> > 
> > As I look at that line again, I notice that the map block
> > "{ lc() => 1 }" looks exactly like a one-pair hashref.  Prefixed
> > with a "+", or in a different context, it is one.  Would
> > 
> >     map { ( lc() => 1) } <$f2>;
> > 
> > be clearer?  I don't consider unnecessary parentheses often, but
> > this may be a case.  What does the style pol^Wpanel say?
> 
> I would probably omit the block altogether, and write
> 
> my %file2words = map +( (lc) => 1 ), <$f2>;
>
> or forget the 1 and just use
> 
> my %file2words;
> @file2words{ map lc, <$f2> } = ();
> 
> The first is a case for not using =>:
>
> my %file2words = map +(lc, 1), <$f2>;
> 
> Hmm, I think I like that best, modulo my standard irritation at the need
> for the '+'

It's certainly short, and also clear modulo that irritation.  "+"
spoils readability, just because it is so rarely needed.  Pity about
the "=>", pointing from key to value in the prospective hash.

>             (one of my projects for when-I-get-round-tuit is writing a
> pragma to make whitespace between function-name and '(' significant (or

Good thing Abigail isn't looking...

> maybe even get rid of 'function(args)' altogether, in favour of
> '(function args)' where necessary), along with allowing methods to be
> called as list operators).

Projects involving the parser awe me.

I have a certain dislike for the (function args) notation, but that
may be entirely subjective.  I realize how it meshes list operator
notation with the function of () as (sub-)expression delimiters.

Anno


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

Date: 12 Jun 2004 11:34:51 -0700
From: Ilaiy@hotmail.com (Ilaiyarasan)
Subject: Re: Microsoft Word and Perl
Message-Id: <1980fc05.0406121034.4f7b4592@posting.google.com>

The error which i get is

Win32::OLE(0.1502) error 0x80020005: " Type mismatch" in
METHOD/PROPERTYGET" argumrnt 1 at test1.pl line 37 which is the
$obj_Story->Fields->Update


Could you tell me what is the problem 

Ilaiy











Ben Morrow <usenet@morrow.me.uk> wrote in message news:<cad4rn$5t5$1@wisteria.csv.warwick.ac.uk>...
> [stop top-posting]
> 
> Quoth Ilaiy@hotmail.com (Ilaiyarasan):
> > 
> > Ben Morrow <usenet@morrow.me.uk> wrote in message news:<cabdue$og7$4@wisteria.csv.warwick.ac.uk>...
> > > Quoth Ilaiy@hotmail.com (Ilaiyarasan):
> > > > 
> > > > my $newdoc = $word->ActiveDocument;
> > > > foreach my $obj_Story ($newdoc->StoryRanges ){
> > > > 	$obj_Story->Fields->{Update};   ==> Cannot find object 
> > > 
> > > I don't know much about OLE, but surely that should be
> > > 
> > > $obj_Story->Fields->update;
> > > 
> > > ? update is a method, not a property.
> > > 
> > > > The equivalent in VBA is .. 
> > > > 
> > > >     Dim obj_Story As Range
> > > >     For Each obj_Story In ActiveDocument.StoryRanges
> > > >         obj_Story.Fields.update
>                                ^^
>                             lower case 'u'
> 
> > > >         While Not (obj_Story.NextStoryRange Is Nothing)
> > > >             Set obj_Story = obj_Story.NextStoryRange
> > > >                 obj_Story.Fields.update
> > > >         Wend
> > > >     Next obj_Story
> > > >         Set obj_Story = Nothing
> >  
> > I think it still gives me a problem 
> > 
> > my $newdoc = $word->ActiveDocument;
> > foreach my $obj_Story ($newdoc->StoryRanges ){
> > 	$obj_Story->Fields->Update;
>                             ^^
>                         upper case 'U'
>                         
> > 	    while (my $obj_Story = $obj_Story->NextStoryRange){
> > 	    	$obj_Story->Fields->Update;
> > 	    }
> > 	    	
> > It srill gave me the same error i am not sure why it is doing that
> > because it works perfectly in VB but when you get the same code in
> > Perl it kind of acts really stange..
> 
> Be more careful.
> 
> If this is not the problem, please post your code and the *exact* error
> message you get.
> 
> Ben


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

Date: Sat, 12 Jun 2004 18:25:00 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: MIDI streaming
Message-Id: <cafhps$7hk$3@wisteria.csv.warwick.ac.uk>


Quoth nenamiele@libero.it (Alx):
> I'm trying to use the fine MIDI::simple module, but I'd like its
> output not to be saved to a file, but streamed out.
> (it is a "singing" cellular automata, and I'd like to listen to its
> hisses and noises in the background).
> Somebody here knows if it is possible?

Call write_score with an open filehandle instead of a filename.

Ben

-- 
don't get my sympathy hanging out the 15th floor. you've changed the locks 3
times, he still comes reeling though the door, and soon he'll get to you, teach
you how to get to purest hell. you do it to yourself and that's what really
hurts is you do it to yourself just you, you and noone else ** ben@morrow.me.uk


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

Date: 12 Jun 2004 13:09:01 -0700
From: Alexander.Farber@t-online.de (A. Farber)
Subject: Re: perl -e '%h=(a=>1,b=>2); for (keys %h) { s/a/b/ }; print keys %h'
Message-Id: <c9ccaf83.0406121209.452ea@posting.google.com>

Tad McClellan <tadmc@augustmail.com> wrote in message 
> >> "A. Farber" <Alexander.Farber@t-online.de> wrote in message
>  
> >> > I'd like to go through the hash keys and
> >> > perform a substitution on them,

> It would be much better if you could do the s/// while populating
> the hash in the first place, but you haven't shown how you're
> building the hash in your real code...

Thanks, that's what I've ended up with


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

Date: Sat, 12 Jun 2004 14:50:52 -0500
From: "Eric Stanfield" <eric@thestanfields.com>
Subject: Re: Perl cgi on Windows 2003 Server fails
Message-Id: <e6387$40cb5e9d$42a79e2b$30972@msgid.meganewsservers.com>

Have you checked the Web Security extensions (think that is the correct
lingo) in IIS on your 2003 server?  Out of the box, the latest IIS is very
gimped as far as what it will let execute.  Look in the IIS manager, on the
left side it is listed there then the options of what to allow/disallow are
shown in the right pane.

"Hallvard ?strem" <hallvardost@hotmail.com> wrote in message
news:79b0e251.0406110349.53d9eeb3@posting.google.com...
> Thanks for your help, Kevin. The problem persists even if the server
> application runs as the current user, that is a user who can execute
> perl scripts from the DOS prompt.
>
> FirstClass CGI setup is quite simple and doesn't require any
> configuration other than the cgi-bin folder being installed in the
> appropriate folder on the file system. The script should execute as
> long as it finds the file in the cgi-bin path, and it does if it is
> e.g. a precompiled script.
>
> Since my server setup worked just fine on Windows NT, I'm quite sure
> my problem must be related to Perl/Windows 2003 Server somehow. Since
> Perl works fine from the prompt, I also believe it to be more likely
> related to the Windows 2003 Server setup, but how is still a mystery
> to me. I'm out of ideas...
>
> Hallvard
>
>
> spamtotrash@toomuchfiction.com (Kevin Collins) wrote in message
news:<slrnccecmb.f8v.spamtotrash@doom.unix-guy.com>...
> > In article <79b0e251.0406090128.2536cc08@posting.google.com>, Hallvard
?strem
> > wrote:
> > > My well tested Perl CGI scripts will not run on my web server after
> > > moving it from Windows NT 4.0 to a brand new Windows 2003 Server. The
> > > web server software is FirstClass Server 7.1 from Open Text Corp.
> > > (http://www.opentext.com/products/firstclass/), and the web server
> > > setup is identical with the setup on NT, which should be OK. Perl
> > > version on Windows 2003 Server is 5.806. Here are some of my
> > > observations:
> > >
> > > 1. Scripts are running OK from the command prompt on the server, and
> > > the Perl installation looks OK. I've been through the more classical
> > > Perl for win32 pitfalls checks.
> > >
> > > 2. Client browser returns this message:
> > > ---
> > > 1.1 200 OK Server: FirstClass/7.1 Content-type: text/html Don't know
> > > how to run /cgi-bin/example.pl
> > > ---
> > > (Example.pl is a simple "Hello World" demo which runs OK from the
> > > prompt -- and normally on any web server with CGI-capabillity.)
> > >
> > > 3. Compiled CGI scripts, e.g. EXE-files, runs OK on the server.
> > >
> > > 4. Checked out the system PATH environment variable, and it points at
> > > C:\Perl\bin like it should.
> > >
> > > 5. Web server service is set up with the Local System user account,
> > > and should have the proper access rights.
> > >
> > > 6. I've installed an Apache test server in order to rule out the
> > > possibility that the problem somehow could be related to my FirstClass
> > > Server setup. The symptoms were almost identical, allthough Apache
> > > returned an not specified "Internal Server Error" message. Compiled
> > > CGI ran OK on Apache as well.
> > >
> > > In other words, there must be something in the Windows 2003 Server
> > > setup that I've missed? It seems like FirstClass Server can't find the
> > > Perl interpreter, even though the system PATH is OK. I've been through
> > > loads of FAQs and documentation, but haven't come across a solution so
> > > far. So I'll appreciate a helping hand on this.
> > >
> > > Regards,
> > > Hallvard Østrem
> >
> > I would suspect that the ".pl" file extension is not set system-wide, or
you
> > possibly need to define a "handler" (Apache term) for .pl files.
> >
> > Kevin




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

Date: Sat, 12 Jun 2004 22:26:16 GMT
From: ChrisO <ceo@nospam.on.net>
Subject: Re: Perl cgi on Windows 2003 Server fails
Message-Id: <cqLyc.1022$Pt.879@newssvr19.news.prodigy.com>

Hallvard ?strem wrote:
> Thanks for your help, Kevin. The problem persists even if the server
> application runs as the current user, that is a user who can execute
> perl scripts from the DOS prompt.
> 
> FirstClass CGI setup is quite simple and doesn't require any
> configuration other than the cgi-bin folder being installed in the
> appropriate folder on the file system. The script should execute as
> long as it finds the file in the cgi-bin path, and it does if it is
> e.g. a precompiled script.
> 
> Since my server setup worked just fine on Windows NT, I'm quite sure
> my problem must be related to Perl/Windows 2003 Server somehow. Since
> Perl works fine from the prompt, I also believe it to be more likely
> related to the Windows 2003 Server setup, but how is still a mystery
> to me. I'm out of ideas...
> 
> Hallvard
> 

I, for one, would be a little curious as to which Perl you are running 
as well.  The symptoms you've described don't directly implicate the 
version of Perl, but I'm curious nonetheless.  The version you specified 
doesn't sound like ActiveState Perl which I consider to be the de facto 
standard in the Windows world.  Your Perl of course wouldn't *have* to 
be ASPN in order to work, hence my curiosity.

-ceo


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

Date: 12 Jun 2004 15:50:58 -0700
From: Alexander.Farber@t-online.de (A. Farber)
Subject: using constant array
Message-Id: <c9ccaf83.0406121450.6df92576@posting.google.com>

Hi,

I have defined a list of constants in my script:

    use constant DEFPLATS => qw(ARMI ARM4 THUMB WINS WINSCW);

But the use of it feels a bit clumsy though -
I have to put it in brackets for the hash slices:

    @prj_platforms{(DEFPLATS)} = (1) x length DEFPLATS;

and it doesn't interpolate in strings.
Do you have any advices on that? TIA

Regards
Alex


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

Date: Sat, 12 Jun 2004 23:15:15 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: using constant array
Message-Id: <cag2q3$dm7$2@wisteria.csv.warwick.ac.uk>


Quoth Alexander.Farber@t-online.de (A. Farber):
> 
> I have defined a list of constants in my script:
> 
>     use constant DEFPLATS => qw(ARMI ARM4 THUMB WINS WINSCW);
> 
> But the use of it feels a bit clumsy though -
> I have to put it in brackets for the hash slices:
> 
>     @prj_platforms{(DEFPLATS)} = (1) x length DEFPLATS;

You don't have to, you just have to make it not a bareword:

@hash{DEFPLATS()}
@hash{+DEFPLATS}

> and it doesn't interpolate in strings.

You can interpolate a sub with

my $str = "stuff @{[ DEFPLATS ]} stuff"

However, I think both your problems are better solved by simply using an
array:

my @DEFPLATS = qw/.../;

or, if you need it to be package- rather than lexically-scoped, like the
constant was,

our @DEFPLATS = qw/.../;

If you need it at compile time you can do the slightly clumsy

my @DEFPLATS;
BEGIN { @DEFPLATS = qw/.../ }

or, if you are package-scoping it,

use vars::i '@DEFPLATS' => qw/.../;

Get vars::i from CPAN.

Ben

-- 
If I were a butterfly I'd live for a day, / I would be free, just blowing away.
This cruel country has driven me down / Teased me and lied, teased me and lied.
I've only sad stories to tell to this town: / My dreams have withered and died.
  ben@morrow.me.uk                                                 (Kate Rusby)


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V10 Issue 6685
***************************************


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