Perlito5

 view release on metacpan or  search on metacpan

lib/Perlito5/Grammar/Scope.pm  view on Meta::CPAN

        hint_scalar => $^H,
        hint_hash   => {%^H},
    };
    # warn "ENTER $Perlito5::PKG_NAME \n";
    # print STDERR "create_new_compile_time_scope [ $^H ]\n";
}

sub end_compile_time_scope {
    # warn "EXIT\n";
    my $scope = pop @Perlito5::BASE_SCOPE;
    $^H = $scope->{hint_scalar};
    %^H = %{ $scope->{hint_hash} || {} };
    # print STDERR "end_compile_time_scope [ $^H ]\n";
}

sub compile_time_glob_set {
    # set a GLOB at compile-time
    my ($glob, $value, $namespace) = @_;
    if ( !ref($glob) ) {
        if ( $glob !~ /::/ ) {
            $glob = $namespace . '::' . $glob;

lib/Perlito5X/overload.pm  view on Meta::CPAN

    elsif (!ref $_ [1] || "$_[1]" !~ /(^|=)CODE\(0x[0-9a-f]+\)$/) {
        # Can't use C<ref $_[1] eq "CODE"> above as code references can be
        # blessed, and C<ref> would return the package the ref is blessed into.
        if (warnings::enabled) {
            $_ [1] = "undef" unless defined $_ [1];
            warnings::warn ("'$_[1]' is not a code reference");
        }
    }
    else {
        $^H{$_[0]} = $_[1];
        $^H |= $constants{$_[0]};
    }
    shift, shift;
  }
}

sub remove_constant {
  # Arguments: what, sub
  while (@_) {
    delete $^H{$_[0]};
    $^H &= ~ $constants{$_[0]};
    shift, shift;
  }
}

1;

__END__

=head1 NAME

src/Perlito5/Grammar/Scope.pm  view on Meta::CPAN

        hint_scalar => $^H,
        hint_hash   => {%^H},
    };
    # warn "ENTER $Perlito5::PKG_NAME \n";
    # print STDERR "create_new_compile_time_scope [ $^H ]\n";
}

sub end_compile_time_scope {
    # warn "EXIT\n";
    my $scope = pop @Perlito5::BASE_SCOPE;
    $^H = $scope->{hint_scalar};
    %^H = %{ $scope->{hint_hash} || {} };
    # print STDERR "end_compile_time_scope [ $^H ]\n";
}

sub compile_time_glob_set {
    # set a GLOB at compile-time
    my ($glob, $value, $namespace) = @_;
    if ( !ref($glob) ) {
        if ( $glob !~ /::/ ) {
            $glob = $namespace . '::' . $glob;

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.526 second using v1.00-cache-2.02-grep-82fe00e-cpan-2ea8abbae53 )