[BACK]Return to example3.pl CVS log [TXT][DIR] Up to [local] / palm / Palm-Keyring / examples

Diff for /palm/Palm-Keyring/examples/example3.pl between version 1.6 and 1.10

version 1.6, 2007/09/12 04:59:37 version 1.10, 2008/03/05 22:04:46
Line 1 
Line 1 
 #!/usr/bin/perl  #!/usr/bin/perl
 # $RedRiver: example3.pl,v 1.5 2007/08/10 04:13:31 andrew Exp $  # $RedRiver: example3.pl,v 1.9 2008/02/28 00:17:33 andrew Exp $
 ########################################################################  ########################################################################
 # palmkeyring.pl *** a command line client for Keyring databases.  # palmkeyring.pl *** a command line client for Keyring databases.
 #  #
Line 26 
Line 26 
 my $PDBFile;  my $PDBFile;
 my $Categories;  my $Categories;
 my $Names;  my $Names;
   my $Accounts;
 my $Action_List;  my $Action_List;
 my $Action_Show;  my $Action_Show;
   
Line 33 
Line 34 
         "file|f=s"        => \$PDBFile,          "file|f=s"        => \$PDBFile,
         "categories|c:s@" => \$Categories,          "categories|c:s@" => \$Categories,
         "name|n=s@"       => \$Names,          "name|n=s@"       => \$Names,
           "account|a=s@"    => \$Accounts,
         "list|l"          => \$Action_List,          "list|l"          => \$Action_List,
         "show|s"          => \$Action_Show,          "show|s"          => \$Action_Show,
 );  );
Line 93 
Line 95 
 sub show_items  sub show_items
 {  {
         get_password() || die "Couldn't decrypt file!";          get_password() || die "Couldn't decrypt file!";
   
         foreach (0..$#{ $pdb->{'records'} }) {          foreach (0..$#{ $pdb->{'records'} }) {
         next if $_ == 0;                  my $r = $pdb->{'records'}->[$_];
         my $r = $pdb->{'records'}->[$_];  
   
                 my $category =                  my $category =
                         $pdb->{'appinfo'}->{'categories'}->[ $r->{'category'} ]->{'name'};                          $pdb->{'appinfo'}->{'categories'}->[ $r->{'category'} ]->{'name'};
   
Line 110 
Line 109 
                 }                  }
                 next if ( @{ $Categories } || @{ $Names } ) && not $matched;                  next if ( @{ $Categories } || @{ $Names } ) && not $matched;
   
         my $a = $pdb->Decrypt($r);                  my $a = $pdb->Decrypt($r);
   
                   $matched = 0;
                   foreach my $account (@{ $Accounts }) {
                           $matched++ if uc($a->{1}->{data}) eq uc($account);
                   }
                   next if ( @{ $Accounts } ) && not $matched;
   
                 # XXX Fix up formatting                  # XXX Fix up formatting
                 print $a->{0}->{data} .  "\n\t" .                  print $a->{0}->{data} .  "\n\t" .

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.10

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>