Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Easy way around this, but I want to understand why it is not working as I expect.
Outputs:#!/usr/bin/perl -w use strict; my @array = ( 'abc', 'def', 'ghi', 'jkl', 'mno', 'pqr', 'stu', 'vwx', 'yz ' ); print "@array[2,4]\n";
I want to get rid of the space, so I added:ghi mno
But there is still a space in the output. Why? And is there some clever way of getting rid of the space without the obvious method of combining the two elements in a temporary variable and printing that?local $, = undef;
|
---|
Back to
Seekers of Perl Wisdom