home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!mips!odin!sierra.corp.sgi.com!stantz
- From: stantz@sierra.corp.sgi.com (Mark Stantz)
- Newsgroups: comp.lang.perl
- Subject: 4.035 bug or feature...why does this run?
- Message-ID: <1992Aug27.171036.28995@odin.corp.sgi.com>
- Date: 27 Aug 92 17:10:36 GMT
- Sender: news@odin.corp.sgi.com (Net News)
- Organization: Silicon Graphics, Inc.
- Lines: 28
- Nntp-Posting-Host: sierra.corp.sgi.com
-
-
- Consider the following trivial perl program, which computes the
- union of two sets of strings:
-
-
- #!/usr/local/bin/perl
-
- @s1 = ("just", " another ");
- @s2 = ("perl", " hacker", "\n");
-
- @u = @s1;
- foreach $item (@s2) {
- push(@u, $item) unless (grep(($_ eq $item), @s1)) # Huh?
- }
-
- print @u;
-
-
- Why does this program run when there is no ';' at the end of
- the line indicated with the comment? Apparently it works fine under 4.035,
- but doesn't run under 4.019 or earlier versions. I would have expected the
- 'doesn't run' behavior in 4.035 as well.
-
- What's the story behind this?
-
- ------------------------------------------------------------------------------
- Mark Stantz | "...And on the seventh day, it was Miller Time..."
- stantz@sgi.com | -- Guinessis
-