Loading ...
Sorry, an error occurred while loading the content.

RE: [PBML] methods

Expand Messages
  • Smith, Sheldon
    I can not think of a case where having all parameters within a parentheses list following the print token would cause a problem. The Perl documentation file
    Message 1 of 1 , Jun 5, 2000
    • 0 Attachment
      I can not think of a case where having all parameters within a parentheses
      list following the 'print' token would cause a problem.

      The Perl documentation file "perlfunc" includes the following information:

      "Any function in the list below [the list of functions provided in Perl] may
      be used either with or without parentheses around its arguments. (The
      syntax descriptions omit the parentheses.) If you use the parentheses, the
      simple (but occasionally surprising) rule is this: It looks like a function,
      therefore it is a function, and precedence doesn't matter. Otherwise it's a
      list operator or unary operator, and precedence does matter. And whitespace
      between the function and left parenthesis doesn't count--so you need to be
      careful sometimes:

      print 1+2+4; # Prints 7.
      print(1+2) + 4; # Prints 3.
      print (1+2)+4; # Also prints 3!
      print +(1+2)+4; # Prints 7.
      print ((1+2)+4); # Prints 7.


      > -----Original Message-----
      > From: "Alberto.·.Vallini" [mailto:vallini@...]
      > Sent: Sunday, June 04, 2000 10:19 AM
      > To: perl-beginner@egroups.com
      > Subject: [PBML] methods
      >
      >
      > Well, in the meanwhile I wait for the next fixed version ov
      > the activePerl
      > for win2000, one thing I have not clear (I know it is a one
      > penny question,
      > but this is why i joined a beginners' list):
      > the method
      > print
      > is meant to always hold parehtesis like JavaScript methods.
      > I see most of the time they don't use them on perl,
      > print $myVar;
      >
      > Question is: could I get the habit to always use the
      > brackets, it would fit
      > my habits with javaScript you see:
      > print($myVar);
      >
      > correct? Or I'm going to meet troubles if I get this habit?
      >
      > thank you very much
      >
      > "when everything else fails, sleep"
      > Alberto.·.Vallini - vallini@...
      >
      >
      > --------------------------------------------------------------
      > ----------
      > Keep in touch with eGroups,
      > Keep your long distance bills lower with beMANY!
      > http://click.egroups.com/1/4120/2/_/12898/_/960132115/
      > --------------------------------------------------------------
      > ----------
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.