I'm working on a DVD database and like the php script VideoDB but I dident want to add in movies one by one since I have over 700 titles. So i started working on a script to take a TXT file and query IMDB using IMDB::Film and get the data on each movie in my list and writ it to another TXT file. I can then inport this into MySQL Im new to using perl for file minipulation so I'm taking it slow.. here is what i got so far
use IMDB::Film; $inputfile="dvdlist.txt"; $outputfile="dvdlist.csv"; open(INFILE,"$inputfile") or die("Couldn't open $inputfile\n"); open(OUTFILE,">$outputfile") or die("Couldn't open $outputfile\n"); @DVDS=<INFILE>; close (INFILE); foreach $line (@DVDS) { print "$line"; $imdbObj = new IMDB::Film(crit => "$line"); print OUTFILE "Title: ".$imdbObj->title()."\n"; print OUTFILE "Year: ".$imdbObj->year()."\n"; print OUTFILE "Plot Symmary: ".$imdbObj->plot()."\n"; }
The problem I'm having is when I run it against the dvdlist.txt file which looks like this.
Shaun Of The Dead Halfbaked aliens
it gives me an out put like this
Title: Shaun of the Dead Year: 2004 Plot Symmary: A man decides to turn his moribund life around by winnin +g back his ex-girlfriend, reconciling his relationship with his mothe +r and dealing with an entire community that has returned from the dea +d to eat the living. Title: Year: Plot Symmary: The story of three not so bright men who come up with a +series of crazy schemes to get a friend out of jail. Title: Year: Plot Symmary: The planet from Title: Year: Plot Symmary: Naive young Mormon Joe Young is recruited to act in porn + movies.
So it process the first title but it looks like the loop is not working for the others..any suggestions?

In reply to Loop with IMDB::Film by Codyd

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.