| revdiablo | adj 1: of uncertain outcome; especially fraught with risk |
| jrockway | dodgy doggy |
| anabain | why uncertain? |
| balbir97 | what should we use mod_perl|python|php or FastCGI of all this |
| amnesiac | Assembly? |
| revdiablo | anabain: I'm not sure if scalar m//g works properly when the original variable changes anabain: You are modifying the same thing you're looking at. There is probably a nicer way to say it, but the phrase that comes to mind is "don't shit where you eat" |
| anabain | in fact, when tried to do with $&, I got a readonly warning. That's why I put two variables, in order to avoid eating+shitting, and it's weird 'cause the same code without the substitution it's okay... |
| revdiablo | I think modifying $var may reset the position of the match Yeah It does |
| anabain | then? |
| PaulWay[w] | Hi all! I've got a script which gets libraries from two different sources, depending on how its called. |
| revdiablo | anabain: Then build a new string with modified values instead of replacing the existing string as you go |
| action | CPAN upload: CORBA-Python-0.37 by PERRAD |
| CPAN | upload: CORBA-Python-0.37 by PERRAD |
| PaulWay[w] | (The production script gets the production library, the development script in a different directory loads the development library instead.) It achieves this through 'if ($0 =~ m[/path/to/production/dir]) { use lib qw(/path/to/production/lib); } else { use lib qw(/path/to/development/lib); }' This works. |
| Jmax | no it doesn't |
| PaulWay[w] | But Perl seems to still check for access to the development directory, which under my SELinux policy is not allowed for the production script. |
| anabain | revdiablo, and could it be possible to retain the pos of the match and perform the substitution right before this position? |
| revdiablo | PaulWay[w]: Both of those 'use' lines will be executed |
| PaulWay[w] | Ah. Blast. |
| revdiablo | PaulWay[w]: 'use' runs at compile time, before the condition gets a chance to even run |
| PaulWay[w] | Can I do anything like that? |
| Jmax | PaulWay[w]: require then import. use is compile-time, require/import is runtime |
| PaulWay[w] | Ah. Excellent. Thanks! |
| Jmax | you're welcome alternatively you could fuddle with @INC directly without using base.pm at all |
| revdiablo | anabain: I don't know, but I would recommend against it. See previous comment about feces and food consumption. |
| PaulWay[w] | So do I require lib qw(blah) then import lib? |
| anabain | ok, revdiablo |
| PaulWay[w] | I'll read up on require and import and get back to you... |
| Jmax | no, require lib; import lib qw(blah); perldoc -f require; perldoc -f import; perldoc base |
| revdiablo | lib->import(qw(blah)); # If you want to avoid indirect method call syntax |