Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: How can one create a text file in the subfolder of a folder?

by kevbot (Vicar)
on Apr 22, 2017 at 16:08 UTC ( [id://1188625]=note: print w/replies, xml ) Need Help??


in reply to How can one create a text file in the subfolder of a folder?

Here is a way to do it with Path::Tiny.
#!/usr/bin/env perl use strict; use warnings; use Path::Tiny; my $x='x'; my $y='y'; my $dirpath = path($x, $y); $dirpath->mkpath; my $outpath = path( $dirpath, 'z.txt' ); my $fh = $outpath->openw_utf8; print $fh "\n It's ok.\n"; $fh->close; print "\n Program is over.\n"; exit;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1188625]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (7)
As of 2024-04-18 06:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found