on 1/23/02 7:07 PM, [EMAIL PROTECTED] purportedly said: > On Wed, 23 Jan 2002 [EMAIL PROTECTED] wrote: > >> I'm using SSLeay along with Open SSl to retrieve https pages via SSL.pm. >> I'm not using a proxy, but in the runtime I get the familiar "unitialized >> variable" message being displayed for a line in SSL.pm. I normally like to >> keep my executions clean and don't want "uninit" messages from coming up, >> so I would like to resolve this problem. I'm using 2.75 SSL.pm and the >> error is coming from line 363 "$proxy_server =~ s|^https?://||i; First, I >> haven't a clue as to what this statement is doing from the syntax. >> I'm guessing that it is doing a pattern search but the "|" are >> throwing me off. I too see from the code that it is trying to parse >> HTTPS_PROXY key value from the ENV hash. I put a value into the key >> value, (i.e. HTTPS_PROXY) but I still get the "unit" message. Could >> someone be so kind as to tell me what the statement is doing and how I >> might eliminate the message. Yes, I do know that I could remove "-w" >> on the execution to suppress the message. > > This line is attempting a substitution -- the "|" characters are the > regular expression delimiters (Perl is quite liberal in what characters > are used in this context). The 'http' (with optional 's') and '://' are > being replaced by a null string. The trailing 'i' indicates "ignore > case." So it is actually stripping the protocol information from the URL. > The complaint is probably coming from the variable $proxy_server not being > properly defined somewhere before this line, hence it cannot be bound to > the substitution operator.
Actually, that is not exactly the issue. Perl has no problem using the variable, that's why it is issuing a warning instead of an error. The warning message is a very common one. It means that an operation is being performed on a variable that has a currently undefined value. Since Perl doesn't initialize variables on declaration, this has to be done manually. You can search the code for where $proxy_server is declared (by a my(), local(), or our() statement), and right after it initialize it to an empty value: $proxy_server = ''; That will remove the warning message. However, you should be aware that the code may expect the value to be undefined under certain circumstances. You may want to search for a call to "defined" on that variable. If you find one, you should change the troublesome line of code to: $proxy_server =~ s|^https?://||i if defined $proxy_server; and *not* initialize the variable as specified above. On second thought, you should do this anyway, as it is much safer overall. Keary Suska Esoteritech, Inc. "Leveraging Open Source for a better Internet" ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]