Delhi Beijing Canberra NewYork
hot cold rainy
go dontgo cannotcomment
####
City : Delhi
Weather : hot
recommended : go
####
City : Delhi
Weather : hot
recommended : dontgo
####
syntax error at perl_script.pl line 8, near ")
or"
####
#! perl -slw
use strict;
use Data::Dumper;
#use File::Path
open(my $in, '<', 'ocean_dummy')
or die "Cannot open input.txt: $!";
my @city = split ' ', <$in>;
my @temp = split ' ', <$in>;
my @note = split ' ', <$in>;
#perl -MFile::Path -e 'mkpath([map { "dir$_" } (1 .. 20)])'
#-e 'mkpath([map { "dir$_" } (1 .. 20)])'
#mkpath([map { "dir$_" } (1 .. 20)]);
my $i = '01';
for my $city ( @city ) {
for my $temp ( @temp ) {
for my $note ( @note ) {
#mkdir directory_$city$temp$note
open O, '>', 'out' . $i++ or die $!;
print O 'city: ', $city;
print O 'weather: ', $temp;
print O 'recommended: ', $note;
close O;
}
}
}