Two Questions Please

Chris Radcliff chris at binev.com
Fri Feb 4 23:52:22 CST 2000


~sdpm~
Hi Joel!

The answer to your first question presupposes a little understanding of
Perl arrays. In Perl, arrays start with element 0 whether you declare it
or not. For instance, if I have:

$chris[1] = 'foo';
$chris[2] = 'bar';
$chris[3] = 'baz';

it's just like saying:

@chris = (undef, 'foo', 'bar', 'baz');

Perl keeps a element 0 open for me to declare later. Likewise, if I
have:

$chris[92037] = 'zip';

it's like saying:

@chris = (undef, undef, undef ...you get the picture... undef, undef,
'zip');

So, when you print @Adr in your example, you're asking it to print
@Adr[0] first, which hasn't been declared. Since you have -w turned on
(good!) you get a warning. If you start counting with 0 or declare an
empty string into @Adr[0], the warning will go away.

To answer your second question, if IE5 asks you to download a file when
you're expecting a Web page, download it as something like errors.txt
and look at it in a text editor. You'll probably find an error that
caused the script to die before it printed the CGI headers.

Hope that helps!

~chris

Joel Fentin wrote:
> 
> ~sdpm~
> If I have a statement like:
> $Adr[1] = 3.
> And later another statement in a different function like:
> print @Adr;
> It prints it correctly but I get a message:
> "Use of uninitialized value......"
> 
> So, at the start of the program I have tried:
> use vars qw(@Adr);
> local @Adr;
> my @Adr;
> 
> The message stays. What does it want?
> 
> =============================
> 
> Second question:
> 
> I am running my programs on a laptop with Windoz using Apache
> server on IE-5. The program starts with an HTM file. When the
> submit button is pressed (and all is ok) it runs my CGI program.
> When all is not ok, I get a file download box. "You have chosen
> to download a file from this location...."
> 
> What kind of problem should I go looking for inside the CGI
> program?
> --
> Joel Fentin    tel: 760-749-8863    FAX: 760-749-8864
> 
> email: joel at cts.com     web: http://efm.simplenet.com
> ~sdpm~
~sdpm~

The posting address is: san-diego-pm-list at hfb.pm.org

List requests should be sent to: majordomo at hfb.pm.org

If you ever want to remove yourself from this mailing list,
you can send mail to <majordomo at happyfunball.pm.org> with the following
command in the body of your email message:

    unsubscribe san-diego-pm-list

If you ever need to get in contact with the owner of the list,
(if you have trouble unsubscribing, or have questions about the
list itself) send email to <owner-san-diego-pm-list at happyfunball.pm.org> .
This is the general rule for most mailing lists when you need
to contact a human.




More information about the San-Diego-pm mailing list