Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: What's the exact rule about hash/pound?

by boo_radley (Parson)
on Feb 27, 2003 at 01:49 UTC ( [id://238967]=note: print w/replies, xml ) Need Help??


in reply to What's the exact rule about hash/pound?

does $#foo start with an unquoted # character?
I imagine the $ "binds" to the # more tightly than the # wants to be a comment.
  • Comment on Re: What's the exact rule about hash/pound?

Replies are listed 'Best First'.
Re: Re: What's the exact rule about hash/pound?
by Cody Pendant (Prior) on Feb 27, 2003 at 02:29 UTC
    >does $#foo start with an unquoted # character?

    Er, well, no, but if the rule is "any time an unquoted # appears in a line of Perl, then the remainder of the line is ignored" then the rule is not correct in respect of that line, is it?

    Obviously there are special cases where that rule is qualified with an "unless blah blah blah" clause.
    --

    “Every bit of code is either naturally related to the problem at hand, or else it's an accidental side effect of the fact that you happened to solve the problem using a digital computer.”
    M-J D
      That's not the rule. Of course, the best way to know the rule is to read the source, but the summary of the rule you quoted originally is adequate to explain the behavior you describe. (and your later summary is very different in practice). Here's another rephrasing: If you're not inside quotes of some kind, a hash symbol that isn't inside another token starts a comment.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-23 13:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found