in reply to ~username expansion
The following is an example of how I have done it in the past:
#!/usr/bin/perl -w use strict; use File::Glob qw(:glob); my $dirstring = q(~user); my $newdirstring = File::Glob::bsd_glob( $dirstring, GLOB_TILDE | GLOB_ERR ); print <<RESULTS; Old directory string: $dirstring New directory string: $newdirstring RESULTS
Hope that helps.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: ~username expansion
by Anonymous Monk on Nov 01, 2004 at 01:35 UTC | |
by superfrink (Curate) on Nov 01, 2004 at 04:15 UTC | |
by tachyon (Chancellor) on Nov 01, 2004 at 11:48 UTC |