Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
How does perl treat spaces? Does it ignore them as in Fortran?

Re: Spaces

Quoted text here. Click to load it

The second paragraph of

    perldoc perlsyn

answers your question:

    Perl is a free-form language, you can format and indent it however
    you like.  Whitespace mostly serves to separate tokens, unlike
    languages like Python where it is an important part of the syntax.

Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg0cm.j.dat/"
The above message is a Usenet post.
I don't recall having given anyone permission to use it on a Web site.

Re: Spaces

On Sun, 07 Aug 2011 21:38:41 -0500 in comp.lang.perl.misc, Tad
Quoted text here. Click to load it

And unlike Fortran, where white space is allowed and ignored even
inside of identifiers.  Nobody has made that mistake since, although
Python's abuse of white space comes close.

Re: Spaces

Quoted text here. Click to load it

That depends on the context.

Quoted text here. Click to load it

No, it ignores them unlike FORTRAN. In particular, Perl does not allow
and ignore spaces in identifiers.

Shmuel (Seymour J.) Metz, SysProg and JOAT  <

Unsolicited bulk E-mail subject to legal action.  I reserve the
right to publicly post or ridicule any abusive E-mail.  Reply to
domain Patriot dot net user shmuel+news to contact me.  Do not
reply to

Site Timeline