@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
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



Comments:

<0> not if it ****s _tcc
<1> Nola: you say qw in your title, but you're using qx (bad bad) and mean qr
<2> Yaakov: thanks
<2> Somni: Ok merlyn!
<1> eh?
<3> hi, guys. how should I do for find all installed modules ?
<4> I think that was sarcasm, though I am not certain.
<5> _tcc: I did not learn that way. I learned by reading books/taking advise from Perl Mongers.
<6> I am looking at some other perl threading code, and it works fine.
<6> Only difference is that they store the thread in $threads[$thrd] = Thread->new etc etc..
<4> Somni: Nola is newly perl-employed having thrown off the shackles of php!
<5> _tcc: Don't jump too far ahead. Learn some Perl first.
<1> hokay
<6> eggzeck, I've coded perl...although I'm not good at it. I am ready to begin threads.
<2> Somni: the title of the paste was a typo... the code, was my ignorance :)
<7> Anyone know whether you can 'recover' a partition table on a running linux box if someone messed with it?



<2> I tried out HTML::Prototype today.. pretty cool.
<5> eval: $string = "Hello there"; ($match) = $string =~ /(there)$/; $match;
<8> eggzeck: there
<5> Nola: ^^ - And you shouldn't use $& , slows things down
<5> Not so drastically, but you know :p
<1> drastically
<2> eggzeck: Thanks... this is just a sample script from the Learning Perl book, trying out different regex.
<1> $& can easily become a real problem
<5> Nola: Oh I see
<1> even with test code you should become used to not using $&
<1> lest it become habit
<2> Somni: ok I'll write in margin :)
<5> Somni: No, the book will later on teach her the best ;)
<1> yes
<1> I'd say even with book examples, find the alternative to $&; it'll be a good learning experience, and it'll get you used to it
<5> Somni: The book later on explains $1, $2, etc/
<1> a book should not be showing examples with it; $& was such a mistake
<1> I'm aware of what BP explains
<5> s{/}{.}
<2> Somni: it does say this freedom comes at a price.. and says that many programs will never use this
<5> Somni: Don't attack what you haven't read/used. It's like saying someting ****s without even using it.
<1> eggzeck: are you serious?
<4> eggzeck: I think he read it.
<5> Ahh, well I didn't know that then. Although he must know that it does explain $& ;)
<1> and I'm saying it shouldn't have code examples using it
<5> I believe one should know about EVERYTHING.
<5> And why not to use it, etc.
<2> Somni: its just one example and it says, normally you don't use this.
<1> honestly, why do you keep telling me what BP says?
<5> Instead of not being in the _know_, then if you ever see it, you'd be like, "wtf is $&"?
<1> I'm aware of what it says, I'm saying it shouldn't
<1> and I'm not saying it shouldn't mention $&, I'm saying it shouldn't have CODE EXAMPLES using it
<1> I am perfectly comfortable with a book giving p***ing mention to $& and pretending it never exists after that
<4> Nola: For the record, $& is NEVER used in practical perl programs.
<2> ok guys! don't fight over it :)
<0> Nola: who are you to tell them not to fight over it?!
<0> :P
<4> Nola: That's why Somni is particularly against it being taught, especially before knowing what IS actually done.
<1> action at a distance by the mere mention of a variable is evil and wrong
<5> haha
<9> anyone around know of a perl application that installs a config
<9> in the user's home dir or something
<1> a statement that does nothing with $&, that doesn't even have a regex before that to fill $&, will affect every regex in the program, before and after
<10> Puppies were killed in the making of this program.
<5> jabra_: Did you jusy copy and paste that question?
<9> ya sorry
<10> jabra_: lots of programs do that. so, yes, I know of a perl application that does that. Hell, I've written some.
<9> scrottie: can you give me a name of one
<9> I need an example to use
<10> yes, ****youall.pl is a little vectorspace search application I use to index web pages in a lot
<10> I haven't released the source, but since you wanted to know the name, there you go.
<10> jabra_: I'm kind of waiting for you to come out and ask for code you can copy, I guess.
<9> i'll figure it out
<9> thanks anyway
<10> my $dbfn = (getpwuid $<)[7] . '/.****youall.db';
<10> my $kb = -f $dbfn ? Storable::retrieve($dbfn) : { };
<5> jabra_: Are you a Perl programmer?
<1> I usually like using the environment before getpwuid



<9> scrottie: I have a makefile using ExtUtils::MakeMaker
<1> $ENV{HOME} for starters
<9> eggzeck: yes
<10> Somni: god thought
<10> good
<4> I am sad.
<6> Hrm, it seems that I need main() to wait for every thread to exit....
<6> How do I do that?
<0> Yaakov: me to
<11> Somni: I like to use getpwuid before env
<0> *too
<4> I think I will go to sleep.
<1> avar: you override the user's choice doing that
<4> Or try, anyway.
<2> Yaakov: why are you sad?
<4> Several reasons.
<11> Somni: The user doesn't really have a choice of home directory
<10> I haven't had to chance $HOME, but when programs don't respected EDITOR... kill 9 time
<9> thinking of using Config::Auto
<1> avar: of course he does, set HOME
<4> Probably not worth talking about, actually.
<11> Somni: ...
<4> Good night, all.
<0> He's sad because Greedo shot first.
<10> for my $thread(threads->list) { $thread->join }
<11> Somni: That changes a mutable env var, not your REAL home dir
<1> HOME=~/test-stuff ****youall.pl
<1> BAM, it just used my test config file
<11> Somni: Which is one of two factors why I prefer getp..
<11> Somni: The other being that it's not at all as reliable
<1> avar: so you prefer to give the user no choice
<10> I like ballgag users, dress them in head to toe leather, padlock the zipper, and store them in trunks
<10> er, like to
<11> Somni: No, I want my code to be logically correct, and using logically correct methods to find out the user's real home dir is not giving him no choice, in particular it does not follow that I'm imposing anything based on it
<11> Somni: print "You home's: $ENV{HOME}" is a logic error
<10> avar: Somni said he liked to use $ENV{HOME} *first*, and I tend to agree.
<10> I don't think he said not to fetch it from /etc/p***wd, just to honor $ENV{HOME} when it's set.
<1> avar: you are imposing the home directory be the system-specified one, instead of the user-specified one
<1> $ENV{HOME} || getpwuid($>)
<11> Somni: What? No that's incorrect too
<1> I like how you think there's a correct answer here
<10> Pointless security is restricting a user from overriding defaults in an application that runs as them, with their permissions, and has the source code available to them. That's not doing it "correctly", that's just a program that has to be copied and modified.
<11> Somni: The intent is to 1. Find the real home dir 2. Do so reliably, for that the env var is worthless
<1> the intent is to find a config file
<1> a config file the user wants to use
<1> it is, after all, their config file
<10> Thank God for Acme::ComeFrom
<1> what is a real home directory? if a user wants some random directory to be the real home directory for your application, why would you second-guess them?
<11> Somni: I'm talking about in general, but even if you want that that might also be a logic error
<1> you would second-guess them because you think you know better
<10> yes, they might put something in $HOME that is wrong. therefore it shouldn't be allowed.
<12> don't worry about 'home directories'. Use $ENV{HOME} for the sorts of things that sensible people use $ENV{HOME}
<12> for.
<11> since your task might be to find a file in the real home of the user, not some **** they made up
<1> avar: you keep saying "real home" like that exists
<1> $ENV{HOME} is the home directory for your application, if it exists; that's why it's set
<1> that's why the variable exists
<10> Users shouldn't be allowed to provide input. They might give bad data. Best to ignore them.
<10> undef is the best untaint.
<13> Is it possible to use unicode/non-latin characters in perl5 variable names?
<1> if you change $ENV{HOME}, suddenly your shell will expand ~ differently; is that any more real?
<10> people who want an argument from their computer should run Windows. Or OS9.
<11> Somni: You're ignoring my point, chosing to belive that there can only be one possible application for finding home dirs, which is some user-supplied config file repository
<1> I'm not ignoring your point, I'm disagreeing with it
<11> Somni: Which might be the case here, but I was making a general point wrt the logic of finding the real home dir with a env var
<1> you keep saying "logic" and "real home dir"
<1> as if they have much meaning here; it's just as logical to use the home directory the user specified as it is to use the one imposed by the system
<10> If you want to lock down what they use as a config file, you need to make the program setuid and store the file outside of their home directory.
<1> it's a matter of who you want to allow to control your application
<11> I'm talking about the logic, or lack thereof of finding system-imposed constructs with user-imposed data
<10> Microsoft... we protect users from themselves... but not from other users of other systems.
<10> An application that runs as the users userid has no business trying to impose *anything*
<10> For applications that run as a user, any lack of a --force option is just an incompleteness.
<1> there are many directories on my system that I own, and store configuration information in; the only thing that makes getpwuid($>) any more my home than one of the others is that I store more stuff there


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #perl
or
Go to some related logs:

#fedora
#math
proxylist.php
#gaim
knopiks usb
samsung SEC 1024
#linux
guilhotine windows
xen Server refused to allocate pty
#python



Home  |  disclaimer  |  contact  |  submit quotes