[Chicago-talk] Re: no strict refs question

Jay Strauss me at heyjay.com
Sun Mar 7 11:42:38 CST 2004


PS. I know I can do:

use strict;
{
    no strict 'vars';
    $app = "filename";
}

foreach (@a) {
    {
     no strict 'refs';
     print $$_,"\n";
    }
}

----- Original Message ----- 
From: "Jay Strauss" <me at heyjay.com>
To: "chicago-pm" <chicago-talk at mail.pm.org>
Sent: Sunday, March 07, 2004 11:38 AM
Subject: no strict refs question


> Can I do:
> 
> > cat j 
> #!/usr/bin/perl
> $app = "filename";
> my @a = qw/app/;
> 
> foreach my $var (@a) {
>  print "$$var\n";
> }
> 
> > ./j
> filename
> 
> 
> With a "my" variable for $app?  as in:
> 
> > cat j 
> #!/usr/bin/perl
> my $app = "filename";  ### notice the my ###
> my @a = qw/app/;
> 
> foreach my $var (@a) {
>  print "$$var\n";
> }
> 
> Thanks
> Jay
> 




More information about the Chicago-talk mailing list