|
|
help with some scripts
This archived discussion is "read only".
» joshuatuscan - help with some scripts could someone please help me fix these scripts. i'm not sure why they don't work.#!/usr/bin/perl -w
# the following is an array. my @arr = qw(Mike Stef Michal Anthony); # notice that when we access an array's value, we use a $ sign before the name print "Prof #1 is $arr[0] \n"
my %profs = ('CD' => 'Mike', AB => 'Stef', EF => 'Michal', 'XX' => 'Anthony'); print "Section AB is $profs{'AB'}
# Print an array. my @food = ("apples","pears","eels"); any help is greatly appreciated. thanks joshua -- posted by joshuatuscan » pyuson - Re: help with some scripts In response to message posted by joshuatuscan:Corrections are shown with comments Second script: # the following is an array. my @arr = qw(Mike Stef Michal Anthony); # notice that when we access an array's value, we use a $ sign before the name print "Prof #1 is $arr[0] \n"; # <- missing a ; terminator Third script: #!/usr/bin/perl
#!/bin/perl
Fourth script: #!/bin/perl #<- Are you sure this is right? # Print an array. my @food = ("apples","pears","eels"); -- posted by pyuson » joshuatuscan - thank you so much i really appreciate the help, works great now!!-- posted by joshuatuscan
Please follow the guidelines set forth in the Suite101 Posting Etiquette when adding to the discussion. |
|
|
|
|
|
|
|