Re: perl Gtk2 install and makemaker install

2013-10-29 Thread Shlomi Fish
Hi El'ad/Dale,

On Tue, 29 Oct 2013 17:29:24 -0700
"D.Edmons"  wrote:

> Hi,
> 
> I'm trying to get Gtk2 installed.  I'm upgrading my local directory to 
> the current stable perl and now need Gtk2 so that I may learn perlgtk2.
> 
> I get the following error when I run `perl Makefile.PL':
> 
>   Can't locate ExtUtils/Depends.pm in @INC (you may need to install the 
> ExtUtils::Depends module) (@INC contains: 
> /home/dale/localperl/lib/site_perl/5.18.1/i686-linux 
> /home/dale/localperl/lib/site_perl/5.18.1 
> /home/dale/localperl/lib/5.18.1/i686-linux 
> /home/dale/localperl/lib/5.18.1 .) at (eval 4) line 1.
> BEGIN failed--compilation aborted at (eval 4) line 1.
> 

Please read the resources in this page about using CPAN:

http://perl-begin.org/topics/cpan/

(**Note:** perl-begin.org is a site I originated and still maintain.)

In order to install perl-gtk2, it would be a better idea to use your
distribution's package manager.

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
UNIX Fortune Cookies - http://www.shlomifish.org/humour/fortunes/

 Also, .* is the most unspecific regex you can use. It’s like saying:
oh well match something of anything or nothing, and, please, a lot of it ;)

Please reply to list if it's a mailing list post - http://shlom.in/reply .

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




perl Gtk2 install and makemaker install

2013-10-29 Thread D.Edmons

Hi,

I'm trying to get Gtk2 installed.  I'm upgrading my local directory to 
the current stable perl and now need Gtk2 so that I may learn perlgtk2.


I get the following error when I run `perl Makefile.PL':

	Can't locate ExtUtils/Depends.pm in @INC (you may need to install the 
ExtUtils::Depends module) (@INC contains: 
/home/dale/localperl/lib/site_perl/5.18.1/i686-linux 
/home/dale/localperl/lib/site_perl/5.18.1 
/home/dale/localperl/lib/5.18.1/i686-linux 
/home/dale/localperl/lib/5.18.1 .) at (eval 4) line 1.

BEGIN failed--compilation aborted at (eval 4) line 1.

Checking if your kit is complete...
Looks good
MakeMaker FATAL: prerequisites not found.
ExtUtils::Depends not installed
ExtUtils::PkgConfig not installed
Glib not installed
Pango not installed

Please install these modules first and rerun 'perl Makefile.PL'.
--
I'm quite certain Glib and Pango are installed.  I've no clue about 
::Depends, ::PkgConfig.


Any quick pointers in the right direction will be appreciated.  The 
reason for the upgrade is due to utf-8 and related issues.


Thank you in advance.


El'ad/Dale Edmons

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




Re: Testing a standalone script

2013-10-29 Thread Manfred Lotz
On Tue, 29 Oct 2013 12:01:52 -0700
John SJ Anderson  wrote:

> On Tue, Oct 29, 2013 at 11:02 AM, Manfred Lotz
>  wrote:
> > This is exactly what I don't want to do. IMHO, for testing modules
> > or applications this is the way to go. However, for a standalone
> > script I'd like to have my test data inside the script itself.
> 
> Well, you could add some input values and expected results in a
> __DATA__ section (maybe as some sort of YAML or other serialization
> format), and then add a '-T' runtime option that reads that data in,
> runs it through the program, and uses 'require' to load Test::More to
> get access to functions like is() and ok() and friends, and use those
> to compare your inputs to your expected results.
> 
> Is something like that what you're envisioning?
> 

This comes close. 

In the meantime I found that there are even packages like
Test::Standalone or Test::Inline supporting what I want. Does anybody
know those packages and is able to recommend one?

-- 
Manfred




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




Re: Testing a standalone script

2013-10-29 Thread John SJ Anderson
On Tue, Oct 29, 2013 at 11:02 AM, Manfred Lotz  wrote:
> This is exactly what I don't want to do. IMHO, for testing modules or
> applications this is the way to go. However, for a standalone script
> I'd like to have my test data inside the script itself.

Well, you could add some input values and expected results in a
__DATA__ section (maybe as some sort of YAML or other serialization
format), and then add a '-T' runtime option that reads that data in,
runs it through the program, and uses 'require' to load Test::More to
get access to functions like is() and ok() and friends, and use those
to compare your inputs to your expected results.

Is something like that what you're envisioning?

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




Re: Testing a standalone script

2013-10-29 Thread Manfred Lotz
On Tue, 29 Oct 2013 12:36:58 -0400
Shawn H Corey  wrote:

> On Tue, 29 Oct 2013 17:10:51 +0100
> Manfred Lotz  wrote:
> 
> > Hi there,
> > I have some relatively small standalone perl scripts where I would
> > like to include tests.
> > 
> > Which is the recommended way to test standalone scripts?
> > 
> > 
> 
> Put the tests in a directory call "t" under the source. And see
> `man prove`. `prove` is a Perl tool for testing modules but it can be
> adapted for scripts. Each test script is given the extension *.t .
> 
> 

This is exactly what I don't want to do. IMHO, for testing modules or
applications this is the way to go. However, for a standalone script
I'd like to have my test data inside the script itself.

-- 
Manfred



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




Re: Testing a standalone script

2013-10-29 Thread Shawn H Corey
On Tue, 29 Oct 2013 17:10:51 +0100
Manfred Lotz  wrote:

> Hi there,
> I have some relatively small standalone perl scripts where I would
> like to include tests.
> 
> Which is the recommended way to test standalone scripts?
> 
> 

Put the tests in a directory call "t" under the source. And see
`man prove`. `prove` is a Perl tool for testing modules but it can be
adapted for scripts. Each test script is given the extension *.t .


-- 
Don't stop where the ink does.
Shawn

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




Testing a standalone script

2013-10-29 Thread Manfred Lotz
Hi there,
I have some relatively small standalone perl scripts where I would like
to include tests.

Which is the recommended way to test standalone scripts?


-- 
Manfred

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




IPC::Cmd pipe array

2013-10-29 Thread shawn wilson
This is cross posted from perlmonks
(http://perlmonks.org/?node_id=1060079). The end goal is to echo an
array of iptables save data into iptables-restore. I am getting output
via IPC::Cmd but not via the redirect (which is fine) however, the
pipe also doesn't seem to be working. Any ideas?

#!/usr/bin/env perl

use strict;
use warnings;

use Data::Dumper;
use IPC::Cmd qw/run/;

my @in = ("Test foo", "Test bar");

print "In: " . Dumper(@in);

@in = ("Test foo", "Test bar");

my @out = run(command => [echo => -n => @in] , '|', [ sed => -r => "s/
+(foo|bar)/pass/" ], '>', \my $out);

print "Out: " . Dumper(@out);
print "Redir: " . Dumper($out);


 Out:

 % ./t2.pl
In: $VAR1 = 'Test foo';
$VAR2 = 'Test bar';
Out: $VAR1 = 1;
$VAR2 = undef;
$VAR3 = [
  'Test foo Test bar'
];
$VAR4 = [
  'Test foo Test bar'
];
$VAR5 = [];
Redir: $VAR1 = undef;

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