CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
quick question about files

 



thangorn
stranger

Oct 18, 2001, 1:26 AM

Post #1 of 3 (567 views)
quick question about files Can't Post

Hi
can anyone tell me how to make a file in perl,
iv tried system (touch filename);
i know how to delete files, test files, move files etc etc,, but cant seem to find the answer to making files



mhx
Enthusiast / Moderator

Oct 18, 2001, 8:34 AM

Post #2 of 3 (561 views)
Re: quick question about files [In reply to] Can't Post

You could use open:

Code
open FILE, ">file.txt" and close FILE 
or die "couldn't create file.txt: $!\n";

This will create an empty file file.txt.
Hope this helps.

-- Marcus


Code
s$$ab21b8d15c3d97bd6317286d$;$"=547269736;split'i',join$,,map{chr(($*+= 
($">>=1)&1?-hex:hex)+0140)}/./g;$"=chr$";s;.;\u$&;for@_[0,2];print"@_,"



thangorn
stranger

Oct 18, 2001, 10:32 AM

Post #3 of 3 (558 views)
Re: quick question about files [In reply to] Can't Post

hhmm, that was the first thing i tried,,, must have made a crazy typo or something,,, Thanks anyway


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives