Leaving asides the question of whether it is a good idea to use regex for this (and it is probably not), there are a couple of points about your one-liner.
First, you could rewrite a simpler form as follows:
perl -ne 'print if /[^"]$/' test.csv
The idea is that 'perl -ne' assigns each line to $_, which also happens to be the default variable for print and for regex matching. But that does not matter much, it is just a simplification.
The second point is that your regex is plain wrong (although I don't even know what you are really looking for): /[^"]$/ looks for (and your code will print) all lines that do not contain a double quote before a new line. /[^"] is a character class meaning any character but the double quote, and $/ is the input record separator, defaulted to new line if not specified otherwise.<trike>So, basically, your code prints any input line not ending with a double quote. This is very unlikely to be what you wanted.
Update: Stupid mistake on my part. I first typed that the regex was looking for a non double-quote at the end of a line, and then, while still typing, saw the / after the $ sign and thought, "oh, no, it is not end of line but input record separator", at the time I could no longer see the original post, so I made a wrong correction to what I had initially typed. My first impulse was of course the good one.
Having said that, it may not change that much to my conclusion. The regex is probably not doing what is wanted. Given the usual structure of a CSV, a closing quote means, in my mind, a quote closing a quoted string, not a quote ending the line. And the fact that the OP is getting all the lines printed seems to confirm this interpretation.
Now if the sentence "closing quote" meant a quote at the end of the line, then, of course, I am wrong on this, a regex would be an appropriate tool, and the regex might need an optional single or multiple space between the non quote character and the end of line, something like this: /^"\s*$/, and/or an optional end of line character. Well, anyway, difficult to say for sure without seeing a data sample.
In reply to Re: Trying to find missing closing quotes in CSV
by Laurent_R
in thread Trying to find missing closing quotes in CSV
by spstansbury
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |