#perl - Mon 2 Apr 2007 between 18:28 and 18:32



ew73Wow, I'm just sort of mindlessly watching and penut-gallery-ing, and ks is pissing me off.
I feel for Randal and integral.
kshaha
actionintegral decides to be very mean and not tell ks about the tutorials that randal got the bot to send them
integraldecides to be very mean and not tell ks about the tutorials that randal got the bot to send them
Randalheh
ksthanks Randal
Randalat this point, I have a far thicker skin than most
but I still hit my boiling point
integraleval: my $ds = { abc => { xyz => 123 } }; sub walk { if (ref $_[0] eq "HASH") { return map walk($_), values %{$_[0]} } else { return $_[0] } } walk($ds)
buubotintegral: 1
integralbugger
ksbeth well i'm trying to re-use existing functions/components instead of re-writing it for the 100th time
ew73pwnecd
Randal[walk($ds)]
integralah!
Randalotherwise you have map in a scalar context
integralks: Well, that's good, but don't blindly pick an incorrect component such as Data::Dumper and then stubbornly stick to it
eval: my $ds = { abc => { xyz => 123 } }; sub walk { if (ref $_[0] eq "HASH") { return map walk($_), values %{$_[0]} } else { return $_[0] } } [walk($ds)]
buubotintegral: [123]
Randalsee - I *am* useful for something. :)
ew73Horray! \o/
Randalalthough I would have put the arrayref into the map branch of the if
integralks: As an exercise, rewrite &walk to use a looping construct rather than recursion.
Randalso the result would have been a nested scalar
overkordbaeverHow do you solve input? My solution doesn't seem to be so nice, a lot of regexp and one if-test for each regex
integralWell, it depends what you want the function to do, Randal :)
Randal"solve" input?
true -it does
ew73I almost always use loops. Recursion gives me a headache.
integraloverkordbaever: Shoot all the users, that way there is no input.
PerlJamoverkordbaever: "solve input"?
Randalif all you want is flat leaf nodes, you did it
integralew73: That's the cheap vodka
Randalif you want a tree rep of the leaf nodes, [] in the map branch. :)
overkordbaeverFor example, i get the input simpledb --get -t cars
for example
Randalyou want an @ARGV parser
PerlJamoverkordbaever: you mean "validate"?
integralGetopt::Long has always served me well.
Randalsee Getopt::(something)

Page: 3 10 17 24 31 38 45 52 59 66 73 80 87 94 101 108 

IrcArchive