Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks,
I am pretty new to Perl. Kindly answer me if any of you can... :)
I have 2 questions today,
Question #1:
$check = "a"; $check++; print $check; exit;
This will give me answer as "b", but what should i do to get "d" or "e" (I mean to pass over 3 or 4 alphabets).
Question #2:
I have a string which have 2 alphabets, I need to trim it to 1 alphabet, ie, I only want the right alphabet, the left one should be trimmed out.
Example
$input= "ab"; $output = "b";
The alphabets can be any, not just "ab", it can be "cd" or "sp", In that case output should be "d" & "p" resp.
Thank you, Monks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: 2 basic questions
by tobyink (Canon) on Apr 29, 2013 at 13:55 UTC | |
by Anonymous Monk on Apr 29, 2013 at 14:50 UTC | |
|
Re: 2 basic questions
by choroba (Cardinal) on Apr 29, 2013 at 14:00 UTC | |
|
Re: 2 basic questions
by toolic (Bishop) on Apr 29, 2013 at 13:56 UTC | |
by Anonymous Monk on Apr 29, 2013 at 14:54 UTC | |
|
Re: 2 basic questions
by ww (Archbishop) on Apr 29, 2013 at 14:14 UTC | |
by Anonymous Monk on Apr 29, 2013 at 14:53 UTC | |
|
Re: 2 basic questions
by karlgoethebier (Abbot) on Apr 29, 2013 at 14:35 UTC | |
|
Re: 2 basic questions (perlintro)
by Anonymous Monk on Apr 29, 2013 at 13:56 UTC | |
|
Re: 2 basic questions
by Random_Walk (Prior) on Apr 29, 2013 at 14:58 UTC |