in reply to Data length in strings

Setting $/ to undef is good, but it won't exactly what the person asked for, namely, concatenate a space between each record. Only the join ' ', <> idiom will do that.

Be that as it may, I think using <> in array context is going to build up a huge AV temporary (Perl's internal representation of an array). Also, I have a sneaking suspicion the person would also like to get rid of the newlines of each record, in which case one would do something like:

my $foo; while( <> ) { chomp; # maybe, maybe not, depending on the circumstances if( defined( $foo )) { $foo .= " $_"; } else { $foo = $_; } }
--
g r i n d e r