HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/x86_64-linux-gnu/perl5/5.34/JSON/Tokenize.pm
package JSON::Tokenize;
use warnings;
use strict;
require Exporter;
our @ISA = qw(Exporter);
use JSON::Parse;
our @EXPORT_OK = qw/
		       tokenize_child
		       tokenize_end
		       tokenize_json
		       tokenize_next
		       tokenize_start
		       tokenize_text
		       tokenize_type
		   /;
our %EXPORT_TAGS = ('all' => \@EXPORT_OK);
use Carp;
our $VERSION = '0.61';

sub tokenize_text
{
    my ($input, $token) = @_;
    if (! $input || ! $token) {
	croak "tokenize_text requires input string and JSON::Tokenize object";
    }
    my $start = tokenize_start ($token);
    my $length = tokenize_end ($token) - $start;
    my $text;
    if (utf8::is_utf8 ($input)) {
	# $start and $length refer to bytes, so we need to convert
	# $input into bytes.
	my $copy = $input;
	utf8::encode ($copy);
	$text = substr ($copy, $start, $length);
	# Make the output utf8-flagged.
	utf8::decode ($text);
    }
    else {
	$text = substr ($input, $start, $length);
    }
    return $text;
}

1;