2009/8/7 jet speed <speedj...@googlemail.com>: > Hi, > > I would like to join the $abc with ':' the final desired output 1:2:3:4:5 > > #!/usr/bin/perl > > use strict; > use warnings; > > my $abc = "1 2 3 4 5"; > my $out = join ':', $abc; > print "$out"; >
join works on arrays (LIST). You feeding it a scalar. @abc = qw/1 2 3 4 5/; print join ':', @abc; Should work. See perldoc -f join for more details. Dp. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/