🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.perl.misc
Article #46

Writing to file?

#46
From: Zenin
Date: Wed, 06 Dec 1995 00:00
19 lines
910 bytes
I can't seem to figure out how to write to a file.
I thought it was somthing like
	write(FOO, "filename");

but I guess it's no so easy. :(

So what is the syntax to do somthing like:
	#!/usr/bin/perl
	open(FOO, "original_filename");
	while(<FOO>) {
		do some stuff;
	}
	write(FOO, "new_filename");
	close FOO;

TIA!

-Zenin
zenin@best.com
Technical Details
Message-ID: <4a54h9$a0g@shellx.best.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f9f6d,3944997a5420a56f,start
X-Google-Attributes: gidf9f6d,public
X-Google-Thread: fa0ae,3944997a5420a56f,start
X-Google-Attributes: gidfa0ae,public
X-Google-Thread: 112e82,3944997a5420a56f,start
X-Google-Attributes: gid112e82,public
From: Zenin <zenin@best.com>
Subject: Writing to file?
Date: 1995/12/06
Message-ID: <4a54h9$a0g@shellx.best.com>
X-Deja-AN: 121030290
organization: Rocky Horror, Barely Legal (Berkeley, CA)
newsgroups: comp.lang.perl.misc,best.unix,best.general