For example, given:
USCAGoleta9311734.5021-120.1287855805
I want to extract just:
US
Is this what your after?
my $string = 'USCAGoleta9311734.5021-120.1287855805'; my $first_two_chars = substr $string, 0, 2;
ref: substr