#!/usr/bin/perl use strict; my @array; my $bgn = 0; for ( 0..2 ) { push @array, pack( "c*", $bgn .. $bgn+511 ); $bgn += 128; } # pack "c*" will only use the low 8 bits and strip off the higher ones, so # $array[0] will be identical to $array[2] for ( 1, 2 ) { my $cmp = ( $array[0] eq $array[$_] ) ? "matches" : "differs from"; print "element 0 $cmp element $_\n"; } __OUTPUT__ element 0 differs from element 1 element 0 matches element 2