in reply to trying to use join in a loop
Sorry did not make it clear what the output is. after the loop has completed and line
my $newfirst=(); for ( my $i=0;$i < $Numfirst;$i++) { #print "name part is ".ucfirst $nfirst[$i]."\n"; $newfirst .= join(" ",(ucfirst $nfirst[$i]) ); } print "new first name is $newfirst\n";
results in BillyBobAllan whereas code
my $NewFirst= join(" ", 'Billy', 'Bob', 'Allan'); print "new first name is $NewFirst\n";
results in Billy Bob Allan
|
|---|