in reply to passing file handle to functions

Hi, if I have understood your question correctly then try this,

use strict; use warnings; #####Function 1############# open (FF, "sample.xml")||die $!; my @con = <FF>; 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>; }

View these How (Not) To Ask A Question and How do I post a question effectively?

Regards,
Velusamy R.


eval"print uc\"\\c$_\""for split'','j)@,/6%@0%2,`e@3!-9v2)/@|6%,53!-9@2~j';