@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet


Comments:

<0> hi ppl can somone look at a short bit of code pease?
<1> i can look, but i make no promises
<0> k thx
<0> lemme know what u think it seems right to me it acts like it posts and then never makes it to the destination
<0> so mr what do u think
<1> um, think of what? i haven't seen anything
<0> oh duh hold on
<0> @message = ("From: test@test.com\n","Newsgroups: microsoft.test\n","Subject: test\n\n","Body: This is a test\n");
<0>



<0> $server->post(@message)
<0> or die "Can't Post: $@\n";
<1> can you post the whole thing at pastebin.com?
<0> sure
<0> http://pastebin.com/725972
<1> mmm...line 6 looks odd to me
<1> i would suggest use strict; at the very least
<1> you should have it log each thing it does
<1> or turn on use strict. or, even better, both
<0> k thx
<2> Line 6 should read: or die "Can't connect to news server: $!\n"; ! instead of @ - minor.
<2> Line 20 too. Change those and you'll get the interpreter's error message.
<1> i've never been good with those vars...$_, $@, and the like
<1> i still don't entirely know when to use them, so i don't
<2> The only three I use are $_ $! and @_
<2> Oh, and put a -w switch in your shebang.
<0> k
<3> um
<3> dude
<3> you send \n\n
<3> then Body..
<3> THEN your post message
<3> ..
<3> post data, rather
<3> for one, should be url encoded
<3> and..
<3> sent, first & immediately after the \n\n
<3> you cant be sending such a break, then unexpected dat, break protocol.. get strange results..
<3> is, to be expected
<0> k thx
<1> anyway, bbl...
<3> post data, need be url encoded most importantly
<3> that : isnt gonna cut it



<3> your problem is simply, you;ve half ***ed it, and thats never enough eh
<4> http://pastebin.com/726665
<4> Why is @temp_suspect_channels not being cleared and repopulated (from scratch) every 3 hours?
<2> Is that the right link?
<5> is init_temp_suspect_channels actually running as scheduled?
<4> yes. It's running as scheduled.
<4> Problem is... the array gets much of the same info each time it's populated. SO I thought the @temp_suspect_channels = (); would empty it out so I could start fresh. It's not working that way.
<2> ahh... it was just taking time to load the whole page.
<4> oh. heh!
<2> hmmm... perhaps you need to reset the schedule property?
<5> my guess is it's a scoping issue
<2> Won't it call the on_list event when it runs that sub?
<4> Two-Bits : How so? I want @temp_suspect_channels to be a global array.
<4> Darkchanter : on_list is an event-driven variable. For every entry the /list sends, on_list is executed.
<5> perhaps explicitly declare it as my @temp_suspect_channels = (); outside of the subs?
<4> when the init_temp_suspect_channels sub is run, it does the /list. The resulting flow of data from the server then starts kicking off on_list in rapid succession.
<2> Yes, so on_list will be called at: 31 $conn->sl("list >100"); ?
<4> when :31 is run, I get about 80 resulting events from the server. on_list gets kicked off 80 times (or however many channels are kicked back) and those get pushed up into the array if they're not already in @bannedchannels.
<2> There's something wrong with the flow between those two subs that effectively call each other. Draw the flow of control between them?
<5> huh?
<5> what subs call each other?
<4> they don't technically call each other. THis is all VERY objecty. :) the init_() sends a /list to the server. Each line of output from the server creates an $event that is read handled by the on_join sub (called by the handler in line 12. The on_list sub takes its event (one line of text) and if it's not in either of the two other arrays, it shoves the name of the channel up into the @temp_suspect_channels array.
<5> yes, i understand what's going on.. but i dont see how this can even be loosely regarded as any two functions calling each other. it's a one-way flow as far as i can see
<2> Yeah, that's what I'm saying - maybe there's a recursive call happening somewhere there.
<5> recurssion would be another matter entirely
<5> and to be honest, i have no idea how perl handles p***ing subs around like that
<5> and you're p***ing $conn to init_temp_suspect_channels which is not only unnecessary, but apparently useless
<2> Line 31 (in sub on_list) will cause sub init_temp_suspect_channels to run and line 54 (in sub on_list) will cause init_temp_suspect_channels to run.
<2> I meant to say "circular reference".
<2> Now when one does a /list on, say, efnet, the screen flickers it updates the thing so often.
<5> push (@temp_suspectchannels, $event->{args}[1]); # how does this cause init_temp_suspect_channels to run?
<2> Oops, I misread it.
<5> though.. i'm just now noticing... simmy! @temp_suspectchannels != @temp_suspect_channels
<2> Doing too many things at once.
<4> Two-Bits : Where's that?!
<4> THANK YOU!
<5> :D
<4> I figured it had to be something stupid like that!


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #perl
or
Go to some related logs:

#chat-world
#kl
raymond_gold
zeynep korur
#allnitecafe
irc beardman chat
#india
india+bizi
#worldchat
#kl



Home  |  disclaimer  |  contact  |  submit quotes