home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!news.centerline.com!thomaso
- From: thomaso@centerline.com (Thomas Andrews)
- Newsgroups: comp.lang.perl
- Subject: Is this a bug...
- Date: 14 Dec 1992 15:10:05 GMT
- Organization: CenterLine Software, Inc.
- Lines: 32
- Message-ID: <1gi84dINNhcv@armory.centerline.com>
- NNTP-Posting-Host: 140.239.2.21
-
- I posted this "bug" but I didn't get any response. Here it is again.
- Anybody want to comment/explain. I checked the Camel book, and there
- is no explanation there...
-
- It appears that calling a subroutine with no argument list is not the
- same as calling the subroutine with an empty argument list. That is,
- &foo();
- is different from
- &foo;
- I could not find documentation for this in the camel book. Is this
- a bug or a feature?
-
- In particular, the following prints out "Just another Perl hacker,":
-
- sub func {
- print join(" ",@_),"\n";
- }
-
- sub main {
- &func;
- }
-
- &main("Just","another","Perl","hacker,");
-
- while if main were defined as:
- sub main {
- &func();
- }
- It would print a blank line...
- --
- Thomas Andrews
- CenterLine Software
-