in reply to Re: how perl do 'envsubst'
in thread how perl do 'envsubst'

thanks for your answer, I didn't know Path::Tiny do the work as File::Slurp, and $fh->print is same as print $fh, I have finished the script, all works great, the process substitution of shell is pipe to /dev/fd/ in essence

Replies are listed 'Best First'.
Re^3: how perl do 'envsubst'
by NERDVANA (Priest) on Jul 03, 2024 at 18:41 UTC
    Yep, you can see it in action with
    $ echo <(echo foo) /dev/fd/63
    But, now I just realized there is still a mystery!
    $ ls /dev/fd 0 1 2 3
    So... how can a program open /dev/fd/63 if it doesn't exist?
      So... how can a program open /dev/fd/63 if it doesn't exist?

      Because it does exist at the time the command is run:

      $ echo <(echo foo) $(ls /dev/fd) /dev/fd/63 0 1 2 3 63

      Greetings,
      🐻

      $gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$
        Ah-ha! I forgot /dev/fd was a symlink to /proc/self/fd.
      if run kmonad <(echo $config), could bind to /dev/fd/61; but use perl only /dev/fd/0 is guaranteed to exist, cann't change to others;