[29746] in Perl-Users-Digest
Perl-Users Digest, Issue: 990 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 30 16:09:45 2007
Date: Tue, 30 Oct 2007 13:09:08 -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 Tue, 30 Oct 2007 Volume: 11 Number: 990
Today's topics:
ANNOUNCE: New release of Curses interface for Config::M dominique.dumont@hp.com
How to convert timestamp to epoch? <void.no.spam.com@gmail.com>
Re: How to convert timestamp to epoch? <kingskippus@gmail.com>
Re: How to convert timestamp to epoch? <kingskippus@gmail.com>
Re: How to convert timestamp to epoch? <mritty@gmail.com>
Re: How to convert timestamp to epoch? <void.no.spam.com@gmail.com>
Make Up To 100's of $ per Day with Ease! <emily9968@gmail.com>
Re: packing a C structure <jl_post@hotmail.com>
Re: packing a C structure <jurgenex@hotmail.com>
Perl and modifying a PDF document <january.weiner@gmail.com>
Regular Expression and Useage <inderpaul_s@yahoo.com>
Re: Regular Expression and Useage <kingskippus@gmail.com>
Re: Regular Expression and Useage <mritty@gmail.com>
Re: sockets problem <stanciutheone@gmail.com>
Spreadsheet::Parse & Write Excel <justin.0711@purestblue.com>
Re: Spreadsheet::Parse & Write Excel <jimsgibson@gmail.com>
Re: TeX programming and LaTeX hacking <tim@birdsnest.maths.tcd.ie>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 30 Oct 2007 12:12:26 GMT
From: dominique.dumont@hp.com
Subject: ANNOUNCE: New release of Curses interface for Config::Model
Message-Id: <Jqq8KG.1qJz@zorch.sf-bay.org>
Hello
I've uploaded a new version of Config::Model::CursesUI[1].
This module provides a Curses interface for all configuration
descriptions created for Config::Model [2].
This interface is used by config-edit program provided by
Config::Model.
For instance, you can try config-edit to modify your Xorg
configuration. For this, you need to install the Xorg model. Once all
modules are installed, you can run (as root, but please backup
/etc/X11/xorg.conf before):
# config-edit -model Xorg
You may want to try it safely first by writing the resulting xorg.conf
elsewhere (in this case you can run this command with your user
account):
$ config-edit -model Xorg -write_directory test
Be sure to read Config::Model::Xorg's README file [4].
Changes:
* lib/Config/Model/CursesUI.pm: bug fixes, interface cleanup,
doc update, handle "uniline" value type
Cheers
[1] http://search.cpan.org/dist/Config-Model-CursesUI/
[2] http://search.cpan.org/dist/Config-Model/
[3] http://search.cpan.org/dist/Config-Model-Xorg/
[4] http://search.cpan.org/src/DDUMONT/Config-Model-Xorg-0.5/README
--
Dominique Dumont
"Delivering successful solutions requires giving people what they
need, not what they want." Kurt Bittner
------------------------------
Date: Tue, 30 Oct 2007 11:45:44 -0700
From: "void.no.spam.com@gmail.com" <void.no.spam.com@gmail.com>
Subject: How to convert timestamp to epoch?
Message-Id: <1193769944.558992.15990@19g2000hsx.googlegroups.com>
If I get timestamps in the following format:
22-OCT-07 06.16.44.160000 PM
22-OCT-07 08.16.02.686000 AM
What is the easiest way for me to convert it into the number of
seconds since 1970?
------------------------------
Date: Tue, 30 Oct 2007 12:15:24 -0700
From: TonyV <kingskippus@gmail.com>
Subject: Re: How to convert timestamp to epoch?
Message-Id: <1193771724.480203.22300@z9g2000hsf.googlegroups.com>
On Oct 30, 2:45 pm, "void.no.spam....@gmail.com"
<void.no.spam....@gmail.com> wrote:
> If I get timestamps in the following format:
>
> 22-OCT-07 06.16.44.160000 PM
> 22-OCT-07 08.16.02.686000 AM
>
> What is the easiest way for me to convert it into the number of
> seconds since 1970?
I would probably make it a function:
use Time::Local;
my $ts_to_convert = '22-jun-07 06.16.44.160000 PM';
print timestamp_to_epoch($ts_to_convert);
sub timestamp_to_epoch {
my ($ts) = @_;
my %month = ('JAN' => 0, 'FEB' => 1, 'MAR' => 2, 'APR' => 3, 'MAY'
=> 4, 'JUN' => 5,
'JUL' => 6, 'AUG' => 7, 'SEP' => 8, 'OCT' => 9, 'NOV' => 10, 'DEC'
=> 11);
if ($ts =~ m{^(\d{1,2})-(\w{1,3})-(\d{1,2}) (\d{1,2})\.(\d{1,2})\.
(\d{1,2})\.\d+ ([AP])M$}i) {
my ($dd, $mo, $yy, $hh, $mm, $ss, $ap) = ($1, $2, $3, $4, $5, $6,
$7);
$yy += 2000; $mo = $month{uc($mo)};
$hh += 12 if (uc($ap) eq 'P');
return timelocal($ss, $mm, $hh, $dd, $mo, $yy);
}
else { return 0; }
}
Check to make sure your return value is non-zero, and you're in
business.
You might also want to check out the Date::Manip package, as I
understand that it was designed to do this type of parsing. I don't
use it myself, so I'll defer to others' recommendations for it, but
here it is:
http://search.cpan.org/dist/Date-Manip/Manip.pod
------------------------------
Date: Tue, 30 Oct 2007 12:27:58 -0700
From: TonyV <kingskippus@gmail.com>
Subject: Re: How to convert timestamp to epoch?
Message-Id: <1193772478.322304.181920@19g2000hsx.googlegroups.com>
On Oct 30, 3:15 pm, TonyV <kingskip...@gmail.com> wrote:
> On Oct 30, 2:45 pm, "void.no.spam....@gmail.com"
>
> <void.no.spam....@gmail.com> wrote:
> > If I get timestamps in the following format:
>
> > 22-OCT-07 06.16.44.160000 PM
> > 22-OCT-07 08.16.02.686000 AM
>
> > What is the easiest way for me to convert it into the number of
> > seconds since 1970?
>
> I would probably make it a function:
Gah, here's a more word-wrap-friendly version:
use Time::Local;
my $ts_to_convert = '22-jun-07 06.16.44.160000 PM';
print timestamp_to_epoch($ts_to_convert);
sub timestamp_to_epoch {
my ($ts) = @_;
my %month = (
'JAN' => 0, 'FEB' => 1, 'MAR' => 2, 'APR' => 3,
'MAY' => 4, 'JUN' => 5, 'JUL' => 6, 'AUG' => 7,
'SEP' => 8, 'OCT' => 9, 'NOV' => 10, 'DEC' => 11);
my $regex = '^(\d{1,2})-(\w{1,3})-(\d{1,2}) ';
$regex .= '(\d{1,2})\.(\d{1,2})\.(\d{1,2})';
$regex .= '\.\d+ ([AP])M$';
if ($ts =~ m{$regex}i) {
my ($dd, $mo, $yy, $hh, $mm, $ss, $ap) =
($1, $2, $3, $4, $5, $6, $7);
$yy += 2000; $mo = $month{uc($mo)};
$hh += 12 if (uc($ap) eq 'P');
return timelocal($ss, $mm, $hh, $dd, $mo, $yy);
}
else { return 0; }
}
------------------------------
Date: Tue, 30 Oct 2007 12:47:12 -0700
From: Paul Lalli <mritty@gmail.com>
Subject: Re: How to convert timestamp to epoch?
Message-Id: <1193773632.151910.156030@o80g2000hse.googlegroups.com>
On Oct 30, 2:45 pm, "void.no.spam....@gmail.com"
<void.no.spam....@gmail.com> wrote:
> If I get timestamps in the following format:
>
> 22-OCT-07 06.16.44.160000 PM
> 22-OCT-07 08.16.02.686000 AM
>
> What is the easiest way for me to convert it into the number of
> seconds since 1970?
If you convert those first two periods to colons, Date::Parse can
handle it just fine:
#!/usr/bin/perl
use strict;
use warnings;
use Date::Parse 'str2time';
my $date = "22-OCT-07 06.16.44.160000 PM";
$date =~ s/\./:/ for 1..2;
my $epoch = str2time($date);
print "Epoch: $epoch\n";
__END__
Paul Lalli
------------------------------
Date: Tue, 30 Oct 2007 12:51:58 -0700
From: "void.no.spam.com@gmail.com" <void.no.spam.com@gmail.com>
Subject: Re: How to convert timestamp to epoch?
Message-Id: <1193773918.232703.172860@z9g2000hsf.googlegroups.com>
On Oct 30, 3:27 pm, TonyV <kingskip...@gmail.com> wrote:
> On Oct 30, 3:15 pm, TonyV <kingskip...@gmail.com> wrote:
>
> > On Oct 30, 2:45 pm, "void.no.spam....@gmail.com"
>
> > <void.no.spam....@gmail.com> wrote:
> > > If I get timestamps in the following format:
>
> > > 22-OCT-07 06.16.44.160000 PM
> > > 22-OCT-07 08.16.02.686000 AM
>
> > > What is the easiest way for me to convert it into the number of
> > > seconds since 1970?
>
> > I would probably make it a function:
>
> Gah, here's a more word-wrap-friendly version:
>
> use Time::Local;
>
> my $ts_to_convert = '22-jun-07 06.16.44.160000 PM';
> print timestamp_to_epoch($ts_to_convert);
>
> sub timestamp_to_epoch {
> my ($ts) = @_;
> my %month = (
> 'JAN' => 0, 'FEB' => 1, 'MAR' => 2, 'APR' => 3,
> 'MAY' => 4, 'JUN' => 5, 'JUL' => 6, 'AUG' => 7,
> 'SEP' => 8, 'OCT' => 9, 'NOV' => 10, 'DEC' => 11);
> my $regex = '^(\d{1,2})-(\w{1,3})-(\d{1,2}) ';
> $regex .= '(\d{1,2})\.(\d{1,2})\.(\d{1,2})';
> $regex .= '\.\d+ ([AP])M$';
> if ($ts =~ m{$regex}i) {
> my ($dd, $mo, $yy, $hh, $mm, $ss, $ap) =
> ($1, $2, $3, $4, $5, $6, $7);
> $yy += 2000; $mo = $month{uc($mo)};
> $hh += 12 if (uc($ap) eq 'P');
> return timelocal($ss, $mm, $hh, $dd, $mo, $yy);
> }
> else { return 0; }
>
>
>
> }
Thank you for writing that up.
I did have to change one line to get it to work:
sub timestamp_to_epoch {
my ($ts) = @_;
my %month = (
'JAN' => 0, 'FEB' => 1, 'MAR' => 2, 'APR' => 3,
'MAY' => 4, 'JUN' => 5, 'JUL' => 6, 'AUG' => 7,
'SEP' => 8, 'OCT' => 9, 'NOV' => 10, 'DEC' => 11);
my $regex = '^(\d{1,2})-(\w{1,3})-(\d{1,2}) ';
$regex .= '(\d{1,2})\.(\d{1,2})\.(\d{1,2})';
$regex .= '\.\d+ ([AP])M$';
if ($ts =~ m{$regex}i) {
my ($dd, $mo, $yy, $hh, $mm, $ss, $ap) =
($1, $2, $3, $4, $5, $6, $7);
$yy += 2000; $mo = $month{uc($mo)};
$hh += 12 if (uc($ap) eq 'P' && $hh != 12);
return timelocal($ss, $mm, $hh, $dd, $mo, $yy);
}
else { return 0; }
}
------------------------------
Date: Tue, 30 Oct 2007 07:40:18 -0700
From: emiy <emily9968@gmail.com>
Subject: Make Up To 100's of $ per Day with Ease!
Message-Id: <1193755218.163669.147250@t8g2000prg.googlegroups.com>
Tired of business opportunities that do not deliver what they promise?
Get Free Advice & a Honest Review on Internet Opportunities that Work!
MOre details http://powerfulmoneymakingideas.blogspot.com/
------------------------------
Date: Tue, 30 Oct 2007 09:22:32 -0700
From: "jl_post@hotmail.com" <jl_post@hotmail.com>
Subject: Re: packing a C structure
Message-Id: <1193761352.284850.216450@50g2000hsm.googlegroups.com>
On Oct 30, 4:19 am, rams <haai...@gmail.com> wrote:
>
> Thanks a lot for your response.The pack command you provided gave me
> much needed output.I got this almost done.
You're very welcome. I'm glad I could help.
> The only problem right now
> iam facing is to convert a variable into a 6 byte hexa value.
> i have variable $i=123456789012 then i would like to convert this into
> a hexa value 12 34 56 78 90 12
> and i would like this hexa value also to pack along with my
> structure..
Okay, before you do this, you must realize that $i (or
123456789012) should be a string (surrounded by quotes) and NOT a
number -- otherwise, any leading zeroes (or letters A-F) you had in
your number could be lost or misinterpreted.
So if you had a line like:
my $i = "123456789012"; # notice the "" marks
and you wanted a string with the bytes 12 34 56 78 90 12
(hexadecimal), you should use the "H*" pack-string, like this:
my $string = pack('H*', $i);
Now $string is equal to "\x{12}\x{34}\x{56}\x{78}\x{90}\x{12}".
You can do this to prove it to yourself (remember to use "eq" (and not
"==") when comparing strings) with the following code:
if ($string eq "\x{12}\x{34}\x{56}\x{78}\x{90}\x{12}")
{
print "The strings are equal!\n"
}
The "H*" pack template tells pack() to interpret the variable it
packs as the hexadecimal values of the bytes the final (packed) string
will have.
If that's a confusing explanation for you, consider this unpack()
line:
$i = unpack('H*', $string);
This line reads the $string and returns another string which contains
the $string's values in hexadecimal form. The pack() example,
naturally, does the exact opposite.
If you want (or need) a quick way to check the $string contents
(for debugging purposes), you can use this line of code:
printf "0x%x\n", ord($_) foreach split(//, $string);
This will print out each character's hexadecimal value, one character
at a time. In fact, if $string is indeed what you wanted (that is,
made up of bytes 12 34 56 78 90 12 (hexadecimal)), then this line of
code should give you the following output:
0x12
0x34
0x56
0x78
0x90
0x12
I hope this helps, Rams.
Take care and God bless.
-- Jean-Luc Romano
------------------------------
Date: Tue, 30 Oct 2007 17:08:11 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: packing a C structure
Message-Id: <%xJVi.862$pT.47@trndny07>
rams wrote:
> iam facing is to convert a variable into a 6 byte hexa value.
> i have variable $i=123456789012 then i would like to convert this into
> a hexa value 12 34 56 78 90 12
Let me rephrase:
You got a string and want to insert a space character between every
other character of that string. Is this correct?
Then you can use the approach described in FAQ "How can I output my numbers
with commas added?", just replace the comma by a space character and a
spacing of 2 instead of 3.
jue
------------------------------
Date: Tue, 30 Oct 2007 16:38:33 +0100 (CET)
From: January Weiner <january.weiner@gmail.com>
Subject: Perl and modifying a PDF document
Message-Id: <fg7j5p$7pj$1@sagnix.uni-muenster.de>
Hello,
I have this cool little script for content analysis of some documents.
Currently, it takes simple text and finds certain phrases, then creates a
html which shows the phrases in bold in a context.
However, the documents are initilally all PDF. Right now I just run
pdftotext first and proceed from there. Of course, all images, formatting
etc. are lost and if you want to precisely track back what happens where,
you need to go back to the original document (preferably with a printout
and a pencil).
What I would like to do is to take directly the PDF file and modify it in
such a way that the phrases are shown in red.
Can this be done? If yes, could you point me to which of the numerous PDF
Perl modules should I use? Or, even better, give me examples how this
can be done?
Regards,
January
--
------------------------------
Date: Tue, 30 Oct 2007 10:54:43 -0700
From: "inderpaul_s@yahoo.com" <inderpaul_s@yahoo.com>
Subject: Regular Expression and Useage
Message-Id: <1193766883.032114.279030@q5g2000prf.googlegroups.com>
I'm somewhat new to regular expression and want to know how to extract
any strings which match an IP address.
I found this on the net and wanted to know if this is the most
efficient (easiest/shortest) way to write the expression or pattern to
match. Also in the discovered solution why do they use the \b word
boundary switch since the characters are of a numeric type ? I'm not
sure about this.
\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b
Many thanks in advance.
Victor
------------------------------
Date: Tue, 30 Oct 2007 12:31:38 -0700
From: TonyV <kingskippus@gmail.com>
Subject: Re: Regular Expression and Useage
Message-Id: <1193772698.853477.183400@o3g2000hsb.googlegroups.com>
On Oct 30, 1:54 pm, "inderpau...@yahoo.com" <inderpau...@yahoo.com>
wrote:
> I'm somewhat new to regular expression and want to know how to extract
> any strings which match an IP address.
>
> I found this on the net and wanted to know if this is the most
> efficient (easiest/shortest) way to write the expression or pattern to
> match. Also in the discovered solution why do they use the \b word
> boundary switch since the characters are of a numeric type ? I'm not
> sure about this.
>
> \b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b
>
> Many thanks in advance.
>
> Victor
Please take a look at the answers to the exact same question you
posted less than 24 hours ago in the thread titled, "Regex Help."
--TV
------------------------------
Date: Tue, 30 Oct 2007 12:41:27 -0700
From: Paul Lalli <mritty@gmail.com>
Subject: Re: Regular Expression and Useage
Message-Id: <1193773287.063291.187580@57g2000hsv.googlegroups.com>
On Oct 30, 1:54 pm, "inderpau...@yahoo.com" <inderpau...@yahoo.com>
wrote:
> I'm somewhat new to regular expression and want to know how to extract
> any strings which match an IP address.
>
> I found this on the net and wanted to know if this is the most
> efficient (easiest/shortest) way to write the expression or
> pattern to match.
Shouldn't you first be concerned about whether it's the most *correct*
before you worry about efficiency?
> Also in the discovered solution why do they use the \b word
> boundary switch since the characters are of a numeric type ?
> I'm not sure about this.
A "word" character in Perl is any letter, number, or underscore.
Therefore, the \b prevents other numbers from being next to the IP
address. That is, it prevents 921128.0.0.123423 from matching. Of
course, it also prevents HOME128.0.0.1, which may or may not be what
you want.
> \b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b
It could be shortened to:
\b(?:\d{1,3}\.){3}\d{1,3}\b
Or you could/should use Regexp::Common from CPAN and just write:
/\b$RE{net}{IPv4}\b/
Which not only is more easily readable, but also prevents such false-
matches as 318.99.183.999. That is, it takes care of checking the
individual components' sizes for you.
Paul Lalli
------------------------------
Date: Tue, 30 Oct 2007 17:03:37 -0000
From: "stanciutheone@gmail.com" <stanciutheone@gmail.com>
Subject: Re: sockets problem
Message-Id: <1193763817.381453.121980@o80g2000hse.googlegroups.com>
On Oct 25, 7:01 pm, Brian McCauley <nobul...@gmail.com> wrote:
> On Oct 22, 2:10 am, "stanciuthe...@gmail.com"
>
> <stanciuthe...@gmail.com> wrote:
> > Hi,
> > my name is valentin and i'm trying to create a server using sockets,
> > the problem is that after i receive the data from the client i can't
> > send a message back if i will not send to the other clients the
> > message that the socket received, this problem i heaved also found in
> > a php application that i'm trying to develope,
>
> > if you need to see the source you can find it below:
>
> >http://pastebin.com/m30faafe4
>
> I've downloaded that and after uncommenting the call to broadcast it
> seems to do what it appears to be intended to do. (Which is to print
> "USERLIST>matap" to all terminals whenever anyone enters a line
> starting with a recognised command verb).
>
> > Thank you, for helping me out
>
> You will have to give a better explanation of what your code is doing
> and how this differs from your expectations.
>
> You could also make it strict. This makes it much less difficult for
> people who what to try to help you (including, of course, yourself).
>
> Please see the posting guidelines.
sorry but i heaved found the problem was so:
-> when you receive the string from the socket you will need to delete
the last caracter because is \0
-> and you will need to send a string you will need to add a \0
Best Regards
------------------------------
Date: Tue, 30 Oct 2007 15:30:45 -0000
From: Justin C <justin.0711@purestblue.com>
Subject: Spreadsheet::Parse & Write Excel
Message-Id: <1a5d.47274e25.82120@zem>
I get the following error when running my script:
Can't locate object method "get_xf_index" via package
"Spreadsheet::ParseExcel::Format" at
/usr/local/share/perl/5.8.8/Spreadsheet/WriteExcel/Worksheet.pm line
1453
It looks odd to me. It's saying it can't locate an object method from
one module in the second module. The two modules are un-related (apart
from the fact that they both deal with Excel files), neither is
dependant on the other.
This is probably due to the way I'm using ...::WriteExcel, and stems
from my not understanding the documentation for ...::ParseExcel. It
looks like it's written very much for OO coding, I'm not that advanced
and have been, probably, banging my head against it too hard.
Here is some code:
#!/usr/bin/perl
use warnings;
use strict;
use Spreadsheet::ParseExcel;
use Spreadsheet::WriteExcel;
my $inFile = "some.xls";
my $outFile = "output.xls";
my $lastCol = 9; # We don't want the data beyond this point
my $firstRow = 4;# counting from 0, 0-3 are the front page for printing
my $lastRow;
my $inBook = Spreadsheet::ParseExcel::Workbook->Parse($inFile);
my $outBook = Spreadsheet::WriteExcel->new($outFile);
my $outSheet = $outBook->add_worksheet();
foreach my $inSheet(@{$inBook->{Worksheet}}) { # there's only one
$lastRow = $inSheet->{MaxRow};
foreach my $row ( $firstRow .. $lastRow) {
foreach my $col ( 0 .. $lastCol) {
# get contents of cell
my $cellcontent = $inSheet->{Cells}[$row][$col]->{_Value};
my $cellFormat = $inSheet->{Cells}[$row][$col]->{Format};
# write contents of cell to new worksheet
$outSheet->write_string($row-3, $col-5, $cell, $cellFormat);
}
}
}
*** END ***
$cellFormat contains a hash reference, AFAICT. I was hoping that that
would be accepted by the ...::WriteExcel and generate what I want.
Can anyone spot anything obviously wrong with the above that may help
me? Are there any Spreadsheet::[Parse|Write]Excel experts here who have
suggestions?
I thank you for your help with this.
Justin.
--
Justin C, by the sea.
------------------------------
Date: Tue, 30 Oct 2007 10:30:50 -0700
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: Spreadsheet::Parse & Write Excel
Message-Id: <301020071030509374%jimsgibson@gmail.com>
In article <1a5d.47274e25.82120@zem>, Justin C
<justin.0711@purestblue.com> wrote:
> I get the following error when running my script:
>
> Can't locate object method "get_xf_index" via package
> "Spreadsheet::ParseExcel::Format" at
> /usr/local/share/perl/5.8.8/Spreadsheet/WriteExcel/Worksheet.pm line
> 1453
> Here is some code:
>
> #!/usr/bin/perl
>
> use warnings;
> use strict;
> use Spreadsheet::ParseExcel;
> use Spreadsheet::WriteExcel;
>
> my $inFile = "some.xls";
> my $outFile = "output.xls";
> my $lastCol = 9; # We don't want the data beyond this point
> my $firstRow = 4;# counting from 0, 0-3 are the front page for printing
> my $lastRow;
>
> my $inBook = Spreadsheet::ParseExcel::Workbook->Parse($inFile);
> my $outBook = Spreadsheet::WriteExcel->new($outFile);
> my $outSheet = $outBook->add_worksheet();
>
> foreach my $inSheet(@{$inBook->{Worksheet}}) { # there's only one
> $lastRow = $inSheet->{MaxRow};
>
> foreach my $row ( $firstRow .. $lastRow) {
> foreach my $col ( 0 .. $lastCol) {
> # get contents of cell
> my $cellcontent = $inSheet->{Cells}[$row][$col]->{_Value};
> my $cellFormat = $inSheet->{Cells}[$row][$col]->{Format};
> # write contents of cell to new worksheet
> $outSheet->write_string($row-3, $col-5, $cell, $cellFormat);
I think you mean $cellcontent here instead of $cell. Please
cut-and-past the exact code showing your problem.
> }
> }
> }
>
> *** END ***
>
> $cellFormat contains a hash reference, AFAICT. I was hoping that that
> would be accepted by the ...::WriteExcel and generate what I want.
>
> Can anyone spot anything obviously wrong with the above that may help
> me? Are there any Spreadsheet::[Parse|Write]Excel experts here who have
> suggestions?
Spreadsheet::ParseExcel and Spreadsheet::WriteExcel are separate
modules that have no relationship to each other and were written by
different authors. In particular, they each have their own concepts of
a "Format" object or class, and these are not shared. You cannot fetch
the format of a cell in an existing spreadsheet and transfer it whole
to a new spreadsheet. You are going to have to play around with
extracting the various pieces of the existing cell format and transfer
each piece to the new spreadsheet using the syntax of
Spreadsheet::WriteExcel.
Your error message occurs because you have sent a blessed object of the
Spreadsheet::ParseExcel::Format to the write_string method of a
Spreadsheet::WriteExcel::Worksheet object, and it is trying to call the
get_xf_index method, which does not exist in the
Spreadsheet::ParseExcel::Format class.
--
Jim Gibson
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
------------------------------
Date: Tue, 30 Oct 2007 13:36:02 +0000
From: Timothy Murphy <tim@birdsnest.maths.tcd.ie>
Subject: Re: TeX programming and LaTeX hacking
Message-Id: <7rGVi.22888$j7.433343@news.indigo.ie>
Robin Fairbairns wrote:
> but if your horizons don't reach to anything that can't be programmed
> in c++ or c# -- i.e., anything out of the ordinary -- then coming to
> such a weird environment as programming tex macros is going to extend
> them.
>
> not that i _would_ recommend teaching tex, but there's no denying that
> it's good training for working with an environment of maximum surprise
Wouldn't Lisp be a closer analogy than C++?
I'm not a computer scientist (TG) but Lisp and TeX seem to me
to share the characteristic that a program can alter the parser,
which is certainly likely to cause surprises.
------------------------------
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 V11 Issue 990
**************************************