foreach my $text (@$input) { ... $text = encrypt($text,$key); ... }