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

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
You certainly have a good point from a parsing perspective, and this is likely where most of the implementation issues arise. Still, this limitation is really not all that different from the way Perl treats $AUTOLOAD type function calls. You have to be careful to adjoin the function name with brackets, because the compiler isn't astute enough to find the function reference, instead assuming there is a bare word in your code, and whining accordingly. Here's how the compiler appears to behave when finding functions to AUTOLOAD:
Func($x) -> &Func($x) OK Func ($x) -> 'Func' ($x) !?!?
So, presumably, the same thing would apply to the parsing of curly braces, in theory:
foo $bar{$baz} -> &foo($bar{$baz}) foo $bar {$baz} -> &foo($bar,sub {$baz})
I discovered this trying to eliminate the requirement for 'my ($self) = @_' having to be in every function for an OO program by writing a wrapper which did it for you. For whatever reason, you can't operate on a named sub. Oh well.

In reply to Re^2: Error Checking: Have you tried 'Try/Catch'? by tadman
in thread Error Checking: Have you tried 'Try/Catch'? by tadman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-03-29 02:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found