Re: Stopping undefined warnings

2014-06-23 Thread SSC_perl
I just realized that I can add no warnings 'uninitialized'; to the entire script, which probably makes my last question moot. Unless there's an answer that someone likes better, just disregard that question. I can't think straight with this cold. Not that I need an excuse. ;)

Re: Stopping undefined warnings

2014-06-23 Thread SSC_perl
On Jun 17, 2014, at 1:27 PM, Jim Gibson wrote: > I would split your one, long line into several lines and use a temporary > variable to hold the possibly undefined value and assigning '' to it if it is > undefined: I like that idea. Thanks, Jim. However, that's going to be a lo

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

2014-06-23 Thread Charles DeRykus
On Mon, Jun 23, 2014 at 2:42 AM, Uday Vernekar wrote: > Hi All, > > > I have following Pattern from which I need to grep only the Fail count and > store that in a variable. > > U/A/S|Test|Test |Loop | Run |Pass |Fail| > Arguments > | Name

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

2014-06-23 Thread Ron Bergin
Uday Vernekar wrote: > Hi All, > > > I have following Pattern from which I need to grep only the Fail count and > store that in a variable. > > U/A/S|Test|Test |Loop | Run |Pass |Fail| > Arguments > | Name |Count|Count|Count|Count | > ---

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() { chomp; next if $. <= 3; my(undef, undef, undef, undef, undef, undef, $fail_count, undef) = m/^(.+?)\|(.+?)\|(.+?)\|(.+?)\|(.+?)\|(.+?)\|(.+?)\|(.+?)$/; print '-' x 30, "\n"; print "SUMMARY\n"; print

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

2014-06-23 Thread Sunita Pradhan
Can you explain little bit , how this regex will work ? -Sunita Date: Mon, 23 Jun 2014 17:12:17 +0530 Subject: Re: Need to Grep only fail count from the Pattern. From: shajiin...@gmail.com To: vernekaru...@gmail.com CC: beginners@perl.org Hi Uday, Here's one way to do it. [code]use strict;use w

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() { chomp; next if $. <= 3; my($uas, $test, $test_name, $loop_count, $run_count, $pass_count, $fail_count, $arguments) = m/^(.+?)\|(.+?)\|(.+?)\|(.+?)\|(.+?)\|(.+?)\|(.+?)\|(.+?)$/; # my($uas, $test, $test_name, $loop_cou

Need to Grep only fail count from the Pattern.

2014-06-23 Thread Uday Vernekar
Hi All, I have following Pattern from which I need to grep only the Fail count and store that in a variable. U/A/S|Test|Test |Loop | Run |Pass |Fail| Arguments | Name |Count|Count|Count|Count | -++---+--

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, "d

printing hash having undefined key

2014-06-23 Thread Sunita Pradhan
Here is my code where i want to print one hash with one key undefined . I have condition print if key exist . I guess it should not print value for undefined key , but it does . #!/usr/bin/perl -w @array = ("abc", 123, "dfg" ,456, "xsd",undef); %hash = reverse @array; foreach $k (keys %hash){