How to open temporary with Perl 5.6?



Hi,

in the test suite of one of my modules I use

open TMP, '+>', undef or die ...

to open a temporary file which is more or less as it is documented in
my Perl 5.8.8 documentation:

As a special case the 3-arg form with a read/write mode and the
third argument being "undef":

open(TMP, "+>", undef) or die ...

opens a filehandle to an anonymous temporary file.

Now I received my first test error from the CPAN testers for that
statement:
Use of uninitialized value in open at t/Parse-Readelf.t line 45.

The tester runs Perl 5.6.2, so I suppose the temporary functionality
was added later. Now my questions would be:
Which Perl version added the special temporary syntax?
Is there some other portable easy-to-use construct to open a temporary
file with Perl versions 5.6.1 or later?

Regards, Thomas
--
Address is not read, Reply-To address is only valid for two months!
.



Relevant Pages

  • Re: Regarding Text Widget in Perl/Tk
    ... > because then it just opens round2.pl in my text editor, ... by the ActivePerl install are the appropriate ones for making Perl run. ... start learning a programming ... there is no good reason to mess with a working file association ...
    (perl.beginners)
  • Re: crontab script
    ... it opens a txt file, get the timestamp. ... Perl has a sleep function built in. ... exec 'perl', 'blog.pl'; ...
    (comp.lang.perl.misc)
  • RE: How is the ~$... file created when you open a document used?
    ... This temporary file holds the logon name of the person ... If the Owner File is damaged or missing the error message changes to: ... Word automatically deletes the Owner File when the original file is closed. ... I understand that Word opens a "copy" of the file and you ...
    (microsoft.public.word.docmanagement)
  • Re: Limit of number of files that can be opened in perl
    ... I am speaking to the system admin if he can bump up the limit to 1024. ... And I believe that at least some perl releases have an overall ... the filehandles, I see it writes ok to some files and not to the others. ... it opens and closes filehandles as needed ...
    (perl.beginners)
  • Re: Visio file damedged by itself "Unexpected end of tile" unable
    ... Many thanks David, ... The temporary file is 4 Kb and the file itself is 5,87 ... will be really grateful if you can try with your Visio 2007. ... Do you have any code running when the document opens? ...
    (microsoft.public.visio.troubleshoot)