Chas. Owens wrote:
On Mon, Apr 13, 2009 at 15:39, Rick <rich.j...@gmail.com> wrote:
perl -lane' print "$F[0] ", "$F[4]" , " $F[5]";'

Is there anyway to incoporate $\ <- output record separtor to do this
instead of printing out w/ manual spaces beteween the variables?
snip

No, you want to use $, or $".  Since $" is already set to a space, you
should probably use it:

perl -lane 'print "@F[0,4,5]"'

You can get it even shorter using -p:

perl -lape '$_="@F[0,4,5]"'


I forgot about putting " " around @F[0,4,5] and therefore it didn't have spaces between the items.. thanks!!

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to