perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerald Richter" <rich...@ecos.de>
Subject Re: Writing to a file
Date Fri, 05 Dec 2003 11:55:26 GMT
Pete Moran wrote:
> Since I have upgraded from 1.3 to 2.0, I dont seem to be able to write
> to a file
>
> [-
> open(TMP, "> /tmp/test");
> print TMP "THIS IS A TEST";
> close TMP;
>
>
> -]
>
> Results in 0 byte file being created any ideas why ?
>

The code looks ok, this should work with 2.0 without problems.

Maybe there is a permission problem. It's always a good idea to check return
values e.g.

open(TMP, "> /tmp/test") or die "cannot open ($!)" ;

Gerald




--------------------------------------------------------------
Gerald Richter     ecos electronic communication services gmbh
IT-Securitylösungen * dynamische Webapplikationen * Consulting

Post:       Tulpenstrasse 5          D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de          Voice:   +49 6133 939-122
WWW:        http://www.ecos.de/      Fax:     +49 6133 939-333
--------------------------------------------------------------
|
|   ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
|
+-------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message