in reply to to "use vars" or not to
$dbh, $timestamp and $server don't sound like variables that should be used from outside the package, so use vars isn't appropriate. They don't sound like they need to be package variables, so our isn't appropriate. my should be used here. (Actually, it would probably make a lot more sense for those to be attributes of any object.)
variables defined by “use vars” can end up being shared between the forked children ?
Variables aren't shared between processes. Each child gets a byte-for-byte copy.
I am occasionally having mangled data go into the database
It doesn't make sense for two processes to use the same database connection. Open a connection in each child.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: to "use vars" or not to
by westy032001 (Novice) on Nov 08, 2010 at 18:03 UTC | |
by Corion (Patriarch) on Nov 08, 2010 at 18:11 UTC | |
by westy032001 (Novice) on Nov 08, 2010 at 19:14 UTC | |
by ikegami (Patriarch) on Nov 08, 2010 at 20:34 UTC |