in reply to Re^2: Optional quotes: to use or not to
in thread Optional quotes: to use or not to

Well..
$example{time} = time;

Does your IDE get that right? What exactly is 'right'?

  • Comment on Re^3: Optional quotes: to use or not to

Replies are listed 'Best First'.
Re^4: Optional quotes: to use or not to
by hurricup (Pilgrim) on Jul 10, 2015 at 11:43 UTC

    Mine does. Braced time is a string and other time is a sub. And even:

    grep {time} @somearray;
    Understood right and time is a sub.

      Sorry, wrong example. (I'm intentionally leaving strict off here. Enabling it would spoil the fun.) Is your IDE smart enough to catch the difference?
      #!/usr/bin/perl my %example; $example{foo} = say; print $example{foo}, "\n";
      ->> 'say'
      #!/usr/bin/perl use 5.010; my %example; $example{foo} = say; print $example{foo}, "\n";
      ->> '1'

        Nope, it doesn't. It parses script with implicit strict and say in your example will be always a sub call.

        And, i've asked about exact two situations when perl (as far as I know) always treats bareword as a string.