-----Original Message-----
From: Madhur Kashyap [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 10, 2005 12:34 PM
To: beginners@perl.org
Subject: Urgent Help with functions


Can someone help me out with this simple code? It gives an error saying:

Illegal division by zero at test.pl line 4.
Exit 255

Code:
---------------------------------------------
#!/usr/local/bin/perl
sub test {
=09my @[EMAIL PROTECTED];
=09my $div=3D$pars[0]/$par[1];
=09print "Pars were @{_}\n";
}


You mistyped the second variable in your divide statement. It should
read:

my $div = $pars[0]/$pars[1];

Always, always start your code with "use strict;" and "use warnings;"!

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to