in reply to it should be simple enough...
I suspect you are confused because your final print statement emits something like $VAR1 = 'GLOB(0x817f880)'. As for why:
Your code should look something like this if you want to read in everything in one gulp:
local $/='//'; #define record separator my @records = <$in>; # read in all records chomp @records; #get rid of trailing // from each record
Or this, which reads in one record at a time and is much more memory efficient
local $/='//'; while (my $record = <$in>) { chomp $record; #remove // from end of line #... process the record ... }
|
|---|