I am trying to return all the data from this subroutine, but when I run this test code I am only getting a partial amount of data.
Is that a better way to do this? Here is the code:
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my ($test_a, $test_b, $test_c) = data(); print Dumper $test_a; print Dumper $test_b; print Dumper $test_c; my ($ar1, $ar2, $ar3); sub data { ($ar1,$ar2,$ar3) = get_data() unless $ar1; return @$ar1, @$ar2, @$ar3; }; sub get_data{ my ($ar1, $ar2, $ar3); push @$ar1, ["Acc #", "Name", "Date", "House Number",], ["1235456", "Joe More", "03/07/2010", "5",],; push @$ar2, ["", "", "","",], ["Home ", "Year", "City","",], ["", "", "","",], ["1", "2000", "Local 1","",], ["2", "2001", "Local 2 ","",], ["3", "2002", "Local 3 ","",], ["4", "2003", "Local 4 ","",], ["5", "2014", "TLocal 5 ","",], ["", "", "","",],; push @$ar3, ["", "", "","",], ["Operation:", "", "","",], ["", "", "","Name","Place", "LOC", "REF","A#1","B#2", "C#3", " +D#4",], ["", "", "","","", "", "","","", "", "",], ["", "", "","1","Mary L", "5/15/1940", "S","V","P", "-", "-",] +, ["", "", "","2","Joe T", "6/8/1990", "B","Q","X", "-", "-",], ["", "", "","3","Carl C", "07/5/1288", "A","S","Y", "-", "-",] +, ["", "", "","","", "", "","","", "", "",],; return @{ $ar1 }, @{ $ar2 }, @{ $ar3 }; }

Thanks

In reply to Returning all data from subroutine by Anonymous Monk

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.