Neither "$x =~/^(.{10})/;" nor "$x =~/^(\d{10})/;" seem to work. When I print them out, I still have 11 characters.
A little more info. The variable has already been set, to a string with 10 or more digits. I want to reset the value to just the first 10 digits. This is what I tried:
$x = "12345678901";
$x =~ /^(\d{10})/; ( I also tried $x =~ /^(.{10})/; )
print "$x\n";
This still prints "12345678901", instead of "12345678900".
I'll look at the substr doc.
Thanks!