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'In reply to Re: Check if a file exists and if not create it
by Your Mother
in thread Check if a file exists and if not create it
by Wroof
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |