jdlev has asked for the wisdom of the Perl Monks concerning the following question:
use LWP::Simple; $source = get("www.url.com");
open(FILE, ">file.txt");
print FILE $source;
close(FILE);
The problem is that I want to create the files in a sub folder rather than having it print to the parent directory. For instance, if my program is called. program.pl and stored in the "mainfolder" folder, in the above example, it creates a file called file.txt in "mainfolder". However, what I want the program to do is to create a new file in a subfolder of mainfolder called subfolder. So even though the program "program.pl" is housed in "mainfolder", when I run "program.pl", I want it to create "file.txt" in "subfolder" of "mainfolder". How do I do that? Thanks,
Jeff
Content restored by GrandFather
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Simple/Quick question about opening creating a file using perl
by kyle (Abbot) on Dec 29, 2008 at 19:51 UTC | |
|
Re: Simple/Quick question about opening creating a file using perl
by jeffa (Bishop) on Dec 29, 2008 at 19:48 UTC | |
|
Re: Simple/Quick question about opening creating a file using perl
by linuxer (Curate) on Dec 29, 2008 at 19:55 UTC | |
by jdlev (Scribe) on Dec 29, 2008 at 20:08 UTC | |
by linuxer (Curate) on Dec 29, 2008 at 20:14 UTC | |
by AnomalousMonk (Archbishop) on Dec 29, 2008 at 20:27 UTC | |
|
Re: Simple/Quick question about opening creating a file using perl
by linuxer (Curate) on Dec 29, 2008 at 19:49 UTC | |
|
Re: Simple/Quick question about opening creating a file using perl
by Lawliet (Curate) on Dec 29, 2008 at 19:51 UTC |