Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re^3: Why does the array not reset each time I call the function?

by radiantmatrix (Parson)
on Apr 02, 2008 at 14:47 UTC ( #677975=note: print w/replies, xml ) Need Help??

in reply to Re^2: Why does the array not reset each time I call the function?
in thread Why does the array not reset each time I call the function?

Having just implemented something that does exactly what you describe, I have one recommendation: use Text::CSV_XS. Treat the passwd, group, and shadow files as CSVs separated by ':'. Build data structures, compare then, then use the same module to output the new files.

You will save yourself a lot of hassle.

Also, don't use DATA as the name of a file handle, it's special. Also, always use strict and warnings. You'll save yourself loads of debugging time.

Ramblings and references
The Code that can be seen is not the true Code
I haven't found a problem yet that can't be solved by a well-placed trebuchet

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://677975]
[erix]: but I guess there's no stopping the herd
[1nickt]: Thank you haukex and hippo. I'm thinking of using IPC::System:: Simple::capture instead. But will go reread Hauke's treatise first :-)
[1nickt]: herveus is so weird. Love his reply in that SQLite thread! Much more effective warning system to have diverse monks debunk on technical merits...
[haukex]: IPC::System:: Simple does all the $? handling for you, and does it well
[erix]: weird problem btw (that SQLite question) - I asked astroboy to let us know if he finds the cause
[hippo]: The syntax is warning enough to me.

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (12)
As of 2017-12-13 11:42 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (360 votes). Check out past polls.