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