bobafifi has asked for the wisdom of the Perl Monks concerning the following question:

I've made a script that outputs four text files to the desktop:
http://bobafifi.com/nav_master.txt

However, I'd rather the files all go into a folder called "includes" instead and so I've modifed the script to make the "includes" folder using
mkdir('includes', 0755);

<snip>
my $prev_next_filename = '2005_nav_prev_next_top.shtml'; open(PREV_NEXT,">$prev_next_filename") || die "Couldn't open $prev_nex +t_filename",$!,"\n";
Can somebody please be so kind as to show me how to modify my filehandle to do this?

Many thanks in advance,

Replies are listed 'Best First'.
Re: Print files to desktop directory?
by ikegami (Patriarch) on Oct 20, 2005 at 21:45 UTC

    Change
    open(PREV_NEXT,">$prev_next_filename")
    to
    open(PREV_NEXT,">includes/$prev_next_filename")

    or

    Change
    my $prev_next_filename = '2005_nav_prev_next_top.shtml';
    to
    my $prev_next_filename = 'includes/2005_nav_prev_next_top.shtml';

      That worked!

      Thanks so much - you rock! ;-)

      -Bob