Hi,

The two cases in this test program both print out the same data; in
this case, the 'whois record',

  #!/usr/bin/perl
  use strict;
  use warnings;

  my $ip = "1.2.3.4";

  # CASE: variable
  my $WHOIS1 = '/usr/bin/whois';
  system("$WHOIS1 $ip");

  # CASE: constant
  use constant WHOIS2 => '/usr/bin/whois %s';
  my $cmd = sprintf(WHOIS2, $ip);
  system($cmd);

Is either case the better or correct usage here?  Or are they simply
interchangeable?

--JC

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to