Loading ...
Sorry, an error occurred while loading the content.

Print rules...

Expand Messages
  • Johnny Wales
    Hiya! This is gonna sound silly, but I ve often seen in perl code something that looks like the following: print qq{ Monkeys! Apes! Cows! }; But, I ve never
    Message 1 of 2 , Jun 3, 2002
    • 0 Attachment
      Hiya!

      This is gonna sound silly, but I've often seen in perl code something that
      looks like the following:

      print qq{ Monkeys!
      Apes!
      Cows! };

      But, I've never understood exactly what the rules were here. I've also
      seen:

      print qq! Monkeys, cows, apes!;

      That seems to work. What can be in that qq{ spot and what are the rules
      for use of multiline strings like this?

      --Me
    • Jeff 'japhy' Pinyan
      ... perldoc perlop, look for Quote-like Operators . -- Jeff japhy Pinyan japhy@pobox.com http://www.pobox.com/~japhy/ RPI Acacia brother #734
      Message 2 of 2 , Jun 3, 2002
      • 0 Attachment
        On Jun 3, Johnny Wales said:

        >print qq{ Monkeys!
        >Apes!
        >Cows! };
        >
        >But, I've never understood exactly what the rules were here. I've also
        >seen:

        perldoc perlop, look for "Quote-like Operators".

        --
        Jeff "japhy" Pinyan japhy@... http://www.pobox.com/~japhy/
        RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
        ** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
        <stu> what does y/// stand for? <tenderpuss> why, yansliterate of course.
        [ I'm looking for programming work. If you like my work, let me know. ]
      Your message has been successfully submitted and would be delivered to recipients shortly.