Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Is there a term for this?

by mw (Sexton)
on Oct 16, 2019 at 14:28 UTC ( #11107544=perlquestion: print w/replies, xml ) Need Help??

mw has asked for the wisdom of the Perl Monks concerning the following question:

Dwellers of the Monastery, allow me to de-lurk, partly from a desire to commune with fellow Monks, partly from a regular frustration in on-line discussions.

Sometimes, one must run Perl scripts on machines that one does not own, has no administrative rights on, and most significantly, one is not allowed to install any software on. In general, one is lucky if /usr/bin/perl -v returns something containing a 5. A prime example is an inventory script. One copies it to one's home directory, one runs it, and one removes it. One might be grateful that even this is allowed.

Not all of these restrictions are even unreasonable. One does not want to upgrade a seemingly innocuous package, only to find that this upgrade breaks something important. One wishes to tread lightly, at least this one does.

For this reason, I have on occasion been forced to write modules for which a beautiful module already exists on CPAN. I have had to produce my very own XML parser, because XML::LibXML was not installed everywhere, and I was forbidden from installing it, or anything else. People pointing out how wonderful XML::LibXML is, and that I am stupidly re-inventing a perfectly good wheel, only succeed in rubbing salt into the wound and bring me no closer to a solution.

Does this resonate with anyone in this group? If so, is there a concise term for this kind of situation? For instance:

  • Hi, I'd like to know how to fork off several subprocesses in a controlled manner, but fork() isn't returning what I expect it to.
  • There's a great module for that on CPAN! Why don't you use that? It'll save you so much hassle!
  • I know. Can't. I'm in a nature reserve. Take nothing but logs, leave nothing but wtmp entries.

Or something in that spirit.

Replies are listed 'Best First'.
Re: Is there a term for this?
by Fletch (Chancellor) on Oct 16, 2019 at 14:49 UTC

    Don't know of a name for it (other than maybe, "Eww; my sympathies"). Top Seven (Bad) Reasons Not To Use Modules and Yes, even you can use CPAN come to mind but those are how to work around the situation.

    (Related aside: one time at $jobs[-2] or so I had to write something to write a configuration file. Problem was the target environment was still shipping only perl 4 long into maybe perl 5.0.8 times (not to name names, but this was a large TLA corporation's management product which rhymes with mivoli). Wound up writing (in perl 5) a code generator that wrote the perl 4 script to run in the end environment. Never underestimate the power of over engineering and hacky kludges . . .)

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

      .. but that Mivoli had a hardened Perl4 version! :)
Re: Is there a term for this?
by hippo (Chancellor) on Oct 16, 2019 at 14:40 UTC

    You have my sympathy. When I have encountered such environments/situations in the past I have referred to them as adminstrative fascism as a nod to the venerable Know your System Administrator by Stephan Zielinski.

    If your target box has no compiler and you have no suitable cross-compilation available elsewhere then any non-PP module such as XML::LibXML is going to prove tricky at the very least. PP modules should still be feasible even if it is a bind installing and deleting them over and over, not that I am a user of such a PP XML module. Hopefully the reward of your work is worth the drudgery.

      Financial institutions. Interesting environment. They say they are risk-averse, but what they really are is blame-averse. They want everything change-managed, version controlled, box-ticked, signed off, audited, and what have you. I am the drokking sysadmin on these boxes, and I have to ask for root. It's not that you couldn't work around it. I have on occasion added to my projects the .pms of CPAN modules I really could not be bothered to rewrite, skirting the definition of "installed".

      Administrative fascist is a little too aggressive for my taste. But thank you for that link, I could use the giggles. LibXML is just an example. Obstacle course maybe?

      Oh well... let's see if there is something fun in the ticket queue.

        They say they are risk-averse, but what they really are is blame-averse.

        Truer words have rarely been uttered.

      Know your system administrator

      Nice link. What are all these references to xtrek? Google it and of course instantly pops up and so now 7 minutes of my life subtracted to explore the text based x rated Star Trek Enterprise of 1995. Who makes a game from next generation.. lame :)

        This is a bit of history for me; perhaps someone who has actually seen it can chime in.

        There were a number of Star Trek themed computer war games with basically the same concept: fly the Enterprise around blowing up Klingons and other enemies of the Federation. If I understand correctly, xtrek was somewhat different — a multiplayer space combat game set in Star Trek with factions from that setting and using X11 for display, thus the "x" in the name. I believe that Xpilot is a similar game that should be less obscure.

        Administrators, of course, sometimes considered such things wastes of "valuable computing resources" and did what would be expected, leading to a cat-and-mouse metagame of playing the game without getting caught by the system operators. :-)

      alias PP='Pure Perl'

      f4uIoX9fKg4

Re: Is there a term for this?
by marto (Archbishop) on Oct 16, 2019 at 16:03 UTC

    Have you considered packaging your app and the dependencies using something like pp?

      I concur with Marto. Ideally you can have a modern version of Perl running with all relevant packages. Barring that packaging the code that you want would help. Hopefully, all of these servers are running Redhat 6 or 7 or the equivalent. Otherwise, you might not be able to just package your code.
Re: Is there a term for this?
by FreeBeerReekingMonk (Deacon) on Oct 16, 2019 at 23:04 UTC
    Hello mw. You are not alone! I use(d) "Perl Core Only" (tm) too!
    You are not re-inventing the wheel, in fact, you are building a boat. And you can get a mast for free, but your boat is inside a bottle, and that mast just does not fit through the neck. And really, everything to build that boat has to go through that neck, your bottleneck!
    You pass tools using uuencode get a file out of the bottle, onto a modern system, just to be able to edit it with vim instead of vi and commit it to a versioning system, then push it back in, improved.

    So nay, do not weep! Build that ship (until you can play with speedboats: fast, but they hold no cargo)

Re: Is there a term for this?
by TieUpYourCamel (Sexton) on Oct 16, 2019 at 14:50 UTC
    You may want to look at Perlbrew. It allows you to install your own Perl, and use it instead of system Perl, and install CPAN packages to your heart's content.
      Note that there's a limit for perlbrew: For CPAN libraries which are just interfaces to "standard" libraries, like in the case of XML::LibXML which is based on libxml2, and if libxml2 is not available, then there's nothing perlbrew can do for you unless you also take the trouble to compile libxml2.

      Perlbrew requires a C compiler to install perl. I doubt mw has a compiler on the target box if it is so tightly locked down.

Re: Is there a term for this?
by daxim (Curate) on Oct 17, 2019 at 08:16 UTC
    The root (huehuehue) problem is that you have a job title/description (sysadmin) but are not imbued with the power that goes along with it.
    is there a concise term for this kind of situation
    This is called dysfunctional, and in my personal moral system you are a victim of injustice. You seem to take it lightly, but there are enough who would be stressed out so much under those circumstances they risk mental harm. I'm not kidding. If you have a cow orker, you must speak up and change the policies.

    There is no good technical reason why you should not be able to add a computer to your organisation that's managed according to principles that are normal for this decade. All the time you frittered away in work-arounds and being blocked from getting things done is already orders of magnitude more expensive than the potential harm that comes with just purchasing a computer and setting it up apart from the legacy systems. There's your business case. https://workplace.stackexchange.com/ can help further.

      You're right there's not a (really) good technical reason; problem is it's not a technical problem . . .

      The cake is a lie.
      The cake is a lie.
      The cake is a lie.

      you must speak up and change the policies

      LOL

      add a computer ... just purchasing a computer and setting it up apart from the legacy systems

      LOL

Re: Is there a term for this?
by Anonymous Monk on Oct 16, 2019 at 18:30 UTC
    is there a concise term for this kind of situation?

    There is a concise term for the perpetrator of such situations: PHB

Re: Is there a term for this?
by karlgoethebier (Monsignor) on Oct 17, 2019 at 12:04 UTC
    "...a term..."

    Crap. I guess what they actually want is a statically linked binary. Using Perl you can‘t provide this. And i doubt that they are willing to change their policy. You could try it with another language. XML as well as command line processing should be relatively comfortable. Best regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

    perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

      a statically linked binary. Using Perl you can‘t provide this.
      I want to solve. What is staticperl?

        Read the friendly manual. You got already the link. Best regards, Karl

        «The Crux of the Biscuit is the Apostrophe»

        perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

Re: Is there a term for this?
by sundialsvc4 (Abbot) on Oct 16, 2019 at 23:34 UTC

    Perhaps this is usefully similar to the case of “running Perl on a shared hosting service,” where of course you cannot do anything to, or about, the existing Perl environment.   You can define your own local directory, point cpan at it as the installation target, and arrange to insert this library first in PERL5LIB.   Now you can install your own modules, using ordinary cpan methods.   Your modules will supersede (if necessary) the installation libraries, and you alone will have the additional modules and/or more-current versions that you need, but no one will see it or be affected by it other than you.

    There are various ways to use this.   For interactive sessions, .bash_profile (or Windows control panel settings) can set up the necessary environment variables at login.   For mod_perl, there are server settings.   For FastCGI, it can be handy to define a “trampoline shell-script” that sets up the environment before launching Perl with the original set of parameters.

    (Super Search is your BFF.)

    Obviously, you must “negotiate the politics” before doing anything, but this just might simultaneously satisfy the concerns both of the IT Department and of your project, because the scope is absolutely limited.   You get what you need to pursue your project most efficiently, without touching the surrounding environment in any way.   I think you could get a blessing for that.   (And it goes without saying that you must get a blessing for that.   But, if you are right now coding modules by hand that are available in cpan, a business justification should be easy to make because right now they’re wasting money on your project.)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://11107544]
Approved by Fletch
Front-paged by haukex
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2019-11-19 20:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (96 votes). Check out past polls.

    Notices?