Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: naming anonymous subroutines inner variables

by anonymized user 468275 (Curate)
on Jun 24, 2016 at 08:57 UTC ( #1166472=note: print w/replies, xml ) Need Help??

in reply to naming anonymous subroutines inner variables

It's hard to believe you expect the random order of SQL statements returned from a hash to remain acceptable for long. But rather than pick at details, I believe the greatest improvement would be to think about code design at the highest level. Consider organising your functionality into separate utility modules. I use a master-class module for methods I want to call from anywhere and a DB module for utilities that relate to databases and files. In this case you probably want a subclass called e.g. DB::Queue for managing a statement queue object and methods for appending, executing and transaction behavior (e.g. commit or rollback the lot) for these queues. It is rarely a good idea to build complex code that only services local blocks. Often you will be rewarded when generic code proves actually much easier to write and test.

One world, one people

  • Comment on Re: naming anonymous subroutines inner variables

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2022-12-04 23:16 GMT
Find Nodes?
    Voting Booth?

    No recent polls found