diff options
-rwxr-xr-x | soxdial | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -590,12 +590,18 @@ sub check_stereo { sub read_file { my $file = shift; my $result = shift; + my $filename = ($file eq '-' ? "stdin" : "file '$file'"); + + warn "$SELF: reading $filename.\n"; open my $fh, "<$file" or die "$SELF: $file: $!\n"; while(<$fh>) { chomp; - push @$result, split ""; + push @$result, split " "; } + + warn "$SELF: read " . @$result . " dial strings from $filename.\n" if $verbose; + close $fh; } @@ -632,6 +638,8 @@ for(@ARGV) { if($input_seen) { read_file($_, \@newargv); $input_seen = 0; + } elsif(/^--?v(?:erbose)?$/) { + $verbose = 1; } elsif(/^--?stdin$/) { read_file("-", \@newargv); } elsif(/^--?i(?:nput)?=?(.+)?$/) { @@ -674,8 +682,6 @@ for ($argc = 0; $argc < @ARGV; $argc++) { $SOX = $ARGV[++$argc]; die "$SELF: missing argument for --sox.\n" unless defined $SOX; warn "$SELF: sox executable set to '$SOX'\n" if $verbose; - } elsif(/^--?v(?:erbose)?$/) { - $verbose = 1; } elsif(/^--?n(?:oexec)?$/) { $verbose = 1; $noexec = 1; |