Skip to content

Instantly share code, notes, and snippets.

@yasu47b
Created August 8, 2016 09:07
Show Gist options
  • Save yasu47b/493c86df5194a35015e926eefcae8cda to your computer and use it in GitHub Desktop.
Save yasu47b/493c86df5194a35015e926eefcae8cda to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use 5.010;
my @array = (10,8,2,2);
while( my ($i, $e) = each @array){
say "i: $i, e: $e";
}
for (@array){
my ($i, $e) = each @array;
say "i: $i, e: $e";
}
@yasu47b
Copy link
Author

yasu47b commented Aug 8, 2016

配列のインデックスと要素を同時に取得するメモ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment