Wiggins has asked for the wisdom of the Perl Monks concerning the following question:

This clause has me stumped...
unless defined( $topic ) && ( $topic eq q{} || defined( _STRING( $topi +c ) ) ^^^^^
a string compare to a quoted nothing???

It is always better to have seen your target for yourself, rather than depend upon someone else's description.

Replies are listed 'Best First'.
Re: What does q{} mean?
by stevieb (Canon) on May 19, 2016 at 18:19 UTC
Re: What does q{} mean?
by Eily (Monsignor) on May 19, 2016 at 18:27 UTC

    ++stevieb

    This is also one of the cases where B::Deparse can help: perl -MO=Deparse -e 'print q{}' yields

    print ''; -e syntax OK
    The print statement is there to avoid the value being in void context and optimized away.

Re: What does q{} mean?
by Old_Gray_Bear (Bishop) on May 19, 2016 at 22:15 UTC
    A Google search (note: 'Google' is not a verb, it is a trade marked name like Kleenex or Xerox) isn't the right tool for this job. Try perldoc -f q for the real scoop on the q function.

    ----
    I Go Back to Sleep, Now.

    OGB

Re: What does q{} mean?
by choroba (Cardinal) on May 20, 2016 at 11:43 UTC
      In some fonts, '' and " are hard to distinguish.

      In which case might I humbly suggest that those fonts are entirely unsuitable for use in programming? See which fonts are popular for ideas regarding replacements.