in reply to Re^3: sub will not return data (after data has been returned)
in thread sub will not return data correctly (the way i want it to!!)

thats wild that it doesnt even need test_2() called. I tried it and it did work, but why does it work even when test_2() isnt called? I will more than likely use this, otherwise I will have to change up abunch of code.
EDIT: i found another problem as well ;) I also am converting the data to its hex equivalent with unpack('H*', ()).

Why does this fail:
push @test_2_data, unpack('H*', (test_2( $test ))) for 1 .. 4; print $_ for(@test_2_data);

And this works:
push @test_2_data, test_2( $test ) for 1 .. 4; for(@test_2_data){ $_ = unpack('H*', $_); } print $_ for(@test_2_data);