in reply to Re^2: Safe Temp Files
in thread Safe Temp Files

the File::Temp approach is about the same length and the intent is more immediately obvious

I disagree on the latter. new is the worst name for a method, for a module like this, so a line like this:

my $fh = File::Temp->new
is always enough to make me go "WTF...?".

I wish the module author had put some more inspiration in the name for the constructor, like Tim Bunce used "connect" in DBI instead of the plain, boring and somewhat obscure "new". I like this a lot better.

Replies are listed 'Best First'.
Re^4: Safe Temp Files
by xdg (Monsignor) on Dec 05, 2006 at 13:14 UTC

    I guess I'm used to the convention of using "new" as a constructor and just mentally parse it backwards as "a new Temp File".

    In the Pod, the author writes it in the indirect notation:

    my $fh = new File::Temp;

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.