in reply to Invalid Hex Conversion?
See also:use diagnostics; my $Address = 'A7:F0'; #takes the first two characters and stores them for later $AddressOriginal = substr($Address, 0, 3); #removes the first three characters leaving the later ## in the format + ##:## $Address = substr($Address, 3, 2); print "$Address\n"; #Test lines to make sure the above lines do their intended purpose #print $Address . "\n"; #print $AddressOriginal . "\n"; #for($count = 1; $count <= $IDcount; $count++) { $hexval = sprintf("%02X\n", ($Address)); $Address++; $Address1 = ($AddressOriginal . $hexval); #Test line to make sure the procedure completed its intended task print $Address1; #} __END__ F0 Argument "F0" isn't numeric in sprintf at ... (#1) (W numeric) The indicated string was fed as an argument to an oper +ator that expected a numeric value instead. If you're fortunate the me +ssage will identify which operator was so unfortunate. A7:00
|
|---|