CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Post deleted by flaq1991

 



flaq1991
Novice

Oct 30, 2013, 4:43 AM

Post #1 of 8 (860 views)
Post deleted by flaq1991

 


flaq1991
Novice

Oct 31, 2013, 1:17 AM

Post #2 of 8 (831 views)
Post deleted by flaq1991 [In reply to]

 


BillKSmith
Veteran

Oct 31, 2013, 5:12 AM

Post #3 of 8 (818 views)
Re: [flaq1991] print doesn't work [In reply to] Can't Post

What do you mean by "Print doesn't work"? If you are not getting any output at all, it probably does not have anything to do with the print. The condition in the if statement must be false.

The most likely causes are that the module did not return anything or that the whitespace is not exactly right in your test.
Good Luck,
Bill


Zhris
Enthusiast

Oct 31, 2013, 5:34 AM

Post #4 of 8 (815 views)
Re: [flaq1991] print doesn't work [In reply to] Can't Post

Cover your code in debug print statements, this will make it easier to visualize its flow. Print something before the if statement to check it even reaches that far, if it does then print $response->content to check it contains what you think it does. Work your way backwards until you find the cause.


Code
print "DEBUG: before if 1\n\n\n"; 
print 'DEBUG: response content: ', $response->content, "\n\n\n";
if($response->content =~ m/Witaj w panelu twojego konta,/i) {
{
print "DEBUG: in if 1\n\n\n";
}
print "DEBUG: after if 1\n\n\n";


We cannot test your code easily to provide a definitive answer.

Chris


(This post was edited by Zhris on Oct 31, 2013, 5:38 AM)


Laurent_R
Veteran / Moderator

Oct 31, 2013, 6:55 AM

Post #5 of 8 (805 views)
Re: [flaq1991] print doesn't work [In reply to] Can't Post

It is quite difficult to follow what your code is doing because it is very poorly indented and the variable and other names you are using (in Polish or whichever presumably Slavic language) don't give us any clue as to what the variables are supposed to contain and what the program is intended to do.

In addition, the use of goto statements is generally considered as bad programming practice (especially when the goto goes to previous code) because it makes the structure of the program much more difficult to understand.

I would also advise you to declare all your variables (with the "my" operator) and to always use the following pragmas near the top of your file:

Code
use strict; 
use warnings;"

which will save you a lot of time by helping you track a number of possible silly bugs.

As for the question you asked, the print statement is OK, meaning that either that the condition:

Code
if($response->content =~ m/Witaj w panelu twojego konta,/i)

is never satisfied, or that your program never reaches that part of the code. Add print statements in various poart of the code to figure out the execution path or use the Perl debugger to follow its execution.


FishMonger
Veteran / Moderator

Oct 31, 2013, 11:28 AM

Post #6 of 8 (789 views)
Re: [Laurent_R] print doesn't work [In reply to] Can't Post

Before helping this person any further you should be awhere that this script is intended to hack a game site. It's passing a series of usernames/passwords to the site to see which ones are able to login and then logs that info.


Laurent_R
Veteran / Moderator

Oct 31, 2013, 4:57 PM

Post #7 of 8 (769 views)
Re: [FishMonger] print doesn't work [In reply to] Can't Post

Thank you, FishMonger, I did not know that, but, as you have obviously seen in what I said in the other post on the same subject, I realized that was something sick about all that.


flaq1991
Novice

Nov 1, 2013, 2:12 AM

Post #8 of 8 (761 views)
Re: [Laurent_R] print doesn't work [In reply to] Can't Post

I thank you if you wanted to help. (sorry for the spelling i'm from poland)

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives