Re: question on reference

2008-04-20 Thread John W. Krahn
Chas. Owens wrote: On Sat, Apr 19, 2008 at 6:08 PM, Richard Lee <[EMAIL PROTECTED]> wrote: snip sub process_it { my($variable, $hash_table) = shift; } when I change to separate shift my $variable = shift; my $hash_table = shift; it worked... are they different? snip Yes, shift

Re: question on reference

2008-04-20 Thread Chas. Owens
On Sat, Apr 19, 2008 at 6:08 PM, Richard Lee <[EMAIL PROTECTED]> wrote: snip > sub process_it { > my($variable, $hash_table) = shift; > > } > > when I change to separate shift > > my $variable = shift; > my $hash_table = shift; > > it worked... are they different? snip Yes, shift retur

Re: question on reference

2008-04-19 Thread John W. Krahn
Richard Lee wrote: John W. Krahn wrote: Richard Lee wrote: Chas. Owens wrote: They do similar, but different, things. The \ operator takes a reference to a variable and [] operator creates an anonymous array. You can build [] from \ by using a temporary array that goes out of scope. my

Re: question on reference

2008-04-19 Thread Richard Lee
John W. Krahn wrote: Richard Lee wrote: Chas. Owens wrote: They do similar, but different, things. The \ operator takes a reference to a variable and [] operator creates an anonymous array. You can build [] from \ by using a temporary array that goes out of scope. my $linked = [EMAIL PR

Re: question on reference

2008-04-19 Thread John W. Krahn
Richard Lee wrote: Chas. Owens wrote: They do similar, but different, things. The \ operator takes a reference to a variable and [] operator creates an anonymous array. You can build [] from \ by using a temporary array that goes out of scope. my $linked = [EMAIL PROTECTED]; my $independ

Re: question on reference

2008-04-19 Thread Gunnar Hjalmarsson
Richard Lee wrote: why does below not work? while ( my ($key,$value) = each( %{$oj_s} ) ) { print "$key and $value\n"; } assuming that oj_s contains $VAR1 = { 'abc' => '10.0.0.1_1035', 'cde' => '192.168.1.1_1037', 'fgh' => '192.168.100.1_10', } What

Re: question on reference

2008-04-19 Thread Richard Lee
Chas. Owens wrote: On Apr 19, 2008, at 12:39, Richard Lee wrote: what is the difference?? I thought doing [ ] and \ would do the samething snip They do similar, but different, things. The \ operator takes a reference to a variable and [] operator creates an anonymous array. You can build

Re: question on reference

2008-04-19 Thread Richard Lee
Chas. Owens wrote: On Apr 19, 2008, at 12:39, Richard Lee wrote: what is the difference?? I thought doing [ ] and \ would do the samething snip They do similar, but different, things. The \ operator takes a reference to a variable and [] operator creates an anonymous array. You can build

Re: question on reference

2008-04-19 Thread Chas. Owens
On Apr 19, 2008, at 12:39, Richard Lee wrote: what is the difference?? I thought doing [ ] and \ would do the samething snip They do similar, but different, things. The \ operator takes a reference to a variable and [] operator creates an anonymous array. You can build [] from \ by usi

question on reference

2008-04-19 Thread Richard Lee
what is the difference?? I thought doing [ ] and \ would do the samething #!/usr/bin/perl -w use strict; use Data::Dumper; my %something = ( a => 1, b => 2, c => 3, ); my %something2 = ( a => 1, b => 2, ); sub process_it { my $some