Actually with a few small modifications your starter code as shown in the OP is able to do what you expected from it (showing you the file names):
#!/usr/bin/perl $/ = ''; # read input by paragraphs @file = <>; for($i = 1; $i < @file; $i+=4) # from field 1 (2nd field); and += for + proper loop { print "$file[$i]"; }
Edit: Oops, it's $/ = ''; # not undef
In reply to Re: extracting data and saving into seperate files
by pKai
in thread extracting data and saving into seperate files
by Angharad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |