Why tempfile needs template?

P

Peng Yu

Hi,

The commented line would work correctly. But the code below it would
not work correctly. I'm wondering what the problem is?

Thanks,
Peng

#!/usr/bin/perl

use warnings;
use strict;

#use File::Temp qw/ tempfile tempdir /;
#my ($fh, $filename) = tempfile();
#print "$filename\n";

use File::Temp;
my ($fh, $filename) = File::Temp->tempfile();
print "$filename\n";
 
S

sln

Hi,

The commented line would work correctly. But the code below it would
not work correctly. I'm wondering what the problem is?

Thanks,
Peng

Considering your 3 per day, bizzarro, un-decipheral,
un=related posts, I would say its a Chinese thing Pong.


sln
 
J

John W. Krahn

Peng said:
The commented line would work correctly. But the code below it would
not work correctly. I'm wondering what the problem is?

Thanks,
Peng

#!/usr/bin/perl

use warnings;
use strict;

#use File::Temp qw/ tempfile tempdir /;
#my ($fh, $filename) = tempfile();
#print "$filename\n";

use File::Temp;
my ($fh, $filename) = File::Temp->tempfile();
print "$filename\n";

You are trying to use the Object interface but you have not created a
File::Temp object.

Instead of File::Temp->tempfile() you should use File::Temp::tempfile()



John
 
S

sln

You are trying to use the Object interface but you have not created a
File::Temp object.

Instead of File::Temp->tempfile() you should use File::Temp::tempfile()



John
Haven't u got some paperss to grade you usenet carpet bagger Peng?


sln
 
S

sln

You are trying to use the Object interface but you have not created a
File::Temp object.

Instead of File::Temp->tempfile() you should use File::Temp::tempfile()



John

Don't waste your time John. Peng is a jack-off user. I have too much
respect for your talents.

sln
 
P

Peng Yu

You are trying to use the Object interface but you have not created a
File::Temp object.

Instead of File::Temp->tempfile() you should use File::Temp::tempfile()

Hi John,

I see. I wasn't quite familar with perl's language yet. Please excuse
me if my question was too obvious to you.

Thanks,
Peng
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,177
Latest member
OrderGlucea
Top