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

Re: [PBML] perl one liners

Expand Messages
  • Jenda Krynicky
    From: sarveshjangid ... The problem is that cmd.exe doesn t understand the singlequotes as parameter delimiters. You have to
    Message 1 of 3 , Jul 3, 2007
    • 0 Attachment
      From: "sarveshjangid" <sarveshjangid@...>
      > Dear all,
      > i am quite new to perl. I am trying to run this one liner through
      > cmd.exe on windows 2000
      > perl -e 'print "Matched!" if "This is my\nmulti-line string" =~
      > /This.*string/;'
      >
      > but i am getting this error. Please help!
      >
      > Can't find string terminator "'" anywhere before EOF at -e line 1.

      The problem is that cmd.exe doesn't understand the singlequotes as
      parameter delimiters. You have to change the onliner to this:

      perl -e "print 'Matched!' if qq{This is my\nmulti-line string} =~
      /This.*string/;"

      That is there have to be doublequotes around the code and you have to
      use singlequotes of qq{} in place of any doublequotes within the
      code.

      HTH, Jenda

      ===== Jenda@... === http://Jenda.Krynicky.cz =====
      When it comes to wine, women and song, wizards are allowed
      to get drunk and croon as much as they like.
      -- Terry Pratchett in Sourcery
    Your message has been successfully submitted and would be delivered to recipients shortly.