home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!kithrup!hoptoad!decwrl!mips!carbon!news.cs.indiana.edu!syscon!gator!fang!att!cbnewsc!cbnews!daleske
- From: daleske@cbnews.cb.att.com (John D. Daleske)
- Subject: Filename expansion ("~user")
- Organization: Stratus Computers, Inc.
- Distribution: usa
- Date: Thu, 20 Aug 1992 15:37:27 GMT
- Message-ID: <1992Aug20.153727.167@cbnews.cb.att.com>
- Keywords: ~user filename expansion
- Sender: John Daleske
- Lines: 18
-
- 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. Following is a test
- script:
-
- $tst1="~daleske";
- die "${tst1} not a directory" if !(-d ${tst1});
- opendir(DH, ${tst1});
- @allfiles = readdir(DH);
- closedir(DH);
- print "@allfiles\n";
-
- If I set $tst1 to the full pathname it works fine. I'd like to use the common
- facility of ~user to avoid needing to know the full path name. (User home
- directories do get moved around.)
-
- Suggestions are appreciated!
- John
-