in reply to Store and match

In general, you might like to have a look at the format, also the assignment in while ($_=<DATA>)... is superfluous - while (<DATA>)... does exactly the same thing.

As to the exact problem, using strictures would have given you a clue to solving the problem since, assuming you rewrite $x =~ /^\[Note\](\w+)/; to my $x =~ /^\[Note\](\w+)/; (to remove the undeclared variable error that would otherwise ensue), you would have seen a use of uninitialised value in pattern match... error, the solution to which is (my $x = $_) =~ /^\[Note\](\w+)/;.

Having done all that, you can then go on to solve the problem of extracting the value from the field - maybe along the lines of $x =~ s/[^,]*,//;, so the final code should, IMO, look like:

<p>#!/usr/bin/perl use warnings; use strict; while (<DATA>){ (my $x = $_) =~ /^\[Note\](\w+)/; $x =~ s/[^,]*,//; print $x; } __DATA__ [Note]note_values,notes_values2 [Book]novels,magazines
Which generates:
$ perl tst.pl notes_values2 magazines $
As required. It then becomes a trivial exercise to ignore lines of no interest...

A user level that continues to overstate my experience :-))