Skip to content

Instantly share code, notes, and snippets.

@ynonp
Created April 25, 2012 05:49
Show Gist options
  • Save ynonp/2486898 to your computer and use it in GitHub Desktop.
Save ynonp/2486898 to your computer and use it in GitHub Desktop.
perl default var
while (<>) {
chomp;
print;
}
use v5.14;
my @arr = (10, 20, 30, 20, 25);
my $sum = 0;
foreach my $el (@arr) {
$sum += $el;
}
foreach (@arr) {
$sum += $_;
}
$sum += $_ for (@arr);
use v5.14;
my @ext = qw/*.txt *.c/;
unlink glob for (@ext);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment