in reply to Re^4: Print array from here-doc
in thread Print array from here-doc

How are you calling the subroutine? If you do

ReportThreshholdExceeded $thing1, $thing2, $thing3;

then $output_array = $thing1. Maybe you actually meant

my @output_array = @_; my $text = join "\t", @output_array; ...

This puts all parameters in $output_array.

Replies are listed 'Best First'.
Re^6: Print array from here-doc
by sasrs99 (Acolyte) on Apr 25, 2007 at 21:44 UTC
    This is how I call it: ReportThreshholdExceeded( @output_array );
      You should either call it like ReportThreshholdExceeded(\@output_array)<\c> (this will put a reference to <c>@output_array in the sub's $output_array or write it like I suggested in the GP post.

      Currently the sub's $output_array only contains the first element of the caller's @output_array.