Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: perlcritic and heredocs

by haukex (Archbishop)
on Apr 15, 2020 at 12:16 UTC ( [id://11115563]=note: print w/replies, xml ) Need Help??


in reply to perlcritic and heredocs

I agree with Corion that you'll need to show the code that produces these issues - I haven't been able to reproduce ProhibitMismatchedOperators at all yet, I've only been able to reproduce ProhibitHardTabs inside q{}'s, not heredocs, and ProhibitImplicitNewlines explicitly states to use heredocs instead of multiline quoted strings.

In other words, this produces ProhibitHardTabs and ProhibitImplicitNewlines policy warnings:

my $foo = q{ if ($a == 'bar') { } SELECT foo FROM bar WHERE quz==3; };

while this doesn't:

my $foo = <<'END'; if ($a == 'bar') { } SELECT foo FROM bar WHERE quz==3; END

Are you sure you're not using multi-line quoted strings instead of heredocs...?

Replies are listed 'Best First'.
Re^2: perlcritic and heredocs
by redtux (Sexton) on Apr 15, 2020 at 22:45 UTC

    Just checked and there was a fix with indented heredocs post 1.32 (1.34)

    This seems to have solved the issue

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11115563]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-25 12:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found