Changeset 43


Ignore:
Timestamp:
Jul 9, 2007, 9:29:00 PM (17 years ago)
Author:
simon
Message:
  • Move code to get the list of UIDs into a function
File:
1 edited

Legend:

Unmodified
Added
Removed
  • keysigning/gpg-challenge.pl

    r42 r43  
    2727my $occasion="something";
    2828
    29 foreach my $keyID (@ARGV) {
    30     if ( $keyID !~ /[A-F0-9]{8}/i )
    31     {
    32         die "\"$keyID\" doesn't look like a valid Key-ID!\n";
    33     }
    34 
    35     printf stderr "Key ID: $keyID\n";
     29sub get_uids ($)
     30{
     31    my $keyID = shift;
    3632
    3733    my (%uids);
     
    7874    }
    7975
    80     foreach $uid ( keys %uids )
     76    return %uids;
     77}
     78
     79foreach my $keyID (@ARGV) {
     80    if ( $keyID !~ /[A-F0-9]{8}/i )
     81    {
     82        die "\"$keyID\" doesn't look like a valid Key-ID!\n";
     83    }
     84
     85    printf STDERR "Key ID: $keyID\n";
     86    my (%uids) = get_uids($keyID);
     87
     88    foreach my $uid ( keys %uids )
    8189    {
    8290        # Get a random string:
Note: See TracChangeset for help on using the changeset viewer.