| |
| |
| |
|
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
Comments:
<0> zn--: You're making a CGI script <1> unless(defined($var) and $var ne '') ... <2> or $foo2=bla$foo= <3> zn--: CGI.pm will present those as empty strings. <0> zn--: And the variable wasn't given or empty? <4> if param('foo1') is not defined <5> my $value = param('key'); defined $value or $value = ''; if ($value eq '') {... <2> pravus yes that is what I'm looking for <3> You might as well do 'if' <2> dazjorz webspam bots are sending my form, and some send nothing <2> some send the right params, some send some null, some forget them <3> Since there's nothign useful that will be false <2> just adding some restrictions so the 200 bot requests a day don't fill up an inbox <4> what does "null"mean? an empty string? <0> zn--: buu said that CGI will give them as empty strings, thus "" <6> \0 ?
<0> zn--: So: if($cgi->param('this') eq "") { it's empty } else { it's filled } <2> so I can just do $foo != "" ? <5> zn--: you can't use != on strings <0> zn--: != is for numbers <1> dazjorz: need to check definedness as well <0> zn--: You want ne <7> sure you can <6> use ne instead of != <7> it just won't do what you want most of the time <2> c# it works hehehehe ok thanks <0> pravus: [04:29] <3> zn--: CGI.pm will present those as empty strings. <5> stop writing CGI programs in languages you don't know <0> pravus: I thought that too <0> pravus, but you guys are probably right <2> mauke I'm not, just editing a line or two of something I didn't write <1> dazjorz: no.. CGI.pm doesn't define params that don't exist <1> ?foo=bar ->params('baz'); returns undef <0> pravus: I knew it! <0> pravus: just thought buu probably knows more about this <0> pravus: I always use defined() too <1> dazjorz: i think buu was talking about: ?foo= <0> pravus: Yea, me too <1> ->param('foo') is defined, but '' <3> Well, yeah, if you define a form with three fields, the browser will try to send them all <2> for me the issue isn't browsers, mine are spam bots <1> zn--: no, your problem is *clients* <3> Ya know, if I had a mother like that I'd never be back.. <8> can someone have a look at my code http://sial.org/pbot/18107 I am a little stuck for some strange reason everything after my 9$content3) is not being executed, and the loop just continues befoe that <1> clients cannot be trusted <1> be they browser or bot <2> pravus correct <9> http://sial.org/pbot/18106 <-- anybody, anybody? <3> What about it <3> samasama: Well it's silly and entirely too long <10> I have only have one more question, how could I work with a string, say I knew that "2005" would be in $var at all times...how could I remove just that? I've tried..everything! (well obviously not :P) <7> frelen678: why are you using a for loop for a single value? <4> samasama - why not use IO::Socket, and reduce that to two lines? <5> Yawgmoth7: you want to remove all occurrences of "2005" in a variable? <7> $foo =~ s/2005//; <3> Yawgmoth7: use s/// <10> *sigh* <10> I guess I'll end up setting up more than one regex <7> of course this sounds like a XY problem <9> merlyn: I've been asked by a higher authority to write it like that <3> samasama: Kill them. <9> heh <4> is this for homework? <10> Oh well, I'll jsut do it like that. <1> Yawgmoth7: $var =~ s/2005//; ? <4> if it's homework, DON'T ASK US <4> ask your teacher <9> nah, not homework <4> asking us is CHEATING <1> cripes i think freenode is lagged <2> I got it working, thanks guys I didn't write this app just tweaking it <4> then what kind of higher authority are you speaking of? <4> besides, we're the highest perl authorities around here. :) <3> merlyn: Cheating rocks! <4> and we say use IO::Socket, or abandon any idea of help <9> merlyn: Boss
<5> yeah, we're totally high <6> especially merlyn <4> get a new boss <6> o/` meet the new boss // same as the old boss o/` <4> have your boss call me, and I'll personally explain to him why you should use IO::Socket <8> Khisanth it worked as it was before, what would u suggest instead? <1> merlyn: and charge a fee, of course... <7> and then there is the catching of exceptions that aren't being thrown ... <3> pravus: I think he drunkely yells down phones for free <9> merlyn: What's so wrong with crafting it by hand? <4> how do you catch unthrown exceptions <3> samasama: It's wasteful, slow, pointless, useless, prone to mistakes, etc <4> samasama - at that rate, your question could extend to "why not code it in ***embler"? <9> merlyn: Good question <6> ***embler is for wimps. machine code! <9> samasama: Is it actually slower? <9> buu even <3> Sure <7> merlyn: I forgot "trying" <7> samasama: if there wasn't anything wrong, you wouldn't need to be asking for help! <7> samasama: to write yes, in execution probably not <9> Khisanth: hmm? <4> & zzz <6> g'night, merlyn <11> I know the answer to this but cant find it on google.. I want to check the value of a scalar, and if it has no value at all {stuff} <11> but $scalar == "" or $scalar eq "" is wrong <4> what does "no value at all" mean? <3> b0nn: What? <8> Khisanth the foreach loop was the only way the program would run <4> geez - why do we keep getting these questions lately? <6> as in "is it defined?" <12> if($scalar) { ... } ? <4> do you mean "zero length string"? <3> b0nn: Do you want defiend? <11> ta chrisbdaemon <4> or defined? <4> or what? <11> I mean has no value whatsoever <12> does ta mean yes or no <4> it can't have NO value <7> frelen678: if you insist <11> ta means thats what I think it should be <4> it's either undef, or an empty string, or a non-empty string <12> do you mean undefined? <4> purl, xy problem <3> merlyn: Well, undef is a no value anyway =] <4> oops. <4> perlbot, xy problem <13> They ask how to do X, but that's because they really want to do Y but think X will get them there and most of the time they are WRONG <4> b0nn - back up <8> but I am wondering what would casue it to go into a loop and ignore everything after $content3 <4> what are you TRYING to figure out <4> what's the problem that this is a partial solution to? <11> Im trying to figure out if a value has been p***ed to my scalar <7> and it's $! not !$ <4> back up - how could it NOT be p***ed? <4> what are the choices? how is this being called? <11> if theres nothing held at that point in my array to p*** <4> what do you mean "in my array"? <11> what do you mean "what do you mean \"in my array" <4> dude - pull attitude, and you get no help. I'm trying to help you <3> IT'S RECURSIVELY GONE PEARSHAPED <4> but I have to figure out what the hell you're trying to do <11> why? <7> although !$; is valid, it is extremely unlikely that you want the logical negation of the subscript seperator <4> because your question doesn't yet make sense <3> b0nn: Just use 'defined' and move on. <4> so I need to move up a level. <14> Khisanth, I want that all the time! <11> it is defined though <4> if it's defined, then it's a value <7> beth_: you don't count <14> :(
Return to
#perl or Go to some related
logs:
sysenter sysleave intel #gentoo #netfilter ubuntu remove openoffice.org ubuntu-desktop #physics Kaeles world of warcraft change theme in xubuntu #gaim #php Could not launch call manager
|
|