On Tue, May 10, 2005 at 10:03:57PM +0530, Madhur Kashyap wrote: > Can someone help me out with this simple code? It gives an error saying: > > Illegal division by zero at test.pl line 4. > Exit 255 > > Code: > --------------------------------------------- > #!/usr/local/bin/perl > sub test { > =09my @[EMAIL PROTECTED]; > =09my $div=3D$pars[0]/$par[1]; > =09print "Pars were @{_}\n"; > } > > test (1,2,3,4,5);
You've shot yourself in the foot by using neither the strict pragma nor the warnings pragma in your code. If you need urgent help, this is the best way to get it. Adding either pragma, or preferably both, will show you immediately where your problem lies. > Another silly question ... is it possible to use the regular > expressions capability of perl and combine it with C++ codes in some > fashion. I mean is it possible to write programs having both C++ and > perl code snippets. perldoc perlembed -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>