@# 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> well I have the line: AddHandler perl-script .rrdcgi in httpd.conf
<0> so the server knows its a cgi
<0> but it seems like it's being executed with perl, rather than rddcgi
<0> I know the script works, because it runs from the command line fine
<1> Right, your server is set up to run anything with .rrdcgi with Perl. Isn't that what you were expecting?
<0> I want it to run with rddcgi - as specified in the shebang line
<1> But your server is set up to run that using Perl.
<2> anyone know if microperl hardcodes the libraries locations? i can't just run microperl, but with LD_LIBRARY_PATH=/lib microperl, it seems to work
<2> i looked into uconfig.sh, doesn't seem to have any lib location stuff there.. hm
<0> but doesn't perl look at the shebang line to know which perl interpreter to use?
<3> tkp: no
<0> oh
<0> well how would I make it use the one at /usr/local/rrdtool/bin/rrdcgi?
<1> tkp: Unix/Linux does that. Not Perl.
<3> Perl looks at the shebang line
<1> I'm guessing, change your web server configuration.



<3> talexb: which is why you shouldn't use -w, amongst other things
<4> no. that's the system not perl
<4> the shebang line tells the system what program will execute the rest of the file
<3> eggzeck: yes it does
<0> right, so how come rrdcgi isn't being used - as specified in my shebang line?
<1> I don't think the web server looks at the shebang line.
<3> avar@Rancorwe:/tmp$ (echo '#!/usr/bin/perl -w' && echo 'print $^W') | perl -l
<3> 1
<3> avar@Rancorwe:/tmp$ (echo '#!/usr/bin/perl' && echo 'print $^W') | perl -l
<3> 0
<0> well how does the webserver know where perl is?
<5> tkp: it doesn't
<6> perljam.... hmm perl flavoured jam?
<5> blondie: when you open the jar of Perl Jam, all you see is punctuation :)
<0> well, how could I possibly make my script be executed by rddcgi and not perl?
<1> tkp: For the third time, by changing your web server configuration file.
<6> :S
<0> talebx: sorry, I've just been pissing arround trying to get this to work for ages
<7> I seem to have problems with references... print shift says HASH(0x8272d70), but my %hash = shift says Reference found where even-sized list expected. What's wrong?
<8> hmmm. i have a hashref, and i want to convert it to a bunch of local variables... something like this: foreach my $var (keys %$hr) { eval 'my $'.$var.' = "'.$hr->{$var}.'";'; } ... but of course that puts the variables in the scope of the for loop, not the block outside... any ideas?
<9> my %hash = shift; # wrong
<9> my $hash = shift; or my %hash = @_; depending
<0> any ideas what I might have to do to my webserver configuration?
<9> brianski_werk: no.
<5> brianski_werk: why would you want to do that?
<9> brianski_werk: my $var = $hash{var}; my $b = $hash{$b};
<9> perlbot: varvar
<10> Why it's stupid to `use a variable as a variable name' - http://perl.plover.com/varvarname.html
<1> tkp: Remove the part that says 'Use Perl when you see an .rrdcgi extension'.
<9> brianski_werk: the answer is "you don't"
<8> sili - yeah i am trying to avoid having 10 exactly the same statements like that
<8> this is perl!
<9> brianski_werk: then use the hash.
<8> "you don't" is not a valid answer ;0
<8> i realize this is a fundamentally bad idea
<8> and that i could just access the hashref
<9> so don't do it
<8> but i want to do it for hack value
<8> just wondered if anyone had ideas
<9> that's not hack, it's stupid
<5> brianski_werk: "doctor, it hurts when I do *this*"
<8> sili - yo mama
<9> turn off strict, $$varname = $hash{$varname};
<9> brianski_werk: make sure you use lots of globals.
<7> thanks
<8> no need for them to be global, just to exist after the for loop
<5> brianski_werk: if you *really* want to create lexicals of an appropriate scope, you'll need deeper magic.
<9> deeper, uglier, and stupider
<8> PerlJam - i imagine so, but what is the deeper magic?
<11> the deeper magic from BEFORE the dawn of time
<8> sili - easy killer.
<9> brianski_werk: i've already told you how to do varvar
<12> brianski_werk - it's not the job of #perl to teach you how to shoot yourself in the foot
<12> you should probably move along now.
<9> hello merlyn
<3> merlyn: job descriptions, cool!
<9> perlbot: watch out for that tree, george
<9> i mean PerlJam . hah.
<9> send now, read later.
<7> can there be uninitialized elements in an array?



<9> undefined
<9> frostschutz: what do you really want to know?
<7> I have a for loop like this: for $element (@array) { print $element } and get Use of uninitialized value for that print...
<13> use my
<9> frostschutz: that means $element is not defined (undef)
<9> frostschutz: and you're printing
<9> frostschutz: you could do 'print for grep defined @array' or for my $elem (@array) {print $elem if defined $elem}
<9> or wahtever. basically you're doing 'print undef'
<14> heya
<7> There shouldn't be any undef in that array. Is there any way to debug-print an array including all contents?
<9> YO YO YO WHADDUP FEZ
<14> i'm a total newb i just wanna know what does this mean:
<14> $win32 = ($^O =~ / ((MS)?win32)|cygwin|os2/i) ? 1 : 0;
<15> good evening bunny rabbits, programmers, and hedgehogs.
<9> frostschutz: use Data::Dumper (see perldoc)
<7> thanks
<9> print Dumper $foo
<16> Oh noes, people stole my .eu
<9> buu.eu?
<15> fez: $^O is the current operating system, so that sets $win32 to 1 if it is running on windows
<15> b.eu?
<14> ah
<9> integral: beeyou
<16> sili: Something like that.
<6> OMG Chekov is on babylon 5
<9> i'll ***ume flamingbuuofdeath.eu
<6> star trek crossover?!
<6> (ok maybe not)
<9> cylons for everyone!
<7> ah, perl was overlooking some syntax error
<13> really.
<13> what would that syntax error be, then?
<17> how to read a whole file into a scala without knowing how large the file is?
<18> *g*
<8> ahh time to read about the * sigil
<19> mc_: either File::Slurp or perhaps set $/ to undef
<20> mc_: $foo = join "", <file>
<20> oh right.. yeah, that's better
<18> {local $/; $c=<file>}
<20> mc_: what decay said
<3> sub cat {local(@ARGV,$/);scalar<>}; $str = cat $file;
<9> perlbot: slurp
<10> http://www.perl.com/pub/a/2003/11/21/slurp.html
<21> $str = do { local(@ARGV,$/) = $filename; <>};
<20> what does "do" without a while do?
<21> would there be a perldoc page for that?
<9> perlbot: relearn slurp as http://www.perl.com/pub/a/2003/11/21/slurp.html and $str = do {local $/; <>}
<10> relearn slurp as http://www.perl.com/pub/a/2003/11/21/slurp.html and $str = do {local $/; < isn't something I know about, sili
<22> tybalt89: yes, sigh
<9> perldoc -q slurp
<21> hehehe
<9> maybe not :/
<9> perlbot: relearn slurp as "http://www.perl.com/pub/a/2003/11/21/slurp.html and $str = do {local $/; <>}"
<10> relearn slurp as "http://www.perl.com/pub/a/2003/11/21/slurp.html and $str = do {local $/; < isn't something I know about, sili
<9> blah. the < is messing him up
<22> huh.. it just returns the last thing in the block
<14> thanks
<14> i was able to submit a build patch for mozilla firefox thanks to knowing that tiny piece of perl
<22> weird.. you can "do foo.pl"
<22> err "do 'foo.pl'"
<21> do 'foo.pl';
<9> do $file or die$!
<22> learn something each day
<19> xaxxon: there is an article on perlmonks showing how to use that for config type stuff
<22> pravus: ndo
<21> yoda: do or do not $file;
<19> xaxxon: eh?
<22> pravus: *nod
<9> do not $file is kinda :/
<22> as in "oh"
<23> Anyone ever used perl to create an https connection using local certificates? I'm converting a php that uses curl and three files: client_cert.pem, client_key.pem and ca_cert.pem .. but I want to do it in perl (and preferably without curl as I want to be able to distribute this to idiots)
<9> even in perl you'd need LWP which is not included with perl
<9> or is it?
<23> (curl being curllib + the perl-curl glue which is xs and so needs compiling)


Name:

Comments:

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






Return to #perl
or
Go to some related logs:

bluflops
prune automake emerge
ubuntu private socket dir: Permission denied gdm
#css
#python
#web
ndiswrapper-utils fc5
split ebuilds e_modules
$((63*512) qemu
#perl



Home  |  disclaimer  |  contact  |  submit quotes