I think I found why this bug happens:
OK so we surf to my home page by means of a
$mech->get('
http://www.potozniak.org/perl');
So in our history stack we currently have this:
http://www.potozniak.org/perl <- current page
Now I went to the first link corresponding to the
$mech->follow_link( n => 1 );
sub routine which brings us to perl/ted/
Now in our history stack we have this:
http://www.potozniak.org/perl/ted/ <- current page
http://www.potozniak.org/perl/
Then I went to the first link on our current page by
the same means as last time.
$mech->follow_link( n => 1 );
sub routine which brings us to perl/ted/post.pl
Now in our history stack we have this:
http://www.potozniak.org/perl/ted/post.pl <- current page
http://www.potozniak.org/perl/ted/
http://www.potozniak.org/perl/
And then I decided to do a $mech->get('
http://www.google.com');
So we would think that our history stack would look like this:
http://www.google.com/ <- current page
http://www.potozniak.org/perl/ted/post.pl
http://www.potozniak.org/perl/ted/
http://www.potozniak.org/perl/
But when we do a back we go back to
http://www.potozniak.org/ted/
Why might this happen you may ask yourself.
I think that when you call get the current page before the get is
over ridden with the page we are now at from the get. Making our
history stack look like this instead of the stack above:
http://www.google.com/ <- current page
http://www.potozniak.org/perl/ted/ <- will be the url after a back
http://www.potozniak.org/perl/ <- will be the url after a double back
I hope this helps out a bit. :-D
---------------------------------------------------
Andrew Potozniak
Administrative Computing
Student Assistant
State University of New York at Buffalo
acp7@citmail.buffalo.edu
645-3587 x 7123
http://www.potozniak.org
---------------------------------------------------
Show quoted text> -----Original Message-----
> From: WWW-Mechanize [mailto:bug-WWW-Mechanize@rt.cpan.org]
> Sent: Monday, July 28, 2003 3:21 PM
> To: acp7@citmail.buffalo.edu
> Subject: [cpan #3072] AutoReply: FW: Mech History Bug
>
>
> Greetings,
> This message has been automatically generated in response to your
> bug report about WWW-Mechanize, a summary of which appears below.
>
> There is no need to reply to this message right now. Your bug in WWW-
> Mechanize has been assigned an ID of [cpan #3072]. Please include the
> string:
>
> [cpan #3072]
>
> in the subject line of all future correspondence about this issue. To do
> so,
> you may reply to this message.
>
> Thank you,
> bug-WWW-Mechanize@rt.cpan.org
>
> -------------------------------------------------------------------------