Felix Dorner wrote:
> Hi,
> 
> I did the best book purchase in years: The Perl Cookbook. They have an
> example that seems to come right from Larry Wall himself. And I don't
> get it. I can use it but I don't understand why it works with wildcards.
> 
> $op = shift or die "Usage: rename expr [files]\n";
> chomp (@ARGV = <STDIN>) unless @ARGV;

The above assigns <STDIN> to @ARGV if it's empty, otherwise it is untouched.

> for(@ARGV) {
>    $was = $_;
>    eval $op;
>    die $@ if $@;
>    rename ($was, $_) unless $was eq $_;
> }


-- 
Just my 0.00000002 million dollars worth,
  Shawn

Programming is as much about organization and communication
as it is about coding.

I like Perl; it's the only language where you can bless your
thingy.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to