At 01:13 AM 1/27/02 +0800, byron wrote: >i've been playing with -F and getting stuck. > >i have a script looking like > >#!/usr/bin/perl -naF// >print "$#F\n"; > >it should print the length of each line of the passed file. > >running it as > >$ echo "word" | ./F >4 > >works. but if i run it as > >$ echo "word" | perl F >syntax error at F line 2, near "print" >Execution of F aborted due to compilation errors. > >i've read perlrun many times, and played around with the #! line, but i can't >get it to work if called using the second method. > >is someone able to explain what's going on, please?
I believe it's a bug; I was only able to get around it by putting a null character after the // on the first line. This gives away part of my solution to gs.pl but since I'm nowhere near the lead so what :-) BTW, you'll find some interesting output if you put -MO=Deparse and experiment -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com