On Fri, Jul 29, 2011 at 04:05:26PM +0200, Dr.Ruud wrote:
> On 2011-07-28 00:45, C.DeRykus wrote:
>
> > open( ... ) or warn "..." and return;
>
> Here you are assuming that warn always returns true. It actually
> does, even if the device that it write to is full, but I don't think
> that is
On 2011-07-28 00:45, C.DeRykus wrote:
open( ... ) or warn "..." and return;
Here you are assuming that warn always returns true. It actually does,
even if the device that it write to is full, but I don't think that is
documented ...
--
Ruud
--
To unsubscribe, e-mail: beginners-uns
On Wed, Jul 27, 2011 at 9:30 AM, Rob Dixon wrote:
> What exactly is wrong with "or do {...}"?
>
> I believe it is the best option simply because is is comparable to the
> common "open ... or die $!" idiom. The do is there only so that a
> warning can be issued as well as the return
There's nothin
On Jul 27, 9:30 am, rob.di...@gmx.com (Rob Dixon) wrote:
> ...
> > Well, one thing I dislike about it is that it is using "or do {...}"
> > instead of
> > an "if ( ) { ... }". And I did mention something similar.
>
> What exactly is wrong with "or do {...}"?
>
> I believe it is the best option sim
On 27/07/2011 08:51, Shlomi Fish wrote:
On Tue, 26 Jul 2011 16:58:47 +0100 Rob Dixon wrote:
On 26/07/2011 16:39, Nikolaus Brandt wrote:
On Tue, Jul 26, 2011 at 01:01:54PM +0300, Shlomi Fish wrote:
Another option would be to use eval { ... } and $@ to trap exceptions:
Thank you all for the
Hello Nikolaus Brand,
You can try these:
1. ) Instead of "die" in your code use "warn", then return from the
subroutine,
2.) Intstead of hard coding the path and file in your program i.e
["$basedir/$userdir/$outfile" ], ask the user to input the path and file,
assign the input to a scalar and check
Hi Rob,
On Tue, 26 Jul 2011 16:58:47 +0100
Rob Dixon wrote:
> On 26/07/2011 16:39, Nikolaus Brandt wrote:
> > On Tue, Jul 26, 2011 at 01:01:54PM +0300, Shlomi Fish wrote:
> >>
> >> Another option would be to use eval { ... } and $@ to trap exceptions:
> >
> > Thank you all for the replies.
> >
>
On 26/07/2011 16:39, Nikolaus Brandt wrote:
On Tue, Jul 26, 2011 at 01:01:54PM +0300, Shlomi Fish wrote:
Another option would be to use eval { ... } and $@ to trap exceptions:
Thank you all for the replies.
I used the above mentioned eval-$@ solution which was absolutely working fine.
I t
Hi,
On Tue, Jul 26, 2011 at 01:01:54PM +0300, Shlomi Fish wrote:
> Hi Nikolaus,
>
> On Tue, 26 Jul 2011 11:32:19 +0200
> Nikolaus Brandt wrote:
>
> > Hi,
> >
> > I'm currently writing a script which contains a subroutine to write
> > data to files.
> > Currently I use
> > open $fh, '>', "$base
Nikolaus Brandt wrote:
Hi,
Hello,
I'm currently writing a script which contains a subroutine to write
data to files.
Currently I use
open $fh, '>', "$basedir/$userdir/$outfile" or die "Can't write: $!\n";
which has the disadvantage, that the whole script dies if e.g. the
userdir is not availa
El 26/07/2011 12:01, Shlomi Fish escribió:
Another option would be to use eval { ... } and $@ to trap exceptions:
http://perl-begin.org/tutorials/perl-for-newbies/part4/#page--exceptions--DIR
Important to remember that "open" won't raise an exception if you are
not using the "autodie" pragma
Hi Nikolaus,
On Tue, 26 Jul 2011 11:32:19 +0200
Nikolaus Brandt wrote:
> Hi,
>
> I'm currently writing a script which contains a subroutine to write
> data to files.
> Currently I use
> open $fh, '>', "$basedir/$userdir/$outfile" or die "Can't write: $!\n";
> which has the disadvantage, that th
Hi,
I'm currently writing a script which contains a subroutine to write
data to files.
Currently I use
open $fh, '>', "$basedir/$userdir/$outfile" or die "Can't write: $!\n";
which has the disadvantage, that the whole script dies if e.g. the
userdir is not available.
Could you give me an advise
13 matches
Mail list logo