in reply to Re^9: how to create a perl program using filehandle and streams ?
in thread how to create a perl program using filehandle and streams ?
I have created following code to display hello! on command line screen
use strict; use warnings; use diagnostics; open (DOG, ">not.txt") or die ("Cannot open not.txt"); print DOG "hello!"; open (DOG, "<not.txt") or die ("Cannot open not.txt"); while(<DOG>){ print;} close (DOG);
And with previous code
use strict; use warnings; use diagnostics; open (DOG, ">not.txt") or die ("Cannot open not.txt"); print DOG "hello!"; close (DOG);
I was thinking that the code only creates file and doesnot display contents of file on the command line screen.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^11: how to create a perl program using filehandle and streams ?
by marto (Cardinal) on Apr 01, 2011 at 12:22 UTC |