Tails has asked for the wisdom of the Perl Monks concerning the following question:
This is just a bit of it, but it's where the problem lies. I uppercase the letter, split on every new character, print for debugging, my board is 10x10, so the max it can be is 10, so if the 3rd element is 0, I'll concatenate it onto the string for use in my module. It's very poorly written but that's why I'm here, to make it better =P. How would I use substitution with regular expressions to do this job? Or would it be better to split and concatenate. Thanks for any help!$combined = uc($topLeftCoord); @chars = (split //, $combined); print "@chars\n"; if ($chars[2] == 0){ $combined = $chars[0] . ":" . $chars[1] . $chars[2]; } else{ $combined = $chars[0] . ":" . $chars[1]; }
|
|---|