| |
| |
| |
|
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
Comments:
<0> sili_: amazing ****er <1> buu: jesus loves you <1> payday candy bars are good. <1> better than christian babies <2> doh.. how do i translate this to &permute() syntax?: permute {print"@_\n"} split; <1> &permute {} split <3> permute syntax? <2> sili_, gives me syntax error <4> paq: try with sub { } and a comma afterwards. <1> eval: sub permute (&@){}; &permute {} split <5> sili_: Error: syntax error at (eval 109) line 1, near "&permute {" <2> simcop2387, i want to run the above code with -Tw and get the error: Can't call method "permute" without a package or object reference <3> paq: that means that permute isn't defined <1> eval: sub permute (&@){}; &permute {}, split <5> sili_: Error: syntax error at (eval 109) line 1, near "&permute {" <1> eval: sub permute (&@){}; &permute({}, split)
<5> sili_: Return: <3> whats wrong with for (split...) {print $_} <2> simcop2387, it is defined in the same file, it works fine when i run the file without -Tw <6> BINGOS <4> Yaakov: hi! Happy P***over. <2> simcop2387, i dunno, i'm trying to get the Fischer-Kause ordered permutation generator from perlfaq4 to work here <7> "TPC" at 83.248.32.73 pasted "need help getting a specific data from a specific line in an array to a scalar variable" (21 lines, 1.6K) at http://sial.org/pbot/16678 <3> paq: theres another problem then <3> paq: hold on <8> anyone midn taking a look at that? <3> perldoc perlfaq4 <8> mind* <1> just permute(sub {}, @list) <9> The perldoc for perlfaq4 - Data Manipulation is at http://perldoc.perl.org/perlfaq4.html <6> Hello, rindolf. Thanks, you too. <1> & is dumb <4> Yaakov: thanks. <10> ok, now i found out what's wrong <10> mode stuff only displays when whover got changed around quits :-/ <3> paq: why not use Algorithm::Permute <2> simcop2387, i dont want to include (and depend on) a whole package when these 8 lines should suffice <2> simcop2387, i guess i'm just having a syntax problem, this function is way above my head <3> paq: sili's solution should work looking at the function <6> COW <2> simcop2387, that gives me: main::permute() called too early to check prototype <2> wow didnt think this would be so tricky <11> HELLO PAQ <6> There's some kind of pie in my underpants. <6> No, no--that's the refrigerator. <11> Hrm. <6> How did that get in there? <2> sili_, do you have another hint for me? :] <11> paq: What is your problem? <2> buu, please see above, i'm trying to get the permute from perlfaq4 to work when -Tw is enabled <2> buu, the code is here: http://perldoc.perl.org/perlfaq4.html (search for "Fischer") <12> paq, stop calling permute in a BEGIN block? <10> how do i use grep in an if? <2> Ani-_, there is no BEGIN block i think, i'll post my code to pastebin, sec <11> I'm so confused. <2> Ani-_, buu, that's the code that i'm trying to run: http://pastebin.com/650218 <9> The paste 650218 has been moved to http://erxz.com/pb/946 <13> buu! <11> EWAIZ <13> My Wound has scabbed over and it's transparent and when I move my fingers, you can see goopy red **** swish around. <14> paq: put function definitions at the start of the file <11> ew73: hahaha <11> ew73: Yay stigmata! <13> buu: It's ****ing awesome. <2> mauke, is there a way to use it without putting it above the call? i'd like to have the permute function at the end of the file, together with my other utility funcs <10> what does grep return when there's no results? <15> 1 <14> paq: PUT ALL FUNCTION DEFINITIONS FIRST <11> paq: Perl doesn't care where the function definition is. <14> yes, it does <12> paq: either define the sub before the call or add a forward definition at the top... or drop the prototpyes all together and use permute sub { ... }, LIST <11> mauke: When does it care? <12> paq: I still wonder though... does it work under -T? (It really shouldn't IMO) <2> mauke, hum.. i never did that, but admittedly i'm not a perl pro.. just calling them by &func has worked for me so far, why is this one special? <11> Oh, prototypes <11> Bah <14> buu: when you call them without parens
<11> paq: Because you're using stupid prototypes. <14> paq: don't use & to call functions <2> Ani-_, it works when i put the definition above the call.. but i'm not sure whether i like that <12> mauke, the parents are completly unrelated... <11> paq: YOU HAVE TWO OPTIONS. <14> Ani-_: wrong <11> paq: 1) declare the sub before you use it <12> mauke, ... <11> paq: 2) Stop using prototypes. <12> mauke, does this code have parens?: perl -wle 's1(5, 7); sub s1 ($$) { };' <14> Ani-_: yes <2> buu, i have tried "stop using prototypes" as Ani-_ suggested.. i don't know what to put for sub { .. } though. is ".." to be replaced with the whole function body? <12> mauke, and yet it still warns... so why would the parens matter? <14> Ani-_: perl -wle 's1 5, 7; sub s1 {}' <12> paq: try: permute sub {print"@_\n"}, split; <2> Ani-_, gives me syntax error :( <12> mauke, oh right... I thought you were saying why the order matters in the code he pasted... <14> see? <12> paq: permute( sub {print"@_\n"}, split); <2> Ani-_, ha! this works but i get a warning: main::permute() called too early to check prototype <2> Ani-_, any way to get rid of that? <12> paq, I know. I told you to get rid of the prototypes. So remove them from the subroutine line. <2> Ani-_, aah.. i put &permute( sub {print"@_\n"}, split); <2> now it works flawlessy <12> paq, NO. <2> why no ? <13> Ani-_: Just give up. <2> ew73, i'm just trying to learn here, sorry my cluelessness <16> is perl on win32 dying or something ? I installed activestate perl but can't seem to find much modules that actually work (missing dependencies in CPAN, nonworking stuff etc) <12> paq, because that means you are BYP***ING the protoptye checking. You did not REMOVE the prototypes. <6> Clues are dangerous. <13> I once saw a clue walking down the street carrying an AK-47 and raining down hellfire on anything that moved. <13> And by 'clue' I mean 'rebel' and by 'street' I mean jungle, and my 'AK-47' I mean the spreadfire gun from Contra. And by 'seen' I mean I was playing Contra. <6> I once saw a clue totally uppercut a kid just for asking a FAQ. <16> I just wanted to make an NT service do some stuff but even getting the modules (from way back 2001/2000) is a hell of a job <2> Ani-_, okay, and in what way could that cause me problems? as far as i know it should only cause trouble when i call the function with wrong arguments, or is there another trap that i'm not aware of? <16> wsup with that ? <13> up up down down left right left right b a select start <16> should i run another perl version on windows ? <12> paq, prototypes can cause many problems. Especially when you are clueless. You are clueless so do not use them. <17> ew73 - not 'a b'? <13> ayrnieu: Muscle memory says b a. <6> And by "clue" I mean clue and by "uppercut" I mean uppercut and by "FAQ" I mean FAQ. <2> Ani-_, can you please elaborate, what kind of problems? <18> do you understand the concept of learning to walk before trying to run? <6> Learning to drag yourself by your lips before learning to crawl? <2> yes i do <18> that too <6> Wikipedia is not an authority! <12> paq, can yes. Am I going to? No. Knowing that won't help you. There are more importants things that you need to know. <2> but the "called too early" was only a *warning*, not an error. so i ***ume overriding it doesn't change a thing (other than suppressing the warning) since the code is still the same (plus an &) <2> Ani-_, ok where should i start reading? :) <10> odd <18> why did you put in the prototypes when you don't know what effects they have? <10> any POE gurus around? <18> why DIDN'T you look up what effects they have? <19> the revolution will be blogged on wikipedia <10> my POE app is behaving odd <19> dngor: run! <12> paq, start reading on what <> really is and why it might be a bad idea. The problem thing for that code would probably be to read from STDIN. <10> it doesn't respond to stuff in realtime <16> so getting info about perl + win32 from you guys is just as easy as getting the stuff to actually work ey <2> Khisanth, i learned the bits of perl that i know "by example".. so i have used &func to call my functions (which were declared in the end of the file) forever, without really thinking about it <16> that's just great <18> most of us don't work in windows <0> What rubbish examples were you reading? <18> probably some from google, it's full of rubbish <20> speaking of rubbish, I just saw the Chronicles of Narnia. Excellent film. <18> s/some// <2> Ani-_, to *be* read from stdin? as in what?! <18> it's rubbish but excellent? <19> my Windows box at work holds up the Linux machine's monitor <0> as in <STDIN> ?
Return to
#perl or Go to some related
logs:
perl2exe mime MySql5 NPTL #math margin-spacing css #lgp v5 thedarkside select distinct by two columns mysql #postfix ubuntu nv 1600 1200
#fedora
|
|