In addition to what Corion has imparted; once you understand what was causing the error - here is a one-liner you may use that echoes input to filename.txt and stops when a blank line is entered:
perl -pe "last if /^\s*$/" > filename.txt
In reply to Re: uninitialized value $_
by shadowsong
in thread uninitialized value $_
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |