Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: On bad habits

by diotalevi (Canon)
on Jun 21, 2005 at 15:38 UTC ( #468721=note: print w/ replies, xml ) Need Help??


in reply to Re: On bad habits
in thread On bad habits

eval STRING does not spawn a new interpreter. It makes a call to the compiler to parse and compile the string. Then it executes it and throws away the newly compiled code.

Here-docs are a cause of a class of error you can only avoid by avoiding here-docs. Lest that sound dumb to you, try adding a space to the end of your here-doc tag in the <<TAG start or in the TAG end. Both are usually invisible and both will cause your script's parsing to be completely awry. They're just a great way to shoot yourself in the foot.


Comment on Re^2: On bad habits
Re^3: On bad habits
by Aragorn (Curate) on Jun 21, 2005 at 20:27 UTC
    This is where your editor can help. Emacs' cperl-mode can display trailing whitespace. For example:
    print <<"EOT"; This is a piece of text. EOT_
    The underscore after EOT indicates a trailing space which can help a lot in this case.

    Arjen

    All that is gold does not glitter...
      I avoid here-docs because cperl-mode's syntax hilighting and indentation seems to be often thrown by it. Maybe there's a workaround I'm not aware of...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2014-12-28 15:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (182 votes), past polls