Skip to content

Instantly share code, notes, and snippets.

@pmichaud
Created July 4, 2013 16:21
Show Gist options
  • Save pmichaud/5928913 to your computer and use it in GitHub Desktop.
Save pmichaud/5928913 to your computer and use it in GitHub Desktop.
pmichaud@plum:~$ cat x.pl
#!/usr/bin/perl
my @a = 1..10;
foreach (grep { $_ % 2 } @a) { $_++; }
print "@a\n";
pmichaud@plum:~$ perl x.pl
2 2 4 4 6 6 8 8 10 10
pmichaud@plum:~$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment