--- "Kipp, James" <[EMAIL PROTECTED]> wrote:
> Why 'scalar <HEAD>' ??

If I may? =o)

> >   open HEAD, "< $file" or die "can't read $file: $!";

This makes HEAD a filehandle to the file.

   push @head, <HEAD>;
 
would put the filehandle access into a list context, and would try to
append the entire file to @head.

> >   for (1 .. 5) {
> >     push @head, scalar <HEAD>;  # first 5 lines
> >   }

This is a loop that counts lines that you want added, so you only want
one line added each time through the loop. 

  scalar <HEAD>

puts the filehandle access into a scalar context so that it will only
return one record each time. =o)



__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

Reply via email to