Did you already check perlvar?
Look for $. and $\.
But I wonder how you produce values separated with ; (semicolon), when you used , (comma) in your code? ;))
Update: example added:
#!/usr/bin/perl # vi:ts=4 sw=4 et: use strict; use warnings; while ( <DATA> ) { chomp; local $\ = $. % 5 ? ";" : "\n"; print; } __DATA__ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
In reply to Re: Concatenate every 5 lines of input with a comma.
by linuxer
in thread Concatenate every 5 lines of input with a comma.
by jsh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |