opening a file

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

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

In fortran, the snippet would be:

    read(50,*,iostat=eof) line
   if (eof /= 0) exit
     write(*,*) trim(line)
 end do

Thanks for your comment.

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

Picture of the Day /

Site Timeline