[29871] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1114 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 13 18:10:14 2007

Date: Thu, 13 Dec 2007 15:09:05 -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           Thu, 13 Dec 2007     Volume: 11 Number: 1114

Today's topics:
    Re: (1)[0] ok but not 1[0] <jl_post@hotmail.com>
    Re: Can't locate object method "readMessage" ... (Inher <ben@morrow.me.uk>
    Re: Can't locate object method "readMessage" ... (Inher <ben@morrow.me.uk>
    Re: Can't locate object method "readMessage" ... (Inher <njc@cookie.uucp>
    Re: Can't locate object method "readMessage" ... (Inher <njc@cookie.uucp>
        CGI query and FORM <visitprakashindia@gmail.com>
    Re: CGI query and FORM <ben@morrow.me.uk>
        File::Find doesn't go down thru directory <cmic@caramail.com>
    Re: File::Find doesn't go down thru directory (Randal L. Schwartz)
        free zip code database donhenning@gmail.com
        How to create chart in perl using Spreadsheet::WriteExc cyrusgreats@gmail.com
    Re: split is not convinient <Mark.Seger@hp.com>
    Re: split is not convinient xhoster@gmail.com
    Re: split is not convinient <krahnj@telus.net>
    Re: split is not convinient <Mark.Seger@hp.com>
    Re: split is not convinient <ben@morrow.me.uk>
    Re: split is not convinient <Mark.Seger@hp.com>
    Re: Testing File Existence - best way? <No_4@dsl.pipex.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 13 Dec 2007 13:50:27 -0800 (PST)
From: "jl_post@hotmail.com" <jl_post@hotmail.com>
Subject: Re: (1)[0] ok but not 1[0]
Message-Id: <143e88ed-b690-44fb-ad5c-cd0f2cbabbb6@d21g2000prf.googlegroups.com>

On Dec 12, 6:28 am, Florian Kaufmann <sensor...@gmail.com> wrote:
>
> The following two are equivalent
> print 1,2,3;
> print (1,2,3);


But the following two lines are not equivalent:

   my @a = (1,2,3);
   my @a = 1,2,3;

Parentheses sometimes make a big difference, because they can change
the order of when operators get evaluated.


------------------------------

Date: Thu, 13 Dec 2007 19:09:12 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Can't locate object method "readMessage" ... (Inheritance question)
Message-Id: <ojc835-90l2.ln1@osiris.mauzo.dyndns.org>


Quoth ncherry@comcast.net:
>
> Thanks that fixed the problem, I ended up getting a new problem as it
> now reports back this (and I know why):
> 
> $ perl -w ~/elk_serial.pl
>  at /home/njc/elk_serial.pl line 14
> 
> This is because readMessage (which was not found before) is returning
> undef as a value. I'm just a little surprised by the message.

The only way to get this message is warn " ", unless something is
passing a string ending in "\r" to warn, which will cause the '...at'
part to overwrite the rest.

> > You don't appear to be overriding the ->new method at all.
> > ElkM1::Control does not appear to be on CPAN, so I can't tell if it
> > defines one. If you are hoping to inherit methods from
> > Device::SerialPort you would need to add that to @ISA, however since
> > Device::SerialPort uses hash-based objects, this would not work.
> 
> The ElkM1::Control code is not on CPAN,

Why not? Publicly available Perl code that isn't on CPAN (yes, SVN, VCP,
I'm looking at you here) is *really* annoying. For one thing, it's
impossible to specify it as a dependancy (well, you can, but it won't do
any good). I realise this isn't your code, but if you are able to
persuade those responsible for it that a CPAN release would be a good
thing, that would be helpful.

Ben



------------------------------

Date: Thu, 13 Dec 2007 19:12:59 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Can't locate object method "readMessage" ... (Inheritance question)
Message-Id: <rqc835-90l2.ln1@osiris.mauzo.dyndns.org>

Having taken a second look at this code...

Quoth ncherry@comcast.net:
>   # Main loop, read any message.
>   while (1) {
>       while (my $msg = $elk->readMessage) {
>   	if (ref($msg) eq 'ElkM1::Control::ZoneChangeUpdate') {

This is a bad idea. It breaks systems like Test::MockObject. The correct
way to test for class membership is to ask the object:

    if ($msg->isa('ElkM1::Control::ZoneChangeUpdate')) {

If you are not sure $msg will be a blessed reference, wrap this in
eval {}.

Ben



------------------------------

Date: Thu, 13 Dec 2007 13:40:06 -0600
From: Neil Cherry <njc@cookie.uucp>
Subject: Re: Can't locate object method "readMessage" ... (Inheritance question)
Message-Id: <slrnfm32km.ses.njc@cookie.uucp>

On Thu, 13 Dec 2007 19:09:12 +0000, Ben Morrow wrote:
>
> Quoth ncherry@comcast.net:
>>
>> Thanks that fixed the problem, I ended up getting a new problem as it
>> now reports back this (and I know why):
>> 
>> $ perl -w ~/elk_serial.pl
>>  at /home/njc/elk_serial.pl line 14
>> 
>> This is because readMessage (which was not found before) is returning
>> undef as a value. I'm just a little surprised by the message.
>
> The only way to get this message is warn " ", unless something is
> passing a string ending in "\r" to warn, which will cause the '...at'
> part to overwrite the rest.

I found that just after I posted. It was a blank carp. I dropped in
some text to see what going on and came up with this:

$ perl ~/elk_serial.pl
Not a GLOB reference at /home/njc/dev/v2-104/lib/ElkM1/Control.pm line 296.
 at /home/njc/elk_serial.pl line 16

Doesn't like my IO handler. I'll need to look into that as I may have
made too many assumptions.

>> > You don't appear to be overriding the ->new method at all.
>> > ElkM1::Control does not appear to be on CPAN, so I can't tell if it
>> > defines one. If you are hoping to inherit methods from
>> > Device::SerialPort you would need to add that to @ISA, however since
>> > Device::SerialPort uses hash-based objects, this would not work.
>> 
>> The ElkM1::Control code is not on CPAN,
>
> Why not? Publicly available Perl code that isn't on CPAN (yes, SVN, VCP,
> I'm looking at you here) is *really* annoying. For one thing, it's
> impossible to specify it as a dependancy (well, you can, but it won't do
> any good). I realise this isn't your code, but if you are able to
> persuade those responsible for it that a CPAN release would be a good
> thing, that would be helpful.

It's not my code, the original author put this up on sourceforge.  I
just put it in that sub dir for this conversartion. Right now I'm just
trying to extend the functionality but haven't gotten very far. I may
eventually put it in CPAN but lets see if my Perl skills are up to the
challenge first.

-- 
Linux Home Automation         Neil Cherry       ncherry@linuxha.com
http://www.linuxha.com/                         Main site
http://linuxha.blogspot.com/                    My HA Blog
Author of:    	Linux Smart Homes For Dummies


------------------------------

Date: Thu, 13 Dec 2007 13:44:09 -0600
From: Neil Cherry <njc@cookie.uucp>
Subject: Re: Can't locate object method "readMessage" ... (Inheritance question)
Message-Id: <slrnfm32s9.ses.njc@cookie.uucp>

On Thu, 13 Dec 2007 19:12:59 +0000, Ben Morrow wrote:
> Having taken a second look at this code...
>
> Quoth ncherry@comcast.net:
>>   # Main loop, read any message.
>>   while (1) {
>>       while (my $msg = $elk->readMessage) {
>>   	if (ref($msg) eq 'ElkM1::Control::ZoneChangeUpdate') {
>
> This is a bad idea. It breaks systems like Test::MockObject. The correct
> way to test for class membership is to ask the object:
>
>     if ($msg->isa('ElkM1::Control::ZoneChangeUpdate')) {
>
> If you are not sure $msg will be a blessed reference, wrap this in
> eval {}.

This bit of code came out of the documentation and I simply changed
the ElkM1::Control->new to ElkM1::Control::Serial->new. I'm basically
just making small changes so I can learn what the module is doing. I
found the second while a bit confusing. Your code make better sense
for the second line.

-- 
Linux Home Automation         Neil Cherry       ncherry@linuxha.com
http://www.linuxha.com/                         Main site
http://linuxha.blogspot.com/                    My HA Blog
Author of:    	Linux Smart Homes For Dummies


------------------------------

Date: Thu, 13 Dec 2007 11:23:30 -0800 (PST)
From: Praki <visitprakashindia@gmail.com>
Subject: CGI query and FORM
Message-Id: <7e67eae5-d505-4c4e-aac5-523afff675ab@s8g2000prg.googlegroups.com>

Hi All,

I m creating the session in the Perl. all the functions are done in a
single file. the operations are performed by the command line
arguments.

for managing the session i m using the CGI. but when i create a CGI
object then all the Input from both POST and GET methods are parsed by
it. i m not able to get the varbale values using FORM. My work is the
enhancemet work so if i change all the FORM varible to CGI query then
its huge task. Is there any way to get the session info from the FORM
Variable...

This comes first of all the lines in my cgi file. so it parse all the
POST and GET methods..
i m not able to the values from FORM varible..

$query = new CGI;
$sid = $query->cookie('CGISESSID') || $query->param('CGISESSID') ||
undef;

after the abouve line
if ($FORM{'lab'} eq "pager") {

plz help me in getting this problem. Is there any way to get session
info from the FORM variable..

Thanks,
Prakash.


------------------------------

Date: Thu, 13 Dec 2007 21:48:30 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: CGI query and FORM
Message-Id: <eul835-dml2.ln1@osiris.mauzo.dyndns.org>


Quoth Praki <visitprakashindia@gmail.com>:
> 
> I m creating the session in the Perl. all the functions are done in a
> single file. the operations are performed by the command line
> arguments.
> 
> for managing the session i m using the CGI. but when i create a CGI
> object then all the Input from both POST and GET methods are parsed by
> it.

Yes, that's how CGI.pm works.

> i m not able to the values from FORM varible..

If you're expecting a session id in a cookie, and %FORM contains GET and
POST parameters, then it won't be in there.

> $query = new CGI;
> $sid = $query->cookie('CGISESSID') || $query->param('CGISESSID') ||
> undef;

This final || undef is unnecessary.

> after the abouve line
> if ($FORM{'lab'} eq "pager") {

You haven't told us how the %FORM variable is created. Chances are
whatever code you are using is buggy and should be replaced, but I
expect you know that.

If you just want to get cookies, without using the rest of CGI.pm, you
can use CGI::Cookie; something like

    use CGI::Cookie;

    my %COOKIE = CGI::Cookie->fetch;

    my $sid = $COOKIE{CGISESSID} || $FORM{CGISESSID};

Ben



------------------------------

Date: Thu, 13 Dec 2007 14:27:21 -0800 (PST)
From: cmic <cmic@caramail.com>
Subject: File::Find doesn't go down thru directory
Message-Id: <3f013f62-2d10-4f0f-a567-342af1aaf5a6@a35g2000prf.googlegroups.com>

Hello

Instead of mixing shell scripts and Perl, I prefer to do all the job
of the command find (recursion) and other piped commands with Perl.
However, the snippet below doesn't print any file under the current
directory.
The commented line (print "Result...) give the right information, if
uncommented, of \
course.

Any hint ? What do I
miss ,
--
michel marcon aka
cmic
Sysadmin.

#!/usr/local/bin/
perl
use
strict;
use
warnings;
use
File::Find;

find(\&wanted,
".");

sub wanted
{
    my $file=
$File::Find::name;
#    print "Result $file,
"\n";
    if (-f $file )
{
        print $file,
"\n";
    }
}




------------------------------

Date: Thu, 13 Dec 2007 14:58:43 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: File::Find doesn't go down thru directory
Message-Id: <864pemjj6k.fsf@blue.stonehenge.com>

>>>>> "cmic" == cmic  <cmic@caramail.com> writes:

cmic> sub wanted
cmic> {
cmic>     my $file=
cmic> $File::Find::name;
cmic> #    print "Result $file,
cmic> "\n";
cmic>     if (-f $file )
cmic> {
cmic>         print $file,
cmic> "\n";
cmic>     }
cmic> }

Hint: $File::Find::name will look like ./foo/bar, but you'll be cd'ed into
"./foo" already, so there's no ./foo/bar below ./foo.

If you're *in* "wanted", use $_.
If you're *after* "wanted", use $File::Find::name.

Don't confuse the two.  They both have their purpose.

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: Thu, 13 Dec 2007 14:28:29 -0800 (PST)
From: donhenning@gmail.com
Subject: free zip code database
Message-Id: <b439bf96-22d6-4258-aaed-9c0faf61c62d@d21g2000prf.googlegroups.com>

The data is from 2006, but it's clean. A few examples on how to use
(in Perl too).

http://www.free-zipcode.com



------------------------------

Date: Thu, 13 Dec 2007 14:07:46 -0800 (PST)
From: cyrusgreats@gmail.com
Subject: How to create chart in perl using Spreadsheet::WriteExcel
Message-Id: <58ec7a34-954b-40f8-aae9-cba66a9257c6@d27g2000prf.googlegroups.com>

I'm trying to create a chart in perl, does anyone knows how . Here is
portion of the code:

 my $workbook = Spreadsheet::WriteExcel->new($file);
 my $worksheet = $workbook->add_worksheet("Chart");
 .....some other code....
 $worksheet->set_row(1,20);
 $worksheet->set_column('E:E', 20);
 $worksheet->embed_chart('E2', $out); <== Here  it creates a chart but
no data/chart displayed.

It creates it but no value or any info displayed, I should mentioned
that there are already values in column E say from E2:E55 that I want
to make a chart/graph out of it, name a title for the chart, legend
and able to choose different chart type, can some one help me out on
this....Thanks in advance..




------------------------------

Date: Thu, 13 Dec 2007 14:09:58 -0500
From: Mark Seger <Mark.Seger@hp.com>
To: "John W. Krahn" <krahnj@telus.net>
Subject: Re: split is not convinient
Message-Id: <47618386.40907@hp.com>

John W. Krahn wrote:
> Mark Seger wrote:
>> Am I going blind are is the output from all 3 examples above the same?
> 
> Yes, because modern versions of perl automagically check for undefined
> values.
> 
>> In any event this discussion caused me to go back and read the
>> documentation since nobody actually said why you needed 'defined' and
>> the only explanation I could find is that you can't distinguish between
>> an undef, 0 or '' in a boolean!
>>
>> I guess the reason I've been lucky up until now is that when leaving off
>> the 'defined' and reading a file I can never read in a 0 or '' since
>> each string will have a \n at the end, but I can also appreciate why
>> including the 'defined' would be good form even if you know it won't
>> effect your particular situation - or is there something else I'm
>> missing here?
> 
> Some "text" files may not contain a final newline and if the last
> character is "0" the last line read will be false but defined.  If the
> Input Record Separator is set to the length 1 ($/ = \1;) then any "0"
> character read in will be false but defined.

excellent example, so I tried it! I built a file consisting of 3 lines, 
the last one not containing a terminator.  However, I would have 
expected my script to just print 1 & 2 but for the 'while' to exit when 
it read the 1 character 0 at the end but it didn't.  I even printed out 
the length of the string to convince myself there weren't any trailing 
chars.  any thoughts?

[root@cag-dl380-01 collectl]# cat x
1
2
0[root@cag-dl380-01 collectl]# cat test.pl
#!/usr/bin/perl -w
open FILE, "<x" or die;
while ($a=<FILE>) { printf ">>$a<< Len: %d\n", length($a); }
[root@cag-dl380-01 collectl]# ./test.pl
 >>1
<< Len: 2
 >>2
<< Len: 2
 >>0<< Len: 1

-mark


------------------------------

Date: 13 Dec 2007 19:36:08 GMT
From: xhoster@gmail.com
Subject: Re: split is not convinient
Message-Id: <20071213143610.019$VM@newsreader.com>

Mark Seger <Mark.Seger@hp.com> wrote:
> >
> > Some "text" files may not contain a final newline and if the last
> > character is "0" the last line read will be false but defined.  If the
> > Input Record Separator is set to the length 1 ($/ = \1;) then any "0"
> > character read in will be false but defined.
>
> excellent example, so I tried it! I built a file consisting of 3 lines,
> the last one not containing a terminator.  However, I would have
> expected my script to just print 1 & 2 but for the 'while' to exit when
> it read the 1 character 0 at the end but it didn't.  I even printed out
> the length of the string to convince myself there weren't any trailing
> chars.  any thoughts?

Sufficiently modern Perls automatically test for defined
in certain while (<>)-like constructs.  But this is one of those shortcuts,
so presumably you will want to spell it out explicitly.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.


------------------------------

Date: Thu, 13 Dec 2007 19:57:59 GMT
From: "John W. Krahn" <krahnj@telus.net>
Subject: Re: split is not convinient
Message-Id: <47618EC5.4FA7DAA3@telus.net>

Mark Seger wrote:
> 
> John W. Krahn wrote:
> >
> > Some "text" files may not contain a final newline and if the last
> > character is "0" the last line read will be false but defined.  If the
> > Input Record Separator is set to the length 1 ($/ = \1;) then any "0"
> > character read in will be false but defined.
> 
> excellent example, so I tried it! I built a file consisting of 3 lines,
> the last one not containing a terminator.  However, I would have
> expected my script to just print 1 & 2 but for the 'while' to exit when
> it read the 1 character 0 at the end but it didn't.  I even printed out
> the length of the string to convince myself there weren't any trailing
> chars.  any thoughts?
> 
> [root@cag-dl380-01 collectl]# cat x
> 1
> 2
> 0[root@cag-dl380-01 collectl]# cat test.pl
> #!/usr/bin/perl -w
> open FILE, "<x" or die;
> while ($a=<FILE>) { printf ">>$a<< Len: %d\n", length($a); }
> [root@cag-dl380-01 collectl]# ./test.pl
>  >>1
> << Len: 2
>  >>2
> << Len: 2
>  >>0<< Len: 1

You wrote:

while ($a=<FILE>) {

but perl interprets that as:

while (defined($a=<FILE>)) {

so that example will not work on modern versions of Perl.

You could bypass the built-in defined() test by using a compound
expression:

$ echo -n "1
2
0" | perl -e'while (++$b and $a=<>) { printf ">>%s<< Len: %d\n", $a,
length $a }'
>>1
<< Len: 2
>>2
<< Len: 2

$ echo -n "1
2
0                                                                           
3
4" | perl -e'$/ = \1; while (++$b and $a=<>) { printf ">>%s<< Len:
%d\n", $a, length $a }'
>>1<< Len: 1
>>
<< Len: 1
>>2<< Len: 1
>>
<< Len: 1



John
-- 
use Perl;
program
fulfillment


------------------------------

Date: Thu, 13 Dec 2007 15:08:25 -0500
From: Mark Seger <Mark.Seger@hp.com>
To: "John W. Krahn" <krahnj@telus.net>
Subject: Re: split is not convinient
Message-Id: <47619139.1090701@hp.com>

John W. Krahn wrote:
> Mark Seger wrote:
>> John W. Krahn wrote:
>>> Some "text" files may not contain a final newline and if the last
>>> character is "0" the last line read will be false but defined.  If the
>>> Input Record Separator is set to the length 1 ($/ = \1;) then any "0"
>>> character read in will be false but defined.
>> excellent example, so I tried it! I built a file consisting of 3 lines,
>> the last one not containing a terminator.  However, I would have
>> expected my script to just print 1 & 2 but for the 'while' to exit when
>> it read the 1 character 0 at the end but it didn't.  I even printed out
>> the length of the string to convince myself there weren't any trailing
>> chars.  any thoughts?
>>
>> [root@cag-dl380-01 collectl]# cat x
>> 1
>> 2
>> 0[root@cag-dl380-01 collectl]# cat test.pl
>> #!/usr/bin/perl -w
>> open FILE, "<x" or die;
>> while ($a=<FILE>) { printf ">>$a<< Len: %d\n", length($a); }
>> [root@cag-dl380-01 collectl]# ./test.pl
>>  >>1
>> << Len: 2
>>  >>2
>> << Len: 2
>>  >>0<< Len: 1
> 
> You wrote:
> 
> while ($a=<FILE>) {
> 
> but perl interprets that as:
> 
> while (defined($a=<FILE>)) {
> 
> so that example will not work on modern versions of Perl.
> 
> You could bypass the built-in defined() test by using a compound
> expression:
> 
> $ echo -n "1
> 2
> 0" | perl -e'while (++$b and $a=<>) { printf ">>%s<< Len: %d\n", $a,
> length $a }'
>>> 1
> << Len: 2
>>> 2
> << Len: 2
> 
> $ echo -n "1
> 2
> 0                                                                           
> 3
> 4" | perl -e'$/ = \1; while (++$b and $a=<>) { printf ">>%s<< Len:
> %d\n", $a, length $a }'
>>> 1<< Len: 1
>>>
> << Len: 1
>>> 2<< Len: 1
>>>
> << Len: 1
> 
> 
> 
> John

cool...  so to [hopefully] close this topic out could someone explain to 
me why using an explicit assignment, even with 'defined', if different 
than than not using any assignment?  I still don't get it...
-mark


------------------------------

Date: Thu, 13 Dec 2007 21:38:58 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: split is not convinient
Message-Id: <icl835-dml2.ln1@osiris.mauzo.dyndns.org>


Quoth Mark Seger <Mark.Seger@hp.com>:
> 
> cool...  so to [hopefully] close this topic out could someone explain to 
> me why using an explicit assignment, even with 'defined', if different 
> than than not using any assignment?  I still don't get it...

    while (<>) 

is a shortcut for

    while($_ = <>)

which is a shortcut for

    while( defined($_ = <>) )

which is a shortcut for

    while( defined($_ = <ARGV>) )

where ARGV is a magic filehandle that reads from the files specified on
the commandline or from stdin. If you run a small example with perl
-MO=Deparse it will expand these expressions for you.

Ben



------------------------------

Date: Thu, 13 Dec 2007 17:29:21 -0500
From: Mark Seger <Mark.Seger@hp.com>
To: Ben Morrow <ben@morrow.me.uk>
Subject: Re: split is not convinient
Message-Id: <4761B241.6050108@hp.com>

Ben Morrow wrote:
> Quoth Mark Seger <Mark.Seger@hp.com>:
>> cool...  so to [hopefully] close this topic out could someone explain to 
>> me why using an explicit assignment, even with 'defined', if different 
>> than than not using any assignment?  I still don't get it...
> 
>     while (<>) 
> 
> is a shortcut for
> 
>     while($_ = <>)
> 
> which is a shortcut for
> 
>     while( defined($_ = <>) )
> 
> which is a shortcut for
> 
>     while( defined($_ = <ARGV>) )
> 
> where ARGV is a magic filehandle that reads from the files specified on
> the commandline or from stdin. If you run a small example with perl
> -MO=Deparse it will expand these expressions for you.
> 
thanks, but I thought someone had said earlier that there was a 
different behavior using $_ and explicitly using my own variable and I 
still don't get that as it seems to me they're one in the same, unless 
of course $_ has special properties I don't know about.  and that's 
always possible...
-mark


------------------------------

Date: Thu, 13 Dec 2007 20:56:03 +0000
From: Big and Blue <No_4@dsl.pipex.com>
Subject: Re: Testing File Existence - best way?
Message-Id: <JOGdnfatf6L5AfzanZ2dnUVZ8v-dnZ2d@pipex.net>

still just me wrote:
> I need to test if a file exists. Is there a better technique than
> "attempt open and watch for an error"?

    Not if you actually intend to open it if you find it.  If you *really* 
just wish to know whether it exists then see the other response.


-- 
              Just because I've written it doesn't mean that
                   either you or I have to believe it.


------------------------------

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 1114
***************************************


home help back first fref pref prev next nref lref last post