PERL function problem

I have perl script as follow.
------------------------------------------------------------------------
#! /usr/bin/env perl

use strict;

sub printLines
{
print "Inside the function.............\n";
my (@file , $count , $key ) = $_;
print $count , $ key ; # It does not print this. ?

}
open(READ_FILE ,"simple.txt");
my @fa = <READ_FILE>;
my $symbolkey = "MY_SYMBOL";
my $line;
foreach $line (@fa){
if ($line =~ /$symbolkey/) {
print $line ,"Match found .............\n";
&printLines(@fa,3,$symbolkey);
}
}
close(READ_FILE);

-------------------------------------------------------------------

Function gets called. But inside function , it does not print values of arguments. What is problem with it.

Thank you,

Use '@' instead of '$'. And you simply should not pass an array directly if the subroutine signature contains a mixture of scalar and list data values, because the @file in your example will gobble up all parameters leaving $count and $key undef, even if you have made the change I mentioned above.

Pass by reference.

my ($r_file , $count , $key ) = @_;
my @file = @$r_file;

And change the way you call the subroutine:

&printLines(\@fa,3,$symbolkey);

Hi,
Thank you for the clarification. Now it is working.