Hi Malik, If you pass a reference to the array as the first argument as below you can keep the array separate from the other arguments you are passing.
@abc = qw(1 2 3); $x = 4; $y = 5; testsub([EMAIL PROTECTED], $x, $y); sub testsub($$$) { ($abc, $x, $y) = @_; print "Array @$abc\n"; print "x $x\n"; print "y $y\n"; } See perldoc perlref for a much better explanation than I could give. Jim -----Original Message----- From: Mallik [mailto:[EMAIL PROTECTED] Sent: 02 March 2004 14:00 To: Perl Beginners Subject: Passing array as First argument Importance: High Dear Friends, I need to pass 3 parameters to a subroutine, in which the first parameter is an array and the last two parameters are strings. @abc = qw(1 2 3); $x = 4; $y = 5; testsub(@abc, $x, $y); sub testsub(@$$) { (@abc, $x, $y) = @_; print "Array @abc\n"; print "x $x\n"; print "y $y\n"; } The output of the above code is Array 1 2 3 4 5 x y As seen above, all the parameters are assigned to the array. So, how can get the values into x and y. Thanks in advance. Mallik. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>