in reply to Check if a file exists and if not create it
Learning is great. There are tons of modern packages that make this stuff really easy. Path::Tiny, for example, saved me a lot of headache just yesterday in a one-liners renaming a bunch of wget files that had query strings in the file names and couldn't be shared with a Windows user who needed them… I digress. One of many ways to do your task–
perl -MPath::Tiny -le 'path("ohai")->touch'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Check if a file exists and if not create it
by Your Mother (Archbishop) on Aug 22, 2014 at 01:52 UTC |