Hi,

I am trying to initialize a dynamically-named array, i.e. with the
following test code (if I type "script.pl char" at the command prompt) I
get the message "array char contains 1 2 3" but I get a warning if 'use
strict' is on. Can anyone show me how it should be done (I would like to
use 'use strict'!)?

#!/usr/bin/perl -w
#use strict;
my ($string);

while (<$ARGV[0]>) {
  chomp($string=$_);
  @$string = (1,2,3);  #Won't work if 'use strict' pragma is used
}

print "array $string contains @$string\n";


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

Reply via email to