#!/usr/bin/perl $a = 'name'; $b = 5; my $c = 'name'; my $d = 5; print "${a}[$b]" eq "${c}[$d]" ? "ok\n" : "booger\n";