Author Topic: FUCK YOU PERL SYNTAX  (Read 1099 times)

0 Members and 1 Guest are viewing this topic.

T234

  • Canadian Legal Expert and Hillballer
  • Senior Member
FUCK YOU PERL SYNTAX
« 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
UK

Mupepe

  • Icon
Re: FUCK YOU PERL SYNTAX
« Reply #1 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

Mupepe

  • Icon
Re: FUCK YOU PERL SYNTAX
« Reply #2 on: March 04, 2008, 04:55:59 PM »
you ignored me.  so i guess my idea really was THAT dumb

T234

  • Canadian Legal Expert and Hillballer
  • Senior Member
Re: FUCK YOU PERL SYNTAX
« Reply #3 on: March 04, 2008, 04:58:29 PM »
BEEN STARING AT MY CODE THERE, HONEYBUMPKINS
UK

T234

  • Canadian Legal Expert and Hillballer
  • Senior Member
Re: FUCK YOU PERL SYNTAX
« Reply #4 on: March 04, 2008, 04:59:17 PM »
OH GOD I HATE YEW ERROR CHECKING
UK

Van Cruncheon

  • live mas or die trying
  • Banned
Re: FUCK YOU PERL SYNTAX
« Reply #5 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]
« Last Edit: March 04, 2008, 06:15:48 PM by Professor Prole »
duc

recursivelyenumerable

  • you might think that; I couldn't possibly comment
  • Senior Member
Re: FUCK YOU PERL SYNTAX
« Reply #6 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
« Last Edit: March 04, 2008, 06:03:28 PM by recursivelyenumerable »
QED

Van Cruncheon

  • live mas or die trying
  • Banned
Re: FUCK YOU PERL SYNTAX
« Reply #7 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

duc

Ecrofirt

  • Heavy Metal Jesus
  • Senior Member
Re: FUCK YOU PERL SYNTAX
« Reply #8 on: March 04, 2008, 06:21:47 PM »
lolz
8=D

T234

  • Canadian Legal Expert and Hillballer
  • Senior Member
Re: FUCK YOU PERL SYNTAX
« Reply #9 on: March 04, 2008, 06:47:52 PM »
WHATS THE PROBLEM WITH THIS LINE:

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

Van Cruncheon

  • live mas or die trying
  • Banned
Re: FUCK YOU PERL SYNTAX
« Reply #10 on: March 04, 2008, 07:06:58 PM »
$error2 = ($b**2 - 4*($a*$c));

there is no function 4(), NUB
duc

T234

  • Canadian Legal Expert and Hillballer
  • Senior Member
Re: FUCK YOU PERL SYNTAX
« Reply #11 on: March 04, 2008, 07:49:05 PM »
 :bow DRINKY CROW :bow2
UK

recursivelyenumerable

  • you might think that; I couldn't possibly comment
  • Senior Member
Re: FUCK YOU PERL SYNTAX
« Reply #12 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
QED

T234

  • Canadian Legal Expert and Hillballer
  • Senior Member
Re: FUCK YOU PERL SYNTAX
« Reply #13 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:
UK