Switch to use autodie to simplify code.
@oalders suggests in a pull request comment: > If we use autodie then we won't need to check for success on open(). I've made this change to accommodate that suggestion.
This commit is contained in:
parent
c5f62dbdb1
commit
9045d3d511
1 changed files with 5 additions and 3 deletions
|
@ -1,6 +1,8 @@
|
||||||
# -*- mode: cperl -*-
|
# -*- mode: cperl -*-
|
||||||
use Test::More;
|
use Test::More;
|
||||||
use strict;
|
use strict;
|
||||||
|
use autodie qw(:all);
|
||||||
|
|
||||||
if ( !$ENV{WPP_TEST} || !-f $ENV{WPP_TEST} ) {
|
if ( !$ENV{WPP_TEST} || !-f $ENV{WPP_TEST} ) {
|
||||||
plan skip_all =>
|
plan skip_all =>
|
||||||
'No WPP_TEST env var set. Please see README to run tests';
|
'No WPP_TEST env var set. Please see README to run tests';
|
||||||
|
@ -30,8 +32,8 @@ This works, and seems to be correct, albeit odd.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
open(SUBSCRIPTION_PAY_HTML, ">", "subscription-payment.html")
|
open(SUBSCRIPTION_PAY_HTML, ">", "subscription-payment.html");
|
||||||
or die "unable to open subscription-payment.html: $!";
|
|
||||||
print SUBSCRIPTION_PAY_HTML <<_SUBSCRIPTION_PAYMENT_DATA_
|
print SUBSCRIPTION_PAY_HTML <<_SUBSCRIPTION_PAYMENT_DATA_
|
||||||
<html>
|
<html>
|
||||||
<body>
|
<body>
|
||||||
|
@ -55,7 +57,7 @@ print SUBSCRIPTION_PAY_HTML <<_SUBSCRIPTION_PAYMENT_DATA_
|
||||||
</html>
|
</html>
|
||||||
_SUBSCRIPTION_PAYMENT_DATA_
|
_SUBSCRIPTION_PAYMENT_DATA_
|
||||||
;
|
;
|
||||||
close(SUBSCRIPTION_PAY_HTML); die "unable to write subscription-payment.html: $!" if ($? != 0);
|
close(SUBSCRIPTION_PAY_HTML);
|
||||||
|
|
||||||
use Cwd; my $cwd = getcwd;
|
use Cwd; my $cwd = getcwd;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue