use strict; use warnings; #####Function 1############# open (FF, "sample.xml")||die $!; my @con = ; close(FF); #Passing Array to a function &function1(\@con); #####Function 2############# open (FF, "sample.xml")||die $!; #Passing File handle to a function &function2(\*FF); close(FF); sub function1{ my ($con) = @_; #Dereference the array my @con = @{$con}; $,="\n"; print @con; } sub function2{ my ($con) = @_; print <$con>; }