develooper Front page | perl.perl5.porters | Postings from July 2016

Re: Indented here docs?

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
July 1, 2016 18:18
Subject:
Re: Indented here docs?
Message ID:
20160701181824.GA12098@debian
* Alberto Simões <albie@alfarrabio.di.uminho.pt> [2016-07-01T14:11:55]
> On 01/07/16 18:00, Matthew Horsfall (alh) wrote:
> >I'm fine with whichever. I modelled mine lightly after ruby 2.3.x
> >which added <<~ to do indented heredocs since <<- already had meaning
> >for them.
> >
> >Is it a simple matter of changing ~ to -, or do we have to worry about
> >deprecation and such as you state.
> >
> >-- Matthew Horsfall (alh)
> 
> As far as I understood (moron here, too, like other commented in this
> thread) from rjbs words, both <<~ and <<- had meaning before this patch, and
> therefore, he was happy to include it without deprecation notices.

My original testing was faulty:

  ~$ perl -Mwarnings -e '$x = <<~"FOO"' -e 'hey dude' -e FOO
  Use of bare << to mean <<"" is deprecated at -e line 1.
  syntax error at -e line 1, near "<<~"
  Execution of -e aborted due to compilation errors.

  ~$ perl -Mwarnings -e '$x = <<-"FOO"' -e 'hey dude' -e FOO
  Use of bare << to mean <<"" is deprecated at -e line 1.
  Name "main::x" used only once: possible typo at -e line 1.
  Argument "FOO" isn't numeric in subtraction (-) at -e line 1.
  Argument "hey dude\nFOO\n" isn't numeric in subtraction (-) at -e line 1.

I have no opinion about the deprecation warning issue or scheduling.  I prefer
<<- if it is consistent with other systems.

-- 
rjbs

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About