Sandboxing while I am learning

Sandboxing while I am learning

am 29.08.2011 14:18:57 von Sayth Renshaw

I have a new debian install and am continuing to learn perl.

Whilst I know I should use perlbrew to keep my perl version separate
from my system version is there anyway to sandbox the perlbrew
environments.

So basically If I want to experiment and toy with different cpan apps
and so forth I can without messing up my perl install.

I have found local::lib and penv.pl here
http://terrarum.net/development/perl-virtual-environments.ht ml but
wondering if this is or there is a good system in place to manage
virtual or sandboxed perl installs.

Cheers

Sayth


--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: Sandboxing while I am learning

am 30.08.2011 11:02:40 von Sayth Renshaw

On Aug 29, 10:18=A0pm, flebber.c...@gmail.com (flebber) wrote:
> I have a new debian install and am continuing to learn perl.
>
> Whilst I know I should use perlbrew to keep my perl version separate
> from my system version is there anyway to sandbox the perlbrew
> environments.
>
> So basically If I want to experiment and toy with different cpan apps
> and so forth I can without messing up my perl install.
>
> I have found local::lib and penv.pl herehttp://terrarum.net/development/p=
erl-virtual-environments.htmlbut
> wondering if this is or there is a good system in place to manage
> virtual or sandboxed perl installs.
>
> Cheers
>
> Sayth

I have posted a feature request at app::perlbrew on github
https://github.com/gugod/App-perlbrew/issues/143 .

An intresting response from the author gugod(Kang-min Liu) he is
considering implenting this feature in a manner similar to ruby's rvm
gemsets..

Sayth


--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: Sandboxing while I am learning

am 30.08.2011 16:44:39 von sono-io

Sayth,

> So basically If I want to experiment and toy with different cpan apps
> and so forth I can without messing up my perl install.

All you have to do is install cpanm for each version of Perl and =
then you don't have to worry about them stepping on each other. With =
cpan configured for each Perl, I have different environments depending =
on the version and it works great.

This post may help:

http://blog.fox.geek.nz/2010/09/installing-multiple-perls-wi th.html

Marc=

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: Sandboxing while I am learning

am 30.08.2011 17:25:54 von Rob Coops

--90e6ba212203d576b104abbaa1b4
Content-Type: text/plain; charset=UTF-8

On Tue, Aug 30, 2011 at 4:44 PM, Marc wrote:

> Sayth,
>
> > So basically If I want to experiment and toy with different cpan apps
> > and so forth I can without messing up my perl install.
>
> All you have to do is install cpanm for each version of Perl and
> then you don't have to worry about them stepping on each other. With cpan
> configured for each Perl, I have different environments depending on the
> version and it works great.
>
> This post may help:
>
> http://blog.fox.geek.nz/2010/09/installing-multiple-perls-wi th.html
>
> Marc
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> http://learn.perl.org/
>
>
>
Personally I a ma big fan of virtual machines for this purpose I can install
many Perl versions, compile support of different database versions combine
with different apache versions and mods etc without having to even think
about what this might do to my Perl installation.

I keep my Perl installation clean and I can break what ever else I want by
messing with a virtual machine image of my machine. Once I am sure that what
I just did works as it should on the virtual machine I can copy the steps to
my real machine and execute the same steps knowing that it will work. Then
all you do is replace your virtual machine image and you can continue to
play on "your machine" without ever endangering your machine.

The multiple cpan installations is not bad it is dangerous in my opinion. I
have seen people go white as a sheet of paper once they realized that they
where not on the test but on the production machine and they just executed
an rm -rf on the application server directory...
The risk of such a simple mistake is even larger when all environments are
on a single machine. Therefore I would personally not advise this but that
might just be paranoid old me ;-)

Regards,

Rob

--90e6ba212203d576b104abbaa1b4--

Re: Sandboxing while I am learning

am 30.08.2011 17:49:40 von sono-io

Rob,

> The multiple cpan installations is not bad it is dangerous in my =
opinion. I have seen people go white as a sheet of paper once they =
realized that they where not on the test but on the production machine =
and they just executed an rm -rf on the application server directory...
> The risk of such a simple mistake is even larger when all environments =
are on a single machine. Therefore I would personally not advise this =
but that might just be paranoid old me ;-)

It's good to be paranoid in situations like this. But I =
wouldn't let that stop me from using perlbrew. Once you switch to a =
particular version of Perl, perlbrew keeps you there even through a =
restart of the computer. As long as you know which version you're in, =
you won't have any problems. Also, you can't inadvertently switch Perls =
without knowing it, since you have to manually enter the switch command =
in Terminal.

Perlbrew is one of those apps that, once you start using it, you =
yell out "YES!!!" and scare everyone within earshot around you.

If you're deleting stuff without knowing where you are, well, =
you deserve to lose the data. Besides, that's what backups are for. =3D;)=


Marc=

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: Sandboxing while I am learning

am 30.08.2011 17:55:55 von Shawn Wilson

On Tue, Aug 30, 2011 at 05:02, flebber wrote:
> On Aug 29, 10:18=A0pm, flebber.c...@gmail.com (flebber) wrote:
>> I have a new debian install and am continuing to learn perl.
>>
>> Whilst I know I should use perlbrew to keep my perl version separate
>> from my system version is there anyway to sandbox the perlbrew
>> environments.

i wish i was as forward thinking when i started learning perl :)
i've had debian mess up my perl modules every time i do a
'dist-upgrade' and just recently started using perlbrew on a mac
because apeiron on irc informed me that i could mess up osx by playing
with system perl.


>> I have found local::lib and penv.pl herehttp://terrarum.net/development/=
perl-virtual-environments.htmlbut
>> wondering if this is or there is a good system in place to manage
>> virtual or sandboxed perl installs.
>>

based on that same conversation (iirc) if you want to make sure you
know every module you use for each project, use a different local::lib
environment per project.

>
> I have posted a feature request at app::perlbrew on github
> https://github.com/gugod/App-perlbrew/issues/143 .
>

i'd think this to be a great feature. if i could install a perl
version. then set an environment name for it and make perlbrew switch
between my environment (like switching between versions) that would
just be awesome.

also on my perlbrew 'wish list' (or things i need to look into) is an
option to set perlbrew environment within a script and perlbrew / cpan
/ cpanm snapshots (no, i don't want fs snapshots for this - though
btrfs directory snapshots might 'work' in a pinch).

> An intresting response from the author gugod(Kang-min Liu) he is
> considering implenting this feature in a manner similar to ruby's rvm
> gemsets..
>

nice work

@Rob - everything i have is on a vm (except osx and my production db).
the point of perlbrew is not to develop on a production box but to
make development and testing funner / better. i don't want a new vm
for each project or perl version (i'd have >20 dev vm if i did this -
which is not going to happen). if you use perlbrew and local::lib you
can test different perl versions and then different environments. i
don't have any cpan modules, however couldn't immagine testing one
without this type of environment.

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: Sandboxing while I am learning

am 30.08.2011 20:45:32 von sono-io

Shawn,

> if you use perlbrew and local::lib you
> can test different perl versions and then different environments.

I haven't looked into local::lib yet. What advantage does that =
give you over a plain perlbrew install?

Marc=

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: Sandboxing while I am learning

am 31.08.2011 20:54:26 von byulga

Marc wrote:
> Shawn,
>
>
>> if you use perlbrew and local::lib you
>> can test different perl versions and then different environments.
>>
> I haven't looked into local::lib yet. What advantage does that give you over a plain perlbrew install?
>
> Marc
>

I haven't used local::lib very much, because perlbrew seems to be the
easiest catch-all solution for my purposes. Once I discovered the
"--as" installation parameter (e.g. "perlbrew install 5.14.1 --as
perl514_sandbox2", etc.), I had very little use for local::lib. Since
perlbrew sets @INC to line up with the "--as" in each installation, one
can create multiple isolated installations of the same Perl version. In
my (limited) experience, cpan worked correctly under whichever
installation was marked active with "perlbrew use" (or "switch").

The downside of this approach is that I'm compiling the same version of
Perl multiple times, for the sole purpose of different installation
directories. That takes time and hard drive space. So I can see how
local::lib may be better if those are critical issues. But for me,
adding another ~70MB copy of Perl to my home directory is
inconsequential when weighed against the ease of using one tool to do
the job. Each to their own.

Besides saved disk space and install time, I'd be interested in knowing
if I've overlooked some other advantage of local::lib over perlbrew.

Brian

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: Sandboxing while I am learning

am 01.09.2011 13:02:22 von Sayth Renshaw

On Sep 1, 4:54=A0am, byu...@langly.dyndns.org ("Brian F. Yulga") wrote:
> Marc wrote:
> > Shawn,
>
> >> if you use perlbrew and local::lib you
> >> can test different perl versions and then different environments.
>
> > =A0 =A0I haven't looked into local::lib yet. =A0What advantage does tha=
t give you over a plain perlbrew install?
>
> > Marc
>
> I haven't used local::lib very much, because perlbrew seems to be the
> easiest catch-all solution for my purposes. =A0Once I discovered the
> "--as" installation parameter (e.g. "perlbrew install 5.14.1 --as
> perl514_sandbox2", etc.), I had very little use for local::lib. =A0Since
> perlbrew sets @INC to line up with the "--as" in each installation, one
> can create multiple isolated installations of the same Perl version. =A0I=
n
> my (limited) experience, cpan worked correctly under whichever
> installation was marked active with "perlbrew use" (or "switch").
>
> The downside of this approach is that I'm compiling the same version of
> Perl multiple times, for the sole purpose of different installation
> directories. =A0That takes time and hard drive space. =A0So I can see how
> local::lib may be better if those are critical issues. =A0But for me,
> adding another ~70MB copy of Perl to my home directory is
> inconsequential when weighed against the ease of using one tool to do
> the job. =A0Each to their own.
>
> Besides saved disk space and install time, I'd be interested in knowing
> if I've overlooked some other advantage of local::lib over perlbrew.
>
> Brian

That basically summarizes why I put the feature request for perlbrew
forward, so that it could encapsulate the usefulness of local::lib
within perlbrew. You shouldn't need to keep installing and compiling
perls.

rvm if you haven't tried it really works well(for ruby).
https://rvm.beginrescueend.com/rvm/

Here is a direct knock off of perlbrew called pythonbrew
https://github.com/utahta/pythonbrew#readme
Essentially all the commands are the same

such as
pythonbrew install 2.7.2
pythonbrew switch 2.7.2

It has implemented a few nice features.

Runs a named python file against specified and/or all pythons:
pythonbrew py -p 2.7.2 -p 3.2 test.py # Use the specified pythons

and then there virtual implementation.

Create isolated python environments (uses virtualenv):
pythonbrew venv init
pythonbrew venv create proj
pythonbrew venv list
pythonbrew venv use proj
pythonbrew venv delete proj

Cheers

Sayth


--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/