On May 10, Zachary Buckholz said:

>#!/usr/bin/perl
>
>use LWP::Simple;
>use Digest::MD5 md5_hex;
>
>for (@ARGV) {
>$url = $_;
>$content = get($url);
>$digest = md5_hex($content);
>print "$digest";
>
>}
>
>exit();

No offense, but why so drawn out?  Why do $url = $_, instead of

  for $url (@ARGV) { ... }

But why use $url at all?  And why all those intermediate variables?

  #!/usr/bin/perl -wl
  print md5_hex get $_ for @ARGV;

or, if you're a parenthesis fiend:

  #!/usr/bin/perl -wl
  print md5_hex(get($_)) for @ARGV;

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to