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

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!panther!mothost!merlin.dev.cdx.mot.com!merlin.dev.cdx.mot.com!lezz
  3. From: lezz@merlin.dev.cdx.mot.com (Lezz Giles)
  4. Subject: Re: Filename expansion ("~user")
  5. Message-ID: <1992Aug21.205254.22775@merlin.dev.cdx.mot.com>
  6. Keywords: ~user filename expansion
  7. Sender: news@merlin.dev.cdx.mot.com (USENET News System)
  8. Nntp-Posting-Host: monarch.dev.cdx.mot.com
  9. Reply-To: lezz@merlin.dev.cdx.mot.com (Lezz Giles)
  10. Organization: Motorola Codex, Canton, MA
  11. References: <1992Aug20.153727.167@cbnews.cb.att.com> <BtCF9y.21s@world.std.com>
  12. Distribution: usa
  13. Date: Fri, 21 Aug 1992 20:52:54 GMT
  14. Lines: 19
  15.  
  16. In article <BtCF9y.21s@world.std.com>, dsb@world.std.com (David Boyce) writes:
  17. |>>I'm relatively new to Perl and love it.  I've read the recent notes in this
  18. |>>notes group and have not found how do one capability that I am trying to
  19. |>>use in a Perl script which is the ~user filename expansion.
  20. |>
  21. |>    The "getpwent" function function should make this info available.
  22. |>You may not be able to use the ~user idiom, but you can write
  23. |>a little function called tilde(user) that uses getpwent and does
  24. |>the right thing.
  25.  
  26. ...plus lots of other articles mentioning getpwent.
  27.  
  28. I apologize unreservedly for not noticing that my logdir can be
  29. rewritten as a perl subroutine.  I'll go and change my perl
  30. programs (and incidentally speed them up) immediately.  I should've
  31. read my own posting from a few days ago about how flexible and powerful
  32. perl is :-)
  33.  
  34. Lezz "Unix teaches humility and perl reinforces the lesson" Giles
  35.