in reply to Re: Re: text reformatting woes
in thread text reformatting woes

i run the script with the -d flag, and after the split() line, i type "print @sections" in the debugger. then it prints out "4811"

Replies are listed 'Best First'.
Re: Re: Re: Re: text reformatting woes
by ysth (Canon) on Apr 19, 2004 at 08:13 UTC
    And what does the beginning of @infile look like? Update: you can't use @infile the way you are; you would need to say:@sections = split /\n\n/, join("", @infile);since split is expecting a scalar to split. Or slurp the whole file into a $infile and use that in the split. Or just assign to sections in the first place:
    open(IN,"./$file"); { local $/ = "\n\n"; chomp(@sections = <IN>); } close(IN);
    (See perlvar for what $/ does.)