Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed 1e8c901

Converted all scripts to YAML::XS.

  • Participants
  • Parent commits 57ff39c

Comments (0)

Files changed (3)

File 1st-version-as-scripts/prepare-yaml.pl

 use warnings;
 
 use File::Spec;
-use YAML;
+use YAML::XS;
 
 opendir my $cwd, ".";
 my @paths = sort { $a cmp $b } grep { /\.(jpg|png)$/ } (File::Spec->no_upwards(readdir($cwd)));
 {
     die "YAML File already exists!";
 }
-open my $yaml, ">", $yaml_fn;
-print {$yaml} Dump(
+YAML::XS::DumpFile(
+    $yaml_fn,
     {
         common_tags => [],
         files =>
             }
             @paths),
         ],
-    }
+    },
 );
-close($yaml);
 

File 1st-version-as-scripts/upload-spec.yml

 ---
 common_tags: []
 files:
-  - description_parts:
-      - ''
-      - ''
-      - ''
-      - ''
-      - ''
-    filename: img_7953.jpg
-    tags: []
-    title: ''
-  - description_parts:
-      - ''
-      - ''
-      - ''
-      - ''
-      - ''
-    filename: img_7954.jpg
-    tags: []
-    title: ''
-  - description_parts:
-      - ''
-      - ''
-      - ''
-      - ''
-      - ''
-    filename: img_7957.jpg
-    tags: []
-    title: ''
-  - description_parts:
-      - ''
-      - ''
-      - ''
-      - ''
-      - ''
-    filename: img_7958.jpg
-    tags: []
-    title: ''
+- description_parts:
+  - ''
+  - ''
+  - ''
+  - ''
+  - ''
+  filename: img_7953.jpg
+  tags: []
+  title: ''
+- description_parts:
+  - ''
+  - ''
+  - ''
+  - ''
+  - ''
+  filename: img_7954.jpg
+  tags: []
+  title: ''
+- description_parts:
+  - ''
+  - ''
+  - ''
+  - ''
+  - ''
+  filename: img_7957.jpg
+  tags: []
+  title: ''
+- description_parts:
+  - ''
+  - ''
+  - ''
+  - ''
+  - ''
+  filename: img_7958.jpg
+  tags: []
+  title: ''

File 1st-version-as-scripts/upload.pl

 use strict;
 use warnings;
 
-use YAML;
+use YAML::XS;
 use Carp;
 
 use Flickr::Upload;
 
-my $data = YAML::LoadFile("upload-spec.yml");
+my $data = YAML::XS::LoadFile("upload-spec.yml");
 
 my $common_tags = $data->{common_tags};