With this i can only display the contents of the file on standard output line by
line.
but i won't get any scrolling facility for large files.

Prachi.




Philip Tellis <[EMAIL PROTECTED]> on 11/27/99 03:08:18 AM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:    (bcc: Prachi Kulkarni/Systems/NSEIL)
Subject:  Re: [ILUG-BOM] To view the file




> There are some commands to open a file .. and read the stuff into an array
> and manipulate the contents .. sentence by sentence or word by word ..
>
> < pseudocode >
> open (FILE,"< test.txt",r)
> loop here
> @myarray=read(FILE)
> loop end till eof ..
> </pseudocode>
> Regards
> Sandesh
> Check out perldoc command ..
> perldoc -f read
> perldoc -f == > for function based help ..


The perl syntax for opening a file and reading it is::

open(HANDLE, "filename");
@lines=<HANDLE>;
close(HANDLE);
foreach $line (@lines) {
     # do something other than just displaying
}

HTH.

Philip


To subscribe / unsubscribe goto the site www.ilug-bom.org ., click on the
mailing list button and fill the appropriate information
and submit. For any other queries contact the ML maintener







To subscribe / unsubscribe goto the site www.ilug-bom.org ., click on the mailing list 
button and fill the appropriate information 
and submit. For any other queries contact the ML maintener

Reply via email to