xavierarmadillo has asked for the wisdom of the Perl Monks concerning the following question:
sub addSecondary($$) { my ($email, $secondary) = @_; open (MYFILE, 'registration.dat'); while (<MYFILE>) { chomp; my $line = $_; if($line =~ /$email/) { $line =~ s/nodata/$secondary/gi; } } close (MYFILE); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Appending to a file.
by tobyink (Canon) on May 07, 2012 at 16:02 UTC | |
by xavierarmadillo (Initiate) on May 07, 2012 at 16:50 UTC | |
by MidLifeXis (Monsignor) on May 07, 2012 at 17:24 UTC | |
by tobyink (Canon) on May 07, 2012 at 18:58 UTC | |
by AnomalousMonk (Archbishop) on May 07, 2012 at 19:34 UTC | |
|
Re: Appending to a file.
by Corion (Patriarch) on May 07, 2012 at 15:45 UTC | |
by xavierarmadillo (Initiate) on May 07, 2012 at 16:00 UTC | |
by ww (Archbishop) on May 07, 2012 at 23:13 UTC | |
|
Re: Appending to a file.
by locked_user sundialsvc4 (Abbot) on May 07, 2012 at 20:35 UTC |