in reply to Re: $" seems not to be working
in thread $" seems not to be working
or{ local $, = "|"; print @record[1..$fields]; }
The default value of $" is a space, of $, it's the empty string — or undef, same thing here (no warnings).{ local $" = "|"; print "@record[1..$fields]"; }
Note that the subscript of an array or a hash, or a ditto slice, is still evaluated as Perl code, at the time of interpolation. Thus, you can do calculations etc. there. Like:
@number = qw(zero one two three four five six seven eight nine ten); print "The sum of $number[1] and $number[2] is $number[1+2].\n";
The module Interpolation makes use of this little fact.
|
|---|