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 -*-
|
||||
use Test::More;
|
||||
use strict;
|
||||
use autodie qw(:all);
|
||||
|
||||
if ( !$ENV{WPP_TEST} || !-f $ENV{WPP_TEST} ) {
|
||||
plan skip_all =>
|
||||
'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
|
||||
|
||||
open(SUBSCRIPTION_PAY_HTML, ">", "subscription-payment.html")
|
||||
or die "unable to open subscription-payment.html: $!";
|
||||
open(SUBSCRIPTION_PAY_HTML, ">", "subscription-payment.html");
|
||||
|
||||
print SUBSCRIPTION_PAY_HTML <<_SUBSCRIPTION_PAYMENT_DATA_
|
||||
<html>
|
||||
<body>
|
||||
|
@ -55,7 +57,7 @@ print SUBSCRIPTION_PAY_HTML <<_SUBSCRIPTION_PAYMENT_DATA_
|
|||
</html>
|
||||
_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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue