Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Why is this incorrect?

by spiritway (Vicar)
on Mar 17, 2006 at 04:13 UTC ( [id://537381]=note: print w/replies, xml ) Need Help??


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!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://537381]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-03-29 14:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found