Perl 的 eval

沒有把 eval 的 manual 弄清楚,結果中了不少槍... 以這段 code 來說:

#!/usr/bin/env perl

use strict;
use warnings;
use Data::Dumper;

sub a {
    eval {
        return 'Inside eval';
    };

    return undef;
}

print Dumper a();

__END__

輸出結果會是 undef,而非 Inside eval,因為:

the value returned is the value of the last expression evaluated inside the mini-program; a return statement may be also used, just as with subroutines.

沒專心看 manual 的結果 XD

不過這還是沒解決我遇到在 eval 裡面仍然會因為 croak 而結束的情況... 再加油吧 :o

Amazon Web Services Console 加強 CloudFront 設定...

之前在 AWS Console 上一直沒辦法設定 AWS CloudFront 的 Custom Origin,必須透過 3rd-party 軟體設定,而現在總算是把這個功能補上去了:「Improved CloudFront Support in the AWS Management Console」。

直接拿 Demo 的圖,最重要的 Custom Origin 功能的畫面:

AWS CloudFront Custom Origin

不過好像還是沒看到 Purge...