[25915] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 8140 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 1 18:05:21 2005

Date: Wed, 1 Jun 2005 15:05:07 -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           Wed, 1 Jun 2005     Volume: 10 Number: 8140

Today's topics:
    Re: Can I use OODoc to create a paragraph with a mix of <daveandniki@ntlworld.com>
    Re: Can I use OODoc to create a paragraph with a mix of <mark.clementsREMOVETHIS@wanadoo.fr>
    Re: confused constructing a regex <uk.ac.ox.physics.teaching@leeg.invalid>
    Re: confused constructing a regex <tadmc@augustmail.com>
    Re: confused constructing a regex <uk.ac.ox.physics.teaching@leeg.invalid>
    Re: getting $date (spam)
        Test <ascoteric@hotmail.com>
    Re: Test <tadmc@augustmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 01 Jun 2005 19:02:50 GMT
From: "Dave" <daveandniki@ntlworld.com>
Subject: Re: Can I use OODoc to create a paragraph with a mix of bold and normal text?
Message-Id: <uDnne.6061$%h4.4230@newsfe3-win.ntli.net>


"Mark" <mark.clementsREMOVETHIS@wanadoo.fr> wrote in message 
news:429dfd1f$0$901$8fcfb975@news.wanadoo.fr...
> Dave wrote:
>> I have a fairly complex Perl script that reads in data from an XML file 
>> processes it and writes it to a text file. This works well. I now wish to 
>> make some words bold, italic, superscript etc. On a Win32 platform I 
>> could automate MSWord to do this but I would like it to be portable, so I 
>> would prefer to produce an OOo document.
>>
>> I have installed the OODoc module tested it. All fine
>>
>> I have found the documentation sparse and confusing and cannot fathom how 
>> to make it append formatted text to a paragraph. I want to say 'append 
>> this string in bold', 'append this string in italics', 'append this 
>> string as a superscript' etc. I assume I need to use the 'appendText' 
>> method with appropriate options but I can't see an example of its usage.
>>
>
> is
>
> http://perl.enstimac.fr/perl5.8.5/site_perl/5.8.5/OpenOffice/OODoc/Text.html#appendtext_element_name_____options___
>
> any help?

Thanks Mark. However this is the documentation I have already seen (it is in 
text.pod with the installed module), it doesn't show me how to change the 
formatting for a sub-element of the paragraph. The example given doesn't 
even append text to an existing paragraph it generates a new one. I'm 
beginning to think that I will need to use OODoc:XPath to acheive what I 
want and to do this would need to understand the file format at a deepish 
level. It looks messy and complicated compared to automating Word, but I am 
trying to free all my stuff from propriety formats and so want to use 
OpenOffice.

I should also mention that my text is UTF-8 and this produces errors in 
Encode.pm which is presumably used by OODoc. I haven't looked into why yet.

Dave




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

Date: Wed, 01 Jun 2005 20:23:24 +0200
From: Mark <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: Can I use OODoc to create a paragraph with a mix of bold and normal text?
Message-Id: <429dfd1f$0$901$8fcfb975@news.wanadoo.fr>

Dave wrote:
> I have a fairly complex Perl script that reads in data from an XML file 
> processes it and writes it to a text file. This works well. I now wish to 
> make some words bold, italic, superscript etc. On a Win32 platform I could 
> automate MSWord to do this but I would like it to be portable, so I would 
> prefer to produce an OOo document.
> 
> I have installed the OODoc module tested it. All fine
> 
> I have found the documentation sparse and confusing and cannot fathom how to 
> make it append formatted text to a paragraph. I want to say 'append this 
> string in bold', 'append this string in italics', 'append this string as a 
> superscript' etc. I assume I need to use the 'appendText' method with 
> appropriate options but I can't see an example of its usage.
> 

is

http://perl.enstimac.fr/perl5.8.5/site_perl/5.8.5/OpenOffice/OODoc/Text.html#appendtext_element_name_____options___

any help?


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

Date: Wed, 01 Jun 2005 18:20:34 GMT
From: leeg <uk.ac.ox.physics.teaching@leeg.invalid>
Subject: Re: confused constructing a regex
Message-Id: <S%mne.3903$cN2.926@newsfe4-gui.ntli.net>

Tad McClellan wrote:
> leeg <uk.ac.ox.physics.teaching@leeg.invalid> wrote:
> 
> 
>>I have an input file of a format that looks something like this:
> 
>                                               ^^^^^^^^^^^^^^
> 
> The devil is in the details with regexes, so "something like" is
> likely not good enough to get a useable answer.
> 

No, but I can't completely define the syntax of the input data so 
implementing "something like" it then fixing failures is the best I can do.

> Can there be spaces in the already-quoted strings? Your example
> has none like that.
> 

Yes there can; there can even be important characters (e.g. ()) in the 
quoted strings, I'll sort those out by transliterating anything that's 
left after I've parsed the data.

> Can declarations be broken across lines? eg:
> 
>    someArray = (value1, 
>                 value2);

Yes, and the example included hashes declared thus.

> 
> Can you have values on the RHS that you do NOT what to quote?
> 

No, as everything can be eval-ed into a string and then dealt with 
'upstream', as it were.

> etc...
> 
[...]
> 
> 
> You might be able to get the LHS(s) handled by a simple 
> 
>    s/ = / => /;
> 
> and let perl autoquote for you.
> 
> You'll need to change (some of?) the parens to squares for 
> anonymous array elements.
> 
Yes, I've sorted that bit with some transliteration, thanks.
> 
> 
> It would become Real Easy if you had a grammar for the data, then
> you could simply write a parser for the grammar.
> 

Yup.

> Got a grammar?
> 
Nope.  :-(


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

Date: Wed, 1 Jun 2005 15:28:24 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: confused constructing a regex
Message-Id: <slrnd9s6j8.2la.tadmc@magna.augustmail.com>

leeg <uk.ac.ox.physics.teaching@leeg.invalid> wrote:
> Tad McClellan wrote:
>> leeg <uk.ac.ox.physics.teaching@leeg.invalid> wrote:
>> 
>> 
>>>I have an input file of a format that looks something like this:


What generates the data?


> implementing "something like" it then fixing failures is the best I can do.


Not necessarily.

It is the best you *know how* to do.


>> It would become Real Easy if you had a grammar for the data, then
>> you could simply write a parser for the grammar.
>> 
> 
> Yup.
> 
>> Got a grammar?
>> 
> Nope.  :-(


Then write a grammar for it, it looks a rather simple language to me.

It will be easier to guess at a grammar and then fix failures that
to do it with pattern matching.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Wed, 01 Jun 2005 20:53:05 GMT
From: leeg <uk.ac.ox.physics.teaching@leeg.invalid>
Subject: Re: confused constructing a regex
Message-Id: <Repne.5179$Mi4.744@newsfe2-win.ntli.net>

Tad McClellan wrote:
> leeg <uk.ac.ox.physics.teaching@leeg.invalid> wrote:
> 
>>Tad McClellan wrote:
>>
>>>leeg <uk.ac.ox.physics.teaching@leeg.invalid> wrote:
>>>
>>>
>>>
>>>>I have an input file of a format that looks something like this:
> 
> 
> 
> What generates the data?
> 

Apple/NeXT's EOModeller application.  It's an old variant of the plist 
format (before XML came along).

> 
> 
>>implementing "something like" it then fixing failures is the best I can do.
> 
> 
> 
> Not necessarily.
> 
> It is the best you *know how* to do.
> 

Actually, you'll have noticed that I don't even know how to do that :-)

> 
> 
>>>It would become Real Easy if you had a grammar for the data, then
>>>you could simply write a parser for the grammar.
>>>
>>
>>Yup.
>>
>>
>>>Got a grammar?
>>>
>>
>>Nope.  :-(
> 
> 
> 
> Then write a grammar for it, it looks a rather simple language to me.
> 
> It will be easier to guess at a grammar and then fix failures that
> to do it with pattern matching.
> 
> 

Perhaps, I don't know how to write a grammar engine either.... :-(


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

Date: Wed, 1 Jun 2005 20:28:16 +0200
From: spam@zeouane.org (spam)
Subject: Re: getting $date
Message-Id: <1gxfiea.1118sdt6y4us9N%spam@zeouane.org>

Josef Moellers <josef.moellers@fujitsu-siemens.com> wrote:

> spam wrote:
> > Graham Gough <graham@cs.man.ac.uk> wrote:
> > 
> > 
> >>perldoc -f localtime
> > 
> > 
> > That probably is what I'm looking for, but the perldoc page isn't (to
> > me, a newbie) very clear .. 
> > 
> > Converts a time as returned by the time function to a 9-element
> >                list with the time analyzed for the local time zone.
> > Typically
> >                used as follows:
> > 
> >                    #  0    1    2     3     4    5     6     7     8
> >                    ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)
> > = localtime(time);
> > 
> > OK, so in my code, I put ... 
> > 
> > my $date = localtime ($day, $mday, $year) ;
> > 
> > No surprises: it doesn't work.  
> > 
> > All other combinations (locatime inside brackets, outside brackets, with
> > curly brackets, with $ in front, after, in the middle ..) don't work.
> 
> You need to master elemntary perl first, before trying such am ambitous
> project B-{)

Oh, I agree.  :-(



-- 
spam


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

Date: Wed, 1 Jun 2005 21:18:26 +0200
From: "Ascoteric" <ascoteric@hotmail.com>
Subject: Test
Message-Id: <d7l238$5hh$65@news.hispeed.ch>





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

Date: Wed, 1 Jun 2005 15:30:49 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Test
Message-Id: <slrnd9s6np.2la.tadmc@magna.augustmail.com>

Ascoteric <ascoteric@hotmail.com> wrote:

> Subject: Test


What were you testing?

To see if you could get yourself killfiled before asking even
a single question?

If so, then the test has passed!


So long.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

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


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