wow!
My impending question about usage of -> also got answered ...
On Thu, Aug 19, 2010 at 5:59 PM, Chas. Owens wrote:
> On Thu, Aug 19, 2010 at 07:51, Sharan Basappa
> wrote:
>> Hello,
>>
>> Assuming I have reference to an hash array $rHash, what would be the
>> way to dereference it.
>> Woul
On Thu, Aug 19, 2010 at 07:51, Sharan Basappa wrote:
> Hello,
>
> Assuming I have reference to an hash array $rHash, what would be the
> way to dereference it.
> Would it be: %hashEntry = %{$rHash}; ?
snip
The ways to dereference a hash are
# treat $ref as a hash variable
%$ref
# treat $ref as
On Thu, Aug 19, 2010 at 6:51 AM, Sharan Basappa wrote:
> Assuming I have reference to an hash array $rHash, what would be the
> way to dereference it.
> Would it be: %hashEntry = %{$rHash}; ?
>
Yes, that dereferences the hash. It's useful notation in loops...
foreach (keys %{$rHash})
while (my ($
Hello,
Assuming I have reference to an hash array $rHash, what would be the
way to dereference it.
Would it be: %hashEntry = %{$rHash}; ?
Regards,
Sharan
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
Chas. Owens wrote:
Thomas Bätzler:
#!/usr/bin/perl -w
use strict;
Don't use -w. Use the [warnings pragma][0] instead. When you say -w
you turn on warnings for everything, even modules that are not
expecting them. Read more in [perldoc perllexwarn][1].
And that is why I prefer -w.
(Mayb
On Mon, Jul 26, 2010 at 09:21, Thomas Bätzler wrote:
snip
> Assuming that $abc is a hash reference, it works like this:
>
> #!/usr/bin/perl -w
>
> use strict;
snip
Don't use -w. Use the [warnings pragma][0] instead. When you say -w
you turn on warnings for everything, even modules that are not
Thank you, Bob & others. I think I now understand better. I have the
source code. So now I should be able to figure this out.
Regards,
Sharan
On Mon, Jul 26, 2010 at 6:00 PM, Rob Coops wrote:
>
>
> On Mon, Jul 26, 2010 at 2:09 PM, Sharan Basappa
> wrote:
>>
>> Folks,
>>
>> I am reusing a code f
Hi,
Sharan Basappa asked:
> I am reusing a code for some enhancements. According to my
> understanding, it is a record with
> some unique string as key and then hash array as the value.
>
> I iterate through the array and print as follows:
>
> foreach my $key (keys %{$abc})
> {
> print "$key
On Mon, Jul 26, 2010 at 08:09, Sharan Basappa wrote:
> Folks,
>
> I am reusing a code for some enhancements. According to my
> understanding, it is a record with
> some unique string as key and then hash array as the value.
>
> I iterate through the array and print as follows:
>
> foreach my $key
On Mon, Jul 26, 2010 at 2:09 PM, Sharan Basappa wrote:
> Folks,
>
> I am reusing a code for some enhancements. According to my
> understanding, it is a record with
> some unique string as key and then hash array as the value.
>
> I iterate through the array and print as follows:
>
> foreach my $ke
Folks,
I am reusing a code for some enhancements. According to my
understanding, it is a record with
some unique string as key and then hash array as the value.
I iterate through the array and print as follows:
foreach my $key (keys %{$abc})
{
print "$key ${$abc}{$key} \n";
}
I get values suc
Ramprasad wrote:
>
> Rob Dixon wrote:
> >
> >
> > Will this do?
> >
> > sort {
> > my ($va, $vb) = map $$hash{$_}{$sortkey}, $direction eq 'a' ? ($a, $b) : ($b,
> > $a);
> > $sortkey eq 'uname' ? $va cmp $vb : $va <=> $vb;
> > } keys %$hash;
> >
> > Cheers,
> >
> > Rob
> >
> >
>
> Gr8 Now the
Rob Dixon wrote:
Ramprasad wrote:
suppose I have a hash like
%users =(
'cvs' => {
'uname' => 'cvs',
'uid' => 582,
'gid' => 500
},
'radvd' => {
'uname' => '
Rob and all the other perl wonder workers who contribute to this list,
Awesome, While I have been reading and writing perl for a few years
now, I am always amazed at the code reduction that can occur when you
properly apply the power of perl. This is the most instructive forum
that I have ever
Ramprasad wrote:
> suppose I have a hash like
>
> %users =(
>'cvs' => {
> 'uname' => 'cvs',
> 'uid' => 582,
> 'gid' => 500
> },
> 'radvd' => {
> 'un
suppose I have a hash like
%users =(
'cvs' => {
'uname' => 'cvs',
'uid' => 582,
'gid' => 500
},
'radvd' => {
'uname' => 'radvd',
'u
you second @EXPORT_OK= statement reset the EXPORT_OK array, I believe
the correct syntex should be.
our @EXPORT_OK = qw(@T_AREA %T_IDS);
Tor.
Jerry Preston wrote:
>
> Hi!,
>
> I do not understand what I am doing wrong. I can pass an hash this way and
> not an array using the following:
>
>
From: "Jerry Preston" <[EMAIL PROTECTED]>
> I do not understand what I am doing wrong. I can pass an hash this
> way and not an array using the following:
>
>require Exporter;
>
>our @ISA = qw(Exporter);
>our @EXPORT = qw();
>our @EXPORT_OK = qw( @T_AREA );
>our @EXPORT_OK =
You are resetting (clearing) @EXPORT_OK. Either you need to set it all at once or push
to it (though I don't know if this latter works, should). See inline.
On Thu, 9 Jan 2003 06:26:01 -0600, "Jerry Preston" <[EMAIL PROTECTED]> wrote:
> Hi!,
>
>
Hi!,
I do not understand what I am doing wrong. I can pass an hash this way and
not an array using the following:
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw();
our @EXPORT_OK = qw( @T_AREA );
our @EXPORT_OK = qw( %T_IDS );
where
@T_AREA = ( "", "NORTH", "SOUT
Can someone help me with this?
I have a query in a database that queries the columns
from the SYSCAT.COLUMNS table of either Oracle or DB2.
I want to be able to print the columns in a string as
follows:
Col1, col2, col3...etc.
depending on the table.
How would I do this?
=
Regards,
Vinc
21 matches
Mail list logo