Home Page   #c  #ruby-lang  #cisco  #mysql  #apache  #javascript  #java  #perl  #php  #openmoko   Wallpapers Girl
Reliable $1 Web Hosting by 3iX

Channels


#perl

09 October 2007


Total 41 pages. You are browsing page 2/41.

First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last

00:38 <****> pkrumins: =^_^=
00:39 <****> it's not a filter
00:39 <****> anno-: no?
00:39 * f00li5h oggles
00:39 <****> ah
00:40 <****> it uses peculiarities of perl's string storage
00:40 <****> anno-: @EXPORT= 8x0 .oO ;
00:40 <****> wassat?
00:41 <****> not sure about 8x0
00:41 <****> eval: @EXPORT= 8x0 .oO ; \@EXPORT
00:41 <****> f00li5h: ['oO']
00:41 <****> o_O
00:41 <****> :O
00:41 <****> :o
00:41 <****>]. how can I slice that w/o knowing the length of the list I'm getting?
00:41 <****> rickest: you could just slice to a large number
00:42 <****> or you could just shift the thing
00:42 <****> rickest: you can't easily. Assign to an array (a temporary one if need be)
00:42 <****> eval: sub purr { qw/ =^_^= milk nip / }; [ ( purr )[ 1..1e10 ] ]
00:42 <****> f00li5h: ''ERROR: 31498: Range iterator outside integer range at (eval 213) line 1.
00:42 <****> @l[ 2 .. $#l]
00:42 <****> eval: sub purr { qw/ =^_^= milk nip / }; [ ( purr )[ 1..1e2 ] ]
00:42 <****> f00li5h: ['milk','nip',undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,un
00:42 <****> eww
00:42 <****> although that does what i thought it'd do
00:42 <****> temp variable it is
00:43 <****> tks for all the input, that's pretty much what I had concluded, too. I think I'll keep doing what I've been doing: assigning to a var first
00:43 <****> @listies = do { my @tempies = sub; @tempies[ 1 ... $#tempies ] } # if you don't want that first thing, why does the sub return it?
00:44 <****> split is the sub and I know the first two lines are trash, the rest need parsing
00:44 <****> then why not just next unless /useless/; them?
00:45 <****> that is what I'm doing, I was just asking if there was an alternative
00:45 * tarrybone thinks [1..-1] should dwim
00:45 <****> tolecnal: how does the range operator know that though?
00:45 <****> my ( undef, undef, @content) = split ...;
00:45 <****> rickest: i think next is the better way, it's far clearer
00:46 <****> anno-: nicer than 1..1e2, but still not that nice
00:46 <****> f00li5h: it just does, automagically :)
00:46 <****> f00li5h: perhaps. [2,] or even [2..] is pretty clear to me too
00:46 <****> tolecnal: ah, so it has to know if it's in a slice?
00:47 <****> wantarray could return ARRAY-SLICE or some such... i suppose
00:47 <****> for ( splice @{ [split...] }, 2 ) {
00:47 * f00li5h doesn't want to get perlguts on himself
00:47 * f00li5h hands anno- his non=functional goggles
00:48 <****> eval: 8x0
00:48 <****> f00li5h: ''
00:48 <****> hrm
00:49 <****> deparse: @EXPORT= 8x0 .oO ;
00:49 <****> f00li5h: (@EXPORT = ((8 x 0) . 'oO'));
00:49 <****> aah!
00:50 <****> the range operator doesnt do anything for going backwards anyways ... so it doesnt seem like a problem to magic-case it :-)
00:50 <****> oh, except that code depends on that not doing anything
00:50 <****> rats
00:50 <****> use range qw/backwards/
00:50 <****> you could have a pragma for it, perhaps
00:50 <****> much as you suggest
00:51 <****> i'd expect people to use reverse -1..1 to get a backwards range anyway
00:51 <****> what should "1 .. -1" be to work in @[ 1 .. -1] ?
00:52 <****> @ ARRAY [ 1..-1] ?
00:52 <****> anno-: well, $[-1] returns the last, so i want -1 to magically mean $#array
00:52 <****> the .. operator doesn't know that
00:52 <****> you can do that with @ ARRAY [ reverse -1 .. 1 ] anyway
00:52 <****> i also like rickest's [2,] and [2..]
00:53 <****> anno-: yeah, thats why i was talking about magicking it
00:53 <****> eval: @kitties = qw/ milk nip purr meow/; [ @kitties[ reverse -1..1 ] ]
00:53 <****> f00li5h: ['nip','milk','meow']
00:53 <****> see?
00:53 <****> oh ... so why isnt that the best answer to rickest?
00:53 <****> oh
00:53 <****> bc its the opposite
00:53 <****> he doesn't have @kitties
00:53 <****> because it only works for three things?
00:53 <****> personally, I expected [2,] to work but maybe that's from using substr too much :)
00:53 <****> he wanted to do that to a sub's return
00:54 <****> anno-: does it?
00:54 <****> tarrybone: because the list is already defined
00:54 <****> eval: @kitties = qw/ milk nip purr meow =^_^= curl petting /; [ @kitties[ reverse -1..1 ] ]
00:54 <****> f00li5h: ['nip','milk','petting']
00:54 <****> right, the opposite
00:54 <****> eval: @kitties = qw/ milk nip purr meow =^_^= curl petting /; [ @kitties[ reverse -2..1 ] ]
00:54 <****> f00li5h: ['nip','milk','petting','curl']
00:54 <****> eval: [ -1 .. 1]
00:54 <****> anno-: [-1,0,1]
00:54 <****> anno-: it does what you mean
00:55 <****> In perl6, [1..] will DWIM.
00:55 <****> besides, that's getting a little obsfucated to me, I prefer the 'next unless...' cmds to that heh
00:55 <****> BUU!
00:55 <****> it does what you mean, not what i mean
00:55 <****> rickest: 'ere 'ere
00:55 <****> buu++ # good to know
00:55 <****> anno-: Yes, but nobody cares what you mean.
00:55 <****> buu.
00:55 <****> dwu!
00:55 <****> dwu: meow
00:55 <****> Zoffix.
00:55 <****> f00li5h: purr.
00:56 <****> Zoffix!
00:56 <****> How goes it?
00:56 <****> f00li5h, !
00:56 <****> f00li5h, meow
00:56 <****> Zoffix: purringly, my baby crunching friend


Total 41 pages. You are browsing page 2/41.

First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last


Tutti i nuovi CAP Italiani. Come ottenere il database completo