in reply to Why is this incorrect?

In looking at your code, the first thing I noticed was your line 3:

my $text, $ques, $ans;

Right away you should have gotten an error about globals needing explicit package name. To declare multiple variables you need to enclose them in parenthese:

my ($text, $ques, $ans);

The same problem exists on line 20:

my $another_line, $one, $two;

Next, you have:

sub $do_one_thing{...;

which is also an error. You need to remove the sigils from this and the subsequent sub.

From what you've shown, I can't imagine this program producing any output.

Replies are listed 'Best First'.
Re^2: Why is this incorrect?
by kettle (Beadle) on Mar 17, 2006 at 07:13 UTC
    you're right, it probably doesn't produce any output. i didn't check it. the actual script that I am using is much longer, and I didn't want copy the whole thing - just to ask about what I didn't understand. (sorry for not checking). anyway, despite that I did get the answer to the question I was asking, so thanks a bunch! i was going to add that i don't really know what I'm doing yet, but i suppose an explicit statement was unnecessary!