in reply to Temp directories and the surprise creation thereof

> The method returns a {normalized, right-slashed, absolute} pathname, but it also creates the temporary directory. Maybe I am odd, but I expected to be given a string and then create the directory with that pathname myself!

The behaviour is documented under tempfile, tempdir, albeit in the style I don't like: it just tells you to read the documentation of something else:

tempdir is just like tempfile, except it calls File::Temp->newdir instead.

And if we follow the link to File::Temp::newdir, we can read:

Create a temporary directory using an object oriented interface.

Careful reading of both the documents is needed to understand all the details. If your program is security sensitive, read the notes on security and understand them.

Update: added a link to the quoted documentation.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: Temp directories and the surprise creation thereof
by Intrepid (Curate) on Dec 05, 2024 at 17:47 UTC

    Very kind of you to comment on my meditation, choroba, and I agree that using a reference to the documentation of another module isn't optimal. Your (gentle, implicit) criticism that I didn't follow the link is righteous and deserved. I'd make a poor Moria-dwarf: sometimes side passageways hold the best treasure ;-).

    Dec 05, 2024 at 17:46 UTC
      Well, I crossed "the link" because there's no link to File::Temp anywhere in the documentation. So it was rather a criticism of the documentation's author than the reader.

      Update: Now I've realised there was no link to Path::Tiny in my reply. Going to fix it.

      map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]