Code Comments
Programming Forum and web based access to our favorite programming groups.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>
Post Follow-up to this messageOn 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/
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.