#perl - Thu 15 Mar 2007 between 15:07 and 15:13



LeoNerdgodzirra: er.. in the terminal, even
Ani-_godzirra: and it's not related to screen. It's your terminal (as LeoNerd just said)
Khisanthdhar: it isn't great but not bad either :)
godzirraDear god, I love you guys.
Thats caused me so many freaking headaches.
dharKhisanth: sometimes its the right tool for the job :)
Ani-_godzirra: ctrl + s = screen lock
godzirraGot it.
Thanks :)
Mooki_9384Ani-_: i dont get it ... quotemeta?
Ani-_Mooki_9384: perldoc -f quotemeta
LeoNerdperldoc -f quotemeta
Khisanthdhar: I don't care much for its memory usage though
Mooki_9384Ani-_: thx!
dharKhisanth: the thing that kills me is OO overload
Khisanth: thing = ObjectFactory.createObjectCreator.SomeTypeofObject.circleJerk( thing )
my wrists have never hurt so much
Ani-_You don't like to type all that?
rindolfMooki_9384: don't use quotemeta.
Mooki_9384: use String::ShellQuote
Mooki_9384rindolf: no?
rindolfMooki_9384: no, don't - it's not what it's intended for.
LeoNerdI've never liked the whole "apply extra quoting" model
Khisanthdhar: that is why you need an IDE! :P
LeoNerdWhy not just be immune from shell expansions in the first place?
Namely; use my open() suggested above
Mooki_9384rindolf: ok.. but i cant get it to run.. pls a small example!
rindolfMooki_9384: first run urpmi perl-String-ShellQuote
LeoNerdopen( my $child, "|-", "program", @args ); my $s = join "", <$child>;
Mooki_9384rindolf: got it thanx!
rindolfMooki_9384: as root.
LeoNerd^-- @args gets passed directly to the execve() call
Shell never comes close. No quoting required
rindolfMooki_9384: or do as LeoNerd said assuming you don't want to have special shell operations like pipelines, etc.
LeoNerdDon't go sticking extra quoting in just so you can join them all into one string so that the shell can remove the quoting again and split the string and then run the command you wanted... Just run the command.
Mooki_9384LeoNerd: i wouldnt mind.. but now its got every space aeparated part of the var as a separate file passed to my command
LeoNerdYes.
That's because of quoting
So just follow my example
Mooki_9384rindolf: should i use shellquote and system?

Page: 2 9 16 23 30 37 44 51 58 65 72 79 86 93 

IrcArchive