#perl - Thu 3 May 2007 between 18:16 and 18:20



Placidso " or ' or / is in fact the same
regardless of the character used
it's just a delimiter, as it were?
bru802If I have several forms on a page, can someone confirm, if this would select/follow the first form with the field username: my @forms = grep {$_->$mech->field()=~ /username/i }$mech->forms(); $mech->form($forms[0]);$mech->field('username','username'); ?
integralIT ALWAYS TAKES A PATTERN.
Can I be any clearer?
Placidprobably not
integralAlways, walways, always (except " ")
Ani-_All those damn exceptions! :)
Caelumdkr: that triangle thingy just gives me a blank line, perl -e '$}=1|1<<pop;print($"x$},(map$_?$=:$"x2,@;),$/),@;=(1,map$;[$_]^$;[-$_],1..@;)while$}--' right?
PerlJamintegral: Wait ... you mean the first argument to split is a ... what again?
PlacidWhat's the difference with "?
integralPlacid: None! It's always a pattern (except " ")
Ani-_Caelum: add 7 or something
Caelum: note how pop() is used. That means it expects an argument.
Caelumdoh, thanks :)
Placidintegral: can you clarify " "? Do you mean a double quoted space is an exception?
integral*sigh* I'm starting to think pretending parrot looks like a real CPU for code generation just doesn't work :-(
Ani-_Placid: perldoc -f split # Read it!
integralEveryone assumes a big flat memory model with pointer arithmetic
PerlJamPlacid: split() has a single special case that if the first parameter is a single, literal, space character, it does something magical
dkrCaelum: http://www.perlmonks.org/index.pl?node_id=188405
PlacidPerlJam: thank you
integralPlacid: Read perldoc -f split, it makes the one special case clear.
The one to which I've been referring.
PlacidAni-_: i have, it didn't explain my actual quesiton, which was to do with speed.
integralI had assumed you'd read the docs, recently.
PerlJamPlacid: optimize algorithms, not code.
integralYes, but whenever something doesn't do what you expect, check the docs!
dkrCaelum: note the part, "Specify the size on the command line" and the "pop" functioni n the code, :)
integralI'm surprised you noticed the speed before the incorrect result.
Placidintegral: which i did. It hasn't explained the speed.
integral: someone was benchmarking, you see
integralSo? Your benchmark doesn't test the result? woops.
You need to build better benchmarks.
Placidlol
Ani-_Placid: then you didn't read it properly.
integralAnd always benchmark real algorithms, not microoptimizations
Placidindeed, but the comparison was between regex and a call to substr & index
sure

Page: 4 11 18 25 32 39 46 53 60 67 

IrcArchive