[OT] Perl Question
Sean
picasso@madflower.com
Mon, 27 Mar 2000 20:17:09 -0500 (EST)
You can also use a foreach. I usually use an html template with
places for the variables and do a substition for the data. It might be a
bit more processor intensive, but its a lot easier to maintain since you
can still pull the html file into the html editor of your choice.
On Mon, 27 Mar 2000, Dan Nguyen wrote:
> On Mon, Mar 27, 2000 at 07:53:34PM -0500, Benjamin Minshall wrote:
> > Greetings:
> > While Not EOF
> > {
> > get line from text file; # Syntax in Perl?
> > do HTML FUBARing on text line
> > output HTML_STUFF
> > }
> >
> > My question is: How can I read lines like this in Perl? I've got
> > everything else
> > covered. Thanks.
>
> open FILE, "foobar" or die "$!";
>
> while (<FILE>) {
> print '$_ will contain your line: ', $_;
> }
>
> or if you don't like having it in $_,
>
> while (defined($variable = <FILE>)) {
> print '$variable will contain our line: ', $variable;
> }
>
>
> --
> Dan Nguyen | It is with true love as it is with ghosts;
> nguyend7@msu.edu | everyone talks of it, but few have seen it.
> dnn@debian.org | -Maxime De La Rochefoucauld
>
> _______________________________________________
> linux-user mailing list
> linux-user@egr.msu.edu
> http://www.egr.msu.edu/mailman/listinfo/linux-user
>