Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!execu!sequoia!painter From: painter@sequoia.execu.com (Tom Painter) Newsgroups: comp.lang.perl Subject: $& after a case-insensitive search Message-ID: <32947@sequoia.execu.com> Date: 26 Feb 91 23:31:10 GMT Organization: Execucom Systems Corp Lines: 38 I'm having a little problem with the $& notation. I haven't seen any mention of this in the book. It seems that the string that is matched is actually the string that appears in the script rather than the actual match from the input. This results in problems when there is a case difference. Observe: Input: This is in a file. THIS IS IN A FILE, TOO. Script: #! /usr/local/bin/perl -n m/FILE/i; print $` . $& . $'; Output: This is in a FILE. THIS IS IN A FILE, TOO. Note that the word file in the first line has changed case. #include Am I missing something? Is this fixed after PL41? Is there a work-around? Thanks Tom -- ----------------------------------------------------------------------------- Tom Painter UUCP: ...!cs.utexas.edu!execu!painter Execucom Systems Corp., Austin, Texas Internet: painter@execu.com (512) 327-7070 execu!painter@cs.utexas.edu Disclaimer: My Company? They'll claim all my waking hours, not my opinions. -----------------------------------------------------------------------------