#!usr/bin/perl -w use strict; my @result; @result = X(); print "array returned from sub X is: ", @result,"\n"; if ((@result == 1) and ( grep {$_ == 3}@result )) { print "Sub X passes the test", @result,"\n"; } else { print "@result: for Sub X fails the test\n"; } print "\n"; @result = Y(); print "array returned from Sub Y is: ", @result,"\n"; if ((@result == 1) and ( grep {$_ == 3}@result)) { print "Sub Y @result passes the test\n"; } else { print "Sub Y @result fails the test\n"; } print "\n"; sub X { return (1,2,3,4,5,6,7,8,9); } sub Y { return (3); } __END__ array returned from sub X is: 123456789 1 2 3 4 5 6 7 8 9: for Sub X fails the test array returned from Sub Y is: 3 Sub Y 3 passes the test