home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / perl / 7453 < prev    next >
Encoding:
Internet Message Format  |  1992-12-16  |  1.6 KB

  1. Path: sparky!uunet!mcsun!uknet!comlab.ox.ac.uk!mbeattie
  2. From: mbeattie@black.ox.ac.uk (Malcolm Beattie)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: Is this a bug...
  5. Message-ID: <1992Dec16.124340.2281@black.ox.ac.uk>
  6. Date: 16 Dec 92 12:43:40 GMT
  7. References: <1gi84dINNhcv@armory.centerline.com>
  8. Organization: Oxford University Computing Service, 13 Banbury Rd, Oxford, U
  9. Lines: 36
  10. Originator: mbeattie@black
  11.  
  12. In article <1gi84dINNhcv@armory.centerline.com> thomaso@centerline.com (Thomas Andrews) writes:
  13. >I posted this "bug" but I didn't get any response.  Here it is again.
  14. >Anybody want to comment/explain.  I checked the Camel book, and there
  15. >is no explanation there...
  16. >
  17. >It appears that calling a subroutine with no argument list is not the
  18. >same as calling the subroutine with an empty argument list.  That is,
  19. >    &foo();
  20. >is different from
  21. >    &foo;
  22. >I could not find documentation for this in the camel book.  Is this
  23. >a bug or a feature?
  24. >
  25. [example deleted]
  26. >It would print a blank line...
  27.  
  28. RTFM.
  29. Camel book, index on p.452: subroutine invocation, 135
  30. p.135:
  31. As an alternate (and preferred) form, you may call a subroutine by
  32. prefixing the name with an ampersand: &foo(@args). If you aren't
  33. passing arguments, you don't have to use parentheses. If you omit
  34. the parentheses, no @_ array is passed to the subroutine.
  35.  
  36. --Malcolm
  37.  
  38. >--
  39. >Thomas Andrews
  40. >CenterLine Software
  41.  
  42.  
  43. -- 
  44. Malcolm Beattie <mbeattie@black.ox.ac.uk> | I'm not a kernel hacker
  45. Oxford University Computing Services      | I'm a kernel hacker's mate
  46. 13 Banbury Road, Oxford, OX2 6NN (U.K.)   | And I'm only hacking kernels
  47. Tel: +44 865 273232 Fax: +44 865 273275   | 'Cos the kernel hacker's late
  48.