<IN>; # skip "--start of file--" while( <IN> ) { if( $_ eq "#:lav\n" ) { local $/= "#:eof\n"; my $block= <IN>; # ... process $block here ... } elsif( $_ eq /^--end of file--/ ) { warn "Unexpected line: $_"; } }
Updated: Thanks to graff for noting that I wrote $\ when I meant $/.
- tyeIn reply to Re^3: weird perl verion and/or OS problem with newlines (tye)
by tye
in thread weird perl verion and/or OS problem with newlines
by vinforget
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |