20 pts.
 Perl subroutine needs reference?
(Sorry about dropping line feeds. "How to use editor" does not open. Is there a manual html-type insertion I can use, like ?) With string: my $kp = "(@array[$i1]*@array2[$i2])*(@array3[$i3]*@array[$i4])"; @array elements are those strings to find: ee, sd .. etc, in the sub tt3' regex substitutions below. I want to tt3($kp), as other similar tt3($kp1), tt3($kp2), ..., in the currently faulty below subroutine. It now produces: # ERROR: Too many arguments for main::ttt3 at ./c.pl line 253, near "$kp)" sub ttt3 { my($input) = @_; # tried: # $input = eval($input); # $kin = eval($kin); my($kin) = $input; $kin =~ s/ee/e2/g; $kin =~ s/zd/zn/g; $kin =~ s/zt/zm/g; $kin =~ s/zq/zr/g; $kin =~ s/zc/zL/g; $kin =~ s/sd/s2/g; $kin =~ s/st/sm/g; $kin =~ s/sc/sL/g; return($kin); } sub tt3 needs reference? how? where?  

Software/Hardware used:
perl Suse asus901
ASKED: December 11, 2012  9:57 PM
UPDATED: December 12, 2012  1:17 PM

Answer Wiki:
With string:   my $kp = "(@array[$i1]*@array2[$i2])*(@array3[$i3]*@array[$i4])"; @array elements are those strings to find: ee, sd .. etc, in the sub tt3' regex substitutions below. I want to tt3($kp), as other similar tt3($kp1), tt3($kp2), ..., in the currently faulty below subroutine. It now produces: # ERROR: Too many arguments for main::ttt3 at ./c.pl line 253, near "$kp)" sub ttt3 { my($input) = @_; # tried: # $input = eval($input); # $kin = eval($kin); my($kin) = $input; $kin =~ s/ee/e2/g; $kin =~ s/zd/zn/g; $kin =~ s/zt/zm/g; $kin =~ s/zq/zr/g; $kin =~ s/zc/zL/g; $kin =~ s/sd/s2/g; $kin =~ s/st/sm/g; $kin =~ s/sc/sL/g; return($kin); } sub tt3 needs reference? how? where?
Last Wiki Answer Submitted:  December 12, 2012  1:18 pm  by  Michael Tidmarsh   11,380 pts.
All Answer Wiki Contributors:  Michael Tidmarsh   11,380 pts. , timesperl   20 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _