Join the result of the split function : join « String « Perl






Join the result of the split function

    


#!/usr/bin/perl -w

use strict;

my $passwd = "A:B:C:D::/value1/value2:/value3";
my @fields = split /:/, $passwd;

my $passwd2 = join "#", @fields;
print "Original password : $passwd\n";
print "New password :      $passwd2\n";

   
    
    
    
  








Related examples in the same category

1.Join strings
2.Takes its input and joins it into a single string.
3.Join the mapped value
4.Join variables
5.Join with
6.Join with 'map chr'
7.Join with 'map lc'
8.Joining string with empty string