in reply to Re: (Ovid) Re: Web Initiated File Download
in thread Web Initiated File Download

THRAK asked:

What does the localization of $/ do?

As you probably know, $/ is the input record separator. Typically, this is set to the newline on the system the program runs on. This causes records to be read in "one line" at a time. However, since you intend to send all of this data straight to the browser, I thought it would be more efficient to use "slurp mode". By using local $/, the input record separator is undef and this causes the print to send the entire file without needing a while loop. However, I put $/ in its own scope to ensure that it would not clobber whatever value it had originally been set to, since this is a global variable.

Cheers,
Ovid

Vote for paco!

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

  • Comment on (Ovid) Re(3): Web Initiated File Download