I got it to work after adding a new var in apache modperl environment.
This works:
$acct_no = $xgi->param("acct_no");
print substr($acct_no, 0, 4, "x" x (length($acct_no)-4));
This did NOT work:
print substr($xgi->param("acct_no"), length($xgi->param("acct_no"))-4,4);
Any explanation would be great.
-rkl
I tried to save a line by using
> On Sep 27, [EMAIL PROTECTED] said:
>
>>> substr($string, 0, -4, "x" x (length($string) - 4));
>>
>>I couldn't get this to work correctly. it only returns the 4 characters
>> of
>>the string whcih is correct. But it did not replace the preceding
>>characters with xxxx.
>
> It works for me:
>
> [EMAIL PROTECTED] [11:47am] ~ #103> perl -l
> $string = join '', .. 9;
> substr($string, 0, -4, "x" x (length($string) - 4));
> print $string;
> __END__
> xxxxxx6789
>
> --
> Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
> RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
> <stu> what does y/// stand for? <tenderpuss> why, yansliterate of course.
> [ I'm looking for programming work. If you like my work, let me know. ]
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]