RE: one liner for removing string from an element of string array

2012-07-20 Thread Nemana, Satya
Ron, Shlomi, 

I realized I haven’t thanked you.

Thanks,

Regards,
Satya
P.S : I am not a fan of one liners but as a beginner of perl there are many 
others out there who want to see the power of perl to do that in one line, it 
is just a way to be a fan of the language and then things get improved 
automatically since  you love it.

-Original Message-
From: Shlomi Fish [mailto:shlo...@shlomifish.org] 
Sent: 13 July 2012 17:00
To: Nemana, Satya
Cc: beginners@perl.org
Subject: Re: one liner for removing string from an element of string array

Hi Satya,

On Fri, 13 Jul 2012 15:38:20 +
Nemana, Satya snem...@sonusnet.com wrote:

 Hi
 
 I have written a small program like this to just print file2 from the second 
 element of the array by removing the .template from the entry (the name file2 
 can change and can be longer or shorter)
 
 use strict;
 use Data::Dumper;
 use warnings;
 
 my @templates = (
 /a/b/c/d/e/f/file1.template,
 /a/b/c/d/e/f/file2.template
 );
 
 my @tokens=split( /\//, $templates[1]);
 print(\n.substr($tokens[$#tokens],0,-9));
 
 However I want this to be more efficient and want to do this in a single line 
 as I have to do this several times.
 How can I do that?
 

See File::Basename - http://perldoc.perl.org/File/Basename.html . In the
future, you may wish to use regular expressions for similar tasks:

http://perl-begin.org/topics/regular-expressions/

Regarding achieving stuff in one line, see:
http://www.shlomifish.org/humour/fortunes/show.cgi?id=newline-prices
and if you're so concerned about that, you can always write subroutines to
encapsulate commonly done tasks.

Regards,

Shlomi Fish 


 TIA,
 
 Regards,
 Satya
 
 
 



-- 
-
Shlomi Fish   http://www.shlomifish.org/
Escape from GNU Autohell - http://www.shlomifish.org/open-source/anti/autohell/

Beliefs are what divide people. Doubt unites them.
— http://en.wikiquote.org/wiki/Peter_Ustinov

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


Storage using Storable

2012-07-20 Thread punit jain
Hi ,

I have a multiple processes which are modifying hash of hash of array. For
multiprocessing I am using Parallel::ForkManager

The requirement is I set Max processes to say 5. Each process is fired by
the script and max 5 parallel process runs and it performs some actions on
a complex datastructure like each process after performing a task based on
success moves user entry from pending hash key to completed hash key.

Now this task needs to be run on around 10K users and I need not run this
more than 1 hr after which I need to store the state disc which I can
revisit and start from point where I left.

I am planning to use Storable module for storing and retrieve later.

My question is do I need to implement locks on write operation as multiple
Procs will be writing data to same complex datastructure ? or just using
store() in each process will take care of simultaneous writes ?

Any pointers to some code will be helpful.

Thanks and Regards,
Puneet


how to resolve this Unparsable version '' for prerequisite Test::Strict at Makefile.PL line 563

2012-07-20 Thread amit bondwal
Dear All,

I am new to perl, I am facing a problem
while installing koha LMS software. When O run the Makefile.pl it shows
the below error:
Unparsable version '' for prerequisite Test::Strict at Makefile.PL line 563

What is Unparsable version of Test::Strict? is it mean that I am using
wrong version
of this package?

My work in not going further what should I do?
Please help.

Regards
Amit Bondwal

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





Re: how to resolve this Unparsable version '' for prerequisite Test::Strict at Makefile.PL line 563

2012-07-20 Thread Shlomi Fish
Hi Amit,

On Fri, 20 Jul 2012 17:50:47 +0530
amit bondwal bondwal.a...@gmail.com wrote:

 Dear All,
 
 I am new to perl, I am facing a problem
 while installing koha LMS software. When O run the Makefile.pl it shows
 the below error:
 Unparsable version '' for prerequisite Test::Strict at Makefile.PL line 563
 
 What is Unparsable version of Test::Strict? is it mean that I am using
 wrong version
 of this package?
 
 My work in not going further what should I do?
 Please help.

I don't see any mentioning of Test::Strict in the Makefile.PL of
liblime-koha_v4.10.05.tar.gz from here:

https://github.com/liblime/LibLime-Koha/downloads

Where do you see it? What have you tried? How can we reproduce the problem?

See:

http://www.catb.org/~esr/faqs/smart-questions.html

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
Chuck Norris/etc. Facts - http://www.shlomifish.org/humour/bits/facts/

Stray XSLT code causes more deaths than road accidents.

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/




suggestions for perl program to make excel graph out from top output

2012-07-20 Thread Nemana, Satya
Gurus,

I want to write a perl program that captures top output in linux and makes nice 
graphs out of them(Microsoft excel)
Are there ready to use modules for this which will help in writing the program?
Any suggestions for inspirations?
Search in cpan for top is resulting in a lot of results, most of which are 
irrelevant, are there smarter ways to search?

Regards,
Satya



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




Re: suggestions for perl program to make excel graph out from top output

2012-07-20 Thread Shlomi Fish
Hi Satya,

On Fri, 20 Jul 2012 13:33:04 +
Nemana, Satya snem...@sonusnet.com wrote:

 Gurus,
 
 I want to write a perl program that captures top output in linux and makes 
 nice graphs out of them(Microsoft excel)
 Are there ready to use modules for this which will help in writing the 
 program?
 Any suggestions for inspirations?
 Search in cpan for top is resulting in a lot of results, most of which are 
 irrelevant, are there smarter ways to search?

Sure, use the GTop module which interfaces against libgtop:

https://metacpan.org/release/GTop

Its current metacpan.org documents are kinda messed up for some reason, so you
should view this page:

https://metacpan.org/module/MJH/GTop-0.17/GTop.pod

This may also prove useful:

http://developer.gnome.org/libgtop/stable/

For creating Excel spreadsheets with graphs you can look at a spreadsheet
generating module, such as:

* https://metacpan.org/release/Spreadsheet-WriteExcel

* https://metacpan.org/release/Spreadsheet-WriteExcelXML

Or maybe something OpenDocument related.

Regards,

Shlomi Fish


 
 Regards,
 Satya
 
 
 



-- 
-
Shlomi Fish   http://www.shlomifish.org/
Rethinking CPAN - http://shlom.in/rethinking-cpan

Writing a BitKeeper replacement is probably easier at this point than getting
its license changed.
— Matt Mackall (who ended up writing a BitKeeper replacement)

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/




RE: suggestions for perl program to make excel graph out from top output

2012-07-20 Thread mike lively

 

 Date: Fri, 20 Jul 2012 17:19:06 +0300
 From: shlo...@shlomifish.org
 To: snem...@sonusnet.com
 CC: beginners@perl.org
 Subject: Re: suggestions for perl program to make excel graph out from top 
 output
 
 Hi Satya,
 
 On Fri, 20 Jul 2012 13:33:04 +
 Nemana, Satya snem...@sonusnet.com wrote:
 
  Gurus,
  
  I want to write a perl program that captures top output in linux and makes 
  nice graphs out of them(Microsoft excel)
  Are there ready to use modules for this which will help in writing the 
  program?
  Any suggestions for inspirations?
  Search in cpan for top is resulting in a lot of results, most of which are 
  irrelevant, are there smarter ways to search?
 
 Sure, use the GTop module which interfaces against libgtop:
 
 https://metacpan.org/release/GTop
 
 Its current metacpan.org documents are kinda messed up for some reason, so you
 should view this page:
 
 https://metacpan.org/module/MJH/GTop-0.17/GTop.pod
 
 This may also prove useful:
 
 http://developer.gnome.org/libgtop/stable/
 
 For creating Excel spreadsheets with graphs you can look at a spreadsheet
 generating module, such as:
 
 * https://metacpan.org/release/Spreadsheet-WriteExcel
 
 * https://metacpan.org/release/Spreadsheet-WriteExcelXML
 
 Or maybe something OpenDocument related.
 
 Regards,
 
 Shlomi Fish
 
 
  
  Regards,
  Satya
  

 
You can also use the Chart module from CPAN to create many different kinds of 
charts as a PNG file.  This file can then be put into an Excel spreadsheet 
using the modules above.   This was fairly easy to do.
 
Mike Lively   

Re: Perl MVC framework

2012-07-20 Thread shawn wilson
On Thu, Jul 19, 2012 at 9:46 PM, Francisco Valladolid H.
fic...@gmail.com wrote:
 Hi.

 On Thu, Jul 19, 2012 at 8:38 PM, Chris Stinemetz
 chrisstinem...@gmail.com wrote:

 What is the best Perl MVC framework for someone to learn that has minimal
 web development back ground, but is intermediate with Perl scipting?

 I've heard of Catalyst but it seems a bit intimedating.
 I just thought I would get some feedback before I choose a framework to
 learn.

 You can try Dancer or Mojolicious http://www.perldancer.org
 http://www.mojolicio.us  both are micro frameworks writtern in Perl
 language.

i've found mojo to be very nice to use over catalyst. you can't deny
catalyst's user base though and any company that uses perl as a web
platform will use catalyst.

(disclaimer: totally ot and oppinion) that said, i dislike having sql,
regex, tt, js, html, css, and perl in a project. i can get rid of one
by using nodejs and another by using a json nosql db. though, these
are new and perl has had 20 years of developers trying to make it work
right.

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




Re: Perl MVC framework

2012-07-20 Thread Bill Stephenson
Chris, an MVC Framework is just a design approach to help manage your code, so 
you don't really need to use Catalyst or Dancer, or anyone else's framework. 
Instead,  you can easily emulate what you like best about any of them when 
setting up an app structure and design one that you can be most productive 
with. 

I thought I'd mention that you always have that option too.

Kindest Regards,

Bill Stephenson



On Jul 19, 2012, at 8:38 PM, Chris Stinemetz wrote:

 Hello List,
 
 What is the best Perl MVC framework for someone to learn that has minimal
 web development back ground, but is intermediate with Perl scipting?
 
 I've heard of Catalyst but it seems a bit intimedating.
 I just thought I would get some feedback before I choose a framework to
 learn.
 
 Thank you in advance,
 
 Chris


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




Re: Perl MVC framework

2012-07-20 Thread Bill Stephenson
On Jul 20, 2012, at 11:03 AM, shawn wilson wrote:

 (disclaimer: totally ot and oppinion) that said, i dislike having sql,
 regex, tt, js, html, css, and perl in a project. i can get rid of one
 by using nodejs and another by using a json nosql db. though, these
 are new and perl has had 20 years of developers trying to make it work
 right.

I agree, that's just a messy approach. I've mentioned before that there ought 
to be Perl runtime for the client side, but that seems to be a pretty stupid 
idea because no one else liked it ;)

I still don't use sql in the apps I've made. I haven't run into a desperate 
need for it. The thing I think many developers ignore is that if you know where 
the data you want to use resides (the path to the file), you really can't get 
it much faster than opening and reading the file (using the system B-tree). 

I don't use Template Toolkit.  To me, calls to my perl code that are embedded 
in HTML is just the opposite of putting html in my perl code. It adds 
complexity that I don't want. I use HTML Template instead. It's simple and 
straight forward.

I struggle with JS, and CSS, but I'm getting a little better with both. I 
recently got Dreamweaver 5.5 and that's helped a lot with applying CSS. I've 
been using the Prototype JS libraries for a bit now, and they're pretty easy to 
figure out, but I still struggle and fumble my way along with them and JS in 
general.

There is a lot to be said for keeping things simple. If you're one guy coding 
perl, js, css, and html for an app, you've already got too much to do.

Bill



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




Re: Perl MVC framework

2012-07-20 Thread Andy Bach
 What is the best Perl MVC framework for someone to learn that has minimal
 web development back ground, but is intermediate with Perl scripting?

Just a note - at the last YAPC::NA there were a number of good review
sessions, for mojolicious, dancer etc.  I hope there up here already:
http://www.youtube.com/yapcna

otherwise, they will be soon.

-- 

a

Andy Bach,
afb...@gmail.com
608 658-1890 cell
608 261-5738 wk

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