Re: more on warn .. is next necessary

2004-03-31 Thread Jenda Krynicky
From: Harry Putnam <[EMAIL PROTECTED]> > I wasn't able to really understand perldoc -f warn. > > I'm doing > use File::Find; > open(FILE,"<$File::Find::name")or warn "blah blah: $!"; > > Two things I'm unsure of: > > 1) is the `: $!' meaningfull here? > 2) do I need a `next;' following to make `

Re: more on warn .. is next necessary

2004-03-29 Thread Harry Putnam
"Wiggins d'Anconia" <[EMAIL PROTECTED]> writes: [...] > if you don't mind dieing, or I often prefer using 'unless' then I > don't need to worry about a dangling else, so similar to what you have > above, In this case I do. > > unless (open(FILE, "<$file")) { >warn "Failed open: $!"; >re

Re: more on warn .. is next necessary

2004-03-29 Thread Wiggins d'Anconia
Harry Putnam wrote: "John W. Krahn" <[EMAIL PROTECTED]> writes: If so, how do I let the `next' know that open has failed? That is, how do I test exit status of open function? open() returns true on success and undef (false) when it fails. Is it just as in shell programing ($?)? No. ok, then

Re: more on warn .. is next necessary

2004-03-29 Thread Harry Putnam
"John W. Krahn" <[EMAIL PROTECTED]> writes: >> If so, how do I let the `next' know that open has failed? >> That is, how do I test exit status of open function? > > open() returns true on success and undef (false) when it fails. > > >> Is it just as >> in shell programing ($?)? > > No. ok, then h

Re: more on warn .. is next necessary

2004-03-29 Thread John W. Krahn
Harry Putnam wrote: > > I wasn't able to really understand perldoc -f warn. > > I'm doing > use File::Find; > open(FILE,"<$File::Find::name")or warn "blah blah: $!"; > > Two things I'm unsure of: > > 1) is the `: $!' meaningfull here? Yes. > 2) do I need a `next;' following to make `File::Fi

more on warn .. is next necessary

2004-03-29 Thread Harry Putnam
I wasn't able to really understand perldoc -f warn. I'm doing use File::Find; open(FILE,"<$File::Find::name")or warn "blah blah: $!"; Two things I'm unsure of: 1) is the `: $!' meaningfull here? 2) do I need a `next;' following to make `File::Find' go on to the next found file? If so, how do I