fork download
  1. #!/usr/bin/perl
  2. my @arr = (3, 2, 1);
  3. my %hash = (k1 => 'v1', k2 => 'v2');
  4. if (@arr) {
  5. if (%hash) {
  6. for my $el (@arr) {
  7. keys %hash;
  8. for (my ($key, $val) = each %hash) {
  9. print "$el$key$val\n";
  10. }
  11. }
  12. } else {
  13. print "$_\n" for @arr;
  14. }
  15. } elsif (%hash) {
  16. print "%hash\n";
  17. } else {
  18. print "No luck, screw it!\n";
  19. }
  20.  
Success #stdin #stdout 0s 17496KB
stdin
Standard input is empty
stdout
3k1v1
3k1v1
2k1v1
2k1v1
1k1v1
1k1v1