Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.18 KB | None | 0 0
  1. sub test {
  2.     my @arr = @_;
  3.     if (grep {$_ == 1} @arr) {
  4.         print "yay it has 1\n";
  5.     } else {
  6.         print "no it doesn't\n";
  7.     }
  8. }
  9.  
  10. test(1,2,3);
  11. test(4,5,6);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement