Advertisement
Guest User

Mikko Ronkko

a guest
Mar 12th, 2009
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.47 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4.  
  5. open(my $file, "<", "temp.txt")
  6.     or die "Can't open file: $!";
  7. my $text = do { local $/; <$file> };
  8.  
  9.  
  10. if ($text =~ /^(.*?)\n\n *([A-Z].*?)\n\n *([A-Z][A-Za-z ]+), Vol\. (\d+), No\. (\d+). \([A-Z][a-z\- ]+\., (\d\d\d\d)\), pp\. (\d+-\d+)\.\n\nStable URL:\nhttp:\/\/links.jstor.org/s) {
  11.     print "Authors: $2, Year: $6, Title: $1, Journal: $3, Vol: $4, Iss: $5, Pages: $7 ";
  12. }
  13. else{
  14.     print "Did not find a match.";
  15. }
  16.  
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement