[16189] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3601 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 10 19:24:08 2000

Date: Mon, 10 Jul 2000 16:23:57 -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: <963271436-v9-i3601@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 10 Jul 2000     Volume: 9 Number: 3601

Today's topics:
        Sorting an array of numbers <berube@odyssee.net>
    Re: Sorting an array of numbers <uri@sysarch.com>
    Re: Sorting an array of numbers (Tad McClellan)
    Re: Sorting an array of numbers <debjit@oyeindia.com>
    Re: Sorting an array of numbers <jcook@strobedata.com>
    Re: Sorting an array of numbers <makarand_kulkarni@my-deja.com>
        sorting multidimensional arrays <waltonic@earbuzz.demon.co.uk>
    Re: sorting multidimensional arrays (Tad McClellan)
    Re: sorting multidimensional arrays <bill@PLEASEDONOTSPAMMEphoenixdsl.com>
        Sorting <b.m.ovregard@shell.no>
    Re: Sorting (Bernard El-Hagin)
        sound editing  aaronp@removeme-shore.net
    Re: sound editing <gus@black.hole-in-the.net>
        Spacing algorithm <s2mdalle@titan.vcu.edu>
    Re: Spacing algorithm <randy@theory.uwinnipeg.ca>
    Re: Spacing algorithm (Bron Gondwana)
        Special attributes in write() call. <anmcguire@ce.mediaone.net>
    Re: StarOffice (StarCalc) in Perl <gellyfish@gellyfish.com>
    Re: StarOffice (StarCalc) in Perl <ck@ix.heise.de>
    Re: StarOffice (StarCalc) in Perl <arifsaha@yahoo.com>
        Starting FTP <bneary@gnosis-is.com>
    Re: Starting FTP (David Efflandt)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 7 Jul 2000 01:35:30 -0400
From: "Benjamin Bérubé" <berube@odyssee.net>
Subject: Sorting an array of numbers
Message-Id: <VZd95.21777$NS6.321668@news.globetrotter.net>

Hi,

I have a problem sorting an array of numbers.  These numbers are actually
strings, like :

@list = ("1", "1030", "102", "100", "1034", "1025", "1003")

Now, doing sort(@list) i get this order :

1, 100, 1003, 102, 1025, 1030, 1034

which as you can see is an *string* order, not a number order.  How can I
sort by number so that I would get :

1, 100, 102, 1003, 1025, 1030, 1034 ???

Note that I must have my numbers as strings in the array before sorting
them.

Thanks in advance for the help !

ben






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

Date: Fri, 07 Jul 2000 05:39:18 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Sorting an array of numbers
Message-Id: <x7ya3epkhp.fsf@home.sysarch.com>

>>>>> "BB" == Benjamin Bérubé <berube@odyssee.net> writes:

  BB> I have a problem sorting an array of numbers.  These numbers are
  BB> actually strings, like :

perldoc -q sort

Found in /usr/local/lib/perl5/5.00503/pod/perlfaq4.pod

How do I sort an array by (anything)?

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Fri, 7 Jul 2000 01:16:07 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Sorting an array of numbers
Message-Id: <slrn8mapsn.ktq.tadmc@magna.metronet.com>


[ removed alt.perl ]


On Fri, 7 Jul 2000 01:35:30 -0400, Benjamin Bérubé <berube@odyssee.net> wrote:

>I have a problem sorting an array of numbers.  These numbers are actually
>strings, like :

[snip]

>Note that I must have my numbers as strings in the array before sorting
>them.


Note that the Perl programmer rarely needs to be concerned
with whether or not a scalar value is a number or a string.

perl will convert back and forth between them as needed.


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Fri, 7 Jul 2000 12:29:16 +0530
From: "Debjit" <debjit@oyeindia.com>
Subject: Re: Sorting an array of numbers
Message-Id: <8k5410$g9h$1@news.vsnl.net.in>

sort{$a <=> $b}LIST;
see perldoc -f sort

Benjamin Bérubé wrote in message ...
>Hi,
>
>I have a problem sorting an array of numbers.  These numbers are actually
>strings, like :
>
>@list = ("1", "1030", "102", "100", "1034", "1025", "1003")
>
>Now, doing sort(@list) i get this order :
>
>1, 100, 1003, 102, 1025, 1030, 1034
>





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

Date: Fri, 07 Jul 2000 07:51:28 -0700
From: Jim Cook <jcook@strobedata.com>
To: Benjamin =?iso-8859-1?Q?B=E9rub=E9?= <berube@odyssee.net>
Subject: Re: Sorting an array of numbers
Message-Id: <3965EE70.F52AC80F@strobedata.com>

> @list = ("1", "1030", "102", "100", "1034", "1025", "1003")
> Now, doing sort(@list) i get this order :

Hey, Ben, did you look at the manual? Which reference told you about
sort() but didn't show this exact example?

Obviously, as has been mentioned, perldoc -q sort will tell you
-------------- perldoc -q sort --------------
How do I sort an array by (anything)?

Supply a comparison function to sort() (described in the sort
entry in the perlfunc manpage):

@list = sort { $a <=> $b } @list;
-------------- --------------

The camel book, "Programming Perl, 2nd ed." by O'Reilly has sort() on P
217 and continues to 218 and says
-------------- O'Reilly P218 --------------
To do an ordinary numeric sort, say this:
sub numerically { $a <=> $b; }
@sortedbynumber = sort numerically 53,29,11,32,7;
-------------- --------------

Please at least use the manual. I've had problems with perldoc until
recently, but this was was really a very basic RTFM.

--
jcook@strobedata.com  Live Honourably    4/1 - 4/3 + 4/5 - 4/7 + . . .
2000 Tuesdays: Feb/last 4/4 6/6 8/8/ 10/10 12/12 9/5 5/9 7/11 11/7 3/14
Strobe Data Inc. home page   http://www.strobedata.com
My home page    O-           http://jcook.net


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

Date: Fri, 07 Jul 2000 16:46:35 -0700
From: Makarand Kulkarni <makarand_kulkarni@my-deja.com>
Subject: Re: Sorting an array of numbers
Message-Id: <39666BDB.7E32EEC2@my-deja.com>

> which as you can see is an *string* order, not a number order.  How can I
> sort by number so that I would get :
use the spaceship operator

@sorted = sort { $a <=> $b }  @list ;

--


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

Date: Sun, 9 Jul 2000 15:01:09 +0100
From: "Adam T Walton" <waltonic@earbuzz.demon.co.uk>
Subject: sorting multidimensional arrays
Message-Id: <963151309.3648.0.nnrp-08.d4e441b4@news.demon.co.uk>

I have written an effective but rather cumbersome search script in perl
(5.005) that searches through .txt files containing information searching
for particular subjects / keywords. Once a match is made the file name where
the match occurs is stored in an array:-

if (matched) { $file_match[$sfound]=$file;} #where @file_match holds the
names of all the files where matches occured, $sfound is the file counter,
$file the name of the file currently open

the script also counts the number of times the search criteria crop up in
the file and stores that in an array as so...

if (matched) { $file_match[$sfound]=$file; $file_hits[$sfound]=$count;}

My problem is simple... how do I sort the @file_hits array into descending
order (simple enough using sort) but so that the corresponding file names in
@file_match get sorted accordingly too... ie so that when the @file_hits
array is sorted the corresponding index in the @file_match array refers to
the right file.

eg...


@file_match    |    @file_hits
_______________________
file1.txt            |    5
file2.txt            |    3
file3.txt            |    9
file4.txt            |    11
file5.txt            |    1
file6.txt            |    7

sorted becomes

@file_match    |    @file_hits
______________________
file4.txt            |    11
file3.txt            |    9
file6.txt            |    7

etc etc


I think that I should be constructing a multidimensional array using
references... but as a relative 'newbie' to programming I am having problems
getting my head around the concept of 'references' - and the relevant
perldoc pages have increased my bewilderment no-end!!!! :)

Yours gratefully

Adam Walton





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

Date: Sun, 9 Jul 2000 11:33:13 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: sorting multidimensional arrays
Message-Id: <slrn8mh6pp.rnq.tadmc@magna.metronet.com>

On Sun, 9 Jul 2000 15:01:09 +0100, Adam T Walton <waltonic@earbuzz.demon.co.uk> wrote:

>I have written an effective but rather cumbersome 
                                        ^^^^^^^^^^

Looks to me like you are not using the "best" data structure
for what you want to accomplish.


>if (matched) { $file_match[$sfound]=$file;} #where @file_match holds the
>names of all the files where matches occured, $sfound is the file counter,
                                               ^^^^^^^^^^^^^^      ^^^^^^^

You seldom _need_ to index arrays explicitly in Perl.

If $sfound is used for keeping track of the "end" of @file_(match|hits),
then you can do away with it (i.e. you do not have to maintain it!)
and let perl keep track of the "end" for you, by using push().

   perldoc -f push


>$file the name of the file currently open
>
>the script also counts the number of times the search criteria crop up in
>the file and stores that in an array as so...
>
>if (matched) { $file_match[$sfound]=$file; $file_hits[$sfound]=$count;}


The name and hits are related by their array indexes.


>My problem is simple... how do I sort the @file_hits array into descending
>order (simple enough using sort) but so that the corresponding file names in
>@file_match get sorted accordingly too...


If they are related by index, then they must be sorted based
on the index if you wish to maintain the relationship.


>I think that I should be constructing a multidimensional array using
>references... 


Yes. Using two separate data structures (arrays, in this case) and
maintaining the relationship between them is error prone.

Better to put them into a more appropriate data structure
from the start.

An array of hashes would do it.


>but as a relative 'newbie' to programming I am having problems
>getting my head around the concept of 'references' - and the relevant
>perldoc pages have increased my bewilderment no-end!!!! :)


Does that include the simplest of the docs about references?

   perldoc perlreftut


Here is code that sorts it with your data structures, then converts
to a data structure that would be "better", then sorts the new DS:

---------------------------------------
#!/usr/bin/perl -w
use strict;

my @file_match = qw/file1.txt file2.txt file3.txt
                    file4.txt file5.txt file6.txt/;

my @file_hits = ( 5, 3, 9, 11, 1, 7 );

# sort the _indexes_ (inefficiently)
die "huh?" unless @file_match == @file_hits;
foreach my $i ( sort {$file_hits[$b] <=> $file_hits[$a]} 0 .. $#file_hits ) {
   print "$file_match[$i]  ==>  $file_hits[$i]\n";
}
print "-----------\n";


# convert the two arrays into an array of hashes (LoH)
# skip this step if they are stored this way in the first place
my @file;
foreach my $i ( 0 .. $#file_match ) {
   push @file, { match => $file_match[$i],
                 hits  => $file_hits[$i]
               };
}

# then sort by "hits", and output
foreach my $href ( sort { $b->{hits} <=> $a->{hits} }  @file ) {
   print "$href->{match}  ==>  $href->{hits}\n";
}
---------------------------------------


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sun, 09 Jul 2000 12:53:05 -0500
From: "Bill Reh" <bill@PLEASEDONOTSPAMMEphoenixdsl.com>
Subject: Re: sorting multidimensional arrays
Message-Id: <N02a5.382$4h2.97885@news.dbn.net>

Good news, it looks like you don't need to use references 
at all.  
Assuming that all of your file names are going to be unique 
(and it seems that they are), you can simply use a hash.
You can use the file names as the keys in the hash (hence 
the need for uniquenss) and the number of matches as the 
values.  ie. $file_match{'file1.txt'}=5;
The only tricky part after that is the sort.
Here's an example:

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

#!/usr/bin/perl -w
$file_match{'file1.txt'}=5;
$file_match{'file2.txt'}=3;
$file_match{'file3.txt'}=9;
$file_match{'file4.txt'}=11;
$file_match{'file5.txt'}=1;
$file_match{'file6.txt'}=7;
foreach $key(reverse sort {$file_match{$a}<=>$file_match{$b}} keys %file_match){
    print $key,': ',$file_match{$key},"\n";
}

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

Good Luck,
Bill

In article <963151309.3648.0.nnrp-08.d4e441b4@news.demon.co.uk>, "Adam T
Walton" <waltonic@earbuzz.demon.co.uk> wrote:
> I have written an effective but rather cumbersome search script in perl
> (5.005) that searches through .txt files containing information
> searching
> for particular subjects / keywords. Once a match is made the file name
> where the match occurs is stored in an array:-
> 
> if (matched) { $file_match[$sfound]=$file;} #where @file_match holds the
> names of all the files where matches occured, $sfound is the file
> counter,
> $file the name of the file currently open
> 
> the script also counts the number of times the search criteria crop up
> in the file and stores that in an array as so...
> 
> if (matched) { $file_match[$sfound]=$file; $file_hits[$sfound]=$count;}
> 
> My problem is simple... how do I sort the @file_hits array into
> descending order (simple enough using sort) but so that the
> corresponding file names in
> @file_match get sorted accordingly too... ie so that when the @file_hits
> array is sorted the corresponding index in the @file_match array refers
> to the right file.
> 
> eg...
> 
> 
> @file_match    |    @file_hits
> _______________________
> file1.txt            |    5 file2.txt            |    3 file3.txt       
>     |    9 file4.txt            |    11 file5.txt            |    1
> file6.txt            |    7
> 
> sorted becomes
> 
> @file_match    |    @file_hits
> ______________________
> file4.txt            |    11 file3.txt            |    9 file6.txt      
>      |    7
> 
> etc etc
> 
> 
> I think that I should be constructing a multidimensional array using
> references... but as a relative 'newbie' to programming I am having
> problems getting my head around the concept of 'references' - and the
> relevant perldoc pages have increased my bewilderment no-end!!!! :)
> 
> Yours gratefully
> 
> Adam Walton
> 
> 
> 




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

Date: Mon, 10 Jul 2000 12:19:54 +0200
From: Magne Oevregaard <b.m.ovregard@shell.no>
Subject: Sorting
Message-Id: <3969A34A.5D3BF3FF@shell.no>

Hi All,

I have a sorting problem.
The problem is that I want to sort by records.
Like this:

File before:

Record 10
Data1 20
Data2 30
Data3 40
Record 09
Data1 200
Data2 210
Data3 220
Rec....

File after:

 ...
Record 09
Data1 200
Data2 210
Data3 220
Record 10
Data1 20
Data2 30
Data3 40

Any idea?

Thanks
Magne


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

Date: Mon, 10 Jul 2000 10:29:31 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Sorting
Message-Id: <slrn8mj93r.9rf.bernard.el-hagin@gdndev25.lido-tech>

Magne Oevregaard <b.m.ovregard@shell.no> wrote:
>Hi All,
>
>I have a sorting problem.
>The problem is that I want to sort by records.
>Like this:
>
>File before:
>
>Record 10
>Data1 20
>Data2 30
>Data3 40
>Record 09
>Data1 200
>Data2 210
>Data3 220
>Rec....
>
>File after:
>
>...
>Record 09
>Data1 200
>Data2 210
>Data3 220
>Record 10
>Data1 20
>Data2 30
>Data3 40
>
>Any idea?

One idea is to read

perldoc -f sort

You'll find the answer there (if you're impatient search for "Examples").

Bernard
--
perl -e'@x=(3,2,4,1,3,2,1,3,1,3,2,3,3,2,3,0,0,1,2,1,1,1,4,1,2,1,1,2,2,1,
2,1,2,1,2,1,2,1,1,1,2,1,0,0,3,2,3,2,3,2,1,1,1,1,1,2,4,2,3,2,1,2,1,0,0,1,
2,1,1,1,4,1,2,1,1,1,2,2,1,1,4,1,1,1,2,1,1,1,2,1,0,0,3,2,4,1,1,2,1,1,1,3,
1,1,1,4,1,1,1,2,1,1,3,0,0);sub x{print q x$xx$_;print q x x x shift@x};#
while(defined($_=shift @x)){s o0o\no;$_!=0?x:print}' #Symmetry yrtemmyS#


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

Date: Tue, 04 Jul 2000 05:26:28 GMT
From: aaronp@removeme-shore.net
Subject: sound editing 
Message-Id: <8Ae85.133$ps5.25753@news.shore.net>


 I just searched CPAN for some sound editing/analysis files and only found
Text::SoundEx (speech synthesis) and then a Win32 sound playing module. Are
there any modules available that allow one to write perl scripts to analyze
and/or play with sound files (or sources for that matter)? I've been looking
for a program that will take a sound file and export to a text file signal
strength as an offshoot of time (or maybe a fourier analysis). I cant find
anything and thought perl would be a great way to do this.. thanks.

Aaron Price, Technical Assistant, UNIX, CGI.
American Association of Variable Star Observers
http://www.aavso.org



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

Date: Tue, 04 Jul 2000 10:01:04 GMT
From: Gus <gus@black.hole-in-the.net>
Subject: Re: sound editing
Message-Id: <962704864.24549.1.nnrp-12.c29f015a@news.demon.co.uk>

aaronp@removeme-shore.net wrote:

>                                                                       . Are
> there any modules available that allow one to write perl scripts to analyze
> and/or play with sound files (or sources for that matter)?

There is the MIDI:: stuff, if you're in to MIDI, or the Audio:: modules
for .WAV files. The Bundle::MP3 will extract .MP3 files and you could 
always convert them to .WAV for manipulation.

As far as FFT goes, perhaps there is something in the Math:: tree that
would suit the task. I can't see anything from a casual perusal, but
a detailed search may show something up.

Regards,
	_Gus




-- 
gus@black.hole-in-the.net
0x58E18C6D
82 AA 4D 7F D8 45 58 05  6D 1B 1A 72 1E DB 31 B5
http://black.hole-in-the.net/gus/


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

Date: Fri, 07 Jul 2000 20:49:50 -0500
From: "David Allen" <s2mdalle@titan.vcu.edu>
Subject: Spacing algorithm
Message-Id: <8k618u$i5j$1@bob.news.rcn.net>

Is there a CPAN module or any scripts that anyone knows of that are able to 
space text properly?  What I mean by that is when I use emacs with 
auto-fill-mode on, if there is an extremely long line, I can go to the end
of it, hit space, and emacs automagically indents it perfectly to fit the
screen.

The data that I"m working with is actually XML, so if possible I would
not want it to do things like break attribute values in lines.  I.e. if you
have this:

<some_tag foo="bar and foo"> 
then I wouldn't want that to be broken as
<some_tag foo="bar and
foo">

but generic line breaking would be good.

My original idea to do this was to take the substring of a string
repeatedly, go to the 75th character, back up one character at
a time until I got a whitespace character, and break it there.  But
I don't know how to address the problem of breaking attribute
values and so on.

does anybody know of an 'indent' like program or script for
generic text/xml that might be able to do something like this?

Any help would be appreciated.
-- 
David Allen
http://opop.nols.com/


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

Date: Sat, 8 Jul 2000 00:39:21 -0500
From: "Randy Kobes" <randy@theory.uwinnipeg.ca>
Subject: Re: Spacing algorithm
Message-Id: <8k6euv$r1v$1@canopus.cc.umanitoba.ca>


David Allen <s2mdalle@titan.vcu.edu> wrote in
    message news:8k618u$i5j$1@bob.news.rcn.net...
> Is there a CPAN module or any scripts that anyone knows of that are able
to
> space text properly?  What I mean by that is when I use emacs with
> auto-fill-mode on, if there is an extremely long line, I can go to the end
> of it, hit space, and emacs automagically indents it perfectly to fit the
> screen.
>
> The data that I"m working with is actually XML, so if possible I would
> not want it to do things like break attribute values in lines.  I.e. if
you
> have this:
>
> <some_tag foo="bar and foo">
> then I wouldn't want that to be broken as
> <some_tag foo="bar and
> foo">
>
> but generic line breaking would be good.

Perhaps either the Text::Format, Text::Wrap,
or Text::Wrapper modules would serve as
templates of how to implement this; see, eg,
http://theoryx5.uwinnipeg.ca/CPAN/data/perl/Text/Wrap.html
http://theoryx5.uwinnipeg.ca/CPAN/data/Text-Format/Text/Format.html
http://theoryx5.uwinnipeg.ca/CPAN/data/Text-Wrapper/Wrapper.html
for descriptions of their use.

best regards,
randy kobes


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

Date: 9 Jul 2000 12:41:37 GMT
From: brong@netizen.com.au (Bron Gondwana)
Subject: Re: Spacing algorithm
Message-Id: <slrn8mgso1.654.brong@hiro.netizen.com.au>

In comp.lang.perl.moderated, on Sat, 8 Jul 2000 00:39:21 -0500
Randy Kobes <randy@theory.uwinnipeg.ca> wrote:
> 
> David Allen <s2mdalle@titan.vcu.edu> wrote in
>     message news:8k618u$i5j$1@bob.news.rcn.net...
> > Is there a CPAN module or any scripts that anyone knows of that are able
> to
> > space text properly?  What I mean by that is when I use emacs with
> > auto-fill-mode on, if there is an extremely long line, I can go to the end
> > of it, hit space, and emacs automagically indents it perfectly to fit the
> > screen.
> >
> > The data that I"m working with is actually XML, so if possible I would
> > not want it to do things like break attribute values in lines.  I.e. if
> you
> > have this:
> >
> > <some_tag foo="bar and foo">
> > then I wouldn't want that to be broken as
> > <some_tag foo="bar and
> > foo">
> >
> > but generic line breaking would be good.
> 
> Perhaps either the Text::Format, Text::Wrap,
> or Text::Wrapper modules would serve as
> templates of how to implement this; see, eg,
> http://theoryx5.uwinnipeg.ca/CPAN/data/perl/Text/Wrap.html
> http://theoryx5.uwinnipeg.ca/CPAN/data/Text-Format/Text/Format.html
> http://theoryx5.uwinnipeg.ca/CPAN/data/Text-Wrapper/Wrapper.html
> for descriptions of their use.

XML::PrettyPrint - which I'm planning to turn into a more complete
module and release on CPAN when I have time, is at:

http://xml.brong.net/packages/XML-PrettyPrint-0.01.tar.gz

As you can see by the release number, it's very much alpha code.  It's
based on XML::Parser and Text::Format with plenty of ideas stolen from
XML::Generator as well.

Let me know which features are most required and I'll try to hack them
in during my CFT!  I should really get off my lazy $bodypart and submit
it to CPAN as well.

-- 
Bron ( next on my list of fun things to write - XML::Diff - but I'm going
       to need some more time with an algorithms textbook to do that one
       justice )


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

Date: Tue, 4 Jul 2000 12:14:39 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Special attributes in write() call.
Message-Id: <Pine.LNX.4.21.0007041203200.2817-100000@hawk.ce.mediaone.net>


Greetings,

    I have a fairly simple question, but I could not find the
answer in the documentation, or in the Deja archives.  I have
a statement:

print "\e[1mThis is a test.\e[0m\n";

which prints in bold:

This is a test.

Now, what I would like to do is allow these characters in
a format, like so:

#!/usr/bin/perl -w

$bstring = "\e[1mThis is a test.\e[0m\n";

write;

format = 
@<<<<<<<<<<<<<<<<<<<<<<<<
$bstring
 .



However this program outputs:

 [1mThis is a test. [0m


There is probably something simple I am missing,
any help would be appreciated.


Best Wishes,

anm
-- 
/*-------------------------------------------------------.  
| Andrew N. McGuire                                      | 
| anmcguire@ce.mediaone.net                              |
`-------------------------------------------------------*/



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

Date: Mon, 03 Jul 2000 16:02:02 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: StarOffice (StarCalc) in Perl
Message-Id: <_N285.1158$iP2.105040@news.dircon.co.uk>

In comp.lang.perl.misc S P Arif Sahari Wibowo <arifsaha@yahoo.com> wrote:
> Hi!
> 
> Is there any way to automate staroffice (starcalc module) from perl?
> 
> Basically I want perl to get staroffice open a spreadsheet, change some
> values in certain cells, and recalculate. Then I would like perl to get
> the result from other cells - either directly or from a text file.
> 

As far as I know you are stuck with the StarOffice Macro language which
looks awfully like Visual Basic to me ... I dont know if StarOffice
exposes any kind of API though .

/J\


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

Date: Tue, 04 Jul 2000 13:08:43 +0200
From: Christian Kirsch <ck@ix.heise.de>
Subject: Re: StarOffice (StarCalc) in Perl
Message-Id: <3961C5BB.DEA6D2A8@ix.heise.de>

S P Arif Sahari Wibowo wrote:
> 
> Hi!
> 
> Is there any way to automate staroffice (starcalc module) from perl?
> 
> Basically I want perl to get staroffice open a spreadsheet, change some
> values in certain cells, and recalculate. Then I would like perl to get
> the result from other cells - either directly or from a text file.
> 

Not directly. You might want to have a look at the
staroffice API (www.sun.com/staroffice ... developers).
Right now, there is a Java interface to SO, and you *should*
be able to use C++ to, although there is no documentation
yet. However, you might be able to interface Perl to the
Java stuff.

Regards
-- 
Christian Kirsch
ck@held.mind.de       ck@ix.heise.de
Tel +49-30-78702288   +49-511-5352-590   
Fax +49-30-78702289


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

Date: Sun, 9 Jul 2000 13:21:21 -0500
From: S P Arif Sahari Wibowo <arifsaha@yahoo.com>
Subject: Re: StarOffice (StarCalc) in Perl
Message-Id: <Pine.LNX.4.21.0007091315220.3163-100000@ninitowo.civil.columbia.edu>

On Tue, 4 Jul 2000, Christian Kirsch wrote:

>Right now, there is a Java interface to SO, and you *should* be able to
>use C++ to, although there is no documentation yet.

Well, the SDK doesn't contain any header or library file whatsoever, make
me wonder what Sun meant by saying that developer can use C++.

The SDK doesn't even contain java library class for doing the interfacing,
only some sample classes.

>However, you might be able to interface Perl to the Java stuff.

Hmm... this is interesting. How can I do that?

Thanks!

-- 
                                   S P Arif Sahari Wibowo
  _____  _____  _____  _____ 
 /____  /____/ /____/ /____          arifsaha@yahoo.com
_____/ /      /    / _____/       http://www.arifsaha.com/


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

Date: Thu, 6 Jul 2000 10:13:33 -0700
From: "Brian Neary" <bneary@gnosis-is.com>
Subject: Starting FTP
Message-Id: <V0395.7869$j7.354405@news.bc.tac.net>

How do I start an FTP download from my perl cgi script so that the user
can't see where the file is coming from?




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

Date: 7 Jul 2000 05:24:14 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Starting FTP
Message-Id: <slrn8maqbn.le7.efflandt@efflandt.xnet.com>

On Thu, 6 Jul 2000 10:13:33 -0700, Brian Neary <bneary@gnosis-is.com> wrote:
>How do I start an FTP download from my perl cgi script so that the user
>can't see where the file is coming from?

By printing a proper Content-type: header and 'get'ting the file with
Net::FTP using STDOUT as the destination.  Net::FTP is in the libnet
package of modules.

-- 
David Efflandt  efflandt@xnet.com  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/  http://cgi-help.virtualave.net/



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

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


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