Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: example in book of Programming Perl does not work.

by aitap (Curate)
on May 30, 2013 at 06:07 UTC ( #1035969=note: print w/replies, xml ) Need Help??


in reply to example in book of Programming Perl does not work.

You wrote a wrong "-" symbol:
$ LC_ALL=C perl -E'my $pid = open(STDOUT, "|") // die $!' # your quot +e No such file or directory at -e line 1. $ perl -E'my $pid = open(STDOUT, "|-") // die $!' # entered via keyboa +rd $
Perl does not consider "" (chr(8211)) to be a dash ("-", chr(45)), so special open behaviour does not work in this case.

Replies are listed 'Best First'.
Re^2: example in book of Programming Perl does not work.
by yangy (Novice) on May 30, 2013 at 08:51 UTC
    thanks, I copy that char from pdf, now I change it to -,it work perfect now.

      I wonder if there is a way to submit an errata to the publisher. Is there source code included along with the PDF file that would be more appropriate to use?

      <muse>I understand that typesetting has its own needs, but I wonder if there is any way to have the best of both worlds in a case like this.</muse>

      --MidLifeXis

        I found it. source code of Programming Perl in oreilly web site. http://examples.oreilly.com/9780596004927/
Re^2: example in book of Programming Perl does not work.
by derby (Abbot) on May 30, 2013 at 12:43 UTC

    That blasted unicode 'en-dash' is the bane of my existence. I know I should pray for patience but most of the time I pray for the hastening schadenfreude that *will* befall the designers who think their dashes deserve to be special.

    -derby

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1035969]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2022-06-27 19:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (88 votes). Check out past polls.

    Notices?