Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!uunet!munnari.oz.au!yarra-glen.aaii.oz.au!pem From: pem@yarra-glen.aaii.oz.au (Paul E. Maisano) Newsgroups: comp.lang.perl Subject: interesting JAPH -- weird bug (or feature :-) Message-ID: <1991Apr25.014633.20386@yarra-glen.aaii.oz.au> Date: 25 Apr 91 01:46:33 GMT Organization: Australian Artificial Intelligence Institute Lines: 20 This JAPH runs on my sparc, SUNOS4.1.1, perl 4.003 (I think you have to save it to a file, though) ----- #!/usr/local/bin/perl $_ = ">/dev/tty"; length < 0 && /bin/echo Just another perl hacker $_ ----- If I use "length($_)" instead, then perl behaves as it should. I normally don't use "length" without an argument since I've seen it cause problems before (because of precedence) but I'm intrigued by what is going on here. Why is the stuff after "&&" being passed to the shell? If I add any other lines to the end of the code, perl won't digest it. It does not happen if I change the "< 0" to a "> 0" either. --- Paul Maisano