On 8/27/07, Mihir Kamdar <[EMAIL PROTECTED]> wrote:
snip
> > > my %prefix_to_rate = (
> > >         12   => 0.30,
> > >         1234 => 0.35,
> > >         134  => 0.50,
> > >         44   => 0.70
> > > );
snip
> my %prefix_to_rate = (
>        '+12'   =>0.30,
>        '+1234' =>0.35,
>        '+134'  =>0.50,
>        '+44'   =>0.70
> );
snip
>                     my $key = substr $cdr[3], 1, $len;
snip

Your substr should use 0 instead of 1.  If you look back at my example
you can see that the string the corresponds to your $cdr[3] had + at
the start, but my keys did not.  This is because I was using an offset
of 1 which is the second character (i.e. the character after the +).

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to