Re: Searching through a directory.
From: John Lin (john_at_mail.summer.berkeley.edu)
Date: 02/14/04
- Next message: Robin Sheat: "Re: Including files to pick up variables"
- Previous message: Manfred Beilfuss: "Manfred Beilfuß/DVAG ist außer Haus."
- In reply to: Daniel Staal: "Re: Searching through a directory."
- Next in thread: R. Joseph Newton: "Re: Searching through a directory."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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>
>
>
- Next message: Robin Sheat: "Re: Including files to pick up variables"
- Previous message: Manfred Beilfuss: "Manfred Beilfuß/DVAG ist außer Haus."
- In reply to: Daniel Staal: "Re: Searching through a directory."
- Next in thread: R. Joseph Newton: "Re: Searching through a directory."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|