Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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;
Server Error (Error ID 3470494a2048917)

An error has occurred. The site administrators have been notified of the problem and will likely soon fix it. We thank you, for you're patients.

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 romping around the Monastery: (8)
As of 2024-03-29 15:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found