develooper Front page | perl.beginners | Postings from October 2009

Re: Am I doing something really stupid?

Thread Previous | Thread Next
Shawn H Corey
October 13, 2009 07:20
Re: Am I doing something really stupid?
Message ID:
"Am I doing something really stupid?"

No, asking for help is never stupid. :) wrote:
> Hi,
> I have the following code:
> #!/usr/bin/perl
> use diagnostics;
> use strict;
> use warnings;
> my @Files = </flows/ft*>;
> foreach my $File (@Files) {
>   print $File  "\n";

This print statement is treating $File as a file handle.  It is similar to:

  print STDERR "\n";

To get it to print the contents of $File, use a comma:

  print $File, "\n";

See: perldoc -f print

> }

Just my 0.00000002 million dollars worth,

Programming is as much about organization and communication
as it is about coding.

I like Perl; it's the only language where you can bless your

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About