in reply to Need help !

my $arg = @_;
That evaluates the @_ array in scalar context and assigns the number of elements in the array (which is always 1 in your code) to the $arg variable. You likely want:
my ($arg) = @_;