Re: Trying to set the iCloud directory in Perl, but failing

[email protected] (Robert Wohlfarth)
Newsgroups perl.beginners
Message-ID <CADNb=K+acNrJZ278vjE6iO92BiGd=S5kmJOvj8Dkp3cSfFymXA@mail.gmail.com>
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 <
[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.