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

Re: [PBML] Command line arguments to perl script: apostrophe?

Expand Messages
  • Shlomi Fish
    Hi, ... The problem is likely with your Unix shell which treats an apostrophe as a delimiter of a string: {{{ shlomif:~$ echo Hello Hello shlomif:~$ echo
    Message 1 of 4 , Oct 25, 2010
      Hi,

      On Tuesday 26 October 2010 01:49:04 Bull Durham wrote:
      > I downloaded and studied the O'Reilly Into and Intermediate Perl
      > books, and pressed on with my own project. This project aims to solve
      > those word-substitution CryptoQuotes you often see in your daily
      > newspaper.
      >
      > I'm pretty well pleased with what I have to-date. It takes the
      > scrambled letters of several words from the CryptoQuote and sorts out
      > the possible solutions.
      >
      > I thought I could improve it by adding contractions to the mix. This
      > means the scrambled letters I enter have an apostrophe (').
      >
      > The crypto words are read in to my script as command line arguments.
      > E.g.,
      >
      > ./nCrypto.pl xyzxqy xyrbzy
      >
      > Which compiles my nCrypto.pl script and reads in the arguments and
      > decrypts them (in this case, probably decrypted as people person).
      >
      > To enter contractions, I hoped to read in the argument list and scan
      > for words with an apostrophe ('). However, in test cases, putting an
      > apostrophe in the command line sends me off into some perlish limbo.
      > The entry
      >
      > ./nCrypto.pl xyzxqy xyrbzy wkz'r
      >
      > Where the wkz'r is something like don't. My script just gives me a
      > prompt:
      >
      > >
      >
      > What is perl waiting for? Is an apostrophe in the invocation of a
      > perl script through its arguments special? I guess it is, but I don't
      > see what it means.

      The problem is likely with your Unix shell which treats an apostrophe as a
      delimiter of a string:

      {{{
      shlomif:~$ echo Hello
      Hello
      shlomif:~$ echo 'Hello'
      Hello
      shlomif:~$ echo One\'Two\'Three
      One'Two'Three
      shlomif:~$ echo "Hello"
      Hello
      shlomif:~$ echo "Hello 'World'"
      Hello 'World'
      }}}

      This is standard Unix shell behaviour and does not only affect Perl. For more
      information see a shell tutorial/book such as:

      * http://unixhelp.ed.ac.uk/

      * http://tldp.org/LDP/Bash-Beginners-Guide/html/

      Regards,

      Shlomi Fish

      --
      -----------------------------------------------------------------
      Shlomi Fish http://www.shlomifish.org/
      "Star Trek: We, the Living Dead" - http://shlom.in/st-wtld

      <rindolf> She's a hot chick. But she smokes.
      <go|dfish> She can smoke as long as she's smokin'.

      Please reply to list if it's a mailing list post - http://shlom.in/reply .
    • Shlomi Fish
      Hi, ... The problem is likely with your Unix shell which treats an apostrophe as a delimiter of a string: {{{ shlomif:~$ echo Hello Hello shlomif:~$ echo
      Message 2 of 4 , Oct 26, 2010
        Hi,

        On Tuesday 26 October 2010 01:49:04 Bull Durham wrote:
        > I downloaded and studied the O'Reilly Into and Intermediate Perl
        > books, and pressed on with my own project. This project aims to solve
        > those word-substitution CryptoQuotes you often see in your daily
        > newspaper.
        >
        > I'm pretty well pleased with what I have to-date. It takes the
        > scrambled letters of several words from the CryptoQuote and sorts out
        > the possible solutions.
        >
        > I thought I could improve it by adding contractions to the mix. This
        > means the scrambled letters I enter have an apostrophe (').
        >
        > The crypto words are read in to my script as command line arguments.
        > E.g.,
        >
        > ./nCrypto.pl xyzxqy xyrbzy
        >
        > Which compiles my nCrypto.pl script and reads in the arguments and
        > decrypts them (in this case, probably decrypted as people person).
        >
        > To enter contractions, I hoped to read in the argument list and scan
        > for words with an apostrophe ('). However, in test cases, putting an
        > apostrophe in the command line sends me off into some perlish limbo.
        > The entry
        >
        > ./nCrypto.pl xyzxqy xyrbzy wkz'r
        >
        > Where the wkz'r is something like don't. My script just gives me a
        > prompt:
        >
        > >
        >
        > What is perl waiting for? Is an apostrophe in the invocation of a
        > perl script through its arguments special? I guess it is, but I don't
        > see what it means.

        The problem is likely with your Unix shell which treats an apostrophe as a
        delimiter of a string:

        {{{
        shlomif:~$ echo Hello
        Hello
        shlomif:~$ echo 'Hello'
        Hello
        shlomif:~$ echo One\'Two\'Three
        One'Two'Three
        shlomif:~$ echo "Hello"
        Hello
        shlomif:~$ echo "Hello 'World'"
        Hello 'World'
        }}}

        This is standard Unix shell behaviour and does not only affect Perl. For more
        information see a shell tutorial/book such as:

        * http://unixhelp.ed.ac.uk/

        * http://tldp.org/LDP/Bash-Beginners-Guide/html/

        Regards,

        Shlomi Fish

        --
        -----------------------------------------------------------------
        Shlomi Fish http://www.shlomifish.org/
        "Star Trek: We, the Living Dead" - http://shlom.in/st-wtld

        <rindolf> She's a hot chick. But she smokes.
        <go|dfish> She can smoke as long as she's smokin'.

        Please reply to list if it's a mailing list post - http://shlom.in/reply .
      Your message has been successfully submitted and would be delivered to recipients shortly.