in reply to Re^3: Help for a regex problem ?
in thread Help for a regex problem ?

Thanks a lot, it hekped greatly. Is there a way for me to use the .pdb files as the <DATA> ? Because some files have about 29000 ATOM lines.

Replies are listed 'Best First'.
Re^5: Help for a regex problem ?
by CountZero (Bishop) on Jul 13, 2009 at 21:08 UTC
    Yes of course. Open a filehandle to that file and use the filehandle instead of <DATA>:
    open my $fh, '<', 'path/to/my/PDB/file' or die "Could not open PDB fil +e: $!"; while (<$fh>) { ... }

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James