[18935] in Perl-Users-Digest
Perl-Users Digest, Issue: 1130 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 14 00:09:27 2001
Date: Wed, 13 Jun 2001 21: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)
Message-Id: <992491507-v10-i1130@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 13 Jun 2001 Volume: 10 Number: 1130
Today's topics:
Re: a question to programmers. <thinkit8@lycos.com>
Re: Api function to call up an input box in Perl <brad.morrison@mincom.com>
Re: better way to break lines of data? (Sweth Chandramouli)
Re: better way to break lines of data? (E.Chang)
Re: Can an lvalue sub also be an rvalue? <johnlin@chttl.com.tw>
GPIB support? <goette@ti.com>
How to create a script to emulate a task that can be pe (blue)
how to make a perl script run a batch file <otoked@yahoo.com>
Memory Issues/File Slurping (Doug McGrath)
Re: Memory Issues/File Slurping <wyzelli@yahoo.com>
Re: Memory Issues/File Slurping <godzilla@stomp.stomp.tokyo>
new to perl need help with concordance <iliilllli1@hotmail.com>
Re: new to perl need help with concordance (Jay Tilton)
Re: new to perl need help with concordance <iliilllli1@hotmail.com>
Re: newbie-- re:win32 system() calls -- rmdir /s/q (Jay Tilton)
Re: newbie-- re:win32 system() calls -- rmdir /s/q (Eric Bohlman)
Re: newbie-- re:win32 system() calls -- rmdir /s/q (Jay Tilton)
period <lfzhang@lbl.gov>
period <lfzhang@lbl.gov>
Re: period (Jay Tilton)
Premature end of srcipt headers? <mrdeza@phys.ucalgary.ca>
Re: Premature end of srcipt headers? <jason@uklinux.net>
Re: Premature end of srcipt headers? <bart.lateur@skynet.be>
say if a handle is valid ? <pilsl_@goldfisch.at>
Re: say if a handle is valid ? <bart.lateur@skynet.be>
Re: Spreadsheet::WriteExcel and cgi output (John McNamara)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 13 Jun 2001 14:40:09 -0700
From: thinkit <thinkit8@lycos.com>
Subject: Re: a question to programmers.
Message-Id: <9g8mjp0elr@drn.newsguy.com>
In article <comdog-801957.10272913062001@news.panix.com>, brian says...
>
>In article <9g5mme04h8@drn.newsguy.com>, thinkit <thinkit8@lycos.com>
>wrote:
>
>>if a language only offered hexadecimal and binary input literals, would you be
>>more or less likely to utilize it? in a similar line, how much hexadecimal do
>> you use in the languages you use now? do you count to 16, or to 0x10?
>
>
>i don't think that would make me stop using Smalltalk which allows
>you to use just about any base that you like. :)
>
>but then, you can use hexadecimal and binary literals in Perl too.
>why use something with less features?
>
>--
>brian d foy <comdog@panix.com>
>CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
>Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html
yes, but you have to use "0x". hexadecimal is subordinate to decimal in perl.
plus there's no way to deal with hexdecimal floats.
------------------------------
Date: Thu, 14 Jun 2001 13:27:00 +1000
From: "bmer" <brad.morrison@mincom.com>
Subject: Re: Api function to call up an input box in Perl
Message-Id: <9g9aqp$r55$1@sol.mincom.oz.au>
>
> > Do you have an example.
>
> I have no experience with Tk myself.
>
Tk.pm comes with a rich set of example scripts.
------------------------------
Date: Thu, 14 Jun 2001 03:19:38 GMT
From: sweth+perl@gwu.edu (Sweth Chandramouli)
Subject: Re: better way to break lines of data?
Message-Id: <e3WV6.78685$G5.16939574@news1.rdc1.md.home.com>
In article <9g8l6l0jll@enews1.newsguy.com>,
Christopher Z. Collier <ccollier@lavastorm.com> wrote:
>$curLine =~ /(.{4})(.{4})(.{4})(.{4})/
>my $field1 = $1, my $field2 = $2, my $field3 = $3, my $field4 = $4;
>
>I can then do what I wish with the data in the $field variables.
>My question is this:
>Can anyone think of a more efficient or easier way do do this? Is this
>going to be really slow? Are those $1, $2, etc. variables stored in any
>kind of array that I can just iterate over? Or should I just be using
>substr()?
In a list context, m// returns a list of the captured
elements of a match, so you could do something like
while (my $line = <FILE>) {
chomp ($line);
@fields = $line =~ /your_regex/;
do_things_with_@fields;
};
As to whether you should be using substr, why not Benchmark
the options and see which works best for you?
-- Sweth.
--
Sweth Chandramouli ; <sweth+perl@gwu.edu>
------------------------------
Date: Thu, 14 Jun 2001 03:25:15 GMT
From: echang@netstorm.net (E.Chang)
Subject: Re: better way to break lines of data?
Message-Id: <Xns90BFEEB3C1E47echangnetstormnet@207.106.93.86>
"Christopher Z. Collier" <ccollier@lavastorm.com> wrote in
<9g8l6l0jll@enews1.newsguy.com>:
> $curLine =~ /(.{4})(.{4})(.{4})(.{4})/
> my $field1 = $1, my $field2 = $2, my $field3 = $3, my $field4 = $4;
>
> I can then do what I wish with the data in the $field variables.
> My question is this:
> Can anyone think of a more efficient or easier way do do this? Is
> this going to be really slow? Are those $1, $2, etc. variables
> stored in any kind of array that I can just iterate over? Or
> should I just be using substr()?
When used in a list context, match returns a list consisting of the
subexpressions matched by the parentheses in the pattern as well as
assigning $1, etc., so you could assign them using a list assignment,
but substr() will be more efficient unpack() is yet another approach.
Here's a comparison of some straightforward uses of those operators. I
am sure there are others that are more elegant, more efficient, or
both.
use Benchmark qw(cmpthese);
cmpthese (3_000_000, {
'regex1' => sub { my $curline = '1002003456779104';
my ($field1, $field2, $field3, $field4) =
($curline =~ /(.{4})(.{4})(.{4})(.{4})/);
},
'regex2' => sub { my $curline = '1002003456779104';
$curline =~ /(.{4})(.{4})(.{4})(.{4})/;
my $field1 = $1;
my $field2 = $2;
my $field3 = $3;
my $field4 = $4;
},
'substr1' => sub { my $curline = '1002003456779104';
my ($field1, $field2, $field3, $field4) =
(substr($curline, 0, 4),
substr($curline, 4, 4),
substr($curline, 8, 4),
substr($curline, 12, 4))
},
'substr2' => sub { my $curline = '1002003456779104';
my $field1 = substr($curline, 0, 4);
my $field2 = substr($curline, 4, 4);
my $field3 = substr($curline, 8, 4);
my $field4 = substr($curline, 12, 4);
},
'unpack' => sub { my $curline = '1002003456779104';
my ($field1, $field2, $field3, $field4) =
unpack("A4A4A4A4", $curline);
}
}
);
The results for one run are:
Benchmark: timing 3000000 iterations of regex1, regex2, substr1,
substr2, unpack
...
regex1: 17 wallclock secs (16.97 usr + 0.00 sys = 16.97 CPU) @
176782.56/s
regex2: 17 wallclock secs (16.37 usr + 0.00 sys = 16.37 CPU) @
183262.06/s
substr1: 8 wallclock secs ( 7.24 usr + 0.00 sys = 7.24 CPU) @
414364.64/s
substr2: 7 wallclock secs ( 6.92 usr + 0.00 sys = 6.92 CPU) @
433526.01/s
unpack: 12 wallclock secs (12.03 usr + 0.00 sys = 12.03 CPU) @
249376.56/s
--
EBC
------------------------------
Date: Thu, 14 Jun 2001 09:19:17 +0800
From: "John Lin" <johnlin@chttl.com.tw>
Subject: Re: Can an lvalue sub also be an rvalue?
Message-Id: <9g939r$rvr@netnews.hinet.net>
"Anno Siegel" wrote
> According to Ilya Zakharevich:
> > *No* question about programming may be answered by experiments (unless
> > answered negatively ;-). This is the difference between programming
> > and scripting.
>
> Agreed, with reservations about the script/program semantics.
Both of you mentioned "the difference between programming and scripting"
or "the script/program semantics". It must be a well-known and important
issue that I've missed. Could you direct me to somewhere I can get further
study on this? (I have read "perldoc -q script" but still don't know what you
are talking about. : ) )
Thank you.
John Lin
------------------------------
Date: Wed, 13 Jun 2001 15:56:54 -0700
From: Mike Goettemoeller <goette@ti.com>
Subject: GPIB support?
Message-Id: <3B27EFB6.40DA1A7@ti.com>
This is a multi-part message in MIME format.
--------------D87D35AAC8F9F5B1D783F548
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi,
I was wondering if there are any modules written for a GPIB interface
for the Agilent/HP E2050A LAN/GPIB converter running on Linux?
Otherwise, does there exist a RS232 to GPIB converter? Thanks,
Mike
--------------D87D35AAC8F9F5B1D783F548
Content-Type: text/x-vcard; charset=us-ascii;
name="goette.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Mike Goettemoeller
Content-Disposition: attachment;
filename="goette.vcf"
begin:vcard
n:Goettemoeller;Mike
tel;work:Texas Instruments (formerly Alantro Communications)
x-mozilla-html:FALSE
url:www.alantro.com
org:Alantro Communications
adr:;;;Santa Rosa;CA;;
version:2.1
email;internet:goette@ti.com
title:Application Engineer
fn:Mike Goettemoeller
end:vcard
--------------D87D35AAC8F9F5B1D783F548--
------------------------------
Date: Thu, 14 Jun 2001 00:10:39 GMT
From: avocet@sympatico.ca (blue)
Subject: How to create a script to emulate a task that can be performed thru command line ?
Message-Id: <3b2800b1.4806538@news1.on.sympatico.ca>
How to create a script to emulate a task that can be performed thru
command line ?
The way its done thru command line is to type
I enter 'passwd username'
PC responds with 'New password:'
I enter 'newpassword'
PC responds with 'Changing local password for username.'
I could write the script except I need to know how to read the
response from the PC to the input from the script, because simply
doing
system 'command';
several times wouldn't work
------------------------------
Date: Thu, 14 Jun 2001 02:44:41 +0100
From: "emre" <otoked@yahoo.com>
Subject: how to make a perl script run a batch file
Message-Id: <9g9512$dus$1@plutonium.btinternet.com>
Is it possible to write a perl script that runs an external batch file or
any other application on a windows system?
------------------------------
Date: 13 Jun 2001 16:37:19 -0700
From: doug.mcgrath@us.telegyr.com (Doug McGrath)
Subject: Memory Issues/File Slurping
Message-Id: <a4e10296.0106131537.7012f016@posting.google.com>
Hello,
I've been fighting a memory problem in a script that slurps a file,
parses it, prints some stuff, and then moves on to the next file for
many thousands of files. The process is sucking up MUCH more memory
than I would've expected, and I've been trying to resolve Out of
Memory errors.
The main processing is in a package where I've declared the variable
into which the file is slurped using "my", but outside the routine
that reads the file. My research indicated that this would improve
processing by not having to reallocate memory for it each time. I'm
not pre-extending the variable, although I've tried that, and it
didn't seem to help overall.
However, as near as I can tell from ps, the memory isn't being reused;
it just grows. Some judicious print statements revealed that slurping
5 files that were a total of about 6 MB increased the process space by
100 MB. Eventually, my system starts thrashing, and the whole process
drags to a crawl.
I'm using Perl 5.004 on Digital UNIX 4.0d. I'm current building 5.6.1
in hopes that there might be bug fixes in Perl itself. Otherwise, I'm
guessing that I'm doing something dreadfully wrong.
The other possibility that I've considered is that I may be
accidentally keeping references hanging around, but I can't find them.
All of my variables are declared with my, and I have "use strict" and
"-w" on. This particular module returns an object, and I've also
double-checked to ensure that I'm not accidentally keeping references
to the hash that encapsulates the object (although the behavior looks
as if that might be the case).
I'm open to ideas.
Doug McGrath
------------------------------
Date: Thu, 14 Jun 2001 09:18:05 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Memory Issues/File Slurping
Message-Id: <RVSV6.17$nB6.2838@vic.nntp.telstra.net>
"Doug McGrath" <doug.mcgrath@us.telegyr.com> wrote in message
news:a4e10296.0106131537.7012f016@posting.google.com...
> Hello,
<SNIP>
> I'm open to ideas.
>
Change the code on line 17....
Seriously though, if you don't post the relevant piece of code, we can't
really tell what your problem is.
Wyzelli
--
@x='074117115116032097110111116104101114032080101114108032104097099107101114
'=~/(...)/g;
print chr for @x;
------------------------------
Date: Wed, 13 Jun 2001 17:07:33 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Memory Issues/File Slurping
Message-Id: <3B280045.24D6E856@stomp.stomp.tokyo>
Doug McGrath wrote:
(snipped)
> I'm open to ideas.
Photonic Fleas have infested your Warp Drive fiber optic cables.
Godzilla!
------------------------------
Date: Wed, 13 Jun 2001 15:50:28 -0700
From: "IlIIllllI1" <iliilllli1@hotmail.com>
Subject: new to perl need help with concordance
Message-Id: <tifri9128kd4ea@corp.supernews.com>
I cant figure out how to finish this exercise
http://www.comp.leeds.ac.uk/Perl/split.html#exercise ive been trying for 2
hours. this is what i have so far
#!/usr/bin/perl
$string = @ARGV[0];
$file = 'electricity.txt'; # Name the file
open(INFO, $file); # Open the file
@text = <INFO>;
close(INFO);
$text = "@text";
@splittext = split(/$string/,$text);
foreach (@splittext) {
$s1 = (' 'x10).$_;
print substr($s1,-10,10).$string;
}
please help me
------------------------------
Date: Thu, 14 Jun 2001 00:13:40 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: new to perl need help with concordance
Message-Id: <3b2800db.8977749@news.erols.com>
On Wed, 13 Jun 2001 15:50:28 -0700, "IlIIllllI1" <iliilllli1@hotmail.com>
wrote:
>I cant figure out how to finish this exercise
>http://www.comp.leeds.ac.uk/Perl/split.html#exercise ive been trying for 2
>hours. this is what i have so far
[snip code]
>please help me
Ask a question about what exactly is giving you difficulty, and what you
have tried so far to overcome that difficulty.
------------------------------
Date: Wed, 13 Jun 2001 18:22:19 -0700
From: "IlIIllllI1" <iliilllli1@hotmail.com>
Subject: Re: new to perl need help with concordance
Message-Id: <tig4et8j8g62d2@corp.supernews.com>
I can't figure out how to print the information in @split so that $string
will be lined up vertically.
"Jay Tilton" <tiltonj@erols.com> wrote in message
news:3b2800db.8977749@news.erols.com...
> On Wed, 13 Jun 2001 15:50:28 -0700, "IlIIllllI1" <iliilllli1@hotmail.com>
> wrote:
>
> Ask a question about what exactly is giving you difficulty, and what you
> have tried so far to overcome that difficulty.
------------------------------
Date: Thu, 14 Jun 2001 00:00:51 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: newbie-- re:win32 system() calls -- rmdir /s/q
Message-Id: <3b27fcd2.7944549@news.erols.com>
On Wed, 13 Jun 2001 15:41:51 -0400, Korac <korac@dirig.com> wrote:
>I'm having trouble using "rmdir /s/q dirname" within the sytem call,
>I've tried putting it in all one string, using join to jam it into a
>variable and it still won't execute properly. Is there something
>critical I'm missing here?
>$remdir_cmd = "rmdir /s/q "; # extra space at end
For its built-in functions, perl can understand forward slashes as
separating directory names and will translate them into what Win32 expects,
but it will not do so for calls to external commands.
Win32 will bark about 'invalid switch' if you use forward slashes to
separate directory names. Use backslashes.
$remdir_cmd = 'rmdir \s\q';
------------------------------
Date: 14 Jun 2001 00:18:06 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: newbie-- re:win32 system() calls -- rmdir /s/q
Message-Id: <9g8vru$ids$3@bob.news.rcn.net>
Jay Tilton <tiltonj@erols.com> wrote:
> For its built-in functions, perl can understand forward slashes as
> separating directory names and will translate them into what Win32 expects,
> but it will not do so for calls to external commands.
It's not a matter of perl doing any translations. The Win32 filesystem
will accept either forward or backward slashes as path separators, but the
command processor (shell) treats forward slashes as switch-introducers and
therefore breaks up paths that use them.
> Win32 will bark about 'invalid switch' if you use forward slashes to
> separate directory names. Use backslashes.
> $remdir_cmd = 'rmdir \s\q';
Correct.
------------------------------
Date: Thu, 14 Jun 2001 00:57:19 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: newbie-- re:win32 system() calls -- rmdir /s/q
Message-Id: <3b28094a.11137448@news.erols.com>
On 14 Jun 2001 00:18:06 GMT, ebohlman@omsdev.com (Eric Bohlman) wrote:
>It's not a matter of perl doing any translations. The Win32 filesystem
>will accept either forward or backward slashes as path separators, but the
>command processor (shell) treats forward slashes as switch-introducers and
>therefore breaks up paths that use them.
I see the distinction now. Thank you for correcting my misconception.
------------------------------
Date: Wed, 13 Jun 2001 16:46:30 -0700
From: Matthew Zhang da LBNL <lfzhang@lbl.gov>
Subject: period
Message-Id: <3B27FB56.D1ADC9F8@lbl.gov>
I am new to perl and right now I am reading somebody's code...
I am confused by the line:
open(<LOCATION>, "xmfindimg $image" . ".spe |")
I am not exactly clear what this line does, except that it runs
xmfindimg and gives its result to LOCATION...my question is
1) what does the period outside of the quotation mark do???
2) how come LOCATION has a basket quote?
3) can someone explain in detail what really does this line do?
thank you!
------------------------------
Date: Wed, 13 Jun 2001 16:47:06 -0700
From: Matthew Zhang da LBNL <lfzhang@lbl.gov>
Subject: period
Message-Id: <3B27FB7A.8341C8B2@lbl.gov>
I am new to perl and right now I am reading somebody's code...
I am confused by the line:
open(<LOCATION>, "xmfindimg $image" . ".spe |")
I am not exactly clear what this line does, except that it runs
xmfindimg and gives its result to LOCATION...my question is
1) what does the period outside of the quotation mark do???
2) how come LOCATION has a basket quote?
3) can someone explain in detail what really does this line do?
thank you!
------------------------------
Date: Thu, 14 Jun 2001 00:38:54 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: period
Message-Id: <3b280210.9287148@news.erols.com>
On Wed, 13 Jun 2001 16:46:30 -0700, Matthew Zhang da LBNL <lfzhang@lbl.gov>
wrote:
>I am new to perl and right now I am reading somebody's code...
>I am confused by the line:
>
>open(<LOCATION>, "xmfindimg $image" . ".spe |")
>
>I am not exactly clear what this line does, except that it runs
>xmfindimg and gives its result to LOCATION...my question is
>1) what does the period outside of the quotation mark do???
Inside the quotes, it's a literal period.
Outside, its the string concatenation operator.
As used here, it's kind of silly. The whole thing can be wrapped in a pair
of double quotes.
"xmfindimg $image.spe |"
>2) how come LOCATION has a basket quote?
The angle brackets? That's the operator that reads a record from the
filehandle LOCATION. As used there, it's a show-stopping mistake. Perl
should emit a complaint about "Type of arg 1 to open must be HANDLE (not
<HANDLE>)".
Try this instead:
open(LOCATION, "xmfindimg $image.spe |");
>3) can someone explain in detail what really does this line do?
As written, it's a compile-time error. Does nothing.
As apparently intended, it opens the a pipe to the external program
'xmfindimg' with parameter "$image.spe". The output from that program can
be read from the LOCATION filehandle.
------------------------------
Date: Wed, 13 Jun 2001 15:56:49 -0600
From: Jason Mrdeza <mrdeza@phys.ucalgary.ca>
Subject: Premature end of srcipt headers?
Message-Id: <3B27E1A1.CCD35C1B@phys.ucalgary.ca>
I am recieving an error of premature scripture heading every time I
attempt to run a cgi script written in perl. Now I have tried returning
a number of different headers, for example..
print "Location: data1.html \n \n";
or a text/html header, and every time I recieve the
aformentoined error. Any advice on the cause would be greatly
appreciated. Thank you.
If a copy of the code is required I can post it...
------------------------------
Date: Wed, 13 Jun 2001 23:27:50 +0100
From: Jason Clifford <jason@uklinux.net>
Subject: Re: Premature end of srcipt headers?
Message-Id: <Pine.LNX.4.30.0106132326300.25307-100000@s1.uklinux.net>
On Wed, 13 Jun 2001, Jason Mrdeza wrote:
> If a copy of the code is required I can post it...
You know that in order to offer worthwhile help we'll need to see the
relevant code so why didn't you just post it?
Do so and you'll be likely to get the help.
Jason Clifford
use CGI;
new CGI;
print header, start_html(), "blah, blah", end_html;
------------------------------
Date: Wed, 13 Jun 2001 22:50:02 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Premature end of srcipt headers?
Message-Id: <2frfitk37fu5nerp0p35l1b0asubs980j6@4ax.com>
Jason Mrdeza wrote:
>I am recieving an error of premature scripture heading every time I
>attempt to run a cgi script written in perl.
This often means that the script failed to compile properly, or that,
for some reason, it dies or gives a warning. Try something like
BEGIN {
open STDERR, ">&STDOUT";
print "Content-type: text/html\n\n<PRE>";
}
at the top of your script, and see what it really returns.
If this still fails, check the shebang line. Is the path to perl valid?
>Now I have tried returning
>a number of different headers, for example..
>
> print "Location: data1.html \n \n";
There should be no space between the two newlines.
--
Bart.
------------------------------
Date: Thu, 14 Jun 2001 00:47:15 +0200
From: peter pilsl <pilsl_@goldfisch.at>
Subject: say if a handle is valid ?
Message-Id: <3b27ed75$1@e-post.inode.at>
I need to check if a global Filehandle is valid (=opened) before writing to
it. How can I do this ?
With different variables I can use the defined-function, but it does not
work on Filehandles where it gives true ever.
thnx,
peter
--
pilsl_@goldfisch.at
http://www.goldfisch.at
------------------------------
Date: Wed, 13 Jun 2001 22:58:54 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: say if a handle is valid ?
Message-Id: <jrrfitkk1821q38lbuiuig388f5cgsovh0@4ax.com>
peter pilsl wrote:
>I need to check if a global Filehandle is valid (=opened) before writing to
>it. How can I do this ?
fileno() is a start. This can tell you if indeed this is a filehandle.
And -w can tell you if you can indeed write to it.
$\="\n";
print fileno(STDERR); # 2
print -w STDERR; # 1
print fileno(STDIN); # 0
print -w STDIN || 0; # 0
--
Bart.
------------------------------
Date: Wed, 13 Jun 2001 22:58:12 GMT
From: jmcnamara@cpan.org (John McNamara)
Subject: Re: Spreadsheet::WriteExcel and cgi output
Message-Id: <3b27ed68.3879100@news1.eircom.net>
Ar Wed, 13 Jun 2001 16:33:40 GMT, do scriobh
mbower@ibuk.bankgesellschaft.de:
Some others have suggested solutions for your refresh problem. Just a
few suggestions about the Spreadsheet::WriteExcel code:
>my $worksheet = $workbook->addworksheet('ha');
>my $worksheet = $workbook->addworksheet('ho');
You should use different $worksheet variable names.
my $worksheet1 = $workbook->addworksheet('ha');
my $worksheet2 = $workbook->addworksheet('ho');
>for($y=0; $y<35; $y++) {
> for($x=0; $x<11; $x++) {
> $workbook->write($y, $x, $x*$y, $format);
write() is a worksheet method and you should call it via a worksheet
object:
$worksheet1->write($y, $x, $x*$y, $format);
Calling write() via a workbook object is supported for backward
compatibility but it is deprecated.
John.
--
perl -peruse filename # Useless non-use of cat.
------------------------------
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.
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 1130
***************************************