Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^7: Split output by tabs

by Anonymous Monk
on Nov 13, 2012 at 15:01 UTC ( #1003635=note: print w/ replies, xml ) Need Help??


in reply to Re^6: Split output by tabs
in thread Split output by tabs

you replace 'foo' with an expression it can be hard to tell whether $f is a filehandle or a variable.

Nope, it is never a "filehandle" , there is no ambiguity

Here is a simple example that the compiler can't correctly handle without braces:

Sure it can, and it does (v5.14).

all you need for disambiguation is M as in m//

I don't know what exact justifications TheDamian gives in the book, but I highly doubt its because of that contrived example -- highly flimsy justification for such an obnoxious rule


Comment on Re^7: Split output by tabs
Re^8: Split output by tabs
by ColonelPanic (Friar) on Nov 13, 2012 at 15:19 UTC

    Yes, there are multiple ways to get that statement to work. You could also use parentheses, do your logic beforehand and put it in a variable, or write the code in countless other ways.

    But it still proves that in some cases even the compiler can't tell whether there is a filehandle (ok, ok, a variable containing a filehandle reference) or an ordinary variable at the start of a print statement.

    This may be a single contrived example (though it is nothing unusual really), but the set of cases in which the statement will not be clear to the human eye is much larger.



    When's the last time you used duct tape on a duct? --Larry Wall

      But it still proves that ...

      Which is a point that did not need proving, and is not a justification for for rule 136

      This may be a single contrived example (though it is nothing unusual really), but the set of cases in which the statement will not be clear to the human eye is much larger.

      No it isn't

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2014-07-12 04:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (238 votes), past polls