| |
| |
| |
|
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 33 34
Comments:
<0> Send my reghards. <0> regards, too. <0> No "h" necessary. <1> "Freebox" at 200.198.106.172 pasted "I'm reading a COM1, getting tickets from my PABX and inserting in mysql DB. But the var $dest is repeating random.. What is wrong?" (58 lines, 1.5K) at http://sial.org/pbot/17620 <2> Somebody can help me? <3> !pastebin <3> perlbot past <4> perlbot paste > _sho_ <5> GumbyBRAIN: /topic <6> a moduleis just a specific hash value, but what topic i must issude "install cgi" ? <7> "_sho_" at 66.180.175.30 pasted "virtual_len = sizeof(struct so" (9 lines) at http://erxz.com/pb/1419 <4> That looks like perl... <3> guys, whats a perl way of doing my perlpaste <3> im not very familiar with perls socket control <2> :( <8> sho: use Socket; my $peer_name = inet_ntoa getsockname SOCKET;
<8> Err, use Socket; my ($port, $iaddr) = getsockname SOCKET; my $peer_name = inet_ntoa $iaddr; <8> PS: perldoc -f getsockname <9> getsockname. To access this perldoc please type, at a command line, 'perldoc -f getsockname'. You may also find it at http://perldoc.perl.org/functions/getsockname.html <8> Darn, I screwed it up again. The docs have a proper example, though. <10> wow. sockets. how quaint. <10> I reach for POE whenever I deal with sockets now. <11> Is there a good module to read human values? i.e. convert 1K into 1024, 24MB into 25165824, etc? <11> Those are strings. :) convert('1K') would return 1024. <11> Easy enough to write but I don't want to reinvent the wheel if I don't have to... <12> I have a second perl installation on one machine - I'm just configuring CPAN now before I install all my modules for the second build... do I need to tell CPAN to use a different root, or anything like that, or will CPAN just know to re install modules alongside somehow? <13> christotoday: CPAN should install modules for the perl with which you invoke CPAN. <13> So if you've got a /usr/bin/perl provided by your distro, and a /usr/local/bin/perl that you've compiled yourself, then CPAN.pm will place modules in different places depending on which Perl interpreter was invoked. <12> ok <12> cool thanks <3> can someone help me translate c socket statements into something perl can use? <3> perl doesnt seem to have a complete port of socket.h <10> what's it missing? <10> and most people don't write code to the low-levels of Socket <10> they use the modules. <3> getsockname <14> getsockname() is built into Perl. <10> Right. <3> i couldnt find it in perldoc (im in perlipc) <10> Look in "perldoc perlfunc" <9> perlfunc - Perl built-in functions. To access this perldoc please type, at a command line, 'perldoc perlfunc'. You may also find it at http://perldoc.perl.org/perlfunc.html <10> it's in there <14> sho: it's a builtin function, so it's in perlfunc. <3> _ah_ <10> Perl's support for sockets is amazingly complete. <14> sho: perlipc does not cover absolutely every possible thing you could possibly use in any program that communicates with another process. <10> sockets help Perl be a "glue" language. so it's in the primary mission. <14> getsockname() is very rarely used, so it's not in perlipc. <3> yeah, thats what i was finding. <3> http://erxz.com/pb/1420 <- this is what im trying to convert <15> dear perley gurus.. can this one liner be written more concisely? <10> In fact, you could probably do all that with an IO::Socket <15> perl -nle '$_=~/(\d+)\s*(\w+)/;print "$2 ",int(0.5+(150-$1)/30);' <10> see that instead <10> getsockname is described there too <14> lesshaste: Why, it isn't concise enough already? <10> It fails to check the match <14> lesshaste: Does your company get charged by the keystroke? or are your keyboard plated with radioactive pot***ium? <10> that's almost always a bad thing <14> I mean, what is the problem here? <15> yrlnry, I am trying to learn about perl one-liners.. normally there is something surprising I can learn <10> I think lesshaste is golfing <15> merlyn, golfing? :) <10> which I've grown to detest <10> golfing (a) encourages bad programming and (b) is seen by outsiders as "typical Perl" <14> lesshaste: You can leave out the $_ =~ <15> is the a simple perl way to round numbers correctly? I have added 0.5 and taken int which looks ugly to me <10> sadly - I now say the same about JAPHing <15> yrlnry, ah... <3> merlyn, im checking <10> sprintf "%.0f", $number <10> that rounds to nearest int <10> that's in the FAQ <10> perldoc -q round <14> Doesn't it use round-to-even on some platforms? <10> yeah, but that's "proper" <10> I know, you've got some rant against that, right? :)
<14> No. <14> Neither for nor against. <10> yrlnry - my next LM article steals a couple of plays from Beck's "Smalltalk Best Practice Patterns" <14> I've written a couple of usenet posts explaining why some systems do that. <10> consider $self->$action(@args) <3> merlyn, i dont get it. i am coming in from xinetd as a tcp stream. yet when i try to dump the socket, i get: <3> Bad arg length for Socket::unpack_sockaddr_in, length is 0, should be 16 at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/Socket.pm line 370. <10> $action could be a user-parameter p***ed in from a constructor or setter <15> merlyn, thanks.. didn't know about perldoc -q round <10> and it can be either a method name *or* a coderef <16> _sho_ lives on a tcp stream! omg, the internet is coming to life! <14> merlyn: Yeah, that's a good trick. <10> so you can have plugable behavior that either calls existing methods, or a custom piece <10> on_completion => 'ring_bell' <3> :p <10> on_completion => 'write_file' <10> on_completion => sub { my $self = shift; ... } <14> merlyn: How widely known is the trick of using a string as a factory object? <10> When I stumbled on that, I was like "aha! something Smalltalk doesn't do out of the box!" <10> although you could add it in Object perform: <10> string as factory? "Foo"->make_something ? <10> oops... time to jump in the shower. <3> merlyn, im not having any luck with the socket builtins <3> perl just bails and thinks there is no socket <3> do i have to open it first? i would figure since xinetd is just handing it off that wouldnt matter <8> sho, show us the code. <17> _sho_: Is "just handing it off" a technical term? <8> You should be able to do regular socket operations on STDIN (or STDOUT) in the inetd case. Unless there's something weird about xinetd. <3> AWESOME thanks thanks thanks roderick! <3> THANKS! <8> What were you doing instead? <3> using SOCK per the documentation <8> Ah ha <3> i couldnt figure out what my socket would be identified as <3> roderick, where you live. i want to buy you a beer <8> Charlottesville, Virginia. You can bring it to my game night, at my place tonight. <3> im in baltimore md <3> this problem has plagued us for about a year now, but nobody really tried to figure out how to do it <16> baltimore eh <16> i live near there <3> where at? <16> fredneck <16> er., frederick <18> q[ender]: yo! :) <16> sup Khisanth :) <18> jury duty :( <16> that ****s. <16> you get picked for an actual jury? <3> heh, im in catonsville. my woman is from carrol county <16> z0mg small werld! <18> q[ender]: not yet <16> .hcounter <19> I've seen "heh" said 33505 times since 8/15/2004. <17> hehe <3> hah <17> counter++ <3> thanks again guys :) <16> Khisanth, the cases friends of mine have served for were all pretty damn lame <17> q[ender]: How many instances of lol ? <16> i don't think there's a lol counter here <20> @x=sort @y; $x=\@x; <<< how do I combine this to get an arrayref from a function that returns a list? <10> $x = [sort @y]; <20> ah thanks <21> I'm writing an app and I'm considering using xml to store the data the app uses, but there are so many xml modules and I can't decide which one I should use <21> any suggestions? <10> I like XML::Smart <10> not for its docs, but because it seems to be friendly. <22> anyone in here ever did some curses programming in perl? <21> the project is also getting a bit big, and I'm considering splitting it into separate files. what would be the best way to do that? <21> oediv, yes <22> TPC also been using the menu_driver?
Return to
#perl or Go to some related
logs:
eboard fc5 #gentoo justfuckinggooogleit Have installed external hardrive E, how to add it to my list of files schwartzian +mod_perl #web #ubuntu #awk bad font path element (#76) R_X86_64_32S local symbol kdelibs
|
|