Hi again all,
I am trying to do a simple substitution in a page but the vars don't seem to be passing for some reason....
everything displays, but the sub is not done...
Basically, I am reading from a txt file and trying to grab the values from there and display the html page with the substitutions done.
The user is supposed to get a temp name and pass that displays, but not displaying. In the HTML page, I get nothing...
Any suggestions greatly appreciated....
Jim
On the page I am using
I am trying to do a simple substitution in a page but the vars don't seem to be passing for some reason....
everything displays, but the sub is not done...
Basically, I am reading from a txt file and trying to grab the values from there and display the html page with the substitutions done.
The user is supposed to get a temp name and pass that displays, but not displaying. In the HTML page, I get nothing...
Any suggestions greatly appreciated....
Jim
Code:
open INF,'</var/[URL unfurl="true"]www/htdocs/cgi-bin/user.txt'[/URL] or die "Can't open input file";
my $flag = 0;
while (<INF>)
{
local($^I, @ARGV) = ('.bak', 'user.txt');
while (<>) {
if (/^(.+)(\|No)$/ && $flag != 1) {
$flag = 1;
print "$1|Yes\n";
($Name,$Pass,$Used) = split /\|/,$_,3;
}
else {
print;
}
}
}
close INF;
open (PAGE, "$newUser") or die ("Unable to open the file $newUser. $!");
while (<PAGE>)
{
s/%%name%%/$Name/g;
s/%%pass%%/$Pass/g;
print $_;
}
close (PAGE)
On the page I am using
Code:
Username: %%name%%<br />
Password: %%pass%%<br />