#!/usr/bin/env perl use strict; use warnings; my @array; while () { chomp; my ($bool,$int) = split ","; # Take each ($bool,$int) tuple, and store it in an array reference # (By placing it in []) that we add to our array push @array, [ $bool, $int ]; } # Cycle through our array of array references and print them foreach my $entry (@array) { print "Bool: " . $entry->[0] . "\n"; # The -> dereferences our arrayref print "Int: " . $entry->[1] . "\n\n"; # The -> dereferences our arrayref } __DATA__ 0,14 0,7 1,13 0,3 1,9 0,2 1,1