| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Comments:
<Caelum> eval: my $n=5; use constant THING => $n; [THING] <buubot> Caelum: [undef] <Snurglewozzle> like $const = sub { param("PID"); }; ? <Caelum> that would work <Snurglewozzle> no this param will be overwritten by other subs and I want to get it from starts and use it later <Caelum> so put it in a variable? <Snurglewozzle> how exactly? <imMute> sub CONSTANT { "blarg" } <Snurglewozzle> I want to put it to a static variable <imMute> Snurglewozzle: think about what you just said <Caelum> Snurglewozzle: my $outer_var; sub stuff { $outer_var = param('PID') ... } sub otherstuff { use $outer_var } ... <hobbs> Snurglewozzle: you don't know what "static" means. :) <me_here> static means use the stack and protect it like hell lol <ramserver> hm <ramserver> is oo really better? <ramserver> damn is it ever catching on <LeoNerd> OO is a tool. It's a solution to certain types of problem <ramserver> but its new <LeoNerd> It can't be judged to be better or worse, without reference to the problem you are solving <ramserver> orig was was proced <ramserver> m <ramserver> ok <hobbs> ramserver: kill yourself now. <jim> ramserver: oo was new in like... 1983 or so <pravus> ramserver: OO is the only way to be marketable in this day and age. you should be learning java and ruby instead of wasting your time with perl. <hobbs> jim: go a bit further back :) <ramserver> grrr <jim> hobbs: well it was smalltalk that was the original appearance, no? <ramserver> anyone here ever see an oo databse work? <Inf3rn0> Wikipedia: "Even though it originated in the 1960s," <ramserver> smalltalk never seemed to have caught on <hobbs> jim: yeah, and that was in use in-house in the 70s :) <jim> yeah... I had an oo database replace my incoming water main yesterday... <jim> it was a lot of work <Caelum> there are a few OO databases, they are just fs storage for objects, mostly for things like java and python, Perl doesn't have (or probably need) one <LeoNerd> You mean an ORDB? <ramserver> no <ramserver> oo <jim> ramserver: try disney squeak if you want to see smalltalk <ramserver> www.squeak.org <ramserver> seaside is touted <ramserver> along with glorp <jim> yeah, I guess that's it <ramserver> GLORP!! <ramserver> lol <jim> the idea for you, would be to get it, learn smalltalk and play with it for like 2 months straight <jim> then you'll see one form of oo and can see why and for what it's better <ramserver> ok <jim> but squeak looks purty <prags2626> /([0-9]+)\/(tcp|udp)\s(open|closed)\s/ <ramserver> glor i am told in the other chat is capacle of sql generation of any complexity <prags2626> i have that for my regex <ramserver> glorp <prags2626> i'm trying to match it against data like: <prags2626> 21/tcp open ftp <prags2626> i don't know how to match the White-space data <prags2626> i use \s, but for some reason it's not working <prags2626> anybody help? <jim> so are most programming languages :P <jim> prags2626: specifics... be informative... put it on as few lines as possible or consider putting your question on a web page... don't leave things out <prags2626> oh ok, got it <prags2626> nevermind <prags2626> i forgot the * <prags2626> jim: next time, will do <prags2626> sorry <jim> no problem, moreorless :) <jim> btw, you might also consider + rather than * for some things <kinections> how do i install Apache.pm from cpan for Apache2? <chrismon> I know how to match with a negative character cl*** <chrismon> but what about a , hrm, negative string match? <Botje> kinections: ehh, you probably want to install mod_perl 2 <chrismon> so "if the string I want to match also does not have this particular string in this particular place" <Botje> chrismon: (?!...) <chrismon> yeah, i've been trying backrefs <chrismon> no space between the ! and the sub expr, right? <Botje> definitely not <Limbic_Region> chrismon - I have a link for you, give me a sec <chrismon> $text =~ s/<span cl***="(?!heading)">([^<]*)<\/span>/$1/g; <Limbic_Region> http://perlmonks.org/?node_id=588315 <chrismon> thank limbic, looking... <Limbic_Region> it isn't exactly what you are after <chrismon> the link or ?! ? <Limbic_Region> the link <kinections> Botje: what do i have to install in cpan for that to happen? <Limbic_Region> see also http://perlmonks.org/?node_id=518444 <chrismon> hah, <chrismon> ??? # doesn't contain foo or bar /foo|bar/ # contains foo or bar <kinections> Botje: Apache2? <Botje> kinections: http://perl.apache.org <kinections> Botje: oh, is it not in cpan? <kinections> Botje: because i've already done that <Botje> no, mod_perl is not on cpan .. <LinuxMafia> hi aquestion <Limbic_Region> lo ananswer <chrismon> hrm, so I'm not sure why then my example doesn't work <chrismon> $text =~ s/<span cl***="(?!heading)">([^<]*)<\/span>/$1/g; <Botje> chrismon: don't parse html with regexps. just don't. <chrismon> i'm thinking that as long as 'cl***="heading"' is in the test, it will continue to match <Limbic_Region> Botje - isn't that CSS? <chrismon> botje, its just not that easy <LinuxMafia> all : what i have to change in "sendRequest(httpRequest, 'post', 'cal.pl', strPost);" if i want to p*** a and b to cal.pl? <Botje> Limbic_Region: <span> ... is very much html <Botje> chrismon: whatever the problem, using regexps will only make it harder. <LinuxMafia> any one? <chrismon> botje, yes, but I'm stuck with what I've got at the moment, or I'd parse it all by hand <chrismon> er, well programmatically <chrismon> but I have to use regex for the momenty <Botje> no you don't, use a html parser. <chrismon> there's got to be a way to say "any string but this" <chrismon> botje, I cannot <Botje> yes you can. <Botje> LinuxMafia: the strPost. <chrismon> nope <chrismon> if this were simply HTML I would, but I can't <LinuxMafia> Botje, oh i got it thanks alot <chrismon> so, you don't know who to "any string but this one" in regex, just admit it ;) <chrismon> er how to <hobbs> chrismon: nor does anyone <Jim497> how could I extract a substring from a string that matches with a concrete pattern? Thank you! <hobbs> chrismon: the language of regular expressions doesn't admit it :) <chrismon> hobbs, i've wondered that for many years <chrismon> always found ways to get around it, not being able to fiture out a way to do it <Limbic_Region> chrismon - ok, so you want to use regexen, why not just use two <hobbs> Jim497: $string =~ /(lots of little rocks) and some cement/ <Limbic_Region> use the first to exclude strings that have the span="heading" <Limbic_Region> and use the second to extract the part you need <chrismon> hrm... <Jim497> Hobbs: ok, thank you! <hobbs> Jim497: but don't forget to add water! <Limbic_Region> next if /span=" <Limbic_Region> er <Limbic_Region> next if /span="heading"/; <Jim497> hobbs: is water important?? <hobbs> Jim497: can't have concrete without water. <Jim497> hobbs: bu my PC is not a "water resist" one... <hobbs> I guess you need to upgrade before you can start processing concrete then. <chrismon> Limbic_Region, can't do that <Jim497> I see, thanks again <Botje> chrismon: jeez, what _CAN_ you do, <Limbic_Region> chrismon - at this point, no one is going to want to help you lest you disclose these unspoken requirements and constraints of yours <chrismon> ok, ?: does it positively, but not negatively <Limbic_Region> you can use one regex but not 2 <Limbic_Region> WTF? <hobbs> chrismon: no, ?: is a non-capturing group. :)
Return to
#perl or Go to some related
logs:
#osdev #math senator32
ubuntu ping proxy bzr create-project kmix consol number of desktops xgl #ubuntu installing disk-admin gnome #perl
|
|