in reply to Re: Parsing a file and finding the dependencies in it
in thread Parsing a file and finding the dependencies in it
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Parsing a file and finding the dependencies in it
by Corion (Patriarch) on Jul 06, 2011 at 14:57 UTC | |
|
Re^3: Parsing a file and finding the dependencies in it
by Marshall (Canon) on Jul 06, 2011 at 19:35 UTC | |
by remiah (Hermit) on Jul 07, 2011 at 07:30 UTC |