Cmdr_Tofu has asked for the wisdom of the Perl Monks concerning the following question:
This fails like I thought it should because /tmp/tmp/tmp does not exist, and my message is printed. The directory needs to be made before we can create files there. Under Windows, similar code:#!/usr/local/perl-5.6.1/bin/perl use strict; $|=1; eval { open (FOO,">/tmp/tmp/tmp/tmp") ||die print FOO "hello"; close FOO; }; if ($@) { print "open failed $@"; } me@unixsystem:/tmp# ./fp.pl open failed Died at ./fp.pl line 6.
Runs successfully (does not print error message) when the c:\gpp\gpp directory does not exist. It does not create any file either. If I try and open a file on an q:\gpp\gpp (in this case an unmapped drive), it does actually die and trigger my error message.use strict; $|=1; eval { open (FOO,">c:\gpp\gpp\gpp") ||die; print FOO "hello"; close FOO; }; if ($@) { print "open failed $@"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: inconsistency with ActiveState's open?
by dreadpiratepeter (Priest) on Jul 14, 2003 at 14:50 UTC | |
|
Re: inconsistency with ActiveState's open?
by Thelonius (Priest) on Jul 14, 2003 at 14:51 UTC | |
|
Re: inconsistency with ActiveState's open?
by davorg (Chancellor) on Jul 14, 2003 at 14:52 UTC | |
by tye (Sage) on Jul 14, 2003 at 16:41 UTC | |
by Cmdr_Tofu (Scribe) on Jul 14, 2003 at 14:57 UTC | |
|
Re: inconsistency with ActiveState's open?
by halley (Prior) on Jul 14, 2003 at 15:50 UTC |