#perl
18 October 2007
Total 49 pages. You are browsing page 3/49.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
01:01 <****> ah
01:01 <****> rei_0000: that is the programmatic approach; you can't just say "Hey, I want root!" and your process is given it, you have to run something that's setuid root
01:01 <****> looks like there's a sudo module in CPAN
01:02 <****> cpanp -i Sudo =P
01:02 <****> k, I just wanted to eliminate as many shell outs as I could in this is all. :|
01:03 <****> sudo module on CPAN... that scares me
01:03 <****> haha
01:03 <****> rei_0000: why?
01:03 <****> Somni: shell outs are not precisely portable between distributions at times, this is why
01:04 <****> Sudo - Perl extension for running a command line sudo
01:04 <****> that'd depend on how you're shelling out
01:04 <****> looks pretty trivial to use
01:04 <****> it's not inherently unportable, just typically practically unportable
01:04 <****> but, since it's not possible, I'll use the Sudo module
01:06 <****> some caveats with the Sudo module it looks like but should be easy to work around
01:09 <****> dammit, I need to move to postgres for p3m, I need some transaction love
01:09 <****> hi
01:09 <****> stupid mysql inheritance..
01:10 <****> After using List::Util (shuffle), I have the line "@decks = (shuffle(1..52),shuffle(1..53),shuffle(1..54));" but it seems @decks consists of nothing but blank entries. What's wrong with it?
01:10 <****> Somni: switch to the innodb tables, they have transactions.
01:11 <****> Botje: that would involve a lot more sites than I'm willing to test at the moment
01:11 <****> you can switch per-table
01:11 <****> :p
01:11 <****> any changes to the database configuration require verification that it doesn't affect the other sites
01:11 <****> awwh
01:12 <****> WOOT
01:12 <****> i feel your pain Somni I have to deal with the same sort of constraints
01:12 <****> Anonycat: works for me.
01:12 <****> they are self-imposed constraints, but I'm not going to accidentally break a site if I can help it
01:12 <****> someone just sponsored me a Intel Xeon 3060 Dual Core Conroe Processor :)
01:12 <****> wweee heeeeeeeeeee
01:12 <****> postgres is installed, and I have been meaning to move over to it
01:12 <****> worth of $200/mo
01:12 * pkrumins dances
01:12 <****> and trances
01:12 <****> this is as good a time as any to start
01:12 <****> TRANCE ON
01:13 * CPAN upload: Net-Proxy-0.12 by BOOK
01:13 * CPAN upload: CSS-Minifier-XS-0.01_04 by GTERMARS
01:13 * CPAN upload: JavaScript-Minifier-XS-0.01_04 by GTERMARS
01:13 * CPAN upload: Apache2-Filter-Minifier-CSS-1.04_02 by GTERMARS
01:13 * CPAN upload: Apache2-Filter-Minifier-JavaScript-1.04_02 by GTERMARS
01:13 <****> eval: use List::Util qw(shuffle); @decks = (shuffle(1..52),shuffle(1..53),shuffle(1..54)); \@decks;
01:13 <****> Somni: [38,36,24,6,47,34,26,27,25,5,39,48,37,40,22,45,31,29,21,12,15,41,44,2,9,8,13,42,50,28,46,49,30,3,10,17,18,32,35,33,23,14,52,11,43,20,1,51,19,16,4,7,9,11,8,27,51,24,46,47,18,7,1,20,35,32,4,45,39,17,42,44,6,30,15,26,22,16,38,2,13,43,40,31,12,50,10,37,3
01:13 <****> Anonycat: probably what is wrong is the lines you chose not to show us. :)
01:13 * CPAN upload: Apache2-PageKit-2.15 by BORISZ
01:13 <****> "sponsored you"?
01:13 <****> yeah, bought me a server
01:13 <****> a dedicated
01:13 <****> right after that I have "print $decks[0][0]; print $decks[1][1]; print $decks[2][2];" for testing, and it prints 3 blank lines
01:14 <****> Anonycat: um, you only made an array of one level, if you want more than one you need to use references
01:14 <****> Anonycat: you should also be using strict and warnings
01:15 <****> @decks = ([shuffle(1..52)],[shuffle(1..53)],]shuffle(1..54)]);
01:15 <****> Anonycat: @decks = (\shuffle(..),\shuffle(..),\shuffle(..))
01:15 <****> except without the typo
01:15 <****> and yes, read perldoc perlreftut
01:15 <****> Botje: yours won't quite work right
01:31 <****> so i have a huge array, is there any quick way to get those elements which values are repeated?
01:32 <****> Use a hash.
01:32 <****> grep {$x{$_}++}, @list
01:32 <****> s/,//
01:32 <****> ok
01:47 <****> Hi all, I'm new to perl but I'm getting there. I have a sub routine which will be passed two variables but the name of the second variable will be different depending on which code segment is calling it. If it's called like 'my_routine($static, $xyz) how can I make $xyz (whatever it's actually called) be known as $secondVariable throughout the routine code?
01:49 <****> Sh4d03: All arguments are stored in the @_ array. You can assign them to whichever variables you prefer.
01:49 <****> if you want named args, use a hash
01:50 <****>'hi'})
01:52 <****> so in perlfan's method I can do 'my_routine(arg1=$static, arg2=$xyz)' and then access them within the routine like $arg1 and $arg2 ?
01:52 <****> um, no
01:53 <****> perlfan meant pass a hashref, and arg1=$static isn't even valid Perl
01:53 <****> though typically you just pass a list, and coerce that into a hash in the sub
01:53 <****> sub foo { my %args = @_; ... }
01:53 <****> "value");
01:54 <****>$xyz)'
01:55 <****> What do you guys recommend for pushing out perl modules to a production system that doesn't (and shouldn't) have a compiler installed? I do have a development system that is the same OS/Arch.
01:55 <****> I looked in to that par stuff, but I don't like it.
01:56 <****> Somni: I don't understand the 'sub foo [ my %args = @_; ... }' line
01:57 <****> Looking back, I think I'll implement buu's method.
01:57 * CPAN upload: Term-Visual-0.08 by LUNARTEAR
01:58 <****> Sh4d03: what part are you having difficulty understanding?
01:59 <****> Somni: most of it because I haven't learned hashes yet.
01:59 <****> well, they're pretty important, so perhaps you should take time now to learn them
01:59 <****> perlbot, beginning perl
01:59 <****> http://www.perl.org/books/beginning-perl/
02:01 <****> Somni: thanks, it was next on my agenda.
02:03 <****> What do you guys recommend for pushing out perl modules to a production system that doesn't (and shouldn't) have a compiler installed? I do have a development system that is the same OS/Arch.
02:04 <****> real men write in binary so that's not a problem
02:05 <****> program: I tend to either tar up the site_perl tree (simple but ugly)
02:05 <****> program: or push debs (elegant but needs CPANPLUS::Dist::Deb)
02:05 <****> program: PAR can be a good way to deal with that
02:06 <****> hobbs, oh hey dude..
02:06 <****> mst, thanks.
02:06 <****> but if you are lucky enough to be using debian, follow mst's second piece of advice! :)
02:06 <****> nah, solaris
02:06 <****> i was messing around with par
02:07 <****> what does the production system need to run the PAR file?
02:07 <****> After looking through perlreftut, I arrive at a problem for which the relevant lines are shown at http://dpaste.com/22746/ -- what do I need to change?
02:07 <****> program: parl (no joke)
02:07 <****> hmm.
02:08 <****> program: if you install PAR you get it.
02:08 <****> which will compile with the PAR::Packer installation, correct? so I could just copy that binary file over
Total 49 pages. You are browsing page 3/49.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
