Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
and get,for example, the following error:'print "$_: "; s/foo/bar/ if <STDIN> =~ /^y/i'
Running ActivePerl-5.24 on W10, here's the code:The system cannot find the file specified.
Where have I gone astray?#!/usr/bin/perl -w use strict; use warnings; use 5.010; # Larry's filename fixer [Cookbook 9.9, mod crt for ActiveState/W10] my $op = shift or die "Usage: perl rename expr [files]\n"; chomp(@ARGV = <STDIN>) unless @ARGV; @ARGV = map glob, @ARGV; for (@ARGV) { my $was = $_; eval $op; die $@ if $@; rename ($was, $_) unless $was = $_; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: eval NoOp on cmd.exe line expr
by kennethk (Abbot) on Mar 13, 2017 at 23:36 UTC | |
|
Re: eval NoOp on cmd.exe line expr
by Anonymous Monk on Mar 13, 2017 at 23:36 UTC | |
|
Re: eval NoOp on cmd.exe line expr
by haukex (Archbishop) on Mar 14, 2017 at 18:58 UTC | |
|
Re: eval NoOp on cmd.exe line expr
by Anonymous Monk on Mar 14, 2017 at 18:23 UTC |