i have a script that calls an URL, and returns characters like this "654321_1111" (quotes are part of the return).
Many web APIs return JSON. If that is the case here, you can use decode_json from one of the JSON modules, such as Cpanel::JSON::XS, or JSON::PP has been in core since Perl 5.14.
Update: In JSON::PP versions before 4.0, that is, those distributed with Perl 5.28 and before, the allow_nonref option must be set to decode a string. That is, instead of decode_json(q{"654321_1111"}), one has to write JSON::PP->new->allow_nonref->decode(q{"654321_1111"}).