I had a lengthy debugging session with a friend on why -w suddenly
warned where it didn't before.

The test case was something like this:

| while(<SERVER>) {
|     print;
|     if(/^([^\s]+\s+)?PING(\s+.*)$/) {
|       print SERVER "${1}PONG${2}\r\n";
|     }
| }

where the input line was "PING :foo\r\n", i.e. $1 is undef, and should
warn.

The shortest test case i found is:

| ice:~>echo a |perl5.6.1 -we 'print "$1"'
| Use of uninitialized value in string at -e line 1.
| ice:~>echo a |perl5.6.1 -we 'print "$1\n"'
| 
| ice:~>echo a |perl5.6.1 -we 'print ".$1\n"'
| Use of uninitialized value in concatenation (.) or string at -e line 1.
| .

just for a quick check, my normal perl behaves as expected:

| ice:~>echo a |perl5.00503  -we 'print "$1\n"'
| Use of uninitialized value at -e line 1.

Now if somebody could explain to me how and why this happens?

CU,
    Sec
-- 
See above, IŽd vote now to remove TCP completely after seeing that results.
                    -- <[EMAIL PROTECTED]> on freebsd-ports, 2.Aug.1997

Reply via email to