I believe it is your use of multiple lists as arguments to the RTFTable function that causes this behavior. You cannot use multiple lists as arguments, since Perl does not know where one list ends and another starts. Use references to lists instead. Reading perlref and perlreftut is an excellent start.
#!/usr/bin/perl use warnings; use strict; use Data::Dumper; use Log::Log4perl qw(:easy); Log::Log4perl->easy_init($DEBUG); my $logger = get_logger(); my @tableProp5 = ( widths => [3*1440, 4*1400], align => 'l l', ); my @myText = ( ['\fs20\b this', 'that'], ['\fs20\b this', 'that'], ['\fs20\b this', 'that'], ['\fs20\b this', 'that'], ); RTFTable(@tableProp5, 9, 7, @myText); sub RTFTable{ my (@tableProps, $headerColor, $bgColor, @Text ) = @_; my $count = 0; my $oDecl5; $logger->debug("tableProps:". Dumper(@tableProps)); $logger->debug("headerColor:". Dumper($headerColor)); $logger->debug("bgColor:". Dumper($bgColor)); $logger->debug("Text:". Dumper(@Text)); } __END__ C:\src\perl\perlmonks\635868>perl 635868.pl 2007/08/29 20:15:44 tableProps:$VAR1 = 'widths'; $VAR2 = [ 4320, 5600 ]; $VAR3 = 'align'; $VAR4 = 'l l'; $VAR5 = 9; $VAR6 = 7; $VAR7 = [ '\\fs20\\b this', 'that' ]; $VAR8 = [ '\\fs20\\b this', 'that' ]; $VAR9 = [ '\\fs20\\b this', 'that' ]; $VAR10 = [ '\\fs20\\b this', 'that' ]; 2007/08/29 20:15:44 headerColor:$VAR1 = undef; 2007/08/29 20:15:44 bgColor:$VAR1 = undef; 2007/08/29 20:15:44 Text:
As you can see, Perl puts all arguments into the first list. The three last variables headerColor, bgColor, Text are all undefined.
--
Andreas

In reply to Re: RTF Table function by andreas1234567
in thread RTF Table function by ikkon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.