THE BORE

General => The Superdeep Borehole => Topic started by: T234 on March 04, 2008, 04:42:25 PM

Title: FUCK YOU PERL SYNTAX
Post by: T234 on March 04, 2008, 04:42:25 PM
WHAT'S WRONG WITH THIS STATEMENT

$Y = ($b**2-4($a*$c));

if ($Y =< -1);
(
 print "This program cannot take the square root of a negative number \n";
)
exit;
endif
Title: Re: FUCK YOU PERL SYNTAX
Post by: Mupepe on March 04, 2008, 04:47:19 PM
shouldn't \n be outside of the quotations?

i haven't done that shit in forever, but that's my only thought.  i'm probably dumb
Title: Re: FUCK YOU PERL SYNTAX
Post by: Mupepe on March 04, 2008, 04:55:59 PM
you ignored me.  so i guess my idea really was THAT dumb
Title: Re: FUCK YOU PERL SYNTAX
Post by: T234 on March 04, 2008, 04:58:29 PM
BEEN STARING AT MY CODE THERE, HONEYBUMPKINS
Title: Re: FUCK YOU PERL SYNTAX
Post by: T234 on March 04, 2008, 04:59:17 PM
OH GOD I HATE YEW ERROR CHECKING
Title: Re: FUCK YOU PERL SYNTAX
Post by: Van Cruncheon on March 04, 2008, 05:31:16 PM
what's the error you're getting, fagbag

other than that, your if statement SHOULD be using curly braces {}, not parentheses (), NUB

i.e.

if ($Y =< -1)
{
 print "This program cannot take the square root of a negative number \n";
}

spoiler (click to show/hide)
NUB
[close]
Title: Re: FUCK YOU PERL SYNTAX
Post by: recursivelyenumerable on March 04, 2008, 06:00:27 PM
why is there a semicolon after the conditional?  and shouldn't it be <= (and shouldn't it ACTUALLY be < 0)
and I don't think Perl has "endif", the close-brace should do the trick (so the "exit" should go in the braces)
although I get these interchangeable scripting languages mixed up
Title: Re: FUCK YOU PERL SYNTAX
Post by: Van Cruncheon on March 04, 2008, 06:15:03 PM
yeah, no semi-colon after if() -- missed that. jesus, that entire snippet is a syntax nightmare. endif is vb, not perl. kill it with fire

Title: Re: FUCK YOU PERL SYNTAX
Post by: Ecrofirt on March 04, 2008, 06:21:47 PM
lolz
Title: Re: FUCK YOU PERL SYNTAX
Post by: T234 on March 04, 2008, 06:47:52 PM
WHATS THE PROBLEM WITH THIS LINE:

$error2 = ($b**2- 4($a*$c));
Title: Re: FUCK YOU PERL SYNTAX
Post by: Van Cruncheon on March 04, 2008, 07:06:58 PM
$error2 = ($b**2 - 4*($a*$c));

there is no function 4(), NUB
Title: Re: FUCK YOU PERL SYNTAX
Post by: T234 on March 04, 2008, 07:49:05 PM
 :bow DRINKY CROW :bow2
Title: Re: FUCK YOU PERL SYNTAX
Post by: recursivelyenumerable on March 04, 2008, 08:01:17 PM
that'll be $150 an hour * 2 of us * (4 pm - 1 pm) (truncated since you don't seem to believe in floating point) = $900
Title: Re: FUCK YOU PERL SYNTAX
Post by: T234 on March 04, 2008, 08:06:20 PM
that'll be $150 an hour * 2 of us * (4 pm - 1 pm) (truncated since you don't seem to believe in floating point) = $900
GET TWO OF THESE ON MY TAB:
(http://usa.denon.com/AKDL1_G.gif)