Hi
I want to create a unique array .
I have the code below. It is creating a array which will have duplicate data .
How can I filter duplicate data ?
#!/usr/bin/perl
use Data::Dumper;
#my $cnt = scalar @$net_int_parsed_output;
$net_int_parsed_output = [lif_1
I have following data structure :
my $cmd_param_show = {'scsitrace_start_log_to_disk_true' =
{'param_val'={'log-to-disk' = 'true'},
'scsitrace_show' = {'log-to-disk'= 'true',
'enabled'=
-{'scsitrace_start_log_to_disk_true'}-{'param_val'}-{'log-to-disk'}\n;
-Akshay
On Thu, Jun 18, 2015 at 2:35 PM, Sunita Pradhan
sunita.pradhan.2...@hotmail.com wrote:
I have following data structure :
my $cmd_param_show = {'scsitrace_start_log_to_disk_true' =
{'param_val'={'log-to-disk
Hi
Is there any perl module for byte , KB, MB conversion ?
ThanksSunita
can find suitable solutions at CPAN.
For example, https://metacpan.org/pod/Format::Human::Bytes This module seems to
be exactly what you looking for.
пн, 25 мая 2015 г. в 15:37, Sunita Pradhan sunita.pradhan.2...@hotmail.com:
Hi
Is there any perl module for byte , KB, MB conversion
Hi
Why a perl programmer use 1 or any number as last statement in module or
package (like : 1;)?I checked without that also package gets loaded .
Can somebody please explain properly , it would be good with examples ?
ThanksSunita
HiDo you know any sites which helps to take up perl certifications course and
exams?
ThanksSunita
You can try using a reference instead of hash like :
--
my $entries;
my($state, $zipcodes);
while (my $line = DATA) {
chomp $line;
($state, $zipcodes) = split (/=/, $line);
push( @{ $entries-{$state} }, split( /,/,$zipcodes) )
}
print Dumper ($entries);
__DATA__
I want to write a script which will verify a valid email address .
Could anybody give some ideas , how to write a pattern for this ?
-Sunita
I do not want to use Cpan modules .
-Sunita
Date: Thu, 10 Jul 2014 11:33:24 -0700
Subject: Re: script to match a valid email id
From: r...@i.frys.com
To: sunita.pradhan.2...@hotmail.com
CC: beginners@perl.org
Sunita Pradhan wrote:
I want to write a script which will verify a valid
I have a file of contents:
---
1 6
2 7
3 8
4 9
5 10
--
I want a file with content:
1 2 3 4 5
6 7 8 9 10
I have written a few lines of following code but it does not work as expected :
---
#!/usr/bin/perl
use v5.10;
use strict;
Design Systems (I) Pvt. Ltd.
Mob:- +91-8527749333
On 7 July 2014 15:26, John Delacour johndelac...@gmail.com wrote:
On 7 Jul 2014, at 09:18, Sunita Pradhan sunita.pradhan.2...@hotmail.com wrote:
I have a file of contents:
---
1 6
2 7
3 8
4 9
5 10
--
I want
I have a set of code for count number of lines and number of words .
#!/usr/bin/perl
while ($line = STDIN){
chomp ($line);
$hash{L_c_start}++ if ($line =~ /^C.*/i);
@words = split /\s+/,$line;
foreach $c (keys @words){
print word $words[$c]\n;
Hi
I want to count number of occurrences of one word in a line within one single
line of perl script .
My code :
$c++ if ($line =~ /\s+$w\s+/g);
print count $c\n;
It always return one even if $line contains same word twice . It does not do
the global match.
It works if I split the line but
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){
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
I have following code for printing a simple hash.
#!/usr/bin/perl -w
%hash = (abc = 123, dfg = 456, xsd = 34);
foreach $k (keys %hash){
print key $k:: value $hash{$k}\n;
}
It does not print keys and displays following warnings:
--
Use of uninitialized value $k:: in
17 matches
Mail list logo