| |
| |
| |
|
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> what could be the problem if i must just my script allways with perl scriptname and not with ./scriptname (also chmod +x scriptname) <0> or i get no ouput <1> stuv, what error does the shell gives you? <0> Ani-_: i get no ouput ... only if i invoke it with perl scriptname <0> then all works like normal <1> stuv, can you do a: head -n1 scriptname | perl -ple 's/./sprintf "%02X", ord $&/eg;' <1> (Please turn that /eg into /seg.) <2> Wow. <2> Rose::DB ****ing amazing. <0> Ani-_: .. 23212F7573722F62696E2F6E65777065726C <2> how awesome. <0> what should that be ?? <3> Ani-_: don't worry, for in swedish is fr <4> does saying "sort { $a cmp $b unless $b eq '<S>' }" guarantee that <S> will always be sorted to the top <1> stuv: can you try: /usr/bin/newperl scriptname ? <5> sort { $b eq '<S>' or $a cmp $b } probably
<0> Ani-_: that works .. <4> ok, that makes a lot more sense <6> Could someone tell me what if(/^[<>]/) would match? <0> but i use this as first line: #!/usr/bin/newperl <7> anything starting with < or >? <1> stuv: I know. That's what 2321... told me. <7> ^if you are matching by line <6> paulgb: I thought so, thanks :D <0> Ani-_: but what is the differenz and how to solve this problem ? <2> eval: print "hrm" if " bleh" =~ /^[<>]/; <8> EvanCarroll: <2> eval: print "hrm" if "< bleh" =~ /^[<>]/; <8> EvanCarroll: hrm 1 <2> not a difficult test. <0> buubot: print "hello"; <9> is there a way write a windows service with perl <1> stuv, as far as I can tell it should work... <7> eval: print "hello"; <8> paulgb: hello 1 <0> r3nd3r: i would stick to c and winapi <5> iood: yes, what i said <9> r3nd3r, no but is there ? <0> Ani-_: when i'm in same folder like the script and use ./scriptname (i've not forgotten chmod +x scriptname) <0> i get no ouput :( <1> stuv, try: echo -e '#!/usr/bin/newperl -l\nprint "ok";' > /tmp/test_perl.pl ; chmod 755 /tmp/test_perl.pl ; /tmp/test_perl.pl <10> whats going wrong here? - i wish to replace all uppercase, with lowercase characters --> =~ s/ ([A-Z]+) / \l $1 /g; --im a bit stuck. <6> eval: print "hrm" if "[128 ms] blah" =~ /^\[\d+ ms\]/; <8> AI_coder: hrm 1 <0> opus21: tr/[a-z]/[A-Z]/ <1> eval: $_="A Word WHICH ..."; s/ ([A-Z]+) / \l $1 /g; $_; <8> Ani-_: A Word WHICH ... <1> eval: $_="A Word WHICH ..."; s/ ([A-Z]+) / \l $1 /g; $_; <8> Ani-_: A Word WHICH ... <10> hmm this also worked: =~ s/([A-Z]+?)/\l$1/g; <0> Ani-_: prints ok <1> stuv, do not use [] in tr///. <6> eval: print "hrm" if "[128 ms] blah" =~ /^\[\d+ m\]/; <8> AI_coder: <11> perlbot regexp <12> eval: 8**10 <8> snL20: 1073741824 <11> !perlbot regexp <1> eval: "\lABC"; <8> Ani-_: aBC <9> perlbot <1> opus21: \l makes the next character lowercase. \L makes the entire string lowercase. <0> opus21: $_="test"; $c=tr/a-z/A-Z/; print "$c: $_ \n"; <9> perlbot, hi <13> hi r3nd3r <9> perlbot math 1+1 <13> 2 <10> Ani-_, thanks :-= <10> :-) <1> opus21: you are replacing (some) completly uppercase words with a space + space + itself + space <1> opus21: the proper s/// construct could be something like: s/([A-Z])/\l$1/g; But don't do that. Us tr/A-Z/a-z/; instead. (it is LOTs fasters) <10> Ani-_, no.. smth like " NameABCD" <0> Ani-_: how to get the string inside the "" ( <a href="THISTEXT"> ) ??? <14> or just use UC <1> opus21: it won't replace those. Your regex says: space + only uppercase letters + space. <14> err uc <10> Ani "tr" ?
<0> i know allready a bit about regular expressions .. but i don't know how to find a text that is in the middle of 2 regexpressions :( <1> opus21: perldoc -f tr/// # and perldoc perlop <8> tr. To access this perldoc please type, at a command line, 'perldoc -f tr'. You may also find it at http://perldoc.perl.org/functions/tr.html <1> stuv: can you try this: perl -wle 'use Module::That::Should::Not::Exists;' ? <0> Ani-_: what u mean ?? <6> eval: $_="[128 ms];$time = $1 if /^[\d+ ms\]/;print $time; <8> AI_coder: Error: Can't find string terminator '"' anywhere before EOF at (eval 132) line 2. <0> the script works when started like i showed you <1> stuv: I mean: run that command. <6> What is $1 in /&[\d+ ms\]? if $_ == "[128 ms]" ?? <11> what do that mean "unique line" for 's option' in 's///gs' ? <1> stuv: The command you ran earlier did do /tmp/test_perl.pl which is basically the same as cd /tmp; ./test_perl.pl. You said it outputted ok. so it does work that way. <6> Not &[ <0> Ani-_: BEGIN failed.... Can't locate Module/That/Should/Not/Exists.pm in @INC .... ? <6> but \[ <15> what sintax would I use to get the after effects of a filter? <0> when used like /usr/bin/newperl scriptname it works ... but not with ./scriptname <1> stuv: can you look in the script for a close STDERR or an open STDERR? <0> nope ... it's just a real simple one <1> stuv: type: cd /tmp in that directory type: ./test_perl.pl <1> stuv: it is a really simple script and it does work that way doesn't it? <15> here is my list http://pastebin.com/715495 <15> that is before <15> this is the hand-edited after just the fiest few packages for example http://pastebin.com/715503 <0> [root@sheltergw perl]# ./extract_url.pl <0> [root@sheltergw perl]# /usr/bin/newperl extract_url.pl <0> Not enouth parameters given!\nUsage: XXXXXXX\n at extract_url.pl line 14. <0> [root@sheltergw perl]# <8> The paste 715495 has been moved to http://erxz.com/pb/1591 <8> The paste 715503 has been moved to http://erxz.com/pb/1592 <0> Ani-_: you see : the first line no output .. the other second works .. <10> could some one come with an example in difference between "+?" and "+" ?.. <6> How do I strip whitespace preceding a nl? <1> eval: $_="abcbd";s/.+b//; $_; #note_the_absence_of_g <8> Ani-_: d <6> s/\s+\n//g; <1> eval: $_="abcbd";s/.+?b//; $_; #note_the_absence_of_g <8> Ani-_: cbd <1> stuv: do the same in /tmp for test_perl.pl. <0> Ani-_: http://rafb.net/paste/results/FVdSQ915.html (script and the output example) <8> The paste FVdSQ915 has been moved to http://erxz.com/pb/1593 <16> can i give my program a handle to a console just like cmd.exe ? <0> Ani-_: LOL ... when using /tmp/extract_url.pl it works ... but with ./extract_url.pl it doesn't lol <0> Ani-_: (after cp extract_url.pl /tmp) <11> what's wrong with that please, i have an infinite loop with the first match while ($response->content =~ m/$regexp/sg ) <4> imMute: doesn't work, actually. at least, i don't think it does. <0> so what could this be ?? i'm realy out of ideas <1> stuv: please run: mount | grep noexec <0> no ouput <0> it only doesn't works when in same folder :P <15> anyone <0> mom <1> lanchow: are you doing another regex on $response->content? <0> i know allready a bit about regular expressions .. but i don't know how to find a text that is in the middle of 2 regexpressions :( <11> Ani-_: no <11> Ani-_: it is an object of LWP::UserAgent <5> iood, i just tested that and it does <4> imMute: for every imaginable input? :) <1> lanchow: you will need to copy it into another variable before using it. <4> imMute: i'll try to come up with a short counterexample <1> lanchow: the problem is that (or atleast from what I just saw in HTTP::Message) $response->content returns a different variable each time. <5> iood: show me something that doesnt work <0> Ani-_: which regex does match one ore more different characters ? (like * in dos) <0> i thought it was .* <1> perldoc perlreref <8> perlreref - Perl regular expressions quick reference. To access this perldoc please type, at a command line, 'perldoc perlreref'. You may also find it at http://perldoc.perl.org/perlreref.html <11> Ani-_: good it works as you said, thank you <1> Don't expect me to be repeating the docs. <4> imMute: good enough?: @a = (1, 3, 5, 8, 9, 1, 2); print sort { $b == 8 or $a <=> $b } @a;' <4> imMute: or am i just missing something :) <5> eval: @a = (1, 3, 5, 8, 9, 1, 2); [sort { $b == 8 or $a <=> $b } @a] <8> imMute: [1,2,8,1,3,5,9] <5> wtf, that just worked... <6> I have a simple question, if I use this piece of code will it automatically read a newline every time one line of code executes?
Return to
#perl or Go to some related
logs:
#physics hpet qemu error hdc totem disable autoplay Se7h skype launch+win+arp
#ubuntu #ubuntu #linux 8388608 Content-Length php
|
|