Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

AW: Reading from a filehandle in while-loop
Yes it should, but not on my system.

Thanks for your comments.

-----Ursprüngliche Nachricht-----
Von: Bob Showalter [mailto:Bob_Showalter@taylorwhite.com]
Gesendet: Dienstag, 26. Oktober 2004 16:00
An: 'David le Blanc'
Cc: beginners@perl.org
Betreff: RE: Reading from a filehandle in while-loop


David le Blanc wrote:
...
> You are making the assumption that  '<TEST>' sets '$_' which is not
> true.  Oddly, perl makes '<>' set $_, but not <FILE>... dunno why

Sorry, but that's just not correct.

while (<TEST> )

DOES set $_, as documented in perldoc perlop under the secion "I/O
Operators"

The OP has some other problem.

--
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>




Report this thread to moderator Post Follow-up to this message
Old Post
Bastian Angerstein
10-27-04 01:55 PM


Re: AW: Reading from a filehandle in while-loop
On Wed, 27 Oct 2004 10:43:46 +0200, Bastian Angerstein
<ang@nmc-m.dtag.de> wrote:
> Yes it should, but not on my system.
>
> Thanks for your comments.
>

So, you are saying this doesnt work?

#!/usr/bin/perl -w

use strict;
use warnings;
use diagnostics;

open (TEST,"STDIN") or die "cannot read input file.";

while(<TEST> ) {

s/\W//g;  # Clean out non-Alphanumeric...

my $input = ' ';
$input = $_ if length;

# Do other things with $input...
print "Seen $input\n";
}

__END__

???

--
WC -Sx- Jones
http://youve-reached-the.endoftheinternet.org/

Report this thread to moderator Post Follow-up to this message
Old Post
Chasecreek Systemhouse
10-28-04 01:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:00 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.