Subject: | How to make this work in older versions of perl |
My perlapp 5.8.8 gives this error:-
Bareword found where operator expected
at /<C:\skypestat.exe>Win32/Skype.pm line 183, near "} case"
Here is a diff of the fix:-
*** Skype-old.pm 2010-11-16 15:49:29.093750000 +0000
--- Skype.pm 2010-11-16 23:58:36.281250000 +0000
***************
*** 1,5 ****
package Win32::Skype;
- # use 5.010000;
use 5.006;
use strict;
--- 1,4 ----
***************
*** 179,195 ****
for ( split //, $dtmf ) {
! switch ( $_ ) {
!
! case /[A-Ca-c]/ { $call->{DTMF} = 2; }
! case /[D-Fd-f]/ { $call->{DTMF} = 3; }
! case /[G-Ig-i]/ { $call->{DTMF} = 4; }
! case /[J-Lj-l]/ { $call->{DTMF} = 5; }
! case /[M-Om-o]/ { $call->{DTMF} = 6; }
! case /[P-Sp-s]/ { $call->{DTMF} = 7; }
! case /[T-Vt-v]/ { $call->{DTMF} = 8; }
! case /[W-Zw-z]/ { $call->{DTMF} = 9; }
! else { $call->{DTMF} = $_; }
!
! }
}
--- 178,191 ----
for ( split //, $dtmf ) {
! $call->{DTMF}=
! /[A-Ca-c]/ ? 2 :
! /[D-Fd-f]/ ? 3 :
! /[G-Ig-i]/ ? 4 :
! /[J-Lj-l]/ ? 5 :
! /[M-Om-o]/ ? 6 :
! /[P-Sp-s]/ ? 7 :
! /[T-Vt-v]/ ? 8 :
! /[W-Zw-z]/ ? 9 :
! $_;
}
***************