Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b060f57

Browse files
committed
Make eval statement naturally proof against perltidy
This is a bit less verbose than adding an exception. Rewrite the other eval statement in Catalog.pm as well, just for the sake of consistency. Idea from Andrew Dunstan Discussion: https://www.postgresql.org/message-id/CAD5tBc%2BzRhuWn_S4ayH2sWKe60FQu1guTTokDFS3YMOeSrsozA%40mail.gmail.com
1 parent c3fb580 commit b060f57

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/backend/catalog/Catalog.pm

+2-5
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,7 @@ sub ParseData
315315
# We're treating the input line as a piece of Perl, so we
316316
# need to use string eval here. Tell perlcritic we know what
317317
# we're doing.
318-
#<<< protect next line from perltidy
319-
# so perlcritic annotation works
320-
eval '$hash_ref = ' . $_; ## no critic (ProhibitStringyEval)
321-
#>>>
318+
eval "\$hash_ref = $_"; ## no critic (ProhibitStringyEval)
322319
if (!ref $hash_ref)
323320
{
324321
die "$input_file: error parsing line $.:\n$_\n";
@@ -364,7 +361,7 @@ sub ParseData
364361
# the whole file at once.
365362
local $/;
366363
my $full_file = <$ifd>;
367-
eval '$data = ' . $full_file ## no critic (ProhibitStringyEval)
364+
eval "\$data = $full_file" ## no critic (ProhibitStringyEval)
368365
or die "error parsing $input_file\n";
369366
foreach my $hash_ref (@{$data})
370367
{

0 commit comments

Comments
 (0)