home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / perl / 5298 < prev    next >
Encoding:
Text File  |  1992-08-13  |  1.6 KB  |  46 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!mcsun!sunic!aun.uninett.no!news.uit.no!stud.cs.uit.no!tomg
  3. From: tomg@stud.cs.uit.no (Tom Grydeland)
  4. Subject: Re: Arrays of filehandles
  5. References:  <1992Aug12.230411.20069@unixg.ubc.ca>
  6. Sender: news@news.uit.no (USENET News System)
  7. Organization: University of Tromsoe
  8. Date: Thu, 13 Aug 1992 14:57:58 GMT
  9. Message-ID: <1992Aug13.145758.14449@news.uit.no>
  10. Lines: 34
  11.  
  12. In article <1992Aug12.230411.20069@unixg.ubc.ca>, andy@orchid.bdc.ubc.ca (Andrew Dwelly) writes:
  13. |> 
  14.     [stuff deleted]
  15. |> # But this bit just falls through as if @filehandle[0] was empty
  16. |> while (<@filehandle[0]>)
  17.  
  18. As has been answered on many similar questions on this group, @array[$index]
  19. is an array slice with one value.
  20.  
  21. |> I need to get various lumps of data from <@filehandle[$whatever]> in the
  22. |> rest of the code. 
  23.  
  24. Then refer to it as $filehandle[$whatever]
  25.  
  26. |> What should I be doing here. Also, what is the difference between an
  27. |> array @this[$that] and $this[that] ? this has also been troubling
  28. |> me in the last few days.
  29.  
  30. The `@' in `@this[$that]' tells perl that you're refering to an array value,
  31. i.e the array slice with one value, $this[$that].
  32.  
  33. The first `$' in $this[$that]' tells perl that you're refering to a scalar
  34. value.
  35.  
  36. thus:   @this[$that] == ($this[$that])
  37.  
  38.  
  39. |> Andy Dwelly (andy@bcu.ubc.ca)
  40.  
  41. -- 
  42. //Tom Grydeland(tomg@stud.cs.uit.no)._._._._._._._._._._._._._._._._._._._._._
  43. |A._| . . ._| | |_._._. . ._|_._._._._. ._|_. ._ _._. ._| | . ._|_. | . ._._. |
  44. | ._|_| |_. | | | | ._._|_. |_._. . |_. | | | ._._| |_._._._| | ._. ._| . . |_|
  45. |_._._._._|_._._._._._._|_._._._._|_._._._._._._._._._._._._|_._._|_|_._|_|_.B|
  46.