FAQ
i get error when trying this line. macosx. perl 5.6.1.

perl -e"for (55..75) { print chr($_) }"

it says:
Unmatched ".

problem with '$_'. shell must be looking at it and messing it up.
how do i get the '$' through tcsh shell?

Search Discussions

  • John W. Krahn at Mar 24, 2002 at 7:44 am

    Bob Ackerman wrote:

    i get error when trying this line. macosx. perl 5.6.1.

    perl -e"for (55..75) { print chr($_) }"

    it says:
    Unmatched ".

    problem with '$_'. shell must be looking at it and messing it up.
    how do i get the '$' through tcsh shell?
    Since $_ is the default argument to chr():
    perl -e"for (55..75) { print chr }"


    John
    --
    use Perl;
    program
    fulfillment
  • Randal L. Schwartz at Mar 24, 2002 at 3:00 pm
    "Bob" == Bob Ackerman writes:
    Bob> i get error when trying this line. macosx. perl 5.6.1.
    Bob> perl -e"for (55..75) { print chr($_) }"

    Bob> it says:
    Bob> Unmatched ".

    Bob> problem with '$_'. shell must be looking at it and messing it up.
    Bob> how do i get the '$' through tcsh shell?

    On the commandline, I always use single quotes to quote arguments, and
    then I merely have to make sure I'm not printing English
    contractions. :)

    $ perl -e 'for (55..75) { print chr $_; }'

    (And there's also the dreaded "I'm gonna expand history references
    even inside single quotes" csh ugly behavior, so watch out for
    exclamations, or pop into sh instead of csh.)

    --
    Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
    <[email protected]> <URL:http://www.stonehenge.com/merlyn/>
    Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
    See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupbeginners @
categoriesperl
postedMar 24, '02 at 5:16a
activeMar 24, '02 at 3:00p
posts3
users3
websiteperl.org

People

Translate

site design / logo © 2023 Grokbase