From: darren kirby Date: 2006-06-11T03:13:30+09:00 Subject: Global not evaluated properly in 'if' statement modifier --nextPart1896045.nd1QrZWQCd Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello all, I am scratching my head over this one. I have a method: def dispatchFile(file) song =3D Convert.new(file) case type when 'ogg' song.oggToWav song.wavToOgg if $outtype =3D=3D 'ogg' song.wavToMp3 if $outtype =3D=3D 'mp3' song.wavToM4b if $outtype =3D=3D 'm4b' song.wavToFlac if $outtype =3D=3D 'flac' when 'mp3' end end When I run this code the 'if's are never evaluated. That is, I have printed= =20 $outtype, and it has a valid value, but the second method which matches the= =20 value never runs. If I comment out the 'if' and run the two methods manuall= y=20 it works fine. In my tests $outtype's value is 'mp3', so why doesn't song.wavToMp3 run? What am I missing? Thanks for consideration, =2Dd =2D-=20 darren kirby :: Part of the problem since 1976 :: http://badcomputer.org "...the number of UNIX installations has grown to 10, with more expected..." =2D Dennis Ritchie and Ken Thompson, June 1972 --nextPart1896045.nd1QrZWQCd Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) iD8DBQBEiwupwPD5Cr/3CJgRAqkBAKDbztjGvQnr4HqgddvbxDLjHyoLMgCfZWYD ZNRcS9WzKNr2EOVRDWylP6M= =Yvim -----END PGP SIGNATURE----- --nextPart1896045.nd1QrZWQCd--