I run:
perl -MCPAN -e 'install Bundle::DBD::Pg'
it asks:
Path to pg_config?
I say:
/Library/PostgreSQL/9.3/bin/pg_config
it runs... and the last lines are:
Test Summary Report
-------------------
t/02attribs.t (Wstat: 256 Tests: 249 Failed: 1)
Failed test: 23
Non-zero exit status: 1
Files=15, Tests=1691, 29 wallclock secs ( 0.23 usr 0.05 sys + 5.29 cusr 1.65 csys = 7.22 CPU)
Result: FAIL
Failed 1/15 test programs. 1/1691 subtests failed.
make: *** [test_dynamic] Error 255
TURNSTEP/DBD-Pg-2.19.3.tar.gz
/usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports TURNSTEP/DBD-Pg-2.19.3.tar.gz
Running make install
make test had returned bad status, won't install without force
I saw a DBI_USER config turn to jgp (my login) which i also created in the DB.
Any hint on where I should start?
As requested, here is the full test result:
Running make test
PGINITDB="/Library/PostgreSQL/9.3/bin/initdb" PERL_DL_NONLAZY=1 /usr/bin/perl "- MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00_signature.t .... skipped: Set the environment variable TEST_SIGNATURE to enable this test
t/00basic.t ......... ok
t/01connect.t ....... Please wait, creating new database for testing
t/01connect.t ....... 1/15 #
# DBI Version 1.631
# DBD::Pg Version 2.19.3
# Perl Version 5.16.2
# OS darwin
# PostgreSQL (compiled) 90302
# PostgreSQL (target) 90302
# PostgreSQL (reported) PostgreSQL 9.3.2 on x86_64-apple-darwin, compiled by i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00), 64-bit
# Default port 5432
# DBI_DSN dbi:Pg:db="postgres";port=5440;host=<pwd>/dbdpg_test_database/data/socket
# DBI_USER jgp
# Test schema dbd_pg_testschema
# LANG C
# array_nulls on
# backslash_quote safe_encoding
# client_encoding UTF8
# server_encoding UTF8
# standard_conforming_strings on
# Adjusted: initdb
t/01connect.t ....... ok
t/01constants.t ..... ok
t/02attribs.t ....... 1/249
# Failed test 'DB handle attribute "PrintWarn" shows warnings when on'
# at t/02attribs.t line 263.
# ''
# doesn't match '(?^:dbd_pg_test_temp)'
(in cleanup) DBD::Pg::st DESTROY failed: no connection to the server at t/02attribs.t line 1558.
# Looks like you failed 1 test of 249.
t/02attribs.t ....... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/249 subtests
t/03dbmethod.t ...... ok
t/03smethod.t ....... ok
t/04misc.t .......... 1/70 # Checking pg_st_split_statement. This may take a while...
t/04misc.t .......... ok
t/06bytea.t ......... ok
t/07copy.t .......... ok
t/08async.t ......... ok
t/09arrays.t ........ ok
t/12placeholders.t .. ok
t/20savepoints.t .... ok
t/99cleanup.t ....... 1/1 Removing test database directory
t/99cleanup.t ....... ok
I must admit I am new to perl and PostgreSQL.
It looks like this has been fixed but not yet included in a new release. Apparently, "Postgres got less chatty in 9.3."
There's a developer release available on CPAN (v2.20.1_6). To install:
cpan TURNSTEP/DBD-Pg-2.20.1_6.tar.gz
or you could pull the latest source with git.
this worked for me, I only had to answer the pg_config question, to which my answer was:
/Applications/Postgres.app/Contents/Versions/9.5/bin/pg_config
Related
I am using Strawberry Perl 5.28 version and end up getting issues while installing DBD::JDBC module .
Hence the make/gmake , make test,gmake test is consistently failing even if I download the DBC::JDBC module and run perl Makefile.PL . I already have JDK 8 and JRE installed.
Any help would be appreciated .
C:\Users>cpan DBD::JDBC DBI
Loading internal logger. Log::Log4perl recommended for better logging
CPAN: CPAN::SQLite loaded ok (v0.217)
Database was generated on Thu, 20 May 2021 14:53:47 GMT
Running install for module 'DBD::JDBC'
CPAN: Digest::SHA loaded ok (v6.02)
CPAN: Compress::Zlib loaded ok (v2.086)
Checksum for C:\STRAWB~1\cpan\sources\authors\id\V\VI\VIZDOM\DBD-JDBC-0.71.tar.gz ok
CPAN: Archive::Tar loaded ok (v2.32)
CPAN: YAML::XS loaded ok (v0.77)
CPAN: CPAN::Meta::Requirements loaded ok (v2.140)
CPAN: CPAN::Meta loaded ok (v2.150010)
Configuring V/VI/VIZDOM/DBD-JDBC-0.71.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Using DBI 1.643 (for perl 5.028002 on MSWin32-x64-multi-thread) installed in C:/strawberry/perl/site/lib/auto/DBI/
Generating a gmake-style Makefile
Writing Makefile for DBD::JDBC
Writing MYMETA.yml and MYMETA.json
VIZDOM/DBD-JDBC-0.71.tar.gz
C:\strawberry\perl\bin\perl.exe Makefile.PL -- OK
Running make for V/VI/VIZDOM/DBD-JDBC-0.71.tar.gz
CPAN: Module::CoreList loaded ok (v5.20190420)
cp JDBC.pod blib\lib\DBD\JDBC.pod
cp lib/Bundle/DBD/JDBC.pm blib\lib\Bundle\DBD\JDBC.pm
cp JDBC.pm blib\lib\DBD\JDBC.pm
VIZDOM/DBD-JDBC-0.71.tar.gz
C:\STRAWB~1\c\bin\gmake.exe -- OK
Running make test for VIZDOM/DBD-JDBC-0.71.tar.gz
set CLASSPATH=dbd_jdbc.jar;t/hsqldb/hsqldb-1.8.0.2.jar;t/hsqldb/log4j-1.2.13.jar;C:\Users\Downloads\DBD-JDBC-0.71.tar\DBD-JDBC-0.71\log4j.properties;C:\Users\Downloads\SimbaSparkJDBC4-2.6.16.1020\SparkJDBC4.jar;
"C:\strawberry\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/01_env.t ...... ok
t/02_connect.t .. 1/5 DBD::JDBC::dr connect warning: No suitable driver found for jdbc:hsqldb:file:t/hsqldb/testdb at C:/strawberry/perl/site/lib/DBI.pm line 679.
# Failed test 'connected'
# at t/02_connect.t line 40.
t/02_connect.t .. 3/5 # Connection error: No suitable driver found for jdbc:hsqldb:file:t/hsqldb/testdb
# Make sure your CLASSPATH includes your JDBC driver.
# Looks like you failed 1 test of 5.
t/02_connect.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/5 subtests
(less 2 skipped subtests: 2 okay)
t/03_hsqldb.t ... 1/22 DBD::JDBC::dr connect warning: No suitable driver found for jdbc:hsqldb:file:t/hsqldb/testdb at C:/strawberry/perl/site/lib/DBI.pm line 679.
# Failed test 'connected'
# at t/03_hsqldb.t line 34.
t/03_hsqldb.t ... 2/22 # Connection error: No suitable driver found for jdbc:hsqldb:file:t/hsqldb/testdb
# Looks like your test exited with 1 just after 22.
t/03_hsqldb.t ... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/22 subtests
(less 20 skipped subtests: 1 okay)
t/basis.t ....... skipped: BASIS URL not defined
t/oracle.t ...... skipped: Oracle URL not defined
Test Summary Report
-------------------
t/02_connect.t (Wstat: 256 Tests: 5 Failed: 1)
Failed test: 3
Non-zero exit status: 1
t/03_hsqldb.t (Wstat: 256 Tests: 22 Failed: 1)
Failed test: 2
Non-zero exit status: 1
Files=5, Tests=32, 7 wallclock secs ( 0.05 usr + 0.02 sys = 0.06 CPU)
Result: FAIL
Failed 2/5 test programs. 2/32 subtests failed.
gmake: *** [Makefile:780: test_dynamic] Error 255
VIZDOM/DBD-JDBC-0.71.tar.gz
C:\STRAWB~1\c\bin\gmake.exe test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports VIZDOM/DBD-JDBC-0.71.tar.gz
Stopping: 'install' failed for 'DBD::JDBC'.
DBI is up to date (1.643).
After lot of fight I have found easy way to resolve this problem to install DBD::JDBC is to download this module as tar file : DBD-JDBC-0.71.tar from CPAN and navigate to path where Strawberry Perl is installed like C:\Strawberry\perl\vendor\lib\DBD and move all files from extracted tar to here . then JDBC should start working .
I'm trying to install Number::Format to use with Padre on Windows:
cpanm Number::Format
I get the following error. How can I fix this?
cpanm (App::cpanminus) 1.7034 on perl 5.020002 built for MSWin32-x86-multi-thread-64int
Work directory is C:\Users\admin/.cpanm/work/1433356714.11300
You have make C:\STRAWB~1\c\bin\dmake.exe
You have LWP 6.08
Falling back to Archive::Tar 2.04
Searching Number::Format () on cpanmetadb ...
--> Working on Number::Format
Fetching http://www.cpan.org/authors/id/W/WR/WRW/Number-Format-1.73.tar.gz
-> OK
Unpacking Number-Format-1.73.tar.gz
Entering Number-Format-1.73
Checking configure dependencies from META.yml
Configuring Number-Format-1.73
Running Makefile.PL
Checking if your kit is complete...
Looks good
Generating a dmake-style Makefile
Writing Makefile for Number::Format
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have POSIX 0 ... Yes (1.38_03)
Checking if you have ExtUtils::MakeMaker 0 ... Yes (6.98)
Checking if you have Test::More 0 ... Yes (1.001014)
Checking if you have Carp 0 ... Yes (1.3301)
Building and testing Number-Format-1.73
cp Format.pm blib\lib\Number\Format.pm
C:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/format_bytes.t ..... ok
t/format_negative.t .. ok
t/format_number.t .... ok
t/format_picture.t ... ok
t/format_price.t ..... ok
Invalid sep_by_space value at t/locale.t line 77.
# Looks like your test exited with 255 just after 5.
t/locale.t ...........
Dubious, test returned 255 (wstat 65280, 0xff00)
All 5 subtests passed
(less 3 skipped subtests: 2 okay)
t/object.t ........... ok
t/round.t ............ ok
t/unformat_number.t .. ok
Test Summary Report
-------------------
t/locale.t (Wstat: 65280 Tests: 5 Failed: 0)
Non-zero exit status: 255
Files=9, Tests=147, 1 wallclock secs ( 0.11 usr + 0.03 sys = 0.14 CPU)
Result: FAIL
Failed 1/9 test programs. 0/147 subtests failed.
dmake.exe: Error code 255, while making 'test_dynamic'
-> FAIL Installing Number::Format failed. See C:\Users\admin\.cpanm\work\1433356714.11300\build.log for details. Retry with --force to force install it.
There's already a bug report for this. The issue hasn't been fixed yet, but somebody uploaded a patch that you can try:
Reason seems to be the POSIX module, which returns many "-1" values where Number::Format->new() expects missing hash keys... I was able to successfully test and install by using the attached patch as a workaround. But it might be smarter to fix this problem in the POSIX module.
Any time a module fails to build, you should check the CPAN Testers report. The tests are failing for Perl 5.20.0 on Window x64, so it's not just you.
I'm trying to install Time::Out.
The error looks to be coming from the tar file. Do I need to install anything more? I get the following:
install Time::Out
Reading 'C:\Perl\cpan\Metadata'
Database was generated on Thu, 05 Jun 2014 08:53:02 GMT
Running install for module 'Time::Out'
Checksum for C:\Perl\cpan\sources\authors\id\P\PA\PATL\Time-Out-0.11.tar.gz ok
Scanning cache C:\Perl/cpan/build for sizes
............................................................................DONE
Time-Out-0.11/
Time-Out-0.11/MANIFEST
Time-Out-0.11/t/
Time-Out-0.11/t/01_init.t
Time-Out-0.11/t/pod.t
Time-Out-0.11/t/03_exceptions.t
Time-Out-0.11/t/02_usage.t
Time-Out-0.11/Out.pod
Time-Out-0.11/README
Time-Out-0.11/Out.pm
Time-Out-0.11/META.yml
Time-Out-0.11/Makefile.PL
Time-Out-0.11/Changes
Configuring P/PA/PATL/Time-Out-0.11.tar.gz with Makefile.PL
Set up gcc environment - 3.4.5 (mingw-vista special r3)
Checking if your kit is complete...
Looks good
Generating a dmake-style Makefile
Writing Makefile for Time::Out
Writing MYMETA.yml and MYMETA.json
PATL/Time-Out-0.11.tar.gz
C:\Perl\bin\perl.exe Makefile.PL INSTALLDIRS=site -- OK
Running make for P/PA/PATL/Time-Out-0.11.tar.gz
cp Out.pm blib\lib\Time\Out.pm
cp Out.pod blib\lib\Time\Out.pod
PATL/Time-Out-0.11.tar.gz
C:\Perl\site\bin\dmake.exe -- OK
Running make test
C:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Te
st::Harness::Switches; test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/01_init.t ........ ok
t/02_usage.t .......
The following tests use sleep() so please be patient...
t/02_usage.t ....... 10/15 # Failed test 11 in t/02_usage.t at line 97
# t/02_usage.t line 97 is: ok($# eq 'timeout') ;
t/02_usage.t ....... 11/15 # Failed test 12 in t/02_usage.t at line 108
# t/02_usage.t line 108 is: ok($# eq 'timeout') ;
# Failed test 13 in t/02_usage.t at line 109
# t/02_usage.t line 109 is: ok(!$seen) ;
t/02_usage.t ....... Failed 3/15 subtests
(less 1 skipped subtest: 11 okay)
t/03_exceptions.t .. ok
t/pod.t ............ skipped: Test::Pod 1.00 required for testing POD
Test Summary Report
-------------------
t/02_usage.t (Wstat: 0 Tests: 15 Failed: 3)
Failed tests: 11-13
Files=4, Tests=19, 23 wallclock secs ( 0.09 usr + 0.05 sys = 0.14 CPU)
Result: FAIL
Failed 1/4 test programs. 3/19 subtests failed.
dmake.exe: Error code 255, while making 'test_dynamic'
PATL/Time-Out-0.11.tar.gz
C:\Perl\site\bin\dmake.exe test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports PATL/Time-Out-0.11.tar.gz
Failed during this command:
PATL/Time-Out-0.11.tar.gz : make_test NO
Is there another module I can use similar to the Time::Out? Besides alarm?
Per the Time::Out documentation, it does not work for blocking IO on windows. This means - at a minimum - that the tests will fail. You can skip the tests from the cpan shell using force install Time::Out, but this may mean that it doesn't work for your purposes.
I am trying to install the timeout_system module. I'm on windows. When I try
cpanm System::Timeout
it fails.
When I try
cpan System::Timeout
I get
C:\Windows\System32>cpan System:Timeout
CPAN: LWP::UserAgent loaded ok (v6.03)
Fetching with LWP:
http://cpan.strawberryperl.com/authors/01mailrc.txt.gz
CPAN: YAML loaded ok (v0.77)
CPAN: CPAN::SQLite loaded ok (v0.202)
Fetching with LWP:
http://cpan.strawberryperl.com/modules/02packages.details.txt.gz
Fetching with LWP:
http://cpan.strawberryperl.com/modules/03modlist.data.gz
Database was generated on Mon, 16 Sep 2013 20:14:09 GMT
Updating database file ...
Done!Running install for module 'System::Timeout'
Running make for C/CH/CHENGANG/System-Timeout-0.07.tar.gz
Fetching with LWP:
http://cpan.strawberryperl.com/authors/id/C/CH/CHENGANG/System-Timeout-0.07.tar.gz
CPAN: Digest::SHA loaded ok (v5.63)
Fetching with LWP:
http://cpan.strawberryperl.com/authors/id/C/CH/CHENGANG/CHECKSUMS
CPAN: Compress::Zlib loaded ok (v2.042)
Checksum for C:\Dwimperl\cpan\sources\authors\id\C\CH\CHENGANG\System-Timeout- 0.07.tar.gz ok
CPAN: Archive::Tar loaded ok (v1.80)
CPAN: File::Temp loaded ok (v0.22)
CPAN: Parse::CPAN::Meta loaded ok (v1.4401)
CPAN: CPAN::Meta loaded ok (v2.120351)
CPAN: Module::CoreList loaded ok (v2.57)
CPAN.pm: Building C/CH/CHENGANG/System-Timeout-0.07.tar.gz
Checking if your kit is complete...
Looks good
Writing Makefile for System::Timeout
Writing MYMETA.yml and MYMETA.json
cp lib/System/Timeout.pm blib\lib\System\Timeout.pm
C:\Dwimperl\perl\bin\perl.exe -MExtUtils::Command -e cp -- bin/timeout blib\script\timeout
pl2bat.bat blib\script\timeout
CHENGANG/System-Timeout-0.07.tar.gz
C:\Dwimperl\c\bin\dmake.EXE -- OK
Running make test
C:\Dwimperl\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/00System-Timeout.t .. 1/9 'sleep' is not recognized as an internal or external command,
operable program or batch file.
'sleep' is not recognized as an internal or external command,
operable program or batch file.
Can't find string terminator "'" anywhere before EOF at -e line 1.
# Failed test 'system timeout exit code'
# at t/00System-Timeout.t line 21.
Can't find string terminator "'" anywhere before EOF at -e line 1.
# Failed test 'timeout timeout exit code'
# at t/00System-Timeout.t line 27.
# Looks like you failed 2 tests of 9.
t/00System-Timeout.t .. Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/9 subtests
t/01bin-timeout.t ..... '..' is not recognized as an internal or external command,
operable program or batch file.
t/01bin-timeout.t ..... 1/4 '..' is not recognized as an internal or external command,
operable program or batch file.
# Failed test 'bin-timeout exit code'
# at t/01bin-timeout.t line 15.
# Looks like you failed 1 test of 4.
t/01bin-timeout.t ..... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/4 subtests
Test Summary Report
-------------------
t/00System-Timeout.t (Wstat: 512 Tests: 9 Failed: 2)
Failed tests: 7, 9
Non-zero exit status: 2
t/01bin-timeout.t (Wstat: 256 Tests: 4 Failed: 1)
Failed test: 4
Non-zero exit status: 1
Files=2, Tests=13, 1 wallclock secs ( 0.09 usr + 0.05 sys = 0.14 CPU)
Result: FAIL
Failed 2/2 test programs. 3/13 subtests failed.
dmake.EXE: Error code 129, while making 'test_dynamic'
CHENGANG/System-Timeout-0.07.tar.gz
C:\Dwimperl\c\bin\dmake.EXE test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports CHENGANG/System-Timeout-0.07.tar.gz
Running make install
make test had returned bad status, won't install without force
C:\Windows\System32>ppm Par-Packer
If anyone has an idea, that would be helpful. I don't have too much experience installing modules in Perl, and it would be very nice to use timeout_system.
Thx
Update: I ended up going with the following:
my $pid = fork();
if (!$pid) {
exec($command);
}
else {
sleep 100;
system("TASKKILL /F /T /PID $$");
}
which works.
I don't think this will work on Windows without change given that forking on Windows does not work the same as on *NIX systems. Installing and testing the dependency module IPC::Cmd via CPAN and running the sample script in the CPAN docs produces the following result...
c:\Perl>perl TEST_IPC_Cmd.pl
Set up gcc environment - 3.4.5 (mingw-vista special r3)
fetched webpage successfully: Continuing in background, pid 5244.
Output will be written to `wget-log.2'.
this is what the command printed:
Continuing in background, pid 5796.
Output will be written to `wget-log.3'.
run_forked is not available: at TEST_IPC_Cmd.pl line 30.
IPC::Open3 available: 1.12IPC::Run available: Can capture buffer: 1
c:\Perl>
Because System::Timeout is just a very simple wrapper around the IPC::Cmd run method (that also sets the timeout property), the IPC::Cmd module would first need modification to run correctly on Windows before System::Timeout would ever work as expected.
In my case, manually installing System::Timeout after installing IPC::Cmd successfully launched a an executable (a Perl one liner) but failed to kill the process after 3 seconds.
#Perl_AAA.pl
use System::Timeout qw(timeout);
print localtime()."\n";
timeout('perl -e "sleep(9); print \"Done\n\";"'); # invoke CORE::system, will not timeout exit
print localtime()."\n";
timeout("3", 'perl -e "sleep(9); print \"Done\n\";"'); # timeout exit after 3 seconds
print localtime()."\n";
print "Normal exit\n";
exit;
Result...
c:\Perl>
c:\Perl>perl TEST_AAA.pl
Thu Oct 17 12:51:22 2013
Done
Thu Oct 17 12:51:31 2013
Running [perl -e "sleep(9); print \"Done\n\";"]...
Done
Thu Oct 17 12:51:40 2013
Normal exit
c:\Perl>
I pasted the output below (originally posted to http://pastebin.com/Sh7a8tHK)
cpan[1]> install Switch
Reading '/.cpan/Metadata'
Database was generated on Tue, 11 Dec 2012 05:55:05 GMT
Running install for module 'Switch'
Running make for R/RG/RGARCIA/Switch-2.16.tar.gz
Checksum for /.cpan/sources/authors/id/R/RG/RGARCIA/Switch-2.16.tar.gz ok
Scanning cache /.cpan/build for sizes
............................................................................DONE
CPAN.pm: Building R/RG/RGARCIA/Switch-2.16.tar.gz
Checking if your kit is complete...
Looks good
Writing Makefile for Switch
Writing MYMETA.yml and MYMETA.json
cp Switch.pm blib/lib/Switch.pm
Manifying blib/man3/Switch.3
RGARCIA/Switch-2.16.tar.gz
/usr/ccs/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /opt/perl/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/given.t ... Useless use of numeric gt (>) in void context at t/given.t line 19.
t/given.t ... Failed 2/293 subtests
t/nested.t .. ok
t/switch.t .. ok
Test Summary Report
-------------------
t/given.t (Wstat: 0 Tests: 293 Failed: 2)
Failed tests: 2-3
Files=3, Tests=590, 1 wallclock secs ( 0.07 usr 0.01 sys + 0.47 cusr 0.00 csys = 0.55 CPU)
Result: FAIL
Failed 1/3 test programs. 2/590 subtests failed.
*** Error code 255
make: Fatal error: Command failed for target `test_dynamic'
RGARCIA/Switch-2.16.tar.gz
/usr/ccs/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports RGARCIA/Switch-2.16.tar.gz
Running make install
make test had returned bad status, won't install without force
Failed during this command:
RGARCIA/Switch-2.16.tar.gz : make_test NO
cpan[2]>
There seems to be a problem with the module as evidenced by "Useless use of numeric gt.....", however I installed this module fine on a different machine using CPAN. This is the only module CPAN is complaining about when installing.
I am using the latest version of perl 5.16:
This is perl 5, version 16, subversion 2 (v5.16.2) built for i86pc-solaris
How can I install this module?
NOTE: Please do not tell me Switch is deprecated. I understand that.
Try doing this :
use feature qw/switch/;
See
perldoc -q switch
Refer to The Effective Perler article Use for() instead of given() if you're OK to use Perl v5.10 or later.
Patch:
--- Switch-2.16-wjgfvU/Switch.pm 2009-10-23 00:52:51.000000000 -0700
+++ Switch-2.16-wjgfvUcopy/Switch.pm 2010-08-15 17:41:38.000000000 -0700
## -146,7 +146,7 ## sub filter_blocks
die "Bad $keyword statement (problem in the code block?) near $Switch::file line ", line(substr($source,0, pos $source), $line), "\n";
};
my $code = filter_blocks(substr($source,$pos[0],$pos[4]-$pos[0]),line(substr($source,0,$pos[0]),$line));
- $code =~ s/{/{ local \$::_S_W_I_T_C_H; Switch::switch $arg;/;
+ $code =~ s/{/{ local \$::_S_W_I_T_C_H; Switch::switch($arg);/;
$text .= $code . 'continue {last}';
next component;
}