#perl
01 November 2007
Total 36 pages. You are browsing page 4/36.
First :: Prev :: [...] [2] [3] [4] [5] [6] [...] :: Next :: Last
02:38 <****> heh
02:38 <****> eval: @foo = ( 1, 2, 3 ); splice @foo, 1, 1; \@foo
02:38 <****> LeoNerd: [1,3]
02:38 <****> ^-- splice removes it
02:38 <****> eval: utf8::decode($foo = "z?x??n?s?bdou?l???????p?q?"); reverse $foo
02:38 <****> Juerd: 27196: Use of uninitialized value in pattern match (m//) at /usr/share/perl/5.8/utf8_heavy.pl line 211.27196: Use of uninitialized value in scalar assignment at /usr/share/perl/5.8/utf8_heavy.pl line 227.27196: Use of uninitialized value in ?q?p???????l?uodb?s?n??x?z
02:38 <****> I see
02:39 <****> Sucky bot.
02:39 <****> so how do I get the index?
02:39 <****> Iterate on it.
02:40 <****> Though, if you're going to be removing quite a few elements, perhaps grep is better?
02:40 <****> iterating gets the values
02:40 <****> ...
02:40 <****> So does grep
02:41 <****> 0.5 } @l; \@
02:41 <****> LeoNerd: ''ERROR: syntax error at (eval 238) line 2, at EOF
02:41 <****> 0.5 } @l; \@l
02:41 <****> LeoNerd: ['e','f','g','i','k','m','n','o','p','r','s','t','v','w','x']
02:41 <****> Though likely you'd do some actual test involving $_ in that block
02:42 <****> ...
02:42 <****> for $x (@l) { ...?? }
02:43 <****> ... should have been a full width character...
02:43 <****> @l = grep { do_I_want_to_keep( $_ ) } @l;
02:43 * luke-jr uses a fixed width font
02:43 <****> LeoNerd: no
02:43 <****> Then that function can do whatever checking it wants
02:45 <****> including a goto out of the grep?
02:46 <****> Hrm... possibly not that.
02:46 <****> Well, perhaps it could but that'd break the grep
02:47 <****> ?u??s??
02:47 <****> yay!
02:47 <****> that would be besides the point, it would most likely be very bad code
02:48 <****> !?? ???? ? ,??-??nl
02:48 <****> well partly
02:49 <****> Oh.. stop extracting the urine, already...
02:49 <****> It's getting old now :P
02:50 <****> Khisanth: do you have a perl job?
02:52 <****> Khisanth: :)
02:52 <****> LeoNerd: extracting the urine?
02:52 <****> Taking the piss
02:52 <****> e1f: Bah, insects are cool, and I'm pretty! ;)
02:52 <****> ?
02:52 <****> LeoNerd: and who's doing that?
02:53 <****> dwu: you're the exception to all the rules
02:53 <****> e1f: This... may or may not be a good thing.
02:53 <****> dwu: btw, we want pics
02:53 <****> dwu: and how do we know that? i mean many insects are in fact not cool!
02:54 <****> simcop2387: Look, I bet even e1f doesn't like roaches. But praying mantises are cool.
02:54 <****> simcop2387: all insects are cool. no exceptions
02:54 <****> e1f: You can't -like- roaches.
02:54 <****> e1f: You may be able to ID them, but roaches are a primal fear!
02:54 <****> e1f: ok, maggots
02:54 <****> some of my best friends are roaches, you ... bigot!
02:54 <****> i don't mind.
02:54 <****> e1f: But they wouldn't be your favourite insect?
02:54 <****> e1f: or how about aphids?
02:54 <****> maggots are just larve
02:55 <****> simcop2387: Maggots lack six legs and three parts, not insects :)
02:55 <****> so no way to get the index in a for loop?
02:55 <****> simcop2387: it's the circle of life
02:55 <****> luke-jr: when i need to do that i usually use a c style loop
02:55 <****> ?
02:55 <****> e1f: SEE? I KNOW NON-INSECTS :(
02:55 <****> luke-jr: not in a for (@whatever) { } loop, no. in a for ( ; ;) loop, sure
02:56 <****> for my $index ( 0 .. $#array ) { ... }
02:56 <****> ??l???u??d?nld
02:56 <****> hm
02:56 <****> Though don't do that if you'll be deleting elements
02:56 <****> let the quibbling commence!
02:56 <****> LeoNerd: would $#array be resolved once or every iteration?
02:56 <****> What's wrong with grep.. really..?
02:56 <****> LeoNerd: I can't jump out of it
02:56 <****> and removing items is a rare occasion
02:56 <****> e1f: Anyways, have you ever seen the roach-like insects that have a sort of smaller, rounder body? I can't ID them (not that I've tried really hard), but are they -actually- roaches? they -move- like roaches... but don't look like 'em...
02:56 <****> luke-jr: once, a c style loop will do it easier, but yea grep if you can
02:57 <****> there a saying: if insect life dissappeared, all life on earth would end in 50 years. on the other hand, if all human life dissappeared, in 50 years life on earth would flourish
02:57 <****> e1f: so kill us all and let god sort it out!
02:57 <****> e1f: that saying seems rather silly.
02:57 <****> perlbot paste
02:57 <****> Paste your code to http://sial.org/pbot/perl http://erxz.com/pb or http://p3m.org/paste/fn/perl and #Perl will be able to view it.
02:57 <****> bpalmer: It's a safe saying, no one can say if it'll be true or not :(
02:57 <****> e1f: the thermophilic bacteria living in extreme hot water deep in the sea .. what care they about "insects"?
02:57 <****> for my $i ($#array .. 0) { ... } ?
02:58 <****> dwu: pics would help.
02:58 <****> e1f: I'll work on my insect photography; they skitter really fast though :(
02:58 <****> Step 1: SQUASH Step 2: Photograph.
02:58 <****> bpalmer: all life on earth is in an equilibrium. do not base importance on size or location
02:59 <****> e1f: nothing else can live close enough to them to affect the bacteria!
02:59 <****> bpalmer: That would ruin the roundness of the body!
02:59 <****> Step 1: Invert glass over them. Step 2: Photograph
02:59 <****> "simcop2387" at 98.192.31.207 pasted "s?????l u?op ?p?sdn ?o? ?d???s" (25 lines, 519B) at http://sial.org/pbot/28375
02:59 <****> Step 3: Drink out of glass, if you're brave.
03:00 <****> e1f: it's not in equilibrium because we're not at a steady state
03:00 <****> bpalmer: Much better, thanks. Now to carry a glass with me whenever I leave the house :(
03:00 <****> luke-jr: check it out!
03:00 <****> ...
03:00 <****> the paste
03:00 <****> i turned the thing into a script for xchat
03:00 <****> boo xchat
03:00 <****> its easy enough to do irssi, the meat of it is two lines
Total 36 pages. You are browsing page 4/36.
First :: Prev :: [...] [2] [3] [4] [5] [6] [...] :: Next :: Last
