opening a file




I thought I would use perl instead of fortran to parse a text file, what
with the new m// s/// capabilities at my fingertips.

So it is that I need to open a text file and send it to STDOUT. This may
come across as a contemptable FAQ to some. I've just looked at all the
entries with the string 'file' beginning them in the index of the camel
book, and it's huge and ambiguous to a guy who is not in the native perl
environment, ie, a server, but simply needs to get a little io on windows.

This is what I have so far:

use strict;
use warnings;


my $divider= "%\n" # a percentage sign and a newline


# perl scraper1.pl

In fortran, the snippet would be:

open(unit=50,file='ehp3.txt',form='formatted')
do
read(50,*,iostat=eof) line
if (eof /= 0) exit
write(*,*) trim(line)
end do
close(unit=50)

Thanks for your comment.
--
George

It's going to be the year of the sharp elbow and the quick tongue.
George W. Bush

Picture of the Day http://apod.nasa.gov/apod/
.



Relevant Pages

  • Re: convert f77 code from mixed case to lower case
    ... If you like, you can offer a Fortran program that does the job, and I will ... offer a Perl script. ... language being better than the other for the task. ... quite sure I could become fluent in Perl, ...
    (comp.lang.fortran)
  • Re: convert f77 code from mixed case to lower case
    ... If you like, you can offer a Fortran program that does the job, and I will ... offer a Perl script. ... language being better than the other for the task. ... quite sure I could become fluent in Perl, ...
    (comp.lang.fortran)
  • Re: Upgrading an OLD (Fortran Powerstation 4.0) compiler
    ... a local web/CGI server in only 51 lines! ... Will the same Perl script work on both Windows and Linux? ... One idea that I had was to use HTML forms to ... > the Fortran. ...
    (comp.lang.fortran)
  • Re: opening a file
    ... That's what they say about fortran, is that you do it in any syntax. ... there's one line in a perl script. ... I believe the most solemn duty of the American president is to protect the ...
    (comp.lang.perl.misc)
  • Re: opening a file
    ... I thought I would use perl instead of fortran to parse a text file, ... perldoc -f print ... end module arjen2 ...
    (comp.lang.perl.misc)