~ubuntu-branches/ubuntu/saucy/openssl098/saucy-updates

« back to all changes in this revision

Viewing changes to .pc/perl-path.diff/demos/b64.pl

  • Committer: Bazaar Package Importer
  • Author(s): Kurt Roeckx
  • Date: 2011-03-23 19:50:31 UTC
  • Revision ID: james.westby@ubuntu.com-20110323195031-mmhmc4v3kv1smgal
Tags: 0.9.8o-6
Upload as transitional openssl098 source package, just keeping
the library.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/local/bin/perl
 
2
 
 
3
#
 
4
# Make PEM encoded data have lines of 64 bytes of data
 
5
#
 
6
 
 
7
while (<>)
 
8
        {
 
9
        if (/^-----BEGIN/ .. /^-----END/)
 
10
                {
 
11
                if (/^-----BEGIN/) { $first=$_; next; }
 
12
                if (/^-----END/) { $last=$_; next; }
 
13
                $out.=$_;
 
14
                }
 
15
        }
 
16
$out =~ s/\s//g;
 
17
$out =~ s/(.{64})/$1\n/g;
 
18
print "$first$out\n$last\n";
 
19
 
 
20