in reply to Re: Ubuntu File Names with spaces and special characters
in thread Ubuntu File Names with spaces and special characters

That explains a lot! My problem is that the squiggly (aka tilde) is NOT interpreted within SINGLE quotes. I tried String::ShellQuote, but it simply enclosed the input with single quotes. I suppose using the module helps with portability, but I doubt I'll ever need to worry about porting the code.

What about the shell? Is it the login shell (Bash) or the shell the Perl source is invoked from (tcsh) or just Linux? In the case of paths, I don't think it matters, but other instances it may make a difference (e.g., back-ticks, etc.).

In any event I believe that solves the problem and maybe, many other problems I've had.

Thanks,
  EigenFunctions
  OpSys: Ubuntu 18.04; Perl: Perl 5, version 26, subversion 1 (v5.26.1) built for x86_64-linux-gnu-thread-multi (with 67 registered patches)   OpSys: Win7 x64 Service Pack 1 Professional/Home Premium; Perl: Strawberry (v5.22.0)/ActiveState (v5.14.2)

  • Comment on Re^2: Ubuntu File Names with spaces and special characters

Replies are listed 'Best First'.
Re^3: Ubuntu File Names with spaces and special characters
by haukex (Archbishop) on Mar 01, 2019 at 08:35 UTC
    That explains a lot! My problem is that the squiggly (aka tilde) is NOT interpreted within SINGLE quotes.

    The tilde ~ is in general not special to Perl. To get the home directory, there's e.g. File::HomeDir, or you could use glob - but be aware that it'll treat any glob metacharacters as special, and there are several caveats when it comes to glob, which is why you might be interested in Path::ExpandTilde instead.

    What about the shell? Is it the login shell (Bash) or the shell the Perl source is invoked from (tcsh) or just Linux?

    That's not always clear, which is one of the reasons I usually recommend to avoid the shell altogether.