SSC_perl wrote:
Hi John,
Hello,
Thanks for getting back to me with your findings. I really
appreciate it. I've gone through everything, made the changes that I
could, and I have some questions to some of your remarks.
You are using the value from readdir() without prepending the path to
the file name.
Unless I'm mistaken, I believe the full paths are being set in
the variables, before being used by opendir.
Yes, the full path of a directory.
Am I misunderstanding something?
readdir() returns just the file names, without the path.
autoconfig.cgi:883: print "<font color=\"336666\">[dir] $dir/$file</font> - .htaccess
installed<br>\n";
The variable $file is not assigned a value.
I'm not seeing this. I thought it was set earlier in the
security sub, but maybe I've just been staring at it for too long.
All instances of $file in the subroutine Security():
745 my (@dirs, @files, $dir, $file) = ();
$file is created at the beginning of the subroutine.
832 foreach $file (@datfiles) {
833 Surf::cl("$path/$file")
=~ /(.*)/;
$file is used in a foreach loop and therefore:
perldoc perlsyn
the variable is implicitly local to the loop and regains its former
value upon exiting the loop.
Where its former value is undef.
874 foreach $file (@files) {
875 push @dirs,
"$dir/$file" if (-d "$dir/$file" && $file !~ /^\./);
Same as above.
883 print "<font
color=\"336666\">[dir] $dir/$file</font> - .htaccess installed<br>\n";
At this point $file has no value.
I also ran perl -c, as well as PerlCritic, on all the files and
have uploaded a "cleaned up" version (1.5.1) to our site. Here's a
direct link:
http://www.surfshopcart.com/download-zip.php
I started looking through it and found this mistake. In the old version
you had:
Email.pm:97: open (my $mail_fh, "|$path -t -oi -oem") ||
error("Can't open $main::global->{form}->{'mailprog'}!\n");
And:
ipn.pl:90: open (MAIL, "|$main::global->{config}->{'mailprog'} -t -oi
-oem") || error("IPNemail: Can't open
$main::global->{config}->{'mailprog'}!\n");
Which you changed to:
Email.pm:91: open (my $mail_fh, '<', "|$path -t -oi -oem") ||
error("Can't open $main::global->{'form'}->{'mailprog'}!\n");
And:
ipn.pl:90: open (my $mail, '<',
"|$main::global->{config}->{'mailprog'} -t -oi -oem") ||
error("ipn_email: Can't open $main::global->{config}->{'mailprog'}!\n");
You've changed them from opening an OUTPUT pipe to a mail program to
opening a file named "|$path -t -oi -oem" for INPUT!
They were correct in the first place.
Or maybe better as:
Email.pm:91: open my $mail_fh, '|-', $path, '-t', '-oi',
'-oem' or error( "Can't open $path!\n" );
And:
ipn.pl:90: open my $mail, '|-', $::global->{ config }{ mailprog },
'-t', '-oi', '-oem' or error( "ipn_email: Can't open
$::global->{config}{mailprog}!\n" );
Antway, I found some mistakes in your code; to wit:
You were being kind. ;) Thank you again!
Can I reference your name as a contributor,
Sure, if you would like to.
or would you prefer
to keep your name off the project? Also, would you consider joining us?
I'll think about it.
John
--
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction. -- Albert Einstein
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/