#perl
03 November 2007
Total 20 pages. You are browsing page 1/20.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
--- Log opened Sat Nov 03 00:00:10 2007
00:04 <****> Hey, I'm working on a perl module for doing async socket commication and I ran in to a problem in error handling for UDP
00:04 <****> What I can read for UNIX documentation there should be a recvmsg call to empty the error queue for a socket, but I can't seem to find any in Perl?
00:05 <****> What is the rigth way to do this or do I have to use syscall or write a xs module to get acces to this information?
00:06 <****> GumbyBRAIN: flex fuel
00:06 <****> All the actual match - is there any particular type of fuel.
00:12 <****> how do I take everything after a cerain character in a string?
00:12 <****> where are you taking it? ;)
00:12 <****> string abracadabra8zubbazub. I want everything after the 8
00:12 <****> FreshCat: a regex, or index+substr. Your pick. :)
00:12 <****> yeah with regex I mean
00:13 <****> the output of B::Concise is kinda cryptic
00:14 <****> yar?
00:14 <****> rmah: ahoy matey!
00:14 <****> arrr
00:14 <****> that be pirates in these channels!
00:15 <****> http://search.cpan.org/~rkinyon/DBM-Deep-1.0006/lib/DBM/Deep.pod
00:15 <****> linxu's url is at http://xrl.us/8b56
00:18 <****> cd //
00:18 <****> what the hell is // ?:D
00:20 <****> Not just cd to FS root, but *really* FS root. Truely. I mean it. I'm not kidding around. I want the FS root damnit!
00:21 <****> Permission denied.
00:21 <****> cd /lib/../
00:21 <****> (not necessarily the same place as / ;)
00:22 * Patterner uses 'cd ///////' to be really sure "7 is a magical number"
00:22 <****> gaaah
00:25 <****> gaaah?
00:26 * CPAN upload: Test-Lazy-0.050_1 by RKRIMEN
00:27 <****> hi. I have a loop that counts numbers 1 2 3 and so on. I have variables like var1 var2 var3. can access the var with concat the variables with the loop on someway like? $var$loopvar
00:27 <****> is it possible?
00:28 <****> and how?
00:28 <****> nighter: like ${$var$loopvar} ?
00:28 <****> yees
00:28 <****> exactly
00:28 <****> i try that
00:28 <****> thanks.
00:28 <****> or more likely... ${"$var$loopvar"}
00:28 <****> I forgot to concatenate them :)
00:29 <****> USE A HASH!
00:29 <****> nighter: and now that you know it's possible, NEVER EVER EVER DO IT
00:30 <****> FFS
00:30 <****> Why do people insist on such craziness
00:30 <****> if you have $var1, $var2 .. $varN, then you have AN ARRAY
00:30 <****> a list
00:31 <****> no, an array. (read for context)
00:31 <****> should the 'state' variable work in perl5.9.5?
00:31 <****> what's the state variable?
00:31 <****> ludan: perldoc feature
00:32 <****> oh ok
00:32 <****> hobbs: i did use feature 'state'
00:32 <****> now that was _really_ silly
00:33 * shaldannon is curious as to what the "state" variable is
00:33 <****> ludan: then yes, it should work.
00:33 <****> bho
00:34 <****> sub func { state $how_many_times = 0; return ++$how_many_times; }
00:34 <****> shaldannon: like a static variable in a function in C
00:34 * shaldannon expects it's something like Alaska, Texas, Virginia (but not DC, because DC isn't a state)
00:35 <****> calling three times func() should give me 1, 2 and 3 right?
00:35 <****> but it doesn't O_O
00:36 * shaldannon guesses it returns 1 every time
00:36 <****> perl can do something special with regex
00:36 <****> shaldannon: you guessed right :)
00:36 <****> what was it?
00:36 <****> or better yet
00:36 <****> anyone got perl code to parse c++ header files?
00:37 <****> h2ph as a starting point..?
00:37 <****> hmm
00:37 <****> ludan: scope. you set the variable $how_many_times in the sub to 0; what you return, then, is always going to be 0+1
00:37 <****> still got problem.
00:37 <****> my $LOGPATH = ${"$PATH$_[0]"};
00:37 <****> that should work i guess
00:37 <****> ahh
00:37 <****> now i got it
00:37 <****> shaldannon: i'd better go to sleep
00:37 <****> ludan: if you set $how_many_times in global scope, then it would (I expect) increase
00:37 <****> shaldannon: of course :(
00:38 <****> or not
00:38 <****> uhm
00:38 <****> wait
00:38 <****> shaldannon: uhm
00:38 <****> hmm?
00:38 <****> it is true
00:38 <****> yeah
00:38 <****> but then, the way to get this variable as a counter is to do not initialize it
00:39 <****> like
00:39 <****> what is a perl header file?
00:39 <****> sub func { state $how_many_times; return ++$how_many_times; }
00:39 <****> that's it
00:39 <****> tenshihan: That's a good question.
00:39 <****> tenshihan: there really isn't such a thing
00:39 <****> tenshihan: could you please try asking a coherent question? :)
00:39 <****> now it's gonna work as expected
00:39 <****> ludan: excellent
00:40 <****> shaldannon: but look at here: http://www.slideshare.net/acme/whats-new-in-perl-510
00:40 <****> shaldannon: state is sorta like: { my $c; sub foo { return ++$c } }
00:40 <****> in those slides there might be a little error as i've done in this rispect
00:40 <****> well
00:40 <****> like a static var in C.
00:40 <****> *respect
00:41 <****> I'm not sure I get its usefulness but anyhow
Total 20 pages. You are browsing page 1/20.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
