Skip Menu |
 

This queue is for tickets about the Geo-IPfree CPAN distribution.

Report information
The Basics
Id: 133012
Status: new
Priority: 0/
Queue: Geo-IPfree

People
Owner: Nobody in particular
Requestors: andreas.mock [...] web.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Problem with Geo::IPfree 1.151940
Date: Thu, 16 Jul 2020 19:08:04 +0200
To: <bug-Geo-IPfree [...] rt.cpan.org>
From: "Andreas Mock" <andreas.mock [...] web.de>
The following code shows a problem with Geo::IPfree while loading the module dynamically with two different approaches. Both approaches thow an exception. --------------------------8<-------------------------- #!/usr/bin/perl use strict; use warnings; use 5.010; use Module::Runtime qw(require_module);; use Class::Load qw(load_class); # First Attempt my @y = map { require_module('Geo::IPfree'); } qw(1); # Second Attempt #my @y = map { # load_class('Geo::IPfree'); #} qw(1); __END__ # Problematic code in Geo/IPfree.pm # # Solution: # a) Using explicit variable storing the read lines # or # b) localize $_ # 28 { 29 my $c = 0; 30 %baseX = map { $_ => ( $c++ ) } @baseX; 31 $base = @baseX; 32 33 my @data; 34 while ( <DATA> ) { 35 last if m{^__END__}; 36 chomp; 37 push @data, split m{ }, $_, 2; 38 } 39 %countrys = @data; 40 } --------------------------8<-------------------------- Best regards Andreas


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.