nd it comes back with msg:
>
> Scalar value @answers[$i] better written as $answers[$i]
>
> So I did.
>
> Wags ;)
>
> -Original Message-
> From: Steven M. Klass [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 15, 2002 14:09
> To: Wagner-David; [EMAIL P
. Klass [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 2:09 PM
To: Wagner-David; [EMAIL PROTECTED]
Subject: Re: More help with my function
Hi all,
Doh!! It must be MONDAY!! I am such an IDIOT!!
Couple of questions. How did changing $prompt [@_[0]] to $prompt $_[0] fix
it? I mean why
;)
-Original Message-
From: Steven M. Klass [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 14:09
To: Wagner-David; [EMAIL PROTECTED]
Subject: Re: More help with my function
Hi all,
Doh!! It must be MONDAY!! I am such an IDIOT!!
Couple of questions. How did changing $prompt [@_[0
Hi all,
Doh!! It must be MONDAY!! I am such an IDIOT!!
Couple of questions. How did changing $prompt [@_[0]] to $prompt $_[0] fix
it? I mean why didn't $_[0] put the prompt. Let me guess shift removed it
from the stack..
I know that if I want the first variable of @answers I can call it w
Here is what I came up with..
#!/usr/bin/perl -w
use strict;
my @heir = qw/inquiry smart yes/;
my $response = "";
while ($response eq "") {
print "Enter the hierarchical mode [$heir[0]]: ";
chomp($response = );
if(($response eq "") || ($response eq "?")) {
print "Valid a
Uncertain what you are trying to get from the list:
I changed print "$prompt [@_[0]]"; to print "$prompt $_[0]";
and if ( $response eq $answers ){ to if ( $response eq $answers[$i] ){
It ran without any warnings and after I gave correct answer, it quit.
Wags ;)