in reply to Re: sub will not return data correctly (the way i want it to!!)
in thread sub will not return data correctly (the way i want it to!!)

There's definitely more than one way to do it.

use strict; use warnings; sub test { read( DATA, my $foo1, 0x04 ); return $foo1; } sub test_b { my @array; for my $i ( 0 .. 15 ) { read( DATA, $array[$i], 0x04 ); } return @array; } print "\ntest_1:\n"; print test() for ( 1..4 ); print "\ntest_2:\n"; print test() for 1..15, "\n"; print "\ntest_3:\n"; print test_b(), "\n" ; __DATA__ belongs to test1belongs to test2belongs to test2belongs to test2belong +s to test2belongs to test3belongs to test3belongs to test3belongs to +test3