I recommend reviewing your course notes. You can approach the problem using index, Regular Expressions, or with the following code:
$line = " This is the test line"; $* = 'line'; # prepare Perl for treating 'line' @${*} = grep { !m!\s! } split //, reverse (''.$${*}); shift @{$*} while @{$*} > $[ +1; print $line[-1], " is the first character.\n";
In reply to Re: find the starting character position in a line
by Corion
in thread find the starting character position in a line
by hifirock
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |