lisaw has asked for the wisdom of the Perl Monks concerning the following question:
Then the edited code is written to the db:open(FILE, "$datadir/$editlist\.txt") || &error_message("Can't find d +ata file - $datadir/$editlist\.txt."); @list = <FILE>; close(FILE); $numlist = @list; print "<textarea cols=60 rows=5 name='list'>\n"; $ccc = 0; for ($a = 0; $a < $numlist; $a ++) { ($two, $one, $nochop) = split(/,/, $list[$a]); if ($one =~ /.*\@.*\..*/) { print "$two,$one\n"; $ccc++; } } print <<"END"; </textarea><br>
Any suggestions to remove the CR's after the value $one?sub change_list { $list = $FORM{'list'}; $editlist = $FORM{'editlist'}; (@splitlist) = split(/\n/, $list); $numlist = @splitlist; open(FILE, ">$datadir/$editlist\.txt") || &error_message("Can't find +data file -$datadir/$editlist\.txt."); for ($a = 0; $a < $numlist; $a++) { ($two, $one) = split(/,/, $splitlist[$a]); $two =~ s/\cM//g; if ($one =~ /.*\@.*\..*/) { print FILE "$two,$one,x\n"; } } close(FILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Remove Carriage Returns
by atcroft (Abbot) on Dec 18, 2002 at 23:10 UTC | |
|
Re: Remove Carriage Returns
by jdporter (Paladin) on Dec 19, 2002 at 03:16 UTC | |
|
Re: Remove Carriage Returns
by lisaw (Beadle) on Dec 19, 2002 at 00:20 UTC |