sub first{ some stuff return @somearray } sub second{ my @Something = @_; #then do whatever } sub main{ second(first); } main;