| |
| |
| |
|
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 35 36 37 38
Comments:
<0> BinGOs: Oh? <1> YAY FIGHT! <2> s/****ing//--ing/ <0> Lol <0> integral: Syntax error <1> you fail at self-censorship. <0> What would perl say? <0> eval: $var = "****ing"; $var =~ s/****ing//--ing/; <3> dazjorz: Error: Can't modify substitution (s///) in postdecrement (--) at (eval 125) line 1, near "s/****ing//--" syntax error at (eval 125) line 1, near "--ing" Bareword found where operator expect <4> dazjorz: You depend on a module for your tests that introduces a raft of dependencies. <2> "she could get into quite a strop about the anodised titanium gnomon..." <0> BinGOs: I know, but it's the only way to test them <0> BinGOs: The only way to test my module is using Test::Expect <4> and one of those dependencies IO::Tty which is notorious for not working on certain platforms. <0> BinGOs: True
<0> BinGOs: You think it'd be better to skip_all all tests if Test::Expect isn't installed? <5> Botje: The perl interpreter built into /home/rutski89/apahce/bin/httpd returns "5.008008" as the string! :) <0> Lol <1> rutski89: is that good or bad? :p <0> rutski89: Typo? <5> Botje: It appears as though mod_perl decides which perl to use based on which perl Makefile.PL is run with :) <0> rutski89: /home/rutski89/apahce" <5> Botje: that's good <1> yay <5> dazjorz: oh, yea, apache, not apahce. <5> dazjorz: nice catch <0> rutski89: I hope for you that that was a typo, not a copy&paste directly from your terminal. ;) <5> Botje: no playing with LDFLAGS required <1> details <1> yay :p <5> dazjorz: heh, yea, it was a type-o <5> now to try to solve the last mystery <6> I have an array of hashes, $foo[0]{'bar'} ... how can I grab all values from field 'bar' into a separate array. preferably in the same order as the original array of hashes <5> if mod_perl is NOT built as a DSO, does Perl's libperl.so have anything to do with the perl interpreter built into httpd? <0> MicroChip32: You have an array ref insode $foo[0]{'bar'} and want to put the contents of the referent of that reference (phoo) inside a new array? <7> MicroChip32, map { $foo[$_]{bar} } 0..$#foo <0> MicroChip32: Or you have a hashref inside $foo[0]{'bar'} and want the values of the hash in a new array? <0> MicroChip32: If last, values %{$foo[0]{'bar'}} will get you the array <6> dazjorz : no. $foo[0]{'bar'} is a scalar. i want to put the values from that field in each element of $foo into a new array. and i think rpete has the right idea, tho wrong structure <0> MicroChip32: References are scalars. ;) <6> dazjorz good point <0> It's a string. :) <7> MicroChip32, structure looks right to me, based on what you've said <6> dazjorz and your values thing looks right, hrm, didnt think of that. i think rpete's map would work too <2> "Remember you must die" <4> dazjorz: Ja. maybe do a simple test and another test that skips if it doesn't find Test::Expect <6> rpete no, the map idea would work, but your use looks wierd. id think more like map { $_->{'bar'} } @foo <0> MicroChip32: "... is a scalar. I want to put the values from that field" The values of one scalar? I don't get the idea <0> MicroChip32: Could you get me the output of Data::Dumper? <6> @foo is an array of hashes <6> one of the fields of those hashes is 'bar' <1> *hashrefs <6> i want the contents of 'bar' from each record in @foo, into a separate array <0> BinGOs: Well, the module does in total, if I remember correctly, 8 tests. Somehow, Test::Expect reports the results of each test two times. So first and second is running of Expect.pl, and the rest is basic checking if the features of the module work correctly <6> and i think both your values() and rpete's map will work <0> BinGOs: So there's nothing to test if Test::Expect isn't installed <6> i hadnt thought of either of those. still waking up i guess <4> dazjorz: make two test scripts and do a simple use_ok() test for the first one then. <4> Or tell me to **** off and die. <1> WELL <1> BACK TO MY OS. <0> BinGOs: **** off and die. <6> Botje : LOL ask and you shall receive :) <6> er, BinGOs i mean <1> BinGOs: can i have your wife when you die? : <8> how would i forward any error messages of 'ls' out to null? i've tried 2>/dev/null but i still see the error.. <6> thanks dazjorz and rpete <0> meff: How are you running 'ls'? <0> meff: Through backticks or system() ? <1> meff: why are you using ls anyway? <8> dazjorz: backticks <0> meff: Yea, what Botje said <8> Botje: its a quick hack for what im doing, its just a tiny script <0> meff: Remember: Perl can do anything basic system commands can. And if it can't, make it can. <4> Botje: you're ****ing welcome to her. She moans all the time ;) <6> er, nope, values wont work, but the map wil
<6> l <1> meff: so use globs or readdir. <4> erm moans as in nags. <1> BinGOs: arr :( <4> heh <0> meff: opendir DIR, "/the/dir"; while(my $dir = readdir(DIR)) { print "The filename is $dir\n"; } closedir DIR <7> MicroChip32, your map is more efficient than mine <0> MicroChip32: No, values didn't work, because I thought there was a hashref in 'bar'. Your data structure is very hard to understand. <0> eval: opendir DIR, "."; while(my $dir = readdir(DIR)) { print "Filename $dir " } closedir DIR; <6> dazjorz not really, its just a mysql query return <3> dazjorz: Return: <8> dazjorz: what i am checking for is the existance of 2 .txt files.. so just loop through the readdir results and add up the lines with .txt on the end? <0> No files in current directory, buubot? <0> MicroChip32: There's @foo, and %foo[0], %foo[1], %foo[2] etcetera <1> dazjorz: WTF <7> heh <0> Microchip32: And there's a $foo[0]{'bar'}. And you want to get ? <0> Botje: ZOMG! <7> this discussion is settled anyway I think :-) <1> dazjorz: you should hit yourself for even *THINKING* of typing %foo[0] <0> Botje: Yea, It just helps me think. <0> Botje: Stupidity, huh. <6> ( ( bar=>'one', blah=>'two' ), ( bar=>'three', blah=>'four' ) ) .... i want to get 'one' and 'three', the values of bar in each hash, into a separate array <0> meff: Try this: my @txtfiles; opendir DIR, "/dir/" or die(..); while(local $_ = readdir(DIR)) { push @txtfiles, $_ if($_ =~ /\.txt$/) } closedir DIR; <6> which the map will do <1> MicroChip32: perldoc perlreftut. <3> 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 <0> MicroChip32: Then you've got your answer. :) <9> I kind of like the hacker logo my web page goddamit <9> on my <0> Teratogen: Show me! <6> dazjorz did that help explain my structure tho ? <9> no! <9> =P <0> MicroChip32: Not at all, it just gave me a headache, but that's no problem ;) <6> LOL =) <0> Teratogen: Admit it, you just hacked into your own system and put it there! <0> A few months ago, when I was at school, I browsed to my website hosted at my server at home <0> I was like "What the F***!?!?!" <0> There was this big message like "Hacked by blahblah" <0> And these green and black stuff everywhere. <0> Turns out that a program I was using at that moment, VHCS, had been exploited *shame* <1> smae on you. <0> Smaegol! <10> hello <6> is saw someone yesterday who looked like smaegol <0> Hello ^Nikos <10> can you please telle a repos that has CGI.pm v3.2 ? <0> MicroChip32: You don't accidently live in the place where I live? <0> ^Nikos: Is that the newest version? <0> or something? <10> yes <11> Hi ^Nikos <11> ^Nikos: try backpan.org <6> stranger yet, in the same place i saw someone who looked like frodo <0> ^Nikos: It's probably available on CPAN. <10> hi rindolf <0> MicroChip32: They're recording Lord of the Rings IV secretly <6> dazjorz : not unless you live in the wilds of michigan <0> MicroChip32: Gladly not <0> MicroChip32: Although I would like to see how Smeagol and Frodo look like in real life. ;) <6> dazjorz nearest town of population over 1000 is like 20 miles away <6> maybe 2000 <0> ^Nikos: If it's the newest version, it's on CPAN, otherwise, you can find it on Backpan. <0> MicroChip32: The perfect set for a movie like Lord of the Rings 4 <10> dazjorz, yeap! cpan had it! thank you :) <6> dazjorz too flat <0> ^Nikos: np :) <10> ;) <0> MicroChip32: Not necessarily <0> MicroChip32: Depends on what they're going to do <6> true <0> MicroChip32: I know! They're going to do a storm at some village - and let that be yours by accident ;) <12> Botje++
Return to
#perl or Go to some related
logs:
div-stretch javascript
#linux #mysql cygwin xdcmp ubuntu on n5495
#egghelp shadowpaste #qemu #perl #asm
|
|