@# 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 29 30 31 32 33 34 35 36 37 38 39 40



Comments:

<0> q[ender]: beloved Andi
<1> GumbyBRAIN, beloved Yaakov
<2> q[ender]: Yaakov, you know, by listing their ***ignments before the resurectin.
<3> GumbyBRAIN, If you strike me down, I shall become more powerful than you can possibly ima...hey...how'd you get a pink lightsaber? that's so cool I want one
<2> Shadda: So the first one down.
<4> mauke: same error
<1> the resurectin, hmmmm
<1> sounds like a disinfectant or something
<5> mc__: are you sure the url refers to the right program?
<4> yes
<1> it is definately coffeetime
<6> hello
<6> how can I redirect a shell stdout so it becomes my stdin ?
<0> HELLO
<7> mc__: How can it be that AFTER reading the idiot's guide, you still hadn't checked the error log?
<7> mc__: That's the most important message the guide tries to convey!



<5> mc__: oh, what happens when you run it as ./script.pl, not via perl script.pl?
<6> mauke: ok I read the 3 manual pages, but I didn't find anything useful
<5> too bad
<7> Not anything?
<6> thanks for you help...
<7> Either you're really smart, or unable to read.
<8> after a search syntax: $str =~ m[.{$pos}(?:\*/)]g; i want my next search to begin from position 0 again and not from where it found the match. how can i do that?
<6> all I want is to get the stdout of a command and use it on my script
<5> ufk: don't use /g or reset pos($str) to 0
<5> gapes: like, in a variable?
<8> $-[0], $+[0] works without /g?
<5> sure
<6> yes that would be great
<5> gapes: third paragraph of perldoc -f system
<9> system To access this perldoc please type, at a command line, 'perldoc -f system'. If you lack this package you may also find it at http://perldoc.perl.org/functions/system.html
<10> i have about 5000 lines in a textfile, in the format of an id and a status, for example a few lines: 001:ACTIVE 002:INACTIVE 003:ACTIVE and so on, one per line. the program i like to make in perl will ask for such an ID, and then will tell the status of either Active or Inactive.can someone tell me how to approach? must i load the file containing the id`s into an array?
<5> gapes: you can do it with open too, but there are only like 6 examples for reading from a command in perldoc -f open
<9> open To access this perldoc please type, at a command line, 'perldoc -f open'. If you lack this package you may also find it at http://perldoc.perl.org/functions/open.html
<11> overrider: you could use an array, OR a hash, OR you could loop over the contents of the file each time
<11> it's really up to you.
<6> mauke: " The return value is the exit status of the program as returned by the "wait" call." <= Is it what you are refering to ?
<11> overrider: are you going to be doing this multiple times in the program?
<11> gapes: This is not what you want to use to capture the output from a command
<5> gapes: no, the rest of the paragraph
<11> gapes: the words AFTER THAT tell you how to capture output from a command!
<11> (although the comma on that line should be a semicolon)
<12> hi all, quick q... if there's a statement in a perl app if ($a eq $b) { .... }
<12> is there a way of setting $b to a list?
<5> Joran: no
<12> e.g. $b = 'a|b|c|d'?
<11> Joran: you mean, "how do I tell if $x is in a list or array?"
<5> $b is a single value, a list is multiple values
<13> that's a faq, jack!
<11> perldoc -q contain
<11> Joran: read that
<5> Joran: that's a string, not a list
<13> now buubot needs to respond with "perldoc perlfaq" when I say "that's a faq, jack!"
<9> perlfaq - Perl frequently asked questions To access this perldoc please type, at a command line, 'perldoc perlfaq'. If you lack this package you may also find it at http://perldoc.perl.org/perlfaq.html
<12> no, was just pondering wether to use the existing script or write a new one in bash
<13> thank you buubot.
<11> Joran: heh, ok.
<13> that's from "Stripes", by the way. and other places.
<12> I'm not a perler, so was clarifying how the script works, and if it'll do what I wanted without moding.
<10> japhy, yes, it is basically in a constant loop, asking over and over for an id and returning its value. would the loop be the best performing choice?
<0> Joran: if you learn perl, you will probably prefer it to bash for anything sophisticated.
<12> I know too many languages to add another ;-)
<13> forget 10 languages, learn perl.
<13> overall, you'll be happier.
<5> Joran: what languages do you know?
<13> I can recommend a good book or two. :)
<12> nah, most of my languages are compiled and I can do everything I need in them... learning is not necessary, clarification sometimes is :-)
<13> Perl is compiled.
<13> so why are you distinguishing that?
<12> gah
<5> languages aren't compiled
<13> *people* are compiled. :)
<12> perlcc? I guess?
<5> Joran: no, perl
<1> data is compiled



<13> No - every time you say "perl"
<13> your code is compiled to byte-like-code, and executed.
<5> it's like javac && java in a single program
<13> none of the slowness of traditional "interpreted" languages.
<13> perl spends very little of its time figuring out *what* to do, and most of its time *doing* it.
<1> C IS FASTAR
<13> C is like the darkside... "not stronger, but quicker to react" :)
<1> hahaha
<12> that's the point thogh, you need the compiler wherever the code is... that's not compiled. compiled is creating a distributable binary ;-)
<13> Joran - see PAR
<5> Joran: no, it's not
<13> turns your perl program + modules into a single executable
<13> if *taht* is your blocking issue.
<14> merlyn: only once you go to c, youll always come back to perl, unlike the darkside
<15> perl is compiled it's just not outputted into nice binaries
<5> q[ender]: as you can see from http://www.spoj.pl/ranks/SBANK/ , perl is faster than C++ and C
<16> lol
<10> can someone else answer my question, it seems that japhy has gone to the bank. the question was when you have a program that is in a constant loop over and over asking for an id, then returning its ***ociated status value which it gets from a ~5000line textfile, what is faster? loading it into an array, looping trough it, or storing using a hash?
<1> now I'm wondering where python, ruby, etc., fit into this mix
<13> overrider - try it!
<13> "what is faster" is rarely a single answer
<0> Perl is a way of telling your computer about your ideas. C is a way of programming your computer to use perl.
<10> merlyn, i couldnt if i wanted to, i must first learn it
<1> hah
<10> merlyn, but ok, i got the message
<15> python is like some weird kid in the corner, it can't even get 2.0/3.0*3.0 to be 2.0, answer comes out as 1.9998 :\
<17> overrider: hash generally
<6> open(LS, "ls|");
<18> hi
<13> a lot of people use Perl without actually trying to learn it
<13> gapes - no
<13> please to be using glob. :)
<17> overrider: but as merlyn indicated it does depend on the situation
<13> my @names = glob ('*')
<18> i want following regexpression: is should accept everything from \S+ but except of [ character. how can i write it ?
<6> merlyn: no ?
<12> nah, I don't think perl is worth my investment... just a distraction that I don't need at present (got too many of them ;-) )
<10> ok thanks. merlyn, which where those books you could recommend? :)
<13> please to be readink faster. :)
<5> [^\[\s]+
<0> gapes: Was that an example of open with a pipe or an attempt to get the output of ls?
<13> overrider - see http://learn.perl.org/
<0> gapes: And, if the latter, why do you need the output of ls?
<13> free books, and books to pay for.
<6> nope just a test Yaakov
<1> 5000 lines is pretty ambiguous... i mean, how long are these silly lines? 2 bytes? 1k? if you know the file will never be too huge, i'd say just slurp the whole thing up
<6> i dont need the output of ls
<12> thanks for the clarification anyway guys.
<18> mauke: will it not negate even \S ? aa i see
<6> ls will be replace by truss or strace
<18> mauke: is there a way to have some expression with \S ?
<0> gapes: OK, merlyn misunderstood you.
<10> q[ender], the lines are looking like this 0001:Active or Inactive
<5> sleon: huh?
<13> sorry... thought you were trying to get a file list
<18> mauke: ^ negates everything in [] right ?
<6> Yaakov: yes, I noticed that to late
<1> overrider, well that won't be too big then
<10> so 0001:ACTIVE, 0004:INACTIVE, 0010:ACTIVE etc
<13> because ls is a crazy way to do that. :)
<17> overrider: are you using 0001 as a key?
<5> sleon: yes
<18> mauke: so it make \S+ without [
<6> merlyn: yes of course, thanks
<10> pravus, yes i am intending so. our employee id`s look like that
<5> sleon: why do you think you need that?
<18> mauke: but sometimes it is needed to have sort of and concatination for [] expressions
<17> overrider: you could read in each line, parse out the 0001 and the active and just stick it in a hash
<18> mauke: just so :) there is | which is logical or
<18> mauke: then what is logical and
<5> (?= ), kind of
<17> overrider: very simple operation and a hash would be faster than an array if you are looking up by key... that's what they are designed to do :)
<18> mauke: can you please give me that example how would i write without negation ?
<19> but (?= ) doesn't allow anchoring its end to another point in the regexp so it's not easy to use it as a logical and


Name:

Comments:

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






Return to #perl
or
Go to some related logs:

T23 turn off numLk
unicodedata.name example
alsamixer dsp2
php-cgi Accelerator gentoo
#ubuntu
preg_replace_callback 100k
#lisp
#asm
GODADDY openssl perl
error: broken count > 0 ubuntu



Home  |  disclaimer  |  contact  |  submit quotes