in reply to Re: [SOLVED]: Using glob in file test gives "Use of uninitialized value in -e" warning.
in thread [SOLVED]: Using glob in file test gives "Use of uninitialized value in -e" warning.

Although if you really need to sudo, then it may be the only way.

Even then, I would probably use sudo to run the perl script and use unlink in the script. Having to work with some random default shell is just a mess, and it can be quite dangerous with elevated privileges.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
  • Comment on Re^2: [SOLVED]: Using glob in file test gives "Use of uninitialized value in -e" warning.

Replies are listed 'Best First'.
Re^3: [SOLVED]: Using glob in file test gives "Use of uninitialized value in -e" warning.
by Laurent_R (Canon) on Dec 07, 2017 at 22:19 UTC
    Yes afoken, you're most probably right.

    It's actually quite strange that I wrote "may be the only way," because I actually thought of sudoing the whole Perl script when I reflected on what I was going to write (and I wasn't quite sure of which of the two solutions would be better), but, for some reason, that thought somehow got completely out of my mind when I actually typed the message.