This works fine on my machine, but I don't get $num and its regexp at first.
if (my $num = /\[/.../\]/)
must be
if (my $num = $_ =~ /\[/.../\]/)
I don't understand what the regexp '/\/.../\/' means. I asked Yape::Regex
my $regexp='\[/.../\]'; use YAPE::Regex::Explain; my $exp = YAPE::Regex::Explain->new($regexp)->explain; print $exp;
and it says
The regular expression: (?-imsx:\[/.../\]) matches as follows: NODE EXPLANATION ---------------------------------------------------------------------- (?-imsx: group, but do not capture (case-sensitive) (with ^ and $ matching normally) (with . not matching \n) (matching whitespace and # normally): ---------------------------------------------------------------------- \[ '[' ---------------------------------------------------------------------- / '/' ---------------------------------------------------------------------- . any character except \n ---------------------------------------------------------------------- . any character except \n ---------------------------------------------------------------------- . any character except \n ---------------------------------------------------------------------- / '/' ---------------------------------------------------------------------- \] ']' ---------------------------------------------------------------------- ) end of grouping ----------------------------------------------------------------------
Where does it match against __DATA__ lines? I have no idea. And Why /E0/ ? Someone please shed some light for me.
In reply to Re^2: Parsing a file and finding the dependencies in it
by remiah
in thread Parsing a file and finding the dependencies in it
by legendx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |