selva has asked for the wisdom of the Perl Monks concerning the following question:
How to substitute and store the result in different variable in the same line .
Ex : $var1 = "10/02/2009";
I have to remove the "/" in the above variable and store in to different variable .
I tried following one , but it is returning substitution status only.
($var2) = ( $var1 =~ s!/!!);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl one liner
by lakshmananindia (Chaplain) on Apr 02, 2009 at 13:40 UTC | |
|
Re: perl one liner
by moritz (Cardinal) on Apr 02, 2009 at 13:41 UTC | |
|
Re: perl one liner
by eff_i_g (Curate) on Apr 02, 2009 at 13:41 UTC | |
|
Re: perl one liner
by shmem (Chancellor) on Apr 02, 2009 at 13:42 UTC | |
|
Re: perl one liner
by Bloodnok (Vicar) on Apr 02, 2009 at 14:28 UTC | |
|
Re: perl one liner
by irah (Pilgrim) on Apr 02, 2009 at 13:43 UTC | |
by johngg (Canon) on Apr 02, 2009 at 15:42 UTC |