Dalin has asked for the wisdom of the Perl Monks concerning the following question:
What happens is that I get the variable name and not the info contained in the variable. Also, Is there a better (less typing) way of referencing the array elements? Thanks in advance, Bradleysub mod_ulist { my @user_files = </usr/local/squid/etc/aclfiles/*.acl>; $file1 = "$user_files[0]"; $file2 = "$user_files[1]"; $file3 = "$user_files[2]"; $file4 = "$user_files[3]"; $file5 = "$user_files[4]"; $file6 = "$user_files[5]"; my $mail_flag = "1"; $oldformat = $~ = "MOD_ULIST"; open ($~); system 'clear'; write; print "Please choose a file to modify: "; my $choice = <STDIN>; chomp ($choice); $ufile = '$file' . "$choice"; file_mod($ufile,$mail_flag); }
Where ever there is confusion to be had... I'll be there.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Changing a varaibale name within the program?
by Sifmole (Chaplain) on Jun 26, 2001 at 23:38 UTC | |
by Hofmator (Curate) on Jun 27, 2001 at 15:43 UTC | |
by Dalin (Sexton) on Jun 26, 2001 at 23:43 UTC | |
by chromatic (Archbishop) on Jun 27, 2001 at 00:04 UTC | |
by Dalin (Sexton) on Jun 27, 2001 at 00:43 UTC |