| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
Comments:
<0> yup <0> it's actually quite smart <0> fastest way to do that. <1> thx <0> $digits = $scalar =~ tr/0-9//; <2> *sigh* <2> wonderful <2> i'm calling a string as a lambda somewhere <3> hmm.. I know this is ugly.. but how could one access the 'HASH(0x8173e0)' again ? <2> perldoc perlreftut <4> perlreftut - Perl references short introduction. To access this perldoc please type, at a command line, 'perldoc perlreftut'. You may also find it at http://perldoc.perl.org/perlreftut.html <2> read the six rules. be happy. <3> not happy <3> read <5> is $var =~ s/(^[\s\t]+|[\s\t]+$)//g; the best way to trim?
<3> the problem is, I'm using eval as a part of user interface in my application <2> qdot: well, you're donig something wrong then. <3> now, for debugging purposes, I want to be able to access an object which is not lexically referenced in the current context, but a user knows its address <2> bnovc: \s includes \t, for one. <6> Botje : whats the best way to reason when you get a question like that? <5> oh :) <7> zing <2> qdot: there's a str2ref thingie floating around somewhere. <5> i was just wondering if there was something like trim() <2> bnovc: not necessary. this isn't php. <5> Botje, well i'm aware but its best to find out <8> of course that is making the ***umption that the thing being ref isn't already dead <1> what's the smartest way to check whether a scalar contains an int-value (only)? regex? <3> Khisanth: it's not <2> Raptor`: state diagram is generally the easiest, for me. <2> you should try writing down some words of the given language first <2> try some edge cases <2> see if patterns emerge. <9> paq - /\D/ ? <3> Khisanth: in debug mode my widgets display their references in tooltips.. I want them accessible <1> dec, thx, just wondered if there is a "faster" way <0> paq - there's Scalar::Util looks_like_a_number <0> or if not /\D/, yes <9> oh yeah, Scalar::Util... forgot about that :) <0> or Scalar::Dude looks_like_a_lady <9> nasty, merlyn :) <2> I like the idea behind the state diagram of {a^j b^k | j+k = 10000} <0> eh - it's just a stones song <2> it's funny. it's wicked. it's evil. <0> Not stones... the other guys <0> or maybe <0> darn it <0> the one with liv tyler's dad <0> aerosmithy <2> you can't smithe air. <0> "under the spreading chestnet tree... the village smithy stands..." <3> Botje: google knows little about str2ref <0> I had to memorize that for a cl***. <0> I hated memorization <0> it's so *not* me <2> yes. <0> I'm a paraphraser. <3> Botje: perl debugger is written in perl, isn't it.. how does it work ? <0> I jump out of an airplane, and utter phrases just in the nick of time. <0> qdot - when -d is enabled <0> there are certain subroutines called <0> it's up to you to define those <2> qdot: barely. <3> merlyn: not how do you use it.. it's how does it do what it does <0> the default pulls in perldebug.pl <0> or something like that <2> it hacks into the perl runtime. <0> but you can say -d:MyThing <0> and it'll pull in Devel::MyThing <2> it defines certain callbacks which get called at appropriate times. <0> and turn on debugging hooks <2> i'm sure perldoc perldebug mentions it <4> perldebug - Perl debugging. To access this perldoc please type, at a command line, 'perldoc perldebug'. You may also find it at http://perldoc.perl.org/perldebug.html <0> Or just look at the source for the debugger. <0> or look at the source for Devel::ebug <0> that's probably a better starting spot
<0> that's a good API for debugger-like things in Perl <10> "devonst17" at 66.92.32.215 pasted "CPAN error: "install POE"" (20 lines, 2.1K) at http://sial.org/pbot/17219 <3> merlyn: well.. all I need from debugger is to convert a string representation of an hash into a hashref <11> devonst17: Mail that to bug-poe@rt.cpan.org <12> damn <12> I was hoping it was easily fixable <2> qdot: why are you juggling with string representations anyway? <2> perl abstracts that whole icky "pointers" concept away for a reason. <0> qdot - use Data::Dumper <0> or Data::Dumper::Streamer <0> Oh - you need "eval" <0> my $hash = eval "{ key => 3, key2 => 5 }"; <0> like that <0> there are safe undumpers though <0> I don't know why you'd go to the "debugger" for that. <0> I did an article on "safe undumper" <0> ... http://www.stonehenge.com/merlyn/LinuxMag/col29.html <0> & moving locations <13> eval seems to be very useful. <12> dngor: I think I may have a fix... in the cfg of POE I said test network... HTTP::Request hasnt been installed yet and its not listed as a req for POE <3> merlyn: no.. I have an object, defined and lexically present in some other part of the code, and unaccessible in the place I'm doing eval () <3> merlyn: I have this object print it's position so user can verify its context from an arbitrary point in the code <3> merlyn: basically what I do is a lot of metalinguistic programming (heil 6.001, it's damn useful) for a scriptable gui.. <3> Botje: I have things defined somewhere else, for which user might know their string representation and I want them 'wormholed' back to the context somewhere else <2> It sounds odd. <3> Botje: do I have to work around it by creating a global hash keyed by string representation ? <2> I don't know. <14> can I store an array into one hash key, and if so, is this right? <14> $pictures{$thisPic} = ( $name, $schools{$1}); <15> tinny: you store an array REFERENCE <2> *sigh* <15> $pictures{$thisPic} = [$name, $schools{$1}]; <15> perldoc perlreftut <4> perlreftut - Perl references short introduction. To access this perldoc please type, at a command line, 'perldoc perlreftut'. You may also find it at http://perldoc.perl.org/perlreftut.html <2> why does noone know about references? <2> well, I made some semi-good progress today. <2> time to go and sleep <11> devonst17: It's not an absolute requirement for POE. The real fix is to skip that test if HTTP::Request isn't available. <14> now, if I foreach(@album) (which are the same keys as the hash) how can I print those arrays back out as text? <14> right now it's printing ARRAY(0x64d4) <14> not exactly what I want <2> tinny: perldoc perlreftut. <2> read the six little rules. be happy. <0> perldoc perlreftut <0> definitely <4> perlreftut - Perl references short introduction. To access this perldoc please type, at a command line, 'perldoc perlreftut'. You may also find it at http://perldoc.perl.org/perlreftut.html <2> (can someone *PLEASE* move those up?) <14> printf OUTTXT "$pictures{$_}[0]\t$pictures{$_}[1]\n"; <14> done <14> thanks for your help guys <2> for the "IF I HAVE TO PRESS PGDOWN I DONT GET IT" crowd <3> Botje: I know how to use references and stuff.. I don't know how to hack references and I want to :D <14> hey, I'm actually learning something, and using perl <2> qdot: but it's excessively painful to do so. surely there must be a better way. <3> tinny: good for you.. I'm trying to commit crime on perl abstraction and go home to cute pointers :D <14> well, using 116 lines of perl and 6 hours, I've saved myself 20 minutes of typing <14> but when I have to do it again, it'll only take me 1.2 hours of figuring out what it does <14> so I'm making progress <16> 20 more minutes of documenting it.. <3> Botje: there is only one other way, to create a top-level hash containing references together with their string representations <3> Botje: but I am sure perl holds similar thing somewhere internally anyway.. the question is, whether the developers were nice enough to hook it to external API <0> there is no string representation <0> until someone asks for it <3> well, yes <3> but references internally are pointers <0> correct <0> so what's the "internal hook" you need? <3> to be able to convert a (32bit) number back into pointer <17> qdot: no, the question is how much work you're going to do before you realize you're going in completely the wrong direction :) <0> Uh - there's a lot more than that <0> it's a pointer to the *structure* <3> yes <0> you can't just take a number and turn it into that structure <3> so afterwards I'd have to bless it
Return to
#perl or Go to some related
logs:
openSuSE KDE mount flush dependencie libexpat suse perl mysql_real_escape #perl #suse grpahmatica ubuntu + switching wireless networks
emule morphix #linux vmplayer command line option
|
|