| |
| |
| |
|
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> how do i get the list of parameters p***ed through CGI? <1> fgxi: perldoc CGI. <2> The perldoc for CGI - is at http://perldoc.perl.org/CGI.html <1> tech: keep a counter <1> tech: they're called "processes" and not forks. <3> integral: yup, i know, i read the doc page on cpan before asking here :-p <4> integral, but how will my program know when a fork exits? <1> tech: umm, because you're already using wait/waitpid and/or SIGCHLD... <1> tech: you sound like you've failed to learn how to use processes. Do that. <1> rutski89: no env vars like PERL5OPT set? <3> integral: not to my knowledge <1> it's not hard to *check*. don't guess when you can check. <3> yea, but I don't know how to check :-p <1> echo $PERL5OPT <3> would it be listed in the plain old "env" output? <1> that's *BASIC* unix stuff.
<1> Yes. <3> nope, its not set <3> does "perl -MCarp=verbose" set an env var too? <1> no, but you're not using that, you said you were using -MCarp <3> yea, i am using -MCarp <3> i was just wondering <3> oh, on another note, I'm securing this cgi script I wrote. I have this line that populates a variable with the data from a file: my $js; $js .= $_ while <FILE>; I'm thinking... could there ever be errors when reading from the file? should i put a die there? <3> where exactly would i put a die in there anyway? <1> a die where? <3> heh, that's what i was wondering :-p <1> normally people use a "slurp" idiom, like; $js = do { local $/; <FILE> } <1> die "not enough data" if length($js) == 0; ? <3> well... I already have a test that die's if the file isn't opened for reading properly... hmm.. but the file could be empty <3> no, i was thinking in the "while <FILE>", lets say the file is really big, and it gets deleted in the middle of being read. what would happen?/ <1> You need to learn about your operating system (POSIX / UNIX). <5> (windows) <5> (etc) <3> bleh, I just got up man. I know all about env vars and stuff... <3> that must have made me look dumb asking what you meant :( I'm no expert on unix, I'm pretty new, been on it for ~1 year. <6> how should I open a file to be able to seek() inside it? <3> Never done any serious programming though, so I don't really know what would happen if a file was deleted while being read by a loop <5> Try IO::File for the encapsulated approach <7> rutski89: that depends on what os, windows or unix <3> oskie: the doc page for seek says its "seek FILEHANDLE, POSITION, WHENCE" so anywhere you use a file handle to open, you should be able to seek as well... e.g. with open or sysopen <3> b_jonas: unix <6> rutski89: I don't understand why I get 'cannot seek in file: Inappropriate ioctl for device' <3> oskie: can you paste-bin your code? <7> rutski89: on unix, you can read it as if nothing has happened, and only when you have closed all file descriptors to the file will it be truly gone, <8> b_jonas on windows, at least in theory, you can't delete a file while in use <7> because deleting a file only deletes its name <6> open(FILE,'<','.randbg.cache') || die "$!"; seek FILE,0,0 || die "$!"; <6> rutski89: that's the code <3> b_jonas: sweet, so basically I don't even have to check for errors there. Wow, unix is smart :-) <7> avar: yes, and on dos which doesn't take care of this, you just mustn't delete a file while it's open <3> lol <8> b_jonas: DOS is so nice <3> hehe <7> rutski89: there may still be conditions when you can't read the file any further, like when the link with the NFS server goes down etc <7> avar: on older versions of dos. newer versions have file locking and all that <3> heh, yea; there are always issues with NFS. This is ever gona be on NFS though <3> oskie: weird, that really gives you an error? <7> oskie: you have to add parenthises around the (FILE,0,0) too, for the same reason you have them around the open <9> I'm using LWP::UserAgent to post to a web form. I use the request method to do that actual posting, but how do I get the Location part of the headers back? <6> rutski89: yeah I guess it's because the file is already at zero... <3> maybe, i'm trying it now myself <7> because this way it means seek(FILE, 0, (0 || die)) which always dies <6> rutski89: ok, that worked better! <3> oskie: ahh, lol, yea, b_jonas got it right <3> use "or", not "||" <3> "||" binds too tightly <10> By the way, I've decided to give up Perl for Ruby, starting today. <10> It's been nice knowing you all. <3> both "||" and "or" short-circuit , right? <10> Perl6 is just taking too long to get here. And the money is in Ruby on Rails now. <11> I gave up perl for php ;p <7> merlyn: for one day only or for a month? <3> merlyn: hehe, have fun :-p <3> I'll never give up perl <3> oskie: still there? <7> merlyn: have you read "http://www.perlmonks.com/?node_id=540609"? it mentions you too <6> rutski89: yeah! ok, it's 'or' then
<10> ... http://vanirtjones.livejournal.com/335589.html <3> I only see him mentioned in the "Perl Apirl Fools TImeline" <10> Yeah, I followed the link to make sure he had the right announcement <3> oskie: yup, but make sure that "or" does a short-circut, I'm not 100% sure it doe <3> **does <10> he missed the 1999 announcement where I made sh2perl "Y2K compliant" <10> both or and || are semantic identical <10> the only difference is precedence. <3> merlyn: cool <3> oskie: yup, use or <10> You see, I have a bit of experience with Perl. :) <3> merlyn: lol, yea <3> merlyn: don't leave :( Ruby is just a fad :-p <10> The internet is just a fad. <12> merlyn: what's your opinion of inside-out objects a la PBP? <3> I have an error reporting question. I do HTML::Template(filename=>"something.tmpl"), and if that file isn't found, HTML::Template spits out a 4 line mess of errors. I tried to add "or die 'my errorr'" to the end of it, but HTML::Template still spits out the 4 lines of error, and my custom error string never gets reported. How do I make it so that I decide what the error output will be? <3> what's PBP? <12> we're rewriting a large chunk of legacy code at my job and i proposed using a simplified inside-out object independent of Cl***::Std <12> perlbot PBP <13> Perl Best Practices by Damian. http://www.oreilly.com/catalog/perlbp/ <14> rutski89: www.oreilly.com/catalog/perlbp/ <3> ahh, I have that book. It's next on my list, after CGI Programming with Perl <10> I wrote a recent article on inside-out objects, and a talk. <10> that's the talk I'm giving to YAPC-BR in fact <12> cool <10> I think IOO solves a few problems, and raises a few others. <3> merlyn: wait... are you Damian? <15> Ahh, inside-out objects. The thing that finally gives us what Java has had for centuries... <10> Uh no. <10> But I've met him quite a few times. <3> cool, what's he like? <12> my version's only dependency is Scalar::Util::refaddr and provides public/private attributes and subs <15> ...a lot of extra work with no real productivity benefit. <10> "are you damian?" "no" "then f you. what's HE like?" <3> is the book in good humor like "Perl" by Orwant Cirsitansin and Wall? <12> not a *lot* of extra work <3> wow, i bet i got their names way wrong :-p <10> rutski89, /whois merlyn :) <3> merlyn: hehe ;-p I only asked because you said you meet him, and i'm gona read his book soon <10> he's a crazy, mad, ozzie. <3> merlyn: ahh, hi Ron :) <3> I'm Patrick <10> Huh, who's ron? <3> oops, read the a in your name as an o <15> merlyn: R.*on <10> heh <3> merlyn: actually I'm not wearing my gl***es at the moment... so yea :-p <10> rutski89 - have you read my columns, or my books? <10> The IOO article might not be online yet <10> it's fairly new <12> d'oh <10> and there's that little embargo to deal with <3> merlyn: nope, I only got into perl like 2 weeks ago <7> why, his name is R...on according to whois <10> rutski89 - get "Learning Perl" then <12> our main concern is the fact that IOO aren't storable by default <15> merlyn: rutski89 What, 2 full weeks without encountering some of merlyn's stuff? <7> R... perl felon <15> s/merlyn: //; s/rutski89/rutski89:/ <3> merlyn: I've read learning Learning Perl, and I'm on page 500 of "Programming Perl", and I'm almost done with CGI Programming with Perl <10> read the alpaca then too <3> Juerd: lol <10> "intermediate perl", nee "Learning Perl Objects references and Modules" <3> merlyn: I have it, Its either 2nd or 3rd on my list <3> I bought a _lot_ of perl books <10> you should read it before the camel <15> rutski89: Oh, you did encounter his stuff then. <3> oh, cool; he's the author <15> Or, if you're a fast learner, Beginning Perl instead of llama/camel/alpaca :) <3> merlyn: thanks for the book man :)
Return to
#perl or Go to some related
logs:
#dns python omni completion #perl #perl obsidian xchat symbolic link #suse WARNING: *** Could not find curses library. gentoo podcast udev fscking slow MULTIPATH: interface round robin algorithm
|
|