b_gsmls has asked for the wisdom of the Perl Monks concerning the following question:
... open(MYINPUTFILE, "<$load_file"); # open for input my(@lines) = <MYINPUTFILE>; # read file into list my($line); foreach $line (@lines) # loop thru list { chomp $line; @h = split(/\//, $line); #split the "/" to get hash value for dir my $hash = "$h[3]"; my $JPG = "$h[4]"; my $outfile = "/imagedb/thumb/$hash/$JPG"; #out put image my $out_path = "/imagedb/thumb/$hash"; my $image = Image::Resize->new($line); #make image my $gd = $image->resize(160, 120); open(FH, ">$outfile"); #print the image file print FH $gd->jpeg(); close(FH); #close image } close(MYINPUTFILE); ....
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Reading 60k lines in file
by ikegami (Patriarch) on Oct 08, 2009 at 16:24 UTC | |
by b_gsmls (Initiate) on Oct 08, 2009 at 19:38 UTC | |
by ikegami (Patriarch) on Oct 08, 2009 at 21:15 UTC | |
|
Re: Reading 60k lines in file
by jakobi (Pilgrim) on Oct 08, 2009 at 16:14 UTC | |
by b_gsmls (Initiate) on Oct 08, 2009 at 16:24 UTC | |
by jakobi (Pilgrim) on Oct 08, 2009 at 16:35 UTC | |
by b_gsmls (Initiate) on Oct 08, 2009 at 17:10 UTC | |
|
Re: Reading 60k lines in file
by wfsp (Abbot) on Oct 08, 2009 at 15:53 UTC | |
by b_gsmls (Initiate) on Oct 08, 2009 at 16:18 UTC | |
|
Re: Reading 60k lines in file
by kennethk (Abbot) on Oct 08, 2009 at 16:02 UTC | |
by b_gsmls (Initiate) on Oct 08, 2009 at 16:04 UTC | |
|
Re: Reading 60k lines in file
by vitoco (Hermit) on Oct 08, 2009 at 20:40 UTC |