Re: homework questions

Shirley Browne (browne@cs.utk.edu)
Mon, 11 Sep 1995 08:31:34 -0400


Melanie,

>Question number three says to write a perl statement to match the anchor
>element in $_. I'm assuming that $_ is a line of input. Is this correct?
>Also...what exactly is the anchor element? Is this just the first or last
>element of the line $_? How do I interpret this?

Do not assume that $_ is a single line of input.
Although $_ is often used to hold the current line of input,
this is not necessarily the case. I should have been more clear,
but in question 3, I intended that $_ might include newlines.
For example, the following Perl fragment would read an entire file
into $_:

while ($line = <>) {
$_ = $_ . $line;
}

Pattern matches always work on $_ by default, however, if no other
variable is specified.

Sorry, I should have said HTML anchor element -- e.g.,
<A HREF="http://www.cs.utk.edu/~cs494/">CS494 Home Page</A>

Hope this clarifies question 3.
Don't hesitate to ask if you have further questions.

Dr. Browne