Re: Searching through a directory.

From: John Lin (john_at_mail.summer.berkeley.edu)
Date: 02/14/04


Date: Fri, 13 Feb 2004 17:49:56 -0800
To: Perl Beginners <beginners@perl.org>

Hi Daniel,

Yes, that is exactly what was wrong with this script. Thanks so much!

John

At 05:41 PM 2/13/2004, you wrote:
>--As of Friday, February 13, 2004 5:07 PM -0800, John Lin is alleged to
>have said:
>
>>for ($i=0; $i <= $#filenames; $i++) {
>> $filename=@filenames[$i];
>> if ($wanted_filename == $filename) {
>> $append_filename=$filename . ';';
>> open(APPENDFILE, ">>/anotherdirectory/filename.txt");
>> print APPENDFILE $append_filename;
>> close(APPENDFILE);
>> }
>>}
>>====================================
>>
>>But for some reason, the IF statement did not work. In the filename.txt
>>file, I am getting something like this:
>
>--As for the rest, it is mine.
>
>I think you want:
>if ($wanted_filename eq $filename)
>
>That'll do a lexographic check instead of a numeric, which is what I think
>you want.
>
>Daniel T. Staal
>
>---------------------------------------------------------------
>This email copyright the author. Unless otherwise noted, you
>are expressly allowed to retransmit, quote, or otherwise use
>the contents for non-commercial purposes. This copyright will
>expire 5 years after the author's death, or in 30 years,
>whichever is longer, unless such a period is in excess of
>local copyright law.
>---------------------------------------------------------------
>
>--
>To unsubscribe, e-mail: beginners-unsubscribe@perl.org
>For additional commands, e-mail: beginners-help@perl.org
><http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>



Relevant Pages

  • Re: Barbara Thiering Refuted!
    ... the particular script. ... John Byrne did. ... THIS HYPOTHESIS for the reason...what was the reason, ... capable of looking up the straight lines and crunching the numbers. ...
    (sci.archaeology)
  • Re: Barbara Thiering Refuted!
    ... the particular script. ... John Byrne did. ... THIS HYPOTHESIS for the reason...what was the reason, ... capable of looking up the straight lines and crunching the numbers. ...
    (sci.archaeology)
  • Re: Roadshows, Part V
    ... each of the "skits" with John and Miles, there was a part where Miles ... script with cues for the lights and sound folks. ... "Listen, you know I really dig that Priscilla chick, right?" ...
    (soc.religion.mormon)
  • lk-changelog.pl 0.325
    ... This script is used by Linus and Marcelo to rearrange and reformat BK ... +'christoph:lameter.com' => 'Christoph Lameter', ... 'hawkes:oss.sgi.com' => 'John Hawkes', ... 'lethal:unusual.internal.linux-sh.org' => 'Paul Mundt', ...
    (Linux-Kernel)
  • Re: Sony FX1 (or Z1U)??
    ... thanks so much for the recap John i absolutely loved the build at the end. ... become the STANDARD like sony used to be with beta. ... one reason stated to me sounded ... >>camera recording in all the camera control phases as well as both SD 4:3 ...
    (rec.video.production)