Hi Jim,
On Fri, Jan 11, 2013 at 1:54 PM, Jim Gibson wrote:
> OR
>
> print_path( $id, $routes->{$id} );
> ...
> sub print_path
> {
> ...
> while( my ($start, $end) = each %$edges ) {
>
>
This is what i want, thank you!
Apparently passing "$routes->{$id}" is my earlier issue.
--budi
On Jan 10, 2013, at 7:33 PM, budi pearl wrote:
> Hi All,
>
> I would like to pass hash: %{$routes{"ROUTE-252"}} instead of %routes but
> got this error:
>
> [budi@dev bin]$ ./print_path.pl
> Type of arg 1 to each must be hash (not hash element) at
> ./print_path.plline 38, near "}) "
> Executio
On Fri, Jan 11, 2013 at 11:05 AM, budi pearl wrote:
> Hi Shawn,
>
> When trying to accessed inside subroutine , i got:
>
> Type of arg 1 to each must be hash (not hash element) at ./print_path.plline
> 41, near "}) "
>
> Execution of ./print_path.pl aborted due to compilation errors.
>
>
> this
Hi Shawn,
When trying to accessed inside subroutine , i got:
Type of arg 1 to each must be hash (not hash element) at
./print_path.plline 41, near "}) "
Execution of ./print_path.pl aborted due to compilation errors.
this is work:
while (my ($start, $end) = each %{$routes{$label}}) {
but thi
On Fri, 11 Jan 2013 10:33:02 +0700
budi pearl wrote:
> my $id = "ROUTE-252";
> print Dumper $routes{$id};
>
> print_path($id, \%{$routes{$id}});
I think you want:
print_path( $id, $routes{$id} );
--
Don't stop where the ink does.
Shawn
--
To unsubscribe, e-mail: beginners-unsubs
Hi All,
I would like to pass hash: %{$routes{"ROUTE-252"}} instead of %routes but
got this error:
[budi@dev bin]$ ./print_path.pl
Type of arg 1 to each must be hash (not hash element) at
./print_path.plline 38, near "}) "
Execution of ./print_path.pl aborted due to compilation errors.
#use
Hi Rob,
This works and looks much more simpler. Thanks, i love it.
--budhi
On Fri, Jan 11, 2013 at 1:00 AM, Rob Dixon wrote:
> On 10/01/2013 10:01, budi perl wrote:
>
>> Hi,
>>
>> I have this following hash:
>>
>> #!/usr/bin/perl
>> #
>> use strict;
>> use Data::Dumper;
>>
>> my %MYROUTES = (
On 10/01/2013 10:01, budi perl wrote:
Hi,
I have this following hash:
#!/usr/bin/perl
#
use strict;
use Data::Dumper;
my %MYROUTES = (
"ROUTE-252" => {
# src => dest
427 => "ABEP",
"ABEP" => 441,
441 => 427,
427 => 444,
444 => "MGWQ",
On Thu, Jan 10, 2013 at 5:19 PM, David Precious wrote:
> On Thu, 10 Jan 2013 17:01:43 +0700
> budi perl wrote:
> You can't have the same hash key twice; you've duplicated 427 there.
>
> Also, you don't need to quote the left side of a fat comma, so you can
> just as easily say e.g. ABEP => 441.
>
On Thu, 10 Jan 2013 17:01:43 +0700
budi perl wrote:
> Hi,
>
> I have this following hash:
>
> #!/usr/bin/perl
> #
> use strict;
> use Data::Dumper;
>
> my %MYROUTES = (
> "ROUTE-252" => {
> # src => dest
>427 => "ABEP",
>"ABEP" => 441,
>441 => 427,
>427
Hi,
I have this following hash:
#!/usr/bin/perl
#
use strict;
use Data::Dumper;
my %MYROUTES = (
"ROUTE-252" => {
# src => dest
427 => "ABEP",
"ABEP" => 441,
441 => 427,
427 => 444,
444 => "MGWQ",
"MGWQ" => "CDEF"
},
"ROUTE-432" => {
11 matches
Mail list logo