f 終於在windows 10 上搞定了PAWS 模組 ~ 迪貝之家

Pages

終於在windows 10 上搞定了PAWS 模組

首先當然去找不用錢的開發環境囉~~~哈..草莓!!
看來未來幾年的日子
得多吃水果了
不是樹莓,就是草莓,要不就是橘子....
The Perl for MS Windows, free of charge!
我喜歡用Portal 版,因為不用安裝
解壓縮後,進到目錄後
畫面上portableshell點兩下
就會開出底下這個shell給你用

----------------------------------------------
 Welcome to Strawberry Perl PDL Edition!
 * URL - http://strawberryperl.com + http://pdl.perl.org
 * to launch perl script run:      perl c:\my\scripts\pdl-test.pl
 * to start PDL console run:       pdl2
 * to update PDL run:              cpanm PDL
 * to install extra module run:    cpanm PDL::Any::Module
          or if previous fails:    ppm PDL::Any::Module
 * or you can use dev tools like:  gcc, g++, gfortran, gmake
 * see README.TXT for more info
----------------------------------------------
Perl executable: C:\strawberry-perl-5.30.0.1-64bit-PDL\perl\bin\perl.exe
Perl version   : 5.30.0 / MSWin32-x64-multi-thread
PDL version    : 2.019

安裝其實很直覺
紅色指令乎伊洛起桌是啦
帶-n是為了讓安裝程式不做任何測試
要是讓它做Test
PAWS永遠也安裝不起來
因為它的相依模組Furl
在編譯後進行Test就不過了
Furl沒過,後續的安裝就不用再進行了
光這個動作我就搞了好幾天了
還想說是不是不同版本的perl
與不同版本的Furl間的相容問題
拿了perl 5.305.28 5.26與
Furl-3.13 3.12 3.10來進行安裝測試
真正是江湖一點訣,講破無價值

C:\strawberry-perl-5.30.0.1-64bit-PDL>cpanm Paws::DynamoDB -n
--> Working on Paws::DynamoDB
Fetching http://www.cpan.org/authors/id/J/JL/JLMARTIN/Paws-0.41.tar.gz ... OK
Configuring Paws-0.41 ... OK
==> Found dependencies: URI::Template, Config::INI, DataStruct::Flat, URL::Encode::XS, DateTime::Format::ISO8601, URL::Encode, ARGV::Struct, Net::Amazon::Signature::V4, String::CRC32, Data::Compare
--> Working on URI::Template
Fetching http://www.cpan.org/authors/id/B/BR/BRICAS/URI-Template-0.24.tar.gz ... OK
Configuring URI-Template-0.24 ... OK
Building URI-Template-0.24 ... OK
Successfully installed URI-Template-0.24
--> Working on Config::INI
Fetching http://www.cpan.org/authors/id/R/RJ/RJBS/Config-INI-0.025.tar.gz ... OK
Configuring Config-INI-0.025 ... OK
==> Found dependencies: Mixin::Linewise::Writers, Mixin::Linewise::Readers
--> Working on Mixin::Linewise::Writers
Fetching http://www.cpan.org/authors/id/R/RJ/RJBS/Mixin-Linewise-0.108.tar.gz ... OK
Configuring Mixin-Linewise-0.108 ... OK
==> Found dependencies: PerlIO::utf8_strict
--> Working on PerlIO::utf8_strict
Fetching http://www.cpan.org/authors/id/L/LE/LEONT/PerlIO-utf8_strict-0.007.tar.gz ... OK
Configuring PerlIO-utf8_strict-0.007 ... OK
Building PerlIO-utf8_strict-0.007 ... OK
Successfully installed PerlIO-utf8_strict-0.007
Building Mixin-Linewise-0.108 ... OK
Successfully installed Mixin-Linewise-0.108
Building Config-INI-0.025 ... OK
Successfully installed Config-INI-0.025
--> Working on DataStruct::Flat
Fetching http://www.cpan.org/authors/id/J/JL/JLMARTIN/DataStruct-Flat-0.01.tar.gz ... OK
Configuring DataStruct-Flat-0.01 ... OK
Building DataStruct-Flat-0.01 ... OK
Successfully installed DataStruct-Flat-0.01
--> Working on URL::Encode::XS
Fetching http://www.cpan.org/authors/id/C/CH/CHANSEN/URL-Encode-XS-0.03.tar.gz ... OK
Configuring URL-Encode-XS-0.03 ... OK
==> Found dependencies: URL::Encode
--> Working on URL::Encode
Fetching http://www.cpan.org/authors/id/C/CH/CHANSEN/URL-Encode-0.03.tar.gz ... OK
Configuring URL-Encode-0.03 ... OK
Building URL-Encode-0.03 ... OK
Successfully installed URL-Encode-0.03
Building URL-Encode-XS-0.03 ... OK
Successfully installed URL-Encode-XS-0.03
--> Working on DateTime::Format::ISO8601
Fetching http://www.cpan.org/authors/id/J/JH/JHOBLITT/DateTime-Format-ISO8601-0.08.tar.gz ... OK
Configuring DateTime-Format-ISO8601-0.08 ... OK
==> Found dependencies: DateTime::Format::Builder
--> Working on DateTime::Format::Builder
Fetching http://www.cpan.org/authors/id/D/DR/DROLSKY/DateTime-Format-Builder-0.82.tar.gz ... OK
Configuring DateTime-Format-Builder-0.82 ... OK
==> Found dependencies: DateTime::Format::Strptime
--> Working on DateTime::Format::Strptime
Fetching http://www.cpan.org/authors/id/D/DR/DROLSKY/DateTime-Format-Strptime-1.76.tar.gz ... OK
Configuring DateTime-Format-Strptime-1.76 ... OK
Building DateTime-Format-Strptime-1.76 ... OK
Successfully installed DateTime-Format-Strptime-1.76
Building DateTime-Format-Builder-0.82 ... OK
Successfully installed DateTime-Format-Builder-0.82
Building DateTime-Format-ISO8601-0.08 ... OK
Successfully installed DateTime-Format-ISO8601-0.08
--> Working on ARGV::Struct
Fetching http://www.cpan.org/authors/id/J/JL/JLMARTIN/ARGV-Struct-0.06.tar.gz ... OK
Configuring ARGV-Struct-0.06 ... OK
==> Found dependencies: Types::Standard
--> Working on Types::Standard
Fetching http://www.cpan.org/authors/id/T/TO/TOBYINK/Type-Tiny-1.006000.tar.gz ... OK
Configuring Type-Tiny-1.006000 ... OK
Building Type-Tiny-1.006000 ... OK
Successfully installed Type-Tiny-1.006000
Building ARGV-Struct-0.06 ... OK
Successfully installed ARGV-Struct-0.06
--> Working on Net::Amazon::Signature::V4
Fetching http://www.cpan.org/authors/id/D/DB/DBOOK/Net-Amazon-Signature-V4-0.19.tar.gz ... OK
Configuring Net-Amazon-Signature-V4-0.19 ... OK
Building Net-Amazon-Signature-V4-0.19 ... OK
Successfully installed Net-Amazon-Signature-V4-0.19
--> Working on String::CRC32
Fetching http://www.cpan.org/authors/id/L/LE/LEEJO/String-CRC32-1.8.tar.gz ... OK
Configuring String-CRC32-1.8 ... OK
Building String-CRC32-1.8 ... OK
Successfully installed String-CRC32-1.8
--> Working on Data::Compare
Fetching http://www.cpan.org/authors/id/D/DC/DCANTRELL/Data-Compare-1.27.tar.gz ... OK
Configuring Data-Compare-1.27 ... OK
==> Found dependencies: Clone
--> Working on Clone
Fetching http://www.cpan.org/authors/id/A/AT/ATOOMIC/Clone-0.43.tar.gz ... OK
Configuring Clone-0.43 ... OK
Building Clone-0.43 ... OK
Successfully installed Clone-0.43 (upgraded from 0.41)
Building Data-Compare-1.27 ... OK
Successfully installed Data-Compare-1.27
Building Paws-0.41 ... OK
Successfully installed Paws-0.41
17 distributions installed

這樣就安裝好了
接著就是做簡單測試囉


C:\strawberry-perl-5.30.0.1-64bit-PDL>perl c:\test\test3.pl
Paws::DynamoDB::ListTablesOutput  {
    Parents       Moose::Object
    public methods (3) : LastEvaluatedTableName, meta, TableNames
    private methods (1) : _request_id
    internals: {
        _request_id   "CDNHUP8LHAMQ9V24FPL32EDUCBVV4KQNSO5AEMVJF66Q9ASUAAJG",
        TableNames    [
            [0] "Employee",
            [1] "Music",
            [2] "MusicCollection"
        ]
    }
}

看一下test3.pl 的code
use strict;
use warnings;
use Paws;

use Data::Printer;


$ENV{'AWS_ACCESS_KEY'} = 'UR KEY';


$ENV{'AWS_SECRET_KEY'} = 'UR KEY';

my $d = Paws->service('DynamoDB',region => 'us-east-2');
my $r;

$r = $d->ListTables;
p $r;