in reply to perl one liner

my ($day,$month,$year) = split("/",$date);

Replies are listed 'Best First'.
Re^2: perl one liner
by johngg (Canon) on Apr 02, 2009 at 15:42 UTC
    my ($day,$month,$year) = split("/",$date);

    I think that code is answering a different question, but you could have answered the OP's one by adding a join.

    my $var1 = q{10/02/2009}; my $var2 = join q{}, split m{/}, $var1;

    Another way would be to use tr, for details look in Quote Like Operators;

    my $var1 = q{10/02/2009}; ( my $var2 = $var1 ) =~ tr{/}{}d;

    I hope this is of interest.

    Cheers,

    JohnGG

    Update: Added my declarations to second code snippet.