im butchering a public script i found on the internet for purpose of doing
a CGI file upload.

theres one excerpt from the script that ive never used before.  the few
lines...

while ( <$upload_filehandle> ) {
   print UPLOADFILE;
}

if it were me, i would not write code this way, i write in a way that make
it easier for me to quickly understand what i was trying to do.  if it were
me coding this in my 'lame' (for idiots) way, it would look more like...

while ( $data = <$upload_filehandle> ) {
   print UPLOADFILE $data;
}

but now that ive seen the code, as originally presented, it does cause me
to ask the question...

how does one know under what set of circumstances can such 'abbreviated'
code be written?  in other words, how can one know what kinds of features
or operations can use the implied variable @_ (which I assume is the
variable that would be used in this case).

specifically, if i wanted to append to a variable
$aggregated_file_contents, each new block of the file as it was being read
and output...

my thought was to try:

while ( <$upload_filehandle> ) {
   print UPLOADFILE;
   $aggregated_file_contents.=;
}

as opposed to what i would have normally done ($aggregated_file_contents .=
$data;)

yes, i know i can simply try it, to see if it works - but is there a more
general rule one can follow that tells them when this kind of thing can
normally be used, versus when not?

thanks alot for any insights here

greg
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to