Why does my Perl script fail on “~/” but works with “$ENV{HOME}”?

后端 未结 3 1592
陌清茗
陌清茗 2021-01-26 22:47

I have been using this script of mine FOREVER and I have always been using \"~/\" to expand my home directory. I get into work today and it stopped working:

#if          


        
3条回答
  •  一整个雨季
    2021-01-26 23:20

    ~ is expanded by the shell. Perl has no idea about it. So, it would work only within a shell script.

提交回复
热议问题