ramesh_ps1 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl my $cfgfile="./dbconnect"; open (CONFIG,$cfgfile); while (<CONFIG>) { chomp; # no newline s/#.*//; # no comments s/^\s+//; # no leading white s/\s+$//; # no trailing white next unless length; # anything left? my ($var, $value) = split(/\s*=\s*/, $_, 2); $value=~ s/\r//g; $ConfigValue{$var} = $value; } print "Name--$ConfigValue{'NAME'}";
--------------------
The above script works fine on CLI but on web I get
only "Name--" displayed.
Edit: g0n - code tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem while displaying dynamic data on perl CGI pages
by MonkE (Hermit) on Jun 01, 2007 at 11:48 UTC | |
by ramesh_ps1 (Initiate) on Jun 01, 2007 at 12:17 UTC | |
by ramesh_ps1 (Initiate) on Jun 01, 2007 at 12:26 UTC | |
by MidLifeXis (Monsignor) on Jun 01, 2007 at 20:35 UTC | |
|
Re: Problem while displaying dynamic data on perl CGI pages
by holli (Abbot) on Jun 01, 2007 at 11:48 UTC | |
|
Re: Problem while displaying dynamic data on perl CGI pages
by friedo (Prior) on Jun 01, 2007 at 11:48 UTC | |
by ramesh_ps1 (Initiate) on Jun 01, 2007 at 12:19 UTC | |
|
Re: Problem while displaying dynamic data on perl CGI pages
by moritz (Cardinal) on Jun 01, 2007 at 15:18 UTC |