Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!bu.edu!nntp-read!composer From: composer@chem.bu.edu (Jeff Kellem) Newsgroups: comp.lang.perl Subject: bug with combination of loops and mechanism Message-ID: Date: 2 Sep 90 07:10:43 GMT Sender: root@bu.edu.bu.edu Reply-To: composer@chem.bu.edu Organization: Boston University Chemistry Department Lines: 41 The following short script doesn't work properly in perl compiled with these configurations: perl 3.0 pl18: Sun 3, SunOS 4.0.3, cc, yacc perl 3.0 pl28: Sun 3, SunOS 4.0.3, gcc 1.37.1, bison 1.11 Encore Multimax, UMAX 4.2, gcc 1.37.1, bison 1.11 The script: #!/usr/bin/perl # while (1) { $dir=<~user>; print "DIR=$dir\n"; } prints, assuming `~user' == `/foo/bar', DIR=/foo/bar DIR= DIR=/foo/bar DIR= : : It seems that on every other iteration through the loop, no globbing is done (i.e. no exec of csh occurs). If you add a few more copies of the globbing line `$dir=<~user>;' in the script, you should notice the difference in speed between printing each line. Note that this also occurs when combined with other looping mechanisms, such as `foreach', `LABEL: BLOCK goto LABEL', etc. Any ideas, Larry? -jeff Jeff Kellem Internet: composer@chem.bu.edu