| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
Comments:
<0> Prohibited: By the way, the Perl way isn't making a $x and setting it to 1 - the Perl way is to do while(1) or for(;;), and then when you want it to stop, call last; <0> Prohibited, like: my @socks; while(1) { push @socks, IO::Socket::INET->new(..); last if($#socks > 5); } <1> I am still waiting for the inevitable "Okay, I have an array of sockets, how do I read and write to them?" <0> lol <0> Prohibited: Hint from BinGOs and me, if you want to asynchroniously read/write from all sockets, use POE ;) <0> I think #perl is the channel with most support. <0> I mean, that gives most support. <0> perlbot karma #perl <2> Karma for #perl: 7 <0> ha! <0> perlbot karma ##php <2> Karma for ##php: 1 <0> lol 0.o <1> IO::Select is just gory to the beginner. <0> Yeah, agreed. <0> Since I started doing the all-wheel-readwrites-in-one-session, I really started to like POE a lot more.
<3> Not quite as gory as select() and vec(). <1> could fork for each client. <0> eww <1> Or threads >:) <3> I fork a lot. <4> nutt'in wrong with fork <3> I don't like POE, or the way of programming in all those tiny states. <1> fork you! And the process you spawned from! <3> It's great for a single thing, like an IRC bot. But when the IRC bot also has a web interface, I much prefer using a different PID for that. <4> one could always 'use forks;' and pretend they were threads. <0> Lol <0> I remember my first Perl project <0> it was waaay too big for me by then <3> If one thing breaks, other things still work. <0> I wanted to make a seperate process for every "module", and one for every user <3> And breaking things is harder even. <3> dazjorz: That's probably overkill. <1> Juerd: you can have separate processes with POE, IKC <3> But doing everything in one POE kernel thingy is bad too, imnsho <3> BinGOs: You can also run Perl on Windows ME, but that doesn't mean it's a sane idea. <4> wheel::run <0> Lol <0> You can run a lot on Windows ME <3> Conceptually different things should be explicitly separated in code. <0> but even running itself is a bad idea. <5> so say if I wanted to send data with what you said before, would it b3 @socks->send($data); <0> even running Windows is a risk <5> be * <0> Prohibited: No <6> no. <3> dazjorz: Providing mains power to your computer is a risk, but worth it. <4> POE is just a cooperative multitasking kernel. Why is that scarry? <0> Prohibited: (Where) have you learned Perl? <0> Juerd, Agreed =) <3> cfedde: It's not scary. I don't like the way of programming. <5> I'm still learning xD <0> Prohibited, @socks is an array, it's a list of values <5> so how would I send data? =/ <3> cfedde: Because there's never anything that can take more than a second, or code starts to randomly fail because other things depend on getting yielded to every once in a while. I don't like paying attention that closely. <0> Prohibited: First, you cannot call a subroutine in all element <0> elements* <0> Prohibited: To get one element of the array, you want to use $socks[number here], for example $socks[0] for the first element and $socks[2] for the third <3> For example, if I have a huge chunk of data to process, I'd hate to do that in many tiny state changes. <3> I much prefer to fork off some processor, that reports back later. <4> Juerd: right, it can lead to tight dependencies if you are not careful <0> Prohibited, Then there's no such subroutine as send() in IO::Socket::INET <1> Juerd: duh, that's what POE::Wheel::Run is for. <4> Juerd: but such situations are why there is wheel::run <0> Prohibited: To send data over a socket, you simply print to it, as in: print $socks[0] "Hello, I'm Prohibited" <3> cfedde: The more care a programming language, or API, requires, the more error prone it is. <3> cfedde: In that respect, I think it's like index maths. <5> Yeah I got that part <3> C-style for loop works, and is proven technology. <3> It's well tested, and well known. <3> But it's too damn easy to make mistakes that take dozens of minutes to debug. <0> Prohibited: Not that you do NOT put a comma after the SOCKET if you're printing to it <0> Prohibited: print $socks[0], "Hello" #WRONG
<4> Juerd: I agree that simple techniques are best. But sometimes you need to do more than one thing at a time. <0> Prohibited: print $socks[0] "Hello" "I'm prohibited" #WRONG <0> Prohibited: print $socks[0] "Hello", "I'm prohibited" #ok <3> Yes, and when you need to do more than one thing at a time, most of the time you can easily factor it into two different processes. <0> Prohibited: Many Perl newbs make that mistake. ;-) <3> I like event based programming for things that are naturally events. <4> Juerd: also agreed. <0> Juerd++ <3> But some things are naturally imperative, and then mixing it with events only makes things awkward. <3> I tend to run into a lot of the latter kind. <4> POE is not the solution to every problem. Just like 'goto' is not the solution to every problem. <3> And when I need to implement something on a certain network protocol, I usually hijack an existing non-perl solution for it, so that I don't have to care about the gory details. <3> I don't like POE for IRC bots. I like irssi for IRC bots. <3> I don't like POE for HTTP servers. I like apache for HTTP servers. <3> etc. <0> Yeah <3> POE's a lot of goto, so that makes sense ;) <3> (states feel like goto to me) <0> Juerd, if you do more things in POE, eventually you start to get the hang of it, and you start understanding why things work like that in POE <3> dazjorz: I've done lots of POE. <3> Doesn't mean I like it. <3> And the positional named arguments don't help either. <0> Juerd: Sometimes, POE is just to make the thing you want to do muuuch easier. <3> I find writing my own state machine a little easier than using POE. I usually don't its power and features. <0> I still need a POE::Filter::DBD though <0> Or is it already there? <3> Really, I think POE is wonderful. But it's not my style, not my way of thinking. <0> Yeah <0> I can understand that <0> hmm <4> there are components for dealing with dbi but not a filter iirc <3> If you need asynch DB access, it's probably something that you want to cache anyway. And when you want to cache, often you should pregenerate instead. <0> I need to add a CPAN search feature to Dazbot... Or is there a bot that has one? <3> dazjorz: What kind of filter would you want? <0> Nah, just basically something to search the exact name of a CPAN module <0> Oh, you mean a POE::Filter <0> I meant POE::Filter::CBC <3> POE::Filter::DBD, what would it do? <0> Encryption filter <3> Ah <3> Can't you use an IO layer for that? <7> Windows Genuine Advantage is great for the F/OSS community, I just gave away 5 Ubuntu discs to people who don't dare run windows anymore <3> I'd love to do that <0> IO layer? <3> But I ran out of Breezy cds <3> And am still waiting for Dapper cds <0> They're free ^_^ <7> Juerd: I got the Dapper CDs in yesterday <3> My burner's broken. <7> Microsoft is just on time <4> burn em baby! burn-em <3> Ikarus_: Oh, that's good news. I think my order will arrive soon then. <0> Actually I was kind of amazed to see how many 20 CD's actually is - the number looked smaller on the page. <0> Or 15 <0> Yeah, think it was 15 <3> We had 50 cd's last time. <7> dazjorz: I need 40 to last the whole year <7> And I think more this year <3> And now you can't ordermore than 10 <0> Well, I rarely use Ubuntu <0> since I'm running Debian on my serve <0> server* <0> I'd really like to run Linux on this PC though :( <0> it's just... the games... <3> I'm going to ask for a payment gateway for people who want more. It's well worth the money, and I don't like burning many cds myself. <0> I want to be able to do a good game from time to time <3> (And the official looking cover helps when convincing people) <3> dazjorz: Then dual boot. <3> Use Windows only when you really, really need it. <0> Juerd, Yeah, I did that a while <0> And my IRC client just stopped updating the #perl window... <8> dazjorz - then redefine 'good game' to include the good games available to you on linux, or get a specialized gaming machine -- say, a DS. <3> And if you play games all day, just buy a second computer. Gamers are rich anyway. <0> so now I'm looking at the "Channel monitor"
Return to
#perl or Go to some related
logs:
ubuntu fglrx drirc initPANSIstrings ubuntu INTEGRATE Y' = 4/X*(X-4)
perl handle SIGALARM mysqldump errno 144 libpqxx.so gcc-4.1 #perl #ubuntu #web FC4 festival female voice
|
|