in reply to Re: Appending to a file.
in thread Appending to a file.
And it works now. What I don't get is why s/0;nodata/1;$secondary/gi if /$email/ works. There is no semicolon at the end and it is not like any function I have seen. I am used to something = something type notation. How does it even know what to look at and compare?sub addSecondary() { my ($email, $secondary) = @_; use Tie::File; tie @array, 'Tie::File', 'registration.dat'; for (@array) { s/0;nodata/1;$secondary/gi if /$email/ } untie @array; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Appending to a file.
by MidLifeXis (Monsignor) on May 07, 2012 at 17:24 UTC | |
|
Re^3: Appending to a file.
by tobyink (Canon) on May 07, 2012 at 18:58 UTC | |
|
Re^3: Appending to a file.
by AnomalousMonk (Archbishop) on May 07, 2012 at 19:34 UTC |