in reply to Join without space in this perl script

print join '|', "@fields[0,1]\n"

Running join on a scalar string like that will have no effect. You should join a list instead.

#!/usr/bin/perl use strict; use warnings; my @fields = qw/foo bar baz/; print join ('|', @fields[0,1]) . "\n";

Replies are listed 'Best First'.
Re^2: Join without space in this perl script
by utpalmtbi (Acolyte) on Nov 19, 2016 at 10:24 UTC
    right.. Thank you !!