| |
| |
| |
|
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
Comments:
<0> Yes. <1> ; is optional on the last statement <0> of a block <2> Khisanth: right <2> that can be the one thing i learn for today then. <0> aboutblank: You might try 'select' <0> aboutblank: Or even the world's largest overgrown selectloop, poe <3> Ecarroll, gee, thanks.... <4> when i have my $variable at the file level, is it in the main namespace? <1> aboutblank: is that a blocking socket or not? <5> could you explain what you mean by 'select' <0> aboutblank: perldoc -f select <6> select. To access this perldoc please type, at a command line, 'perldoc -f select'. You may also find it at http://perldoc.perl.org/functions/select.html <1> hagabaka: it is not in any namespace actually <0> hagabaka: Not really, no.
<0> hagabaka: You were in the main namespace when you declared it, but lexicals don't have symbol table entries. <5> Khisanth: uhh no, unless thats the default <4> oh <3> can anyone at least tell me how to hide the dos box running Perl/Tk scripts on windows? <0> rcc: use wperl.exe <4> hmm, how do I get a variable in the main namespace then? or is there a better way to have a variable accessible from other namespaces? <0> hagabaka: use 'our' to declare package level variables. <1> aboutblank: Blocking => 0 in the constructor <4> thanks <3> buu: use wperl.exe as a module in my program, or run it under wperl.exe? <4> this is fun :) <7> http://pastebin.com/742073 <-- something is wrong, when I try using either the -a or -b flag or both or whatever combination it doesn't run any of that stuff. Feel free to tell me everything I'm doing wrong or am doing messy just know it's like my 3rd perl script I've wrote so...don't expect anything too great :P <1> run with wperl instead of perl <6> The paste 742073 has been moved to http://erxz.com/pb/1380 <0> Yawgmoth7: Why do you have two "if( $opt_b ) " blocks? <0> Er, never mind, I can't read <0> Yawgmoth7: Don't use the form that ****s around with globals. <7> hmm? <1> hagabaka: I hope you aren't trying to do this in a xchat script :) <4> no...i'm parsing a file with Parse::RecDescent, and i need to use some of my variables while running code in its namespace <7> Let me try using Getopt::Long <4> hmm...maybe i should just use functions to return them instead <1> certainly beats using globals <2> de <7> ack <7> I changed it to use Getopt::Long and it's still doing the same thing <7> buu, what did you mean by a form that "****s around with globals"? <7> I have an idea but I want to make sure I'm not confused as I often am <3> is it possible to get PAR to use wperl when building par programs on windows? <0> Yawgmoth7: "As a side effect creates $opt_*" <4> oh wait, it relies on string interpolation, so i can't use a function call :( <2> eval: 'mew' <6> f00li5h: Return: mew <0> rcc: Probably. If nothing else you could rename wperl perl <2> the reason that mew still hilighted me is that buubot was hilighting me by nick too -_- <7> http://pastebin.com/742093 <-- my updated one with Getop::Long that does the same thing <6> The paste 742093 has been moved to http://erxz.com/pb/1381 <8> hi <7> I'm gonna look up some example scripts <7> I'll probably see what I'm doing <7> qrong <0> Yawgmoth7: What is "same thing" ? <7> wrong* <0> Yawgmoth7: You need to add more debugging code. <7> buu, the same thing is if I run that script it doesn't do the if statements. <0> Yawgmoth7: Examine your variables, your data and your ***umptions! <2> Yawgmoth7: don't you not want $ab? since you get $a and $b true when that happens? <2> Yawgmoth7: use strict, use warnings <1> hagabaka: you can resort to @{[]} <8> what are the variables called that are p***ed to a function? <8> is it @_ ? <4> Khisanth: hmm, where can i look it up? <2> nachos: yes. <9> eval: "abcd1" =~ m/\d/ <6> devonst17: Return: 1 <2> nachos: (if you want to make a local copy) my ($foo, $bar ) = @_; <9> eval: $message = "abc"; int($message !~ m/\W/) + int($message =~ m/\d/) == 0 <6> devonst17: Return: <8> thanks f00li5h
<9> eval: $message = "abc1"; int($message !~ m/\W/) + int($message =~ m/\d/) == 0 <6> devonst17: Return: <9> >:( <8> If i set a variable as local, once it exits the function, the variable will be set back to its default value? <8> make that, its origonal value. <0> nachos: Um. Probably, yes. <4> Parse::RecDescent uses a string for all its format, which contains some code refering to variables that will only exist during parsing. but i also want to interpolate some variables in it before even giving it to RecDescent. i could use qq and escape all the "late" variables first, but it's realy tiring and ugly that way... <10> does anyone have suggestions for safely parsing raw HTTP POST data with perl? <10> as in, not using CGI.pm <2> hagabaka: use sprintf <2> hagabaka: sprintf( "$real variable is %s with $moose", '$foos'); <4> hmm, sounds good. thanks <2> hagabaka: any time. <4> do i have to use % for a single percent sign in the format? would %{ create a problem? <2> hagabaka: has to be %s, then it will interleave the arguements <0> hagabaka: You have to use %% <0> %{ will possibly get read by perl first. <4> oh <0> elliotf: Yeah, use CGI.pm <4> but i'm using non-interpolating quote <11> how would i go about executing a command in perl in which I could save the output to a text file? <12> `command > file` <10> buu: it's not a CGI environment <13> NightHawkBandit: look at the open, print, close, and qx commands.. <12> ***uming you mean a shell command. <12> if not you should probably try rewording your question.. <11> thanks <11> yeah i mean a shell command <11> :) <10> buu: I'm referring to raw http post data, not a filtered CGI environment <0> elliotf: Feed it to HTTP::Request and MIME::Body, probably. <10> buu: I've got the http headers, I just need to deal with the POST data.. <14> elliotf: What type of POST is it? <10> woggle: ideally, any kind of post <10> woggle: I'm targetting form submission first <10> woggle: trying to extend perlbal into a general-purpose perl web server <14> elliotf: If multipart/form-data, either fake a request environment (tied filehandle will help) or borrow code from CGI.pm or CGI::Simple. <10> woggle: thanks, I'm looking through CGI.pm, but seems to be expecting a CGI env (unless if I'm mistaken) rather than the raw data <5> what could cause my read command to hang my program? <14> elliotf: For application/x-www-form-urlencoded you can p*** it to CGI's new() directly or to URI::WithQuery somewhat obtusely. <11> so this code is supposed to call nslookup on all the hosts in the list file.. but for some reason it doesn't work: http://www.rafb.pastebin.com/742108 <11> any ideas? <14> elliotf: CGI.pm can accept a filehandle as an argument to its constructor. <14> elliotf: Hm. Nevermind, actually, that's a debugging thing. <13> perlbot doesn't work <15> What do you mean it doesn't work? What happens when you try to run it? What's the output? What's the error message? What did you expect to happen? We need more information to help you. <10> woggle: I'd prefer to abstract it at the protocol level, as it's for perlbal <10> woggle: having CGI.pm mess with the filehandles could get ugly. <14> elliotf: But for application/x-www-form-urlencoded, you can just do CGI->new($data) <10> woggle: but how do I get $data? <14> The body of the request. <10> woggle: I have the raw buffer that I'm reading... <10> ... <10> woggle: I'll give it a go... <14> If you want to borrow code from a CGI.pm like thing, you'll probably find CGI::Simple easier to read. <10> woggle: thanks, I'll do that <10> woggle: CGI.pm is just too big. <10> woggle: mostly I wanted to be able to be safe.. in case someone forges the HTTP headers.. <14> I was speaking less of the size and more of the coding style and lack of historic mistakes. <10> woggle: I wanted to be able to safely deal with any bogus input <10> woggle: right, and I was talking about borrowing code, rather than using another module <11> Paladin for some reason it executes the command, but it doesn't put it into the file... meaning it things that nslookup $host and > text.txt is 2 different commands <10> woggle: as I have limited requirements. <10> woggle: but most of these seem to ***ume a CGI env, which isn't what I'm looking for... <16> NightHawkBandit: that can be done in the shell entirely <10> (unless if I'm mistaken) <16> NightHawkBandit: you forgot to chomp $host <13> NightHawkBandit: try printing out the command line you are executing <13> NightHawkBandit: see if it is really what you think it should be <11> k thanks <14> elliotf: Well, adding an appropriate constructor to CGI::Simple souldn't be that hard... <14> elliotf: (along with modifying its _read_parse...) <11> Paladin hmm its exactly what i think it is <10> woggle: that's my problem, I'm having to parse at the protocol level, and I want to do it safely.
Return to
#perl or Go to some related
logs:
postgre ON UPDATE SET DEFAULT vesa:failed to set up write combining range
#perl #linux Bianchi-Pinkall Flat Tori #oe gnome useflags make.config gentoo 01110000011001010111001001101100 #sql gentoo azureus popup stuck
|
|