Lazyness is a Virtue -- especially for data loading.
By Steven Lembark (Lembark) from stlouis.pm
Date: Tuesday, 28 June 2011 10:00
Duration: 20 minutes
Target audience: Intermediate
Language:
You can find more information on the speaker's site:
Accessing a database at process startup for static information is common, but can be hard on the database in a production environment. Another bad alternative is re-checking the data status every time it is used. An AUTOLOAD can handle the issue by lazily installing the sub, but makes it impossible to use can.
Lexical variables and a one-shot subtrouine to load them offer a nice, clean, private way to handle lazy data acquisition: put the permanent handler and data structure in lexical variables, and have the subroutine replace itself after the first call.
- Christoph Otto (cotto)
- Leanan
- Stephen Scaffidi (hercynium)
- Robert Threet (RAT)
- Tommy Petty
- Link McGaughey
- James E Keenan (kid51)
- Charles Phillips
- Steve Smale
- Daniel Sterling (HighBit)
- Matt Reinhart
- Mike Weisenborn
- Chas. Owens (cowens)
- James Mastros (theorbtwo)
- Greg Estep
- Jon Gentle (atrodo)
- Mike Burns (lungching)