Guest User

Untitled

a guest
Oct 12th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.12 KB | None | 0 0
  1. if ($msg ~= m/something/") {
  2.  $server->command("msg $target \x02i'm a huge fag")
  3. }
  4.  
  5. #this would be the same as
  6.  
  7. $server->command("msg $target \x02 i'm a huge fag") if ($msg ~= m/something/");
  8.  
  9. #with one really major exception. You basic format is using the original paragraphs (first thing I posted). The second one treats the entire thing as one function whereas a paragraph allows continuation of other conditionals. for instance
  10.  
  11. if ($var le 10) {
  12.   print "it's less than or equal to 12";
  13. }
  14. elsif ($var le 20) {
  15.   print "it's certainly less than or equal to 20, but it's also NOT less than
  16. or equal to 10 or we'd not be printing this.";
  17.   if ($var le 15) {
  18.     print "well, the first line printed, but let's get a bit more specific. If
  19. -this- line prints, we know that it's both less than or equal to 20, and less
  20. than or equal to 15 because this conditional is nested in the previous.";
  21.   }
  22. }
  23. else {
  24.   print "well there's no condition here other than the first two things are
  25. obviously false, so it's neither less than or equal to 10 or less than or equal
  26. to 20. it could be potato for all we know or care.";
  27. }
Add Comment
Please, Sign In to add comment