Link to home
Start Free TrialLog in
Avatar of wvanthony
wvanthony

asked on

Unable to generate output from an array substring

Hi - I am working with an array substring, and have been unable to pull data from it....the code in question appears below:

#!/usr/bin/perl
#
# by: Michael D. McClellan

$gameschedule_file = "/www/htdocs/calendar/gameschedule.txt";
$gamelist_file = "/www/htdocs/calendar/gamelist.txt";

open(GAMESCHEDULE,"$gameschedule_file");
@gameschedule_test = <GAMESCHEDULE>;
close(GAMESCHEDULE);
$gameschedule_test = $gameschedule[0];
print $gameschedule_test;
print "Hello World!";
exit;


The format of the gameschedule.txt file is:

002%%307
003%%308
004%%312
005%%314
006%%316
007%%318


What I am trying to do is return the first line (002%%307) via print...once I can do this, then I will replace the print command with a variable and strore the value there (and continue coding the program)....I've looked at some sample code, and it looks like mine matches, but I'm not getting anything to return....any assistance would be greatly appreciated....thanks in advance for your help in this matter...

ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wvanthony
wvanthony

ASKER

Ozo,


Once again, you rock!  $gameschedule_test = $gameschedule_test[0]; is what I meant to say - that solved the problem....thanks!