Re: perl certification

2015-05-20 Thread Shaji Kalidasan
Greetings, However, for academic purpose, you can check the following links CIW Perl Specialist http://www.ciwcertified.com/certifications/web_development_series/perl.php Exam Objectives http://www.ciwcertified.com/_resources/objectives/1D0_437.pdf Course Description

Re: How to sort a file based on numerical values exists in each line

2015-03-24 Thread Shaji Kalidasan
Hi Anirban, Here is one way to do it [code] use strict; use warnings; my @data; open my $fin, '', 'data.txt' or die Cannot open file ($!); while($fin) { my($val) = split ',', $_; #split the data using comma my($key, $value) = split '=', $val; #split the values using equal sign (=)

Re: How to sort a file based on numerical values exists in each line

2015-03-24 Thread Shaji Kalidasan
,SC=0,DCP1=187,SIG=SCCONC,DCP2=188195,TEI=1; RXMOI:MO=RXOTRX-473-4,SC=0,DCP1=214,SIG=SCCONC,DCP2=215222,TEI=4; RXMOI:MO=RXOTRX-473-5,SC=0,DCP1=223,SIG=SCCONC,DCP2=224231,TEI=5; RXMOI:MO=RXOTRX-473-9,SC=0,DCP1=259,SIG=SCCONC,DCP2=260267,TEI=9; [/output] On Tue, Mar 24, 2015 at 4:39 PM, Shaji

Re: Can u suggest me the best ide for perl

2015-03-13 Thread Shaji Kalidasan
Hi Rakesh, EPIC - Perl editor and IDE for eclipse. Please download eclipse from http://www.eclipse.org/downloads/ and then goto Help---Install New Software and then add the update site (i.e the following URL) http://e-p-i-c.sf.net/updates/testing and follow the on-screen instructions. Note:

Re: About staying brushed up on perl

2014-07-21 Thread Shaji Kalidasan
Greetings, I self learned perl four years ago in the year 2010. The primary book from where I learned Perl programming is Learning Perl http://www.amazon.com/Learning-Perl-Randal-L-Schwartz/dp/1449303587/ref=sr_1_1 Then, I trained about 200+ students on Perl programming in the last 4 years

Re: -e switch is not working on Window 7 and 8

2014-07-20 Thread Shaji Kalidasan
Dear Purvee, Here is one way to do it #Approach 1 [code] perl -e print qq{Hello\n} [/code] [output] Hello [/output] Please note: qq stands for double quotes #Approach 2 [code] perl -e print 'Hello' [/code] [output] Hello [/output] On Mon, Jul 21, 2014 at 10:54 AM, Purvee Vora

Re: auto completion by crtl + space is not working with eclipse -epic module , Good IDE for beginner

2014-07-15 Thread Shaji Kalidasan
Dear Benjamin, Excerpt from the documentation The autocompletion suggestions will pop up automatically after you have typed a trigger character. Triggers are : and . Alternatively, it can be triggered by pressing CTRL-SPACE. Currently the Indirect Object Invocation is not recognized by the

Re: want to write to file in different format

2014-07-07 Thread Shaji Kalidasan
Hi Sunita, Here's one way to do it [code] use strict; use warnings; open my $fin, '', 'data.txt' or die Cannot open file ($!); open my $fout1, '', 'output1.txt' or die Cannot open file ($!); open my $fout2, '', 'output2.txt' or die Cannot open file ($!); while ($fin) { #Approach 1 using split

Re: Perl CGI-html quotation marks

2014-07-03 Thread Shaji Kalidasan
Here's one way to do it print BUTTON; input type=button value=Open Window onclick=window.open(' http://www.example.com') BUTTON On Thu, Jul 3, 2014 at 9:53 PM, Uri Guttman u...@stemsystems.com wrote: On 07/03/2014 12:16 PM, James Kerwin wrote: Hello all, I'm currently using Perl CGI to

Re: printing hash having undefined key

2014-06-23 Thread Shaji Kalidasan
Hi Sunita, In Perl hash keys can contain undef, blank space or a tab. All these entities are valid and as a result it will print the key/value pair for the undef also. For clarity I have added the values 'blank space' and a tab in your example Example 1: [code] @array = (abc, 123, dfg

Re: Need to Grep only fail count from the Pattern.

2014-06-23 Thread Shaji Kalidasan
Hi Uday, Here's one way to do it. [code] use strict; use warnings; while(DATA) { chomp; next if $. = 3; my($uas, $test, $test_name, $loop_count, $run_count, $pass_count, $fail_count, $arguments) = m/^(.+?)\|(.+?)\|(.+?)\|(.+?)\|(.+?)\|(.+?)\|(.+?)\|(.+?)$/; # my($uas, $test, $test_name,

Re: Need to Grep only fail count from the Pattern.

2014-06-23 Thread Shaji Kalidasan
Hi Sunita, Simplified the code to increase clarity [code] use strict; use warnings; while(DATA) { chomp; next if $. = 3; my(undef, undef, undef, undef, undef, undef, $fail_count, undef) = m/^(.+?)\|(.+?)\|(.+?)\|(.+?)\|(.+?)\|(.+?)\|(.+?)\|(.+?)$/; print '-' x 30, \n; print SUMMARY\n; print

Re: uninitialized error for hash printing

2014-06-22 Thread Shaji Kalidasan
Hi Sunita, As per Uri's suggestions, here's one way to make it work by surrounding the variable with curly braces [code] %hash = (abc = 123, dfg = 456, xsd = 34); foreach $k (keys %hash){ print key ${k}:: value $hash{$k}\n; } [/code] [output] key abc:: value 123 key dfg:: value 456

Re: Planning to buy Hard Copy Book

2014-06-11 Thread Shaji Kalidasan
Hi Frank, Get a copy of Learning Perl 6th edition from Oreilly. It's really the best book for beginners. http://www.amazon.com/Learning-Perl-Randal-L-Schwartz/dp/1449303587/ref=sr_1_1?ie=UTF8qid=1402493659sr=8-1keywords=Learning+Perl Programming Perl is considered as the Perl bible

Re: References

2014-05-14 Thread Shaji Kalidasan
Dear Mike, There are many benefits of using references. One such advantage is when you pass two arrays to a subroutine. I will illustrate with an example which shows how you can pass two arrays to a subroutine. The first example explains passing arrays without references and the second example

Re: Just gotten back into Perl, wondering how I could better write my first app.

2014-05-10 Thread Shaji Kalidasan
Dear Mike, Instead of '-w' you can use 'use warnings' as you are using Perl version 5.10 and above. One more thing for your help subroutine you can use here document instead. Here is the code snippet sub help { print MENU; Easily create and extract tarballs -h display this menu -c compress

Re: Where's this documented?

2014-03-17 Thread Shaji Kalidasan
Dear Shawn, You can use more than one file test on the same file to create a complex logical condition. Suppose you only want to operate on files that are both readable and writable; you check each attribute and combine them with and: if (-r $file and -w $file) {    ... } Each time you

Re: Calculate MD5 checksum of a remote and local file using FTP

2014-02-25 Thread Shaji Kalidasan
gift back to God. --- On Tuesday, 25 February 2014 10:58 AM, Jim Gibson j...@gibson.org wrote: On Feb 23, 2014, at 7:09 PM, Shaji Kalidasan shajiin...@yahoo.com wrote: Dear Perlers, I made some improvements in my code

Re: Calculate MD5 checksum of a remote and local file using FTP

2014-02-23 Thread Shaji Kalidasan
. --- On Saturday, 22 February 2014 7:14 PM, Shaji Kalidasan shajiin...@yahoo.com wrote: Dear Perlers, I need to download a file from a server using FTP and then I need to compare both files (MD5 Checksum) to ensure that I am testing the right build. Here

Calculate MD5 checksum of a remote and local file using FTP

2014-02-22 Thread Shaji Kalidasan
Dear Perlers, I need to download a file from a server using FTP and then I need to compare both files (MD5 Checksum) to ensure that I am testing the right build. Here is the program I have attempted so far. Please throw some light in comparing the MD5 checksum of the source and destination

Re: Turn part of a string into a single newline

2014-02-14 Thread Shaji Kalidasan
Dear Parys, Here is one way to do it [code] use strict; use warnings; my $str = agctagccgagctaNNatggctaNNNatgtgaNNatg; $str =~ s/N+/\n/g; ### #Print the string as is (commented out) #print $str, \n; ### print '-' x 40,\n; #Split the string on

Re: OO perl programming

2014-02-06 Thread Shaji Kalidasan
Hi Kavita, Here is a good starting point for OO Perl. http://blob.perl.org/books/beginning-perl/3145_Chap11.pdf Further, you can purchase a copy of Object Oriented Perl by Damian Conway at Amazon. (Please follow the second Link) http://www.manning.com/conway/

Re: Match Hash Key's with Array elements

2013-12-13 Thread Shaji Kalidasan
Greetings, Here is one way to do it. Please note that I have retained your variable naming conventions and style instead of inventing my own. [code] use strict; use warnings; my %complex_hash;   my @ex = qw / 5326 2041 1391 1439  x1259 /;   open my $fh, , fullhost.txt or die $!; while ($fh) { 

Re: Match Hash Key's with Array elements

2013-12-13 Thread Shaji Kalidasan
Greetings, Thanks a bunch Uri and Shawn for providing valuable inputs. Here is the optimized code after corrections (based on inputs from Uri and Shawn) [code] use strict; use warnings; my %complex_hash;   my @ex = qw / 5326 2041 1391 1439  x1259 /;   open my $fh, , fullhost.txt or die $!;

Re: Problem printing double quotes in XML using XML::DOM

2013-11-30 Thread Shaji Kalidasan
with it is your gift back to God. --- On Saturday, 30 November 2013 12:07 PM, Shaji Kalidasan shajiin...@yahoo.com wrote: Dear Shlomi, I want the XML output to include double quotes instead of quot;.  Example

Re: Problem printing double quotes in XML using XML::DOM

2013-11-29 Thread Shaji Kalidasan
to God. --- On Friday, 29 November 2013 1:53 PM, Shlomi Fish shlo...@shlomifish.org wrote: Hello Shaji, On Fri, 29 Nov 2013 13:32:49 +0800 (SGT) Shaji Kalidasan shajiin...@yahoo.com wrote: Dear Perlers, I am trying

Problem printing double quotes in XML using XML::DOM

2013-11-28 Thread Shaji Kalidasan
Dear Perlers, I am trying to print double quotes in the output (output.xml) but it is printing quot; instead of . How can I include double quotes in the output. Please help. Here is the code [code] #!/usr/bin/perl use strict; use warnings; use XML::DOM; my $parser =

Problem installing Log::Log4perl using Strawberry Perl on Windows

2013-11-25 Thread Shaji Kalidasan
Dear Perlers, I tried installing Log::Log4perl on Windows (Strawberry Perl Version 5.18.1) but I could not install using both 'cpan' and 'cpanm' but finally managed to install using --force. Is this a known problem? Here is the output message (from console). I am using Strawberry Perl version

Re: Problem installing Log::Log4perl using Strawberry Perl on Windows

2013-11-25 Thread Shaji Kalidasan
://search.cpan.org/dist/Log-Log4perl/lib/Log/Log4perl/FAQ.pm#How_can_I_install_Log::Log4perl_on_Microsoft_Windows? and then ask log4perl-de...@lists.sourceforge.net as the prior link suggests. Matt On Mon, Nov 25, 2013 at 9:06 AM, Shaji Kalidasan shajiin...@yahoo.com wrote: Dear Perlers, I tried installing

Re: Problem setting $= (Format Lines Per Page Special Variable)

2013-11-07 Thread Shaji Kalidasan
. --- On Thursday, 7 November 2013 3:04 PM, Paul Johnson p...@pjcj.net wrote: On Thu, Nov 07, 2013 at 11:44:27AM +0800, Shaji Kalidasan wrote: Dear Perlers, I am facing problems while setting the $= special variable. Even though I

Re: please help correct my script

2013-11-07 Thread Shaji Kalidasan
Dear Wang, It is actually writing the desired info to the output file summaryOFdNdS.txt. Here is the content of the output file. In my case, I gave the filename mydata.txt as command line argument [content of summaryOFdNdS.txt] geneNamebranchtNSdN/dSdNdSN*dNS*dS mydata.txt5..1      0.043  

Problem setting $= (Format Lines Per Page Special Variable)

2013-11-06 Thread Shaji Kalidasan
Dear Perlers, I am facing problems while setting the $= special variable. Even though I set it to 10 it takes the default value which is 60. In line number 31, I set the variable to a value of 10. It is not printing the page number for every 10 lines Please guide me where I am going wrong.

Problem rewinding the __DATA__ filehandle

2013-10-25 Thread Shaji Kalidasan
Dear Perlers, I am trying to print the matching lines using __DATA__ filehandle and for the very first time it prints the desired lines, but as soon as I rewind it using seek, it is printing lines from the very beginning which is not the desired result (as it prints from the start). I want to

Re: Problem rewinding the __DATA__ filehandle

2013-10-25 Thread Shaji Kalidasan
. --- On Saturday, 26 October 2013 5:44 AM, Jim Gibson jimsgib...@gmail.com wrote: On Oct 25, 2013, at 4:46 PM, Shaji Kalidasan wrote: Dear Perlers, I am trying to print the matching lines using __DATA__ filehandle and for the very first time

Re: Problem rewinding the __DATA__ filehandle

2013-10-25 Thread Shaji Kalidasan
with it is your gift back to God. --- On Saturday, 26 October 2013 8:56 AM, John W. Krahn jwkr...@shaw.ca wrote: Jim Gibson wrote: On Oct 25, 2013, at 4:46 PM, Shaji Kalidasan wrote: Dear Perlers, I am trying to print

Please throw some light on $? variable

2013-10-23 Thread Shaji Kalidasan
Dear Perlers Please throw some light on the $? variable I am trying to figure out how the internal structure (format) of $? variable. Please throw some light on this topic. Any help is highly appreciated. [code] system('cat file1.txt'); if($?) {#A Non zero exit code means failure if($? ==

Re: Please throw some light on $? variable

2013-10-23 Thread Shaji Kalidasan
. --- On Wednesday, 23 October 2013 7:50 PM, Jim Gibson jimsgib...@gmail.com wrote: On Oct 23, 2013, at 12:56 AM, Shaji Kalidasan wrote: Dear Perlers Please throw some light on the $? variable I am trying to figure out how the internal structure (format

Help on exception handling (Try::Tiny)

2013-10-04 Thread Shaji Kalidasan
;     }     finally {         say @_ ? There was an error : Everything worked;     };     say The sum of (@total) is $sum\n; } [/code] [output] Exiting subroutine via next at C:/Users/shaji kalidasan/workspace/juno-sr1/shaji/Rajesh Perl Project/raid.pl line 15. Everything worked The sum of (1024) is 1024

Re: Help on exception handling (Try::Tiny)

2013-10-04 Thread Shaji Kalidasan
. --- From: Andy Bach afb...@gmail.com To: Shaji Kalidasan shajiin...@yahoo.com Sent: Friday, 4 October 2013 10:23 PM Subject: Re: Help on exception handling (Try::Tiny) On Fri, Oct 4

Re: Help on saving and retrieving data structures

2013-09-14 Thread *Shaji Kalidasan*
September 2013 6:01 PM Subject: Re: Help on saving and retrieving data structures On Fri, 13 Sep 2013 19:10:58 +0800 (SGT) *Shaji Kalidasan* shajiin...@yahoo.com wrote: I am saving the data structure to a file and retrieving it back again, but, when I 'use strict' it is giving the following

Help on saving and retrieving data structures

2013-09-13 Thread *Shaji Kalidasan*
Dear Perlers, I am saving the data structure to a file and retrieving it back again, but, when I 'use strict' it is giving the following error message Global symbol %game requires explicit package name It is working fine without 'strict'. Please help [code] #Code for saving the data

Re: Help on saving and retrieving data structures

2013-09-13 Thread *Shaji Kalidasan*
. --- From: 'lesleyb' lesl...@herlug.org.uk To: beginners@perl.org Sent: Friday, 13 September 2013 5:26 PM Subject: Re: Help on saving and retrieving data structures On Fri, Sep 13, 2013 at 07:10:58PM +0800, *Shaji

Re: Help on saving and retrieving data structures

2013-09-13 Thread *Shaji Kalidasan*
. --- From: Dr Jimi-Carlo Bukowski-Wills jbwi...@staffmail.ed.ac.uk To: *Shaji Kalidasan* shajiin...@yahoo.com Sent: Friday, 13 September 2013 5:12 PM Subject: Re: Help on saving and retrieving data structures Hi   It’s

Re: How do I pass arrays into a subroutine

2013-09-07 Thread *Shaji Kalidasan*
Greetings, You cannot pass two arrays as the previous array will slurp (consume) all the elements. You need to go for references. Here is one way to do it [code] use strict; use warnings; my @pets = ('dogs' , 'cats' , 'horses'); my @numbers = (1..10);   study (\@pets , \@numbers);   sub study

Re: Resources on Multi threading

2013-09-05 Thread *Shaji Kalidasan*
September 2013 9:41 PM Subject: Re: Resources on Multi threading Hi Shaji, On Wed, 4 Sep 2013 23:57:33 +0800 (SGT) *Shaji Kalidasan* shajiin...@yahoo.com wrote: Dear Perlers, I need some resources (tutorials/documents) with some basic examples on Multi threading for my understanding as I need

Resources on Multi threading

2013-09-04 Thread *Shaji Kalidasan*
Dear Perlers, I need some resources (tutorials/documents) with some basic examples on Multi threading for my understanding as I need to write a task which makes use of threads. Any pointers to resources and good tutorials with some simple examples will be of immense help. Thank you,   best,

Re: Help on regex

2013-08-15 Thread *Shaji Kalidasan*
. --- From: timothy adigun 2teezp...@gmail.com To: *Shaji Kalidasan* shajiin...@yahoo.com Cc: beginners@perl.org beginners@perl.org Sent: Thursday, 15 August 2013 1:41 PM Subject: Re: Help on regex Hi, On Thu, Aug 15, 2013 at 6

Help on regex

2013-08-14 Thread *Shaji Kalidasan*
Greetings, I am trying to get name, phone and address in a lexical variable and trying to print it, but, I am not getting the expected output. Any help is greatly appreciated. [code] use strict; use warnings; while (DATA) {     my ($name, $phone, $address) = /^([a-zA-Z ]+):([\-\d]+):([\w,

Re: Help on regex

2013-08-14 Thread *Shaji Kalidasan*
. --- From: Lawrence Statton lawre...@cluon.com To: beginners@perl.org Sent: Wednesday, 14 August 2013 10:17 PM Subject: Re: Help on regex On 08/14/2013 11:26 AM, *Shaji Kalidasan* wrote:     my ($name, $phone, $address) = /^([a-zA-Z ]+):([\-\d]+):([\w, ])$/; And here is your

using join

2013-08-03 Thread *Shaji Kalidasan*
Greetings, I am facing some difficulty using join to display the array elements Here is the code snippet [code] use strict; use warnings; my @fruits = qw/apple mango orange banana guava/; #print '[', join '][', @fruits; #print ']'; print '[', join '][', @fruits, ']'; best, [/code] [output]

Re: using join

2013-08-03 Thread *Shaji Kalidasan*
. --- From: Michael Rasmussen mich...@jamhome.us To: *Shaji Kalidasan* shajiin...@yahoo.com Cc: Perl Beginners beginners@perl.org Sent: Sunday, 4 August 2013 10:37 AM Subject: Re: using join On Sun, Aug 04, 2013 at 12:59:29PM +0800, *Shaji Kalidasan

Re: using join

2013-08-03 Thread *Shaji Kalidasan*
. --- From: timothy adigun 2teezp...@gmail.com To: *Shaji Kalidasan* shajiin...@yahoo.com Cc: Perl Beginners beginners@perl.org Sent: Sunday, 4 August 2013 10:58 AM Subject: Re: using join Hi, You want to read: On Sun, Aug 4, 2013

Re: Unable to understanding map usage

2013-07-24 Thread *Shaji Kalidasan*
Rajeev, Here is a complete working code which explains the details. Courtesy : Jim Gibson and Shawn H Corey for the detailed explanation [code] use strict; use warnings; my @data = qw/                 apples                 oranges                 guavas                 cherries                

Re: Unable to understanding map usage

2013-07-24 Thread *Shaji Kalidasan*
Rajeev, There is a typo in formatting. So here is the complete working code. I apologize for any inconvenience caused. Courtesy : Jim Gibson and Shawn H Corey for the detailed explanation [code] use strict; use warnings; my @data = qw/                 apples                 oranges            

Re: cpan App::cpanminus

2013-07-23 Thread *Shaji Kalidasan*
Rohit, You might be behind a firewall which blocks http or https requests originating from non browsers. This type of blocking will be typically be categorized into Dos attack (denial-of-service attack). Your network administrator can temporarily grant you access. In our environment we

Re: grab pattern from start and end block

2013-07-12 Thread *Shaji Kalidasan*
Agnello, Here is one way to do it [code] use strict; use warnings; use subs qw/get_single_record/; my $start = '^start$';#Start pattern my $end = '^end$';#End pattern while( my @record = get_single_record( *DATA, $start, $end )){ chomp @record; print join ',', @record, \n; #You can use say

Re: Is there a way to generate HTML reports?

2013-07-08 Thread *Shaji Kalidasan*
reports? On Sat, Jul 06, 2013 at 10:43:30PM +0800, *Shaji Kalidasan* wrote: Greetings, As I understand, Perl has excellent report-generation capabilities. By using formats, we can actually visualize how our output will look because the definition of a format in Perl is very similar

Is there a way to generate HTML reports?

2013-07-06 Thread *Shaji Kalidasan*
Greetings, As I understand, Perl has excellent report-generation capabilities. By using formats, we can actually visualize how our output will look because the definition of a format in Perl is very similar to what you see on the output. Is there any way we to convert these formats into HTML

Re: printing content of a pipe

2013-06-28 Thread *Shaji Kalidasan*
Rajeev, Adhering to the thought process of Shlomi, if you are using Perl version 5.12 and higher, you can use OO methods directly  In 5.12 and above, all file handles are automatically blessed into the IO::File class, and you can use IO::File methods on them whenever you need to. As IO::File

Re: Please exempt the book Modern Perl from Web Commercials on http://perl-begin.org/

2013-06-26 Thread *Shaji Kalidasan*
Franklin, Here is one way to do it [code] #Program to reverse a string without using built-in function my $str = Japan is the land of rising sun.; my @str = split '', $str; for ( my $i = $#str ; $i = 0 ; $i-- ) { print $str[$i]; } [/code] [output] .nus gnisir fo dnal eht si napaJ [/output]  

Re: Please exempt the book Modern Perl from Web Commercials on http://perl-begin.org/

2013-06-26 Thread *Shaji Kalidasan*
...@shlomifish.org To: beginners@perl.org beginners@perl.org Sent: Wednesday, 26 June 2013 3:37 PM Subject: Re: Please exempt the book Modern Perl from Web Commercials on http://perl-begin.org/ Hello Shaji, some comments about your code. On Wed, 26 Jun 2013 17:52:13 +0800 (SGT) *Shaji Kalidasan* shajiin

Re: [OT] is the book on Perl 6 outdated?

2013-06-03 Thread *Shaji Kalidasan*
Greetings, IMHO it is outdated, but I cannot suggest alternatives as I have no experience in Perl 6. The following link (tutorial) might be helpful to you http://perl6maven.com/tutorial/toc For further information, please refer the official FAQ

Re: Perl error codes and warnings

2013-05-29 Thread *Shaji Kalidasan*
Kalidasan* shajiin...@yahoo.com Cc: Perl Beginners beginners@perl.org Sent: Wednesday, 29 May 2013 9:26 AM Subject: Re: Perl error codes and warnings Hi Shaji, On Wed, May 29, 2013 at 4:19 AM, *Shaji Kalidasan* shajiin...@yahoo.com wrote: Greetings, Where can I get more information

Re: Perl error codes and warnings

2013-05-29 Thread *Shaji Kalidasan*
. --- From: Warren James - jawarr james.war...@acxiom.com To: '*Shaji Kalidasan*' shajiin...@yahoo.com; timothy adigun 2teezp...@gmail.com; Charles DeRykus dery...@gmail.com Cc: Perl Beginners beginners@perl.org Sent: Wednesday, 29 May 2013 7:38 PM Subject

Perl error codes and warnings

2013-05-28 Thread *Shaji Kalidasan*
) {     print $_\n if /\w/; } [/code-1] [output-1] Possible attempt to separate words with commas at C:/Users/shaji kalidasan/workspace/juno-sr1/shaji/Shaji Code Snippets/hari.pl line 4. bat, ball, king, eagle, zebra [/output-1] [code-2] use strict; use warnings; my @names = qw/orange apple %!*# banana

What does $$ mean ?

2013-05-17 Thread *Shaji Kalidasan*
Greetings, What does this mean [CODE1] keys %{$$disk_type_ref{$pool}}; [/CODE1] Moreover, what does $$ mean here [CODE2] @{$$disk_type_ref{$pool}{$med_value}} [/CODE2] What data structures does the above things denote? Any pointers will be of great help. Thanking you in advance. best,

Re: What does $$ mean ?

2013-05-17 Thread *Shaji Kalidasan*
, *Shaji Kalidasan* wrote: [CODE1] keys %{$$disk_type_ref{$pool}}; [/CODE1] Moreover, what does $$ mean here   %{$$disk_type_ref{$pool}}; can also be written as   %{ $disk_type_ref-{ $pool } }; See further perldsc

Need clarification in using return value for modules

2013-03-28 Thread *Shaji Kalidasan*
Greetings, I am using the following module [module] package My::GoldenRock::Utilities; use strict; use warnings; use base 'Exporter'; our @EXPORT_OK = qw(foo bar); our %EXPORT_TAGS = (all = \@EXPORT_OK); our $VERSION = 0.1; sub foo() { print Inside foo\n; } sub bar { print Inside bar\n; }

Re: Need clarification in using return value for modules

2013-03-28 Thread *Shaji Kalidasan*
. --- From: Nathan Hilterbrand noset...@cotse.net To: beginners@perl.org Sent: Thursday, 28 March 2013 8:54 PM Subject: Re: Need clarification in using return value for modules On 03/28/2013 11:17 AM, *Shaji Kalidasan

Re: Problem with Active Perl PPM on Windows

2013-03-09 Thread *Shaji Kalidasan*
PPM on Windows On Mar 8, 2013, at 8:57 PM, *Shaji Kalidasan* wrote: Greetings, I did a fresh installation of Active Perl version 5.16.2 and while using Perl Package Manager (PPM) GUI interface, the view all packages (Ctrl + 1) shows only the packages that comes with standard Perl

Re: anonymous array for loop

2013-03-09 Thread *Shaji Kalidasan*
Chris, May I ask you to show the sample data of the array '@files' and '@newFiles', I presume the array looks like this my @files    = (                 [/storage/pcmd/2013-03-09.06:17.-0700.MMEpcmd.gz],                 [/storage/pcmd/2013-03-09.06:22.-0700.MMEpcmd.gz],                

Problem with Active Perl PPM on Windows

2013-03-08 Thread *Shaji Kalidasan*
Greetings, I did a fresh installation of Active Perl version 5.16.2 and while using Perl Package Manager (PPM) GUI interface, the view all packages (Ctrl + 1) shows only the packages that comes with standard Perl distribution. It shows the total number of known packages (272 packages), number

Re: Line Endings

2013-02-24 Thread *Shaji Kalidasan*
. --- From: Dr.Ruud rvtol+use...@isolution.nl To: beginners@perl.org Sent: Sunday, 24 February 2013 4:51 PM Subject: Re: Line Endings On 2013-02-23 01:51, *Shaji Kalidasan* wrote: my $cr = $content

Re: Line Endings

2013-02-24 Thread *Shaji Kalidasan*
you do with it is your gift back to God. --- From: Tiago Hori tiago.h...@gmail.com To: *Shaji Kalidasan* shajiin...@yahoo.com Cc: beginners@perl.org beginners@perl.org Sent: Sunday, 24

Re: Line Endings

2013-02-22 Thread *Shaji Kalidasan*
Greetings, Tiago, adding to Jim's and Andy's wisdom. Here is the complete code snippet [code] use strict; use warnings; unless(@ARGV == 1) {     die Usage : $0 filename\n; } my $file = shift; my $fin = IO::File-new($file, 'r') or die Cannot open file for read ($!); $fin-binmode(:raw); my

Re: Where can I find the list of modules distributed by perl core?

2013-02-17 Thread *Shaji Kalidasan*
From: chenlin rao rao.chen...@gmail.com To: beginners@perl.org Sent: Monday, 18 February 2013 12:43 PM Subject: Where can I find the list of modules distributed by perl core? Or how can I know whether one module like YAML is such a core module? I need to write some perl scripts used for hadoop

Re: how to find item that happened once in an array

2013-01-19 Thread *Shaji Kalidasan*
Hi Jun, Here is another way to solve your problem [code] @my_array = qw (one one two three three four); my @unique_items = (); foreach my $item (@my_array) {         #grep in scalar context returns how many times $item is found in the @my_array         my $count = grep $item eq $_, @my_array;  

Re: Regex help needed

2013-01-09 Thread *Shaji Kalidasan*
Punit Jain, This is not the optimized code but you can refactor it. This works for the given scenario, no matter the order of input data. Hope it helps to some extent. [code] my $var = ''; my @args = (); my %hash; while (DATA) { chomp; my ($var,$arg) = split /=/,$_,2; if($var eq '{') { @args

Re: What is the difference between () and [] syntax for array?

2013-01-07 Thread *Shaji Kalidasan*
Neo, The primary difference is that, the first one is an array of 3 elements and second is an array containing one element which in turn is a reference (an anonymous array). This is probably best explained by an example. [code] use strict; use warnings; use Data::Dumper qw/Dumper/; my @a1 =

Re: Array vs List output

2013-01-02 Thread *Shaji Kalidasan*
Neeraj, If you print an array inside double quotes, each item of the array is separated by the value specified in Perl special variable $ which is the Output list separator. (interpolated lists) By default the value of $ is space So you can rewrite your code modifying the Output list

Re: Array vs List output

2013-01-02 Thread *Shaji Kalidasan*
. --- From: John W. Krahn jwkr...@shaw.ca To: Perl Beginners beginners@perl.org Sent: Wednesday, 2 January 2013 6:11 PM Subject: Re: Array vs List output *Shaji Kalidasan* wrote: Neeraj

Re: Help with a regex

2012-12-21 Thread *Shaji Kalidasan*
Greetings, Here is one way of doing it. I admit there will be better solutions to this. while (DATA) {     if(/         (\w+) #Match dns         \.       #Match dot         (\w+) #Match support         (@)   #Match @         (\w+) #Match dnsbed         \.       #Match dot         (\w+) #Match

Re: Help with a regex

2012-12-21 Thread *Shaji Kalidasan*
back to God. --- From: Feng He fen...@nsbeta.info To: *Shaji Kalidasan* shajiin...@yahoo.com Cc: beginners@perl.org beginners@perl.org Sent: Friday, 21 December 2012 3:31 PM Subject: Re

Re: Help with a regex

2012-12-21 Thread *Shaji Kalidasan*
--- Your talent is God's gift to you. What you do with it is your gift back to God. --- From: *Shaji Kalidasan

Re: question of regexp or (another solution)

2012-12-14 Thread *Shaji Kalidasan*
Hi, On Fri, Dec 14, 2012 at 2:53 PM, samuel desseaux sdesse...@gmail.comwrote: Hi! I work in a library and i need to have several fields in one line Example I have this =995  \\$xPR$wLivre =995 \\$bECAM$cECAM =995  \\$n =995  \\$oDisponible =995  \\$kG1 42171 and i want in one