The leading tilde ("~") is the problem. It's specific to the shell. Perl doesn't recognize it. Perl treats that first tilde as a directory. The error is telling you that a directory named "~" doesn't exist.
You can use the full path name, like this: my $MyiCloudLoc = q[/home/jdoe/Library/Mobile\ Documents/com~apple~CloudDocs]; On Fri, Aug 13, 2021 at 4:35 PM wagsworld48 via beginners < beginners@perl.org> wrote: > I have: > my $MyiCloudLoc = q[~/Library/Mobile\ Documents/com~apple~CloudDocs]; > > Then: > chdir($MyiCloudLoc) or die "$!"; > > Error is “no such file or directory” > > Yet if I do the following in terminal: > > Cd ~/Library/Mobile\ Documents/com~apple~CloudDocs > > It changes to that directory. > > Seems simple, but not understanding what I am doing wrong. > > Thanks for any info… ;) > > Wags ;) > WagsWorld > Hebrews 4:15 > Ph(primary) : 408-914-1341 > Ph(secondary): 408-761-7391 > -- Robert Wohlfarth