in reply to Re^2: Regexp works with some elements and doesn't with others
in thread Regexp works with some elements and doesn't with others
In this case, for example, you could modify the code to be -
use Data::Dumper; .... <snip> .... if ($text2 =~ m/^The website has been restructured/) { print "text array before is " . Dumper(\@text, $value); splice(@text,$value,1); print "text array after is " . Dumper(\@text, $value); splice(@links,$value,1); }
This way, you can see for yourself how @text is changing, and how it's different from what you expect. Note that you have to pass a reference to a list to the Dumper function call, since @text is one of two elements in the list of things you want to show.
Although you have to go through and uncomment/delete the Dumper lines once you've got it working, if you like actually 'seeing' changes as they happen, this may work very well for you, especially once you start using complex data structures.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Regexp works with some elements and doesn't with others
by diotalevi (Canon) on Feb 07, 2006 at 04:15 UTC | |
|
Re^4: Regexp works with some elements and doesn't with others
by GrandFather (Saint) on Feb 07, 2006 at 03:29 UTC |