Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Unparseability is A Good Thing

by ikegami (Pope)
on Aug 23, 2009 at 15:46 UTC ( #790674=note: print w/replies, xml ) Need Help??


in reply to Re: Unparseability is A Good Thing
in thread Unparseability is A Good Thing

If we removed just subroutine prototypes rom the language the proof would not hold any more. So the question is is there a more general proof that does not rely on prototypes?

Yes:

BEGIN { eval "sub foo {}" if rand() < 0.5; } foo 'x';
>perl -c test.pl test.pl syntax OK >perl -c test.pl String found where operator expected at test.pl line 5, near "foo 'x'" (Do you need to predeclare foo?) syntax error at test.pl line 5, near "foo 'x'" test.pl had compilation errors.

Execution is required to decide whether foo is a subroutine call or a bareword.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://790674]
help
Chatterbox?
[Corion]: Hmmm. I feel a Meditation coming on. I wrote a module, DBIx::PivotQuery, which returns a table-like set of rows (AoA) but some columns are generated from column values, like in an (Excel) pivot table or a ROLLUP command
[Corion]: My current approach for subtotals involves rerunning the given query, with the hint to the user that they should use a temporary table if they want better performance.
[Corion]: But I could create that temporary table in the module and use it for the improved perfomance directly instead.
[Corion]: And the question is, what would be better/preferred ;-)

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2017-02-23 15:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (347 votes). Check out past polls.