[30771] in Perl-Users-Digest
Perl-Users Digest, Issue: 2016 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Nov 29 06:09:40 2008
Date: Sat, 29 Nov 2008 03:09:06 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 29 Nov 2008 Volume: 11 Number: 2016
Today's topics:
FAQ 9,4 is bogus. IT IS TO BE DISREGARDED AND ERRONEOUS sln@netherlands.com
Re: FAQ 9,4 is bogus. IT IS TO BE DISREGARDED AND ERRON sln@netherlands.com
Re: FAQ 9.4 How do I remove HTML from a string? sln@netherlands.com
Re: FAQ 9.4 How do I remove HTML from a string? sln@netherlands.com
Re: FAQ 9.4 How do I remove HTML from a string? sln@netherlands.com
Re: how to force a symbolic link? <someone@example.com>
Re: IP address - longest prefix match <hjp-usenet2@hjp.at>
Re: Mysql -> Perl - MS-Excel ? <hjp-usenet2@hjp.at>
new CPAN modules on Sat Nov 29 2008 (Randal Schwartz)
subroutine to array QoS@domain.invalid
Re: subroutine to array <someone@example.com>
Re: subroutine to array sln@netherlands.com
Why tempfile needs template? <PengYu.UT@gmail.com>
Re: Why tempfile needs template? sln@netherlands.com
Re: Why tempfile needs template? <someone@example.com>
Re: Why tempfile needs template? sln@netherlands.com
Re: Why tempfile needs template? sln@netherlands.com
Re: Why tempfile needs template? <PengYu.UT@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 29 Nov 2008 02:24:41 GMT
From: sln@netherlands.com
Subject: FAQ 9,4 is bogus. IT IS TO BE DISREGARDED AND ERRONEOUS!
Message-Id: <7m91j4tg0h34cfc1qivrm6eadouuk3dmqc@4ax.com>
I posted the reasonons, line by line on the FAQ itself.
Numberous FAQ's were posted on top of the usenet list.
If this was via automation, then no problem.
If not then, I want to assure you FAQ 9.4 is erroneous.
Thanks
sln
------------------------------
Date: Sat, 29 Nov 2008 03:57:53 GMT
From: sln@netherlands.com
Subject: Re: FAQ 9,4 is bogus. IT IS TO BE DISREGARDED AND ERRONEOUS!
Message-Id: <6bf1j457hegva97tjto153v5aq6maqj2ee@4ax.com>
On Sat, 29 Nov 2008 02:24:41 GMT, sln@netherlands.com wrote:
>I posted the reasonons, line by line on the FAQ itself.
>Numberous FAQ's were posted on top of the usenet list.
>
>If this was via automation, then no problem.
>
>If not then, I want to assure you FAQ 9.4 is erroneous.
>
>Thanks
>
>
>sln
Otherwise I have proven it wrong. Unless you can counter,
it is fallatious, a bj on you.
sln
------------------------------
Date: Sat, 29 Nov 2008 02:14:23 GMT
From: sln@netherlands.com
Subject: Re: FAQ 9.4 How do I remove HTML from a string?
Message-Id: <5391j4dgj7osafs68a4djutf9376fuj6ek@4ax.com>
On Sat, 29 Nov 2008 01:59:55 GMT, sln@netherlands.com wrote:
>On Sat, 29 Nov 2008 11:48:42 +1000 (EST), Res <res@ausics.net> wrote:
>
>>the only fucking idiot here is you
This is going to be burried so far up you ass you won't see daylight
for a thousand fucking years.
I only post these snippets, because I'm doing some shit that
I don't wan't you to know about. You made me post them here!
So here u got's. Its simple realy when you consider them in the
whole. The 'whole' is what you will NOT be able to conceptually grasp!
sln
------------------------------
Date: Sat, 29 Nov 2008 02:35:03 GMT
From: sln@netherlands.com
Subject: Re: FAQ 9.4 How do I remove HTML from a string?
Message-Id: <iha1j4p5a3n6clbruqf98ug15qqjpivbf2@4ax.com>
On Sat, 29 Nov 2008 01:59:55 GMT, sln@netherlands.com wrote:
>On Sat, 29 Nov 2008 11:48:42 +1000 (EST), Res <res@ausics.net> wrote:
>
>>the only fucking idiot here is you
>>
[snip]
so shut the fuck up.
sln
------------------------------
Date: Sat, 29 Nov 2008 03:30:44 GMT
From: sln@netherlands.com
Subject: Re: FAQ 9.4 How do I remove HTML from a string?
Message-Id: <okd1j4l55a1i3affbt16cr8da8g9k6aoq0@4ax.com>
On Sat, 29 Nov 2008 01:59:55 GMT, sln@netherlands.com wrote:
>On Sat, 29 Nov 2008 11:48:42 +1000 (EST), Res <res@ausics.net> wrote:
>
>>the only fucking idiot here is you
>>
>>On Sat, 29 Nov 2008, sln@netherlands.com wrote:
>>
>>> On Fri, 28 Nov 2008 17:14:22 -0800, Tim Greer <tim@burlyhost.com> wrote:
>>>
>>>> sln@netherlands.com wrote:
>>>>
>>> [snip]
>>> Your a fucking idiot.
>>>
>>> Either you know and can contribute on the specific
>>> FAQ topic, like I did, or you can't.
>>>
>>> Don't beat a dead horse.
>>>
>>>
>>> sln
>>>
>>>
>>
>>--
>>Res
>>
>>If you are not part of the solution, then you are part of the problem!
>
Tell me its just another blow hard jack off? I need to hear that because
there are so many and I rarely drink enough to ask.
Tell me..
sln
------------------------------
Date: Fri, 28 Nov 2008 19:56:42 -0800
From: "John W. Krahn" <someone@example.com>
Subject: Re: how to force a symbolic link?
Message-Id: <Z33Yk.5302$1s7.632@newsfe02.iad>
Peng Yu wrote:
>
> In shell, 'ln' has an option -f. I'm wondering if there is such option
> for symlink in perl.
-e 'oldlink' and unlink 'oldlink';
symlink 'yourfile', 'oldlink' or die "oldlink: $!";
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
------------------------------
Date: Sat, 29 Nov 2008 09:43:38 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: IP address - longest prefix match
Message-Id: <slrngj205r.pq2.hjp-usenet2@hrunkner.hjp.at>
On 2008-11-24 19:24, Jürgen Exner <jurgenex@hotmail.com> wrote:
> "friend.05@gmail.com" <hirenshah.05@gmail.com> wrote:
>>Suppose I have C_IP address : 12.120.29.25
>>
>>and I have list of following IP addresses :
>>
>> 212.120.128.0|19;
[...]
>> 12.120.24.0|21;
>>
>>
>>Now I need to map C_IP to list with longest prefix match. (As u can
>>there are many IP address with 12.120. but I need to map to one with
>>longest prefix match)
>
> This may not be the smartest ways to do it, but at least it works:
No, it doesn't.
For the 174344 IP addresses in the example netblocks, it fails in 76288
cases (or 44%).
You can't find an IP prefix by searching for a string prefix in the
dotted quad representation, you have to use the binary representation.
For example, if you have two netblocks 143.130.32.0/20 and
143.130.48.0/20, and an IP address 143.130.45.1, your method would find
143.130.48.0/20 while the correct answer is 143.130.32.0/20:
143.130.45.1: 10001111 10000010 00101101 00000001
143.130.32.0/20: 10001111 10000010 0010
143.130.48.0/20: 10001111 10000010 0011
As you can see, 143.130.32.0/20 matches, but 143.130.48.0/20 doesn't.
As Ted wrote, use Net::Netmask.
hp
------------------------------
Date: Sat, 29 Nov 2008 10:11:32 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Mysql -> Perl - MS-Excel ?
Message-Id: <slrngj21q5.pq2.hjp-usenet2@hrunkner.hjp.at>
On 2008-11-26 18:54, Dr.Ruud <rvtol+news@isolution.nl> wrote:
> me schreef:
>> Unfortunately this client wants a pure Excel file - no csv import...
>> so I'm stuck with a specific MS-Excel output. I agree, csv is the
>> better way to go.
>
> If you don't need any special formatting,
> and you output dates as "yyyy-mm-dd HH:MM:SS" strings,
> then just save the resulting CSV (with proper headers) under an xls-name
> like data.xls,
> and most users won't even notice that the file isn't a native Excel
> file.
Be careful, though:
* CSV import depends on the locale. You have to get the decimal
character ("." or ",") right.
* If something looks like a number, it is treated as a number. So
if you have strings like "012.890" or "123E5", they will be converted
to "12.89" and "12300000" respectively.
* And sometimes the results are just weird, like a number being
recognized as a date ...
CSV is nice and simple, but Excel just isn't very good at importing it.
It the goal is to get the data into Excel, it is much preferable to
create an Excel file in the first place.
hp
------------------------------
Date: Sat, 29 Nov 2008 05:42:23 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sat Nov 29 2008
Message-Id: <KB2yIn.D48@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
Apache2-AuthCookieDBI-2.04
http://search.cpan.org/~matisse/Apache2-AuthCookieDBI-2.04/
An AuthCookie module backed by a DBI database.
----
Business-Hours-0.09
http://search.cpan.org/~ruz/Business-Hours-0.09/
Calculate business hours in a time period
----
Catalyst-Plugin-Authentication-0.10009
http://search.cpan.org/~jayk/Catalyst-Plugin-Authentication-0.10009/
Infrastructure plugin for the Catalyst authentication framework.
----
Class-Interface-1.01
http://search.cpan.org/~sinister/Class-Interface-1.01/
A class for implementing/extending interfaces/abstracts in Perl.
----
DNS-WorldWideDns-0.0102
http://search.cpan.org/~rizen/DNS-WorldWideDns-0.0102/
An interface to the worldwidedns.net service.
----
Danga-Socket-1.61
http://search.cpan.org/~bradfitz/Danga-Socket-1.61/
Event loop and event-driven async socket base class
----
Dicop-Base-3.05
http://search.cpan.org/~bsi/Dicop-Base-3.05/
basics for a Dicop HTTP server/client
----
Dicop-Workerframe-2.21
http://search.cpan.org/~bsi/Dicop-Workerframe-2.21/
----
Graph-0.85
http://search.cpan.org/~jhi/Graph-0.85/
graph data structures and algorithms
----
Graph-0.86
http://search.cpan.org/~jhi/Graph-0.86/
graph data structures and algorithms
----
HTML-GenToc-3.10
http://search.cpan.org/~rubykat/HTML-GenToc-3.10/
Generate a Table of Contents for HTML documents.
----
HTML-Toc-1.00
http://search.cpan.org/~fvulto/HTML-Toc-1.00/
Generate, insert and update HTML Table of Contents.
----
IO-Lambda-0.44
http://search.cpan.org/~karasik/IO-Lambda-0.44/
non-blocking I/O in lambda style
----
IPC-SysV-2.00_02
http://search.cpan.org/~mhx/IPC-SysV-2.00_02/
System V IPC constants and system calls
----
Kephra-0.4
http://search.cpan.org/~lichtkind/Kephra-0.4/
crossplatform, GUI-Texteditor along perllike Paradigms
----
Mail-DSPAM-Learning-0.1
http://search.cpan.org/~thhamon/Mail-DSPAM-Learning-0.1/
Perl extension for correcting spam learning of a DPSAM server
----
Mail-Log-Trace-1.00.00
http://search.cpan.org/~dstaal/Mail-Log-Trace-1.00.00/
Trace an email through the mailsystem logs.
----
MojoX-Renderer-JSON-0.10
http://search.cpan.org/~gbarr/MojoX-Renderer-JSON-0.10/
JSON renderer for Mojo
----
MojoX-Renderer-Mason-0.10
http://search.cpan.org/~gbarr/MojoX-Renderer-Mason-0.10/
HTML::Mason renderer for Mojo
----
MojoX-Renderer-YAML-0.10
http://search.cpan.org/~gbarr/MojoX-Renderer-YAML-0.10/
YAML renderer for Mojo
----
Music-Chord-Note-0.0.1
http://search.cpan.org/~bayashi/Music-Chord-Note-0.0.1/
get Chord Tone List from Chord Name
----
Net-GeoPlanet-0.2
http://search.cpan.org/~skreuzer/Net-GeoPlanet-0.2/
Access Yahoo's GeoPlanet location service
----
Net-Twitter-Search-0.10
http://search.cpan.org/~shiny/Net-Twitter-Search-0.10/
Twitter Search
----
Net-Twitter-Search-0.11
http://search.cpan.org/~shiny/Net-Twitter-Search-0.11/
Twitter Search
----
Number-RecordLocator-0.004
http://search.cpan.org/~jesse/Number-RecordLocator-0.004/
Encodes integers into a short and easy to read and pronounce "locator string"
----
Padre-0.19
http://search.cpan.org/~szabgab/Padre-0.19/
Perl Application Development and Refactoring Environment
----
Padre-Plugin-HTMLExport-0.01
http://search.cpan.org/~fayland/Padre-Plugin-HTMLExport-0.01/
export highlighted HTML in Padre
----
Perl-Repository-APC-2.002
http://search.cpan.org/~andk/Perl-Repository-APC-2.002/
Class modelling "All Perl Changes" repository
----
Perlwikipedia-1.4.1
http://search.cpan.org/~dcollins/Perlwikipedia-1.4.1/
a Wikipedia bot framework written in Perl
----
Rose-DB-Object-0.775_03
http://search.cpan.org/~jsiracusa/Rose-DB-Object-0.775_03/
Extensible, high performance object-relational mapper (ORM).
----
String-Tests-0.01
http://search.cpan.org/~sfryer/String-Tests-0.01/
run a series of tests on a string
----
Tk-XPMs-1.11
http://search.cpan.org/~ldomke/Tk-XPMs-1.11/
xpm images for icons
----
WWW-Search-2.505
http://search.cpan.org/~mthurn/WWW-Search-2.505/
Virtual base class for WWW searches
----
WWW-Search-2.506
http://search.cpan.org/~mthurn/WWW-Search-2.506/
Virtual base class for WWW searches
----
WWW-Search-Ebay-Europe-2.006
http://search.cpan.org/~mthurn/WWW-Search-Ebay-Europe-2.006/
----
WebService-Google-Language-0.06
http://search.cpan.org/~hma/WebService-Google-Language-0.06/
Perl interface to the Google AJAX Language API
----
Xacobeo-0.04_02
http://search.cpan.org/~potyl/Xacobeo-0.04_02/
XPath (XML Path Language) visualizer.
----
p5-WWW-iTunesConnect-1.003
http://search.cpan.org/~bfoz/p5-WWW-iTunesConnect-1.003/
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
------------------------------
Date: Sat, 29 Nov 2008 05:35:52 GMT
From: QoS@domain.invalid
Subject: subroutine to array
Message-Id: <Yw4Yk.1721$QX3.995@nwrddc02.gnilink.net>
Is there any other way to load a subroutine into an array?
#!/usr/bin/perl
use strict;
use warnings;
my @array;
@array = loadSub('example');
if (defined $array[0]) {
foreach my $l (@array) {
print $l;
}
}
exit;
sub loadSub #-----------------------------------------------------------
{
my $sub = quotemeta ($_[0]) || return (0);
my $this_perl = $0;
if (open (IN, '<', $this_perl)) {
my ($out, $found,);
while (my $line = (<IN>)) {
if (! $found && ! $line =~ m/^\s*sub\s+$sub/) {
next;
}
else {
$found = 1;
if ($line =~ m/^\s*}/) { last; }
$out .= $line;
}
}
if (! $found) {
warn 'Unable to find subroutine: ' . $sub . "\n";
$out = 0;
}
close IN
|| warn "Unable to close input file in loadSub\n";
return ($out);
}
else {
warn "Unable to read file: $this_perl\n$!\n";
}
return (0);
}
sub example #-----------------------------------------------------------
{
my ($a, $b,);
foreach my $n (1..5) { $a++; $b += $a + $n; }
return ($b);
}
------------------------------
Date: Fri, 28 Nov 2008 23:22:39 -0800
From: "John W. Krahn" <someone@example.com>
Subject: Re: subroutine to array
Message-Id: <356Yk.7109$1s7.6831@newsfe02.iad>
QoS@domain.invalid wrote:
> Is there any other way to load a subroutine into an array?
perldoc -q "How do I find matching/nesting anything"
> #!/usr/bin/perl
> use strict;
> use warnings;
>
> my @array;
>
> @array = loadSub('example');
Or just:
my @array = loadSub('example');
> if (defined $array[0]) {
> foreach my $l (@array) {
> print $l;
> }
> }
Or just:
@array and print @array;
> exit;
>
> sub loadSub #-----------------------------------------------------------
> {
> my $sub = quotemeta ($_[0]) || return (0);
You are returning 0 but you are testing the result of running this
subroutine with defined() so your test "if (defined $array[0]) {" will
always be true.
> my $this_perl = $0;
>
> if (open (IN, '<', $this_perl)) {
> my ($out, $found,);
> while (my $line = (<IN>)) {
> if (! $found && ! $line =~ m/^\s*sub\s+$sub/) {
> next;
> }
> else {
> $found = 1;
> if ($line =~ m/^\s*}/) { last; }
> $out .= $line;
> }
> }
> if (! $found) {
> warn 'Unable to find subroutine: ' . $sub . "\n";
> $out = 0;
> }
> close IN
> || warn "Unable to close input file in loadSub\n";
> return ($out);
> }
> else {
> warn "Unable to read file: $this_perl\n$!\n";
> }
> return (0);
You are returning 0 but you are testing the result of running this
subroutine with defined() so your test "if (defined $array[0]) {" will
always be true.
> }
> sub example #-----------------------------------------------------------
> {
> my ($a, $b,);
> foreach my $n (1..5) { $a++; $b += $a + $n; }
> return ($b);
> }
Could be written more simply as:
#!/usr/bin/perl
use strict;
use warnings;
# Is there any other way to load a subroutine into an array?
my @array = loadSub( 'example' );
@array and print @array;
sub loadSub {
my $sub = quotemeta $_[ 0 ] or return;
my $this_perl = $0;
open my $IN, '<', $this_perl or do {
warn "Unable to read file: $this_perl\n$!\n";
return;
};
my $out;
while ( my $line = <$IN> ) {
next if !defined $out && $line !~ /^\s*sub\s+$sub/;
$out .= $line;
return $out if $line =~ /^\s*}/;
}
warn "Unable to find subroutine: $sub\n";
return;
}
sub example {
my ( $x, $y );
$y += ++$x + $_ for 1 .. 5;
return $y;
}
__END__
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
------------------------------
Date: Sat, 29 Nov 2008 09:19:11 GMT
From: sln@netherlands.com
Subject: Re: subroutine to array
Message-Id: <l522j4188s4e7uat52985lrbotbaqrb8j9@4ax.com>
On Sat, 29 Nov 2008 05:35:52 GMT, QoS@domain.invalid wrote:
Not until you indent more than 2 characters.
Even then I won't look at it. Just because of the title.
sln
------------------------------
Date: Fri, 28 Nov 2008 18:50:03 -0800 (PST)
From: Peng Yu <PengYu.UT@gmail.com>
Subject: Why tempfile needs template?
Message-Id: <2e2d3f77-2ccd-4b25-b854-1374cf83816b@n10g2000yqm.googlegroups.com>
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";
------------------------------
Date: Sat, 29 Nov 2008 02:54:06 GMT
From: sln@netherlands.com
Subject: Re: Why tempfile needs template?
Message-Id: <shb1j4dj0djot9gouhaa0ba13tnt7tftdi@4ax.com>
On Fri, 28 Nov 2008 18:50:03 -0800 (PST), Peng Yu <PengYu.UT@gmail.com> wrote:
>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
------------------------------
Date: Fri, 28 Nov 2008 20:03:11 -0800
From: "John W. Krahn" <someone@example.com>
Subject: Re: Why tempfile needs template?
Message-Id: <2a3Yk.7309$kn7.3256@newsfe08.iad>
Peng Yu wrote:
>
> 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
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
------------------------------
Date: Sat, 29 Nov 2008 04:10:17 GMT
From: sln@netherlands.com
Subject: Re: Why tempfile needs template?
Message-Id: <e3g1j4h25ldncivp7p4hipik7ffh8etsnn@4ax.com>
On Fri, 28 Nov 2008 20:03:11 -0800, "John W. Krahn" <someone@example.com> wrote:
>Peng Yu wrote:
>>
>> 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
Haven't u got some paperss to grade you usenet carpet bagger Peng?
sln
------------------------------
Date: Sat, 29 Nov 2008 04:14:54 GMT
From: sln@netherlands.com
Subject: Re: Why tempfile needs template?
Message-Id: <vag1j4lj5g43f9oqo254a9mj8t5rj8c31i@4ax.com>
On Fri, 28 Nov 2008 20:03:11 -0800, "John W. Krahn" <someone@example.com> wrote:
>Peng Yu wrote:
>>
>> 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
Don't waste your time John. Peng is a jack-off user. I have too much
respect for your talents.
sln
------------------------------
Date: Fri, 28 Nov 2008 21:16:22 -0800 (PST)
From: Peng Yu <PengYu.UT@gmail.com>
Subject: Re: Why tempfile needs template?
Message-Id: <5929cdf3-9139-41de-b609-8881382e2264@t2g2000yqm.googlegroups.com>
On Nov 28, 10:03=A0pm, "John W. Krahn" <some...@example.com> wrote:
> Peng Yu wrote:
>
> > 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) =3D tempfile();
> > #print "$filename\n";
>
> > use File::Temp;
> > my ($fh, $filename) =3D 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()
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
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 2016
***************************************