Skip to content

Instantly share code, notes, and snippets.

@tacitochaves
Created January 3, 2014 15:09
Show Gist options
  • Save tacitochaves/8239381 to your computer and use it in GitHub Desktop.
Save tacitochaves/8239381 to your computer and use it in GitHub Desktop.
União entre dois arrays
#!/home/chaves/perl5/perlbrew/perls/perl-5.16.3/bin/perl
use 5.12.0;
my @A = (1, 2, 3, 5, 7, 23, 8, 14, 95, 19);
my @B = (3, 14, 6, 22, 88, 19, 100);
my @AUB = sort { $a <=> $b } map { $_ } (@A,@B);
say "@AUB";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment