[27848] in Perl-Users-Digest
Perl-Users Digest, Issue: 9212 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 30 06:05:58 2006
Date: Sun, 30 Apr 2006 03:05:03 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 30 Apr 2006 Volume: 10 Number: 9212
Today's topics:
Re: Detecting filehandles <tadmc@augustmail.com>
new CPAN modules at Sun Apr 30 2006 (Randal Schwartz)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 29 Apr 2006 09:06:57 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Detecting filehandles
Message-Id: <slrne56so1.rlv.tadmc@magna.augustmail.com>
Subotai <subotai@aol.com> wrote:
> Is there a way to detect if an argument you are passed in a subroutine is a
> filehandle?
No, because it is not possible to pass a filehandle as a
subroutine argument.
> For instance:
>
> open(FILE, '/file');
> foo(\*FILE);
That is not passing a filehandle.
That is passing a reference to a typeglob.
> foo($someotherarg);
>
> sub foo {
> $arg = shift;
> #### do some check on $arg to see if it is a filehandle or a normal scalar
if ( ref($arg) eq 'GLOB' )
{ print "arg is a glob\n" }
else
{ print "arg is NOT a glob\n" }
> }
>
> Also if you have an open filehandle, is there a way to see what file it is
> referencing?
A "filehandle" does not correspond to a "file". They are different things.
A filehandle corresponds to an input/output channel.
A filehandle might correspond to a file, but it might correspond
to any of several other things instead.
What file would you report for:
open FILE, 'echo "Hello World" |' or die ...
foo(\*FILE);
or
foo(\*STDOUT);
??
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 30 Apr 2006 04:42:09 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules at Sun Apr 30 2006
Message-Id: <IyIqE9.Eoo@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.
Tk-JFileDialog-1.31
http://search.cpan.org/~turnerjw/Tk-JFileDialog-1.31/
A highly configurable File Dialog widget for Perl/Tk.
----
Tk-JBrowseEntry-4.63
http://search.cpan.org/~turnerjw/Tk-JBrowseEntry-4.63/
is a full-featured "Combo-box" (Text-entry combined with drop-down listbox.
----
Hatena-Keyword-0.03
http://search.cpan.org/~naoya/Hatena-Keyword-0.03/
Extract Hatena Keywords in a string
----
POE-Session-Attribute-0.01
http://search.cpan.org/~jsn/POE-Session-Attribute-0.01/
Use attributes to define your POE Sessions
----
Number-RecordLocator-0.001
http://search.cpan.org/~jesse/Number-RecordLocator-0.001/
[One line description of module's purpose here]
----
XML-TreePP-0.10
http://search.cpan.org/~kawasaki/XML-TreePP-0.10/
Pure Perl implementation for parsing/writing xml files
----
XML-FeedPP-0.10
http://search.cpan.org/~kawasaki/XML-FeedPP-0.10/
Parse/write/merge web feeds, RSS/RDF/Atom
----
HTML-Expander-2.6
http://search.cpan.org/~cade/HTML-Expander-2.6/
html tag expander with inheritable tag definitions (modes)
----
RRDTool-OO-0.14
http://search.cpan.org/~mschilli/RRDTool-OO-0.14/
Object-oriented interface to RRDTool
----
Statistics-Gap-0.10
http://search.cpan.org/~anaghakk/Statistics-Gap-0.10/
An adaptation of the "Gap Statistic"
----
HTML-GoogleMaps-4
http://search.cpan.org/~nmueller/HTML-GoogleMaps-4/
a simple wrapper around the Google Maps API
----
Catalyst-Plugin-ClamAV-0.02
http://search.cpan.org/~fujiwara/Catalyst-Plugin-ClamAV-0.02/
ClamAV scanning Plugin for Catalyst
----
POE-Component-Server-SOAP-1.09
http://search.cpan.org/~apocal/POE-Component-Server-SOAP-1.09/
publish POE event handlers via SOAP over HTTP
----
ExtUtils-ModuleMaker-0.46
http://search.cpan.org/~jkeenan/ExtUtils-ModuleMaker-0.46/
Better than h2xs for creating modules
----
YAML-Syck-0.43
http://search.cpan.org/~autrijus/YAML-Syck-0.43/
Fast, lightweight YAML loader and dumper
----
Getopt-WonderBra-1.04
http://search.cpan.org/~rpaul/Getopt-WonderBra-1.04/
Lift and Separate Command Line Options
----
Template-Plugin-Digest-SHA1-0.03
http://search.cpan.org/~andrewf/Template-Plugin-Digest-SHA1-0.03/
TT2 interface to the SHA1 Algorithm
----
Catalyst-Plugin-CGI-Untaint-0.02
http://search.cpan.org/~tjc/Catalyst-Plugin-CGI-Untaint-0.02/
Plugin for Catalyst
----
CGI-Untaint-telephone-0.02
http://search.cpan.org/~tjc/CGI-Untaint-telephone-0.02/
----
Template-Plugin-Digest-MD5-0.03
http://search.cpan.org/~andrewf/Template-Plugin-Digest-MD5-0.03/
TT2 interface to the MD5 Algorithm
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.
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/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
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 V10 Issue 9212
***************************************