dreamstreet
Programmer
Hello,
I have a text file liek this:
3d=3do
1=one
hel=hello
One a page, I have a text field and if tehy type anything from the text file before the '=' sign, it should repleace it with whatever after the '=' sign'. For example, if they typed '3d', it should replace it with '3do'. If they type '1', it should replace it with 'one'. I have the following code but it is not working. If anyone can help, that'll be great.
open (FILE, "line.txt");
@line=<FILE>;
close(FILE);
@t= split(/=/, @line);
foreach $f (@t) {
if ($text =~/$f/) {
$trans=$f;
}
print $trans;
exit;
}
I have a text file liek this:
3d=3do
1=one
hel=hello
One a page, I have a text field and if tehy type anything from the text file before the '=' sign, it should repleace it with whatever after the '=' sign'. For example, if they typed '3d', it should replace it with '3do'. If they type '1', it should replace it with 'one'. I have the following code but it is not working. If anyone can help, that'll be great.
open (FILE, "line.txt");
@line=<FILE>;
close(FILE);
@t= split(/=/, @line);
foreach $f (@t) {
if ($text =~/$f/) {
$trans=$f;
}
print $trans;
exit;
}