RCP has asked for the wisdom of the Perl Monks concerning the following question:
In the code lines below, I need to change
"/tmp" to "~/tmp" or to a home directory "$HOME"
but either options do not work. I added "\$HOME", but
I get an error message about a closedfile on line 4
.
This is for HP-UX UNIX shell.
Thanks... RCP
#! perl -w open(MYOUTFILE, ">/tmp/design_name_dnp_top"); open (FILEH, "/tmp/strfile"); while (<FILEH>) { chomp; /\/([^\/]+)\d$/; print MYOUTFILE $1."topdnp\n"; } close(FILEH); close(MYOUTFILE);
Retitled by davido.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do I retrieve the value of $HOME?
by dragonchild (Archbishop) on Dec 30, 2004 at 14:54 UTC | |
by friedo (Prior) on Dec 30, 2004 at 16:51 UTC |