HI
I have a hash like this
$hashname->{$filesystem}->{'fsname'}=$filesystem;
How to get the values from this multilevel hash.
Thanks in advance... :) (1 Reply)
I have line which is read from xml doc. I want to put this line into hash(perl variable). find line below and how i want to put this in hash
<font size="10" type="int" name="ABC" >
hash key should be size, type and name with corresponding value
I doing as below:-
$line =~ s/\s*.*?\s//;... (3 Replies)
This is my data
1 0
1 0
1 1
1 2
1 6
1 7
Assume that first field is key and 2nd field is value
I want to create a hash in perl, on this data. My hash should having uniq key and all values by , separated.
1,0,0,1,2,6,7
1 will be my key and rest of are should be values. (3 Replies)
hi
every resource i see regarding DBI refers to retrieving data from a database into and array or a hash, but i havent seen anything on how to pull out a single value to a scalar
in my database i have a field called "forcewrite" with a value of "6". I am trying to connect to the database,... (2 Replies)
Can Someone explain me why even using Tie::IxHash I can not get the output data in the same order that it was inserted? See code below.
#!/usr/bin/perl
use warnings;
use Tie::IxHash;
use strict;
tie (my %programs, "Tie::IxHash");
while (my $line = <DATA>) {
chomp $line;
my(... (1 Reply)
Hi,
In Perl, is it possible to use a range of numbers with '..' as a key in a hash?
Something in like:
%hash = (
'768..1536' => '1G',
'1537..2560' => '2G'
);
That is, the range operation is evaluated, and all members of the range are... (3 Replies)
Hi ,
i have the below code its working fine when i execute in unix , but its not working in windows could you pls explain me where i am going wrong.
This is the program
$data = { '1' => 'one' ,
'2' => 'two' ,
3 => 'three'
};
print "hello : $data->{'1'}... (2 Replies)
Hi,
I have an hashes of hash, where hash is dynamic, it can be n number of hash. i need to compare data_count values of all .
my %result (
$abc => {
'data_count' => '10',
'ID' => 'ABC122',
}
$def => {
'data_count' => '20',
'ID' => 'defASe',
... (1 Reply)
My issue is that the perl script (as I have done it so far) created empty branches when I try to check some branches on existence.
I am using multydimentional hashes: found it as the best way for information that I need to handle. Saing multidimentional I means hash of hashes ... So, I have
... (2 Replies)
Discussion started by: alex_5161
2 Replies
LEARN ABOUT SUSE
parent
parent(3pm) Perl Programmers Reference Guide parent(3pm)NAME
parent - Establish an ISA relationship with base classes at compile time
SYNOPSIS
package Baz;
use parent qw(Foo Bar);
DESCRIPTION
Allows you to both load one or more modules, while setting up inheritance from those modules at the same time. Mostly similar in effect to
package Baz;
BEGIN {
require Foo;
require Bar;
push @ISA, qw(Foo Bar);
}
By default, every base class needs to live in a file of its own. If you want to have a subclass and its parent class in the same file, you
can tell "parent" not to load any modules by using the "-norequire" switch:
package Foo;
sub exclaim { "I CAN HAS PERL" }
package DoesNotLoadFooBar;
use parent -norequire, 'Foo', 'Bar';
# will not go looking for Foo.pm or Bar.pm
This is equivalent to the following code:
package Foo;
sub exclaim { "I CAN HAS PERL" }
package DoesNotLoadFooBar;
push @DoesNotLoadFooBar::ISA, 'Foo', 'Bar';
This is also helpful for the case where a package lives within a differently named file:
package MyHash;
use Tie::Hash;
use parent -norequire, 'Tie::StdHash';
This is equivalent to the following code:
package MyHash;
require Tie::Hash;
push @ISA, 'Tie::StdHash';
If you want to load a subclass from a file that "require" would not consider an eligible filename (that is, it does not end in either ".pm"
or ".pmc"), use the following code:
package MySecondPlugin;
require './plugins/custom.plugin'; # contains Plugin::Custom
use parent -norequire, 'Plugin::Custom';
DIAGNOSTICS
Class 'Foo' tried to inherit from itself
Attempting to inherit from yourself generates a warning.
use Foo;
use parent 'Foo';
HISTORY
This module was forked from base to remove the cruft that had accumulated in it.
CAVEATS SEE ALSO
base
AUTHORS AND CONTRIBUTORS
Rafaeel Garcia-Suarez, Bart Lateur, Max Maischein, Anno Siegel, Michael Schwern
MAINTAINER
Max Maischein " corion@cpan.org "
Copyright (c) 2007 Max Maischein "<corion@cpan.org>" Based on the idea of "base.pm", which was introduced with Perl 5.004_04.
LICENSE
This module is released under the same terms as Perl itself.
perl v5.12.1 2010-04-26 parent(3pm)