List Info

Thread: Spreadsheet::WriteExcel with fork




Spreadsheet::WriteExcel with fork
country flaguser name
United States
2007-08-31 19:24:41
Hi,

I am having problem using Spreadsheet::WriteExcel with
fork:
in a simple test, I have to declare $workbook using our,
instead of
using my

 our $workbook =
Spreadsheet::WriteExcel->new("test.xls");
##if I used my, the xls format is wrong when used combined
with fork
    # Add a worksheet
   my  $worksheet = $workbook->add_worksheet('wks1');

    #  Add and define a format
    my $format = $workbook->add_format(); # Add a format
    $format->set_bold();

    # Write a formatted and unformatted string, row and
column
notation.
    my ($col , $row )= (0, 0);
    $worksheet->write($row, $col, "Hi Excel!",
$format);
    $worksheet->write(1,    $col, "Hi
Excel!");


my $child_pid;
my ids;
my a
= ('parent') ;
open OUT, ">$0.out";

for (my $i=0; $i < 10; $i++) {
  $child_pid = fork();
  if (!defined $child_pid ) {
    die "cannot fork: $!";
  } elsif ($child_pid) {
    push ids, $child_pid;
    # I'm the parent
  } else {
    # I'm the child
    sleep (int (rand (5)));
    push a, "child$i";
    for (my $n=0; $n<20; $n++) {
      print OUT "child$itat$nn";
    }
    exit;
  }
}

foreach (ids) {
  waitpid ($_,0);
}
print "an";
close OUT;

 $workbook->close();


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Spreadsheet::WriteExcel" group.
To post to this group, send email to
spreadsheet-writeexcelgooglegroups.com
To unsubscribe from this group, send email to
spreadsheet-writeexcel-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/spreadsheet-writeexcel
?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Spreadsheet::WriteExcel with fork
country flaguser name
United States
2007-08-31 20:34:01
On Sep 1, 1:24 am, Jen <yz742...gmail.com> wrote:
> Hi,
>
> I am having problem using Spreadsheet::WriteExcel with
fork:

Hi,

Thanks for the example program. I don't know if this is a
general
problem or something specific to Spreadsheet::WriteExcel.

Can you post your system details using the program in this
thread:

http://groups.google.
com/group/spreadsheet-writeexcel/browse_thread/thread/23c265
20737d753b

John.
--


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Spreadsheet::WriteExcel" group.
To post to this group, send email to
spreadsheet-writeexcelgooglegroups.com
To unsubscribe from this group, send email to
spreadsheet-writeexcel-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/spreadsheet-writeexcel
?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )