Advertisement
Guest User

Untitled

a guest
Mar 13th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.25 KB | None | 0 0
  1. use strict;
  2. use warnings;
  3.  
  4. $|=1;
  5.  
  6. my $canais = {
  7.     canal_1 => {
  8.         slot    => 1,
  9.         nome    => "Canal 1",
  10.         eqp     => "ed871p09j4",
  11.         ativo   => 1,
  12.         nerros  => 0,
  13.         ntotal  => 0,
  14.         ulterro => "",
  15.     },
  16.     canal_2 => {
  17.         slot    => 2,
  18.         nome    => "Canal 2",
  19.         eqp     => "ed871p09j4",
  20.         ativo   => 1,
  21.         nerros  => 0,
  22.         ntotal  => 0,
  23.         ulterro => "",
  24.     },
  25.     canal_3 => {
  26.         slot    => 1,
  27.         nome    => "Canal 3",
  28.         eqp     => "ed871p09j5",
  29.         ativo   => 1,
  30.         nerros  => 0,
  31.         ntotal  => 0,
  32.         ulterro => "",
  33.     },
  34.     canal_4 => {
  35.         slot    => 3,
  36.         nome    => "Canal 4",
  37.         eqp     => "ed871p09j2",
  38.         ativo   => 1,
  39.         nerros  => 0,
  40.         ntotal  => 0,
  41.         ulterro => "",
  42.     },
  43. };
  44.  
  45. $canais->{canal_5} = {
  46.     slot    => 0,
  47.     nome    => "Canal 5",
  48.     eqp     => "ed871p09j6",
  49.     ativo   => 0,
  50.     nerros  => 3,
  51.     ntotal  => 7,
  52.     ulterro => "2013-03-12 20:34:12"
  53. };
  54.  
  55. for my $chave (sort keys $canais) {
  56.     my $canal = $canais->{$chave};
  57.     print "\n>>>> $chave\n";
  58.     for my $coluna (keys $canal) {
  59.         print "$coluna = $canal->{$coluna}\n";
  60.     }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement