Hi there!

Thanx!

That's all I needed to know! :-)

/G
ps. I don't have the manual or Perl installed on this computer...

----- Original Message ----- From: "Randal L. Schwartz" <merlyn@stonehenge.com>
To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Cc: <beginners@perl.org>
Sent: Saturday, November 12, 2005 11:47 PM
Subject: Re: Why glob() ?


"Gustav" == Gustav Wiberg <[EMAIL PROTECTED]> writes:

Gustav> This seems totally meaningless, but what would $list = glob('*.txt') return?

Now is the time I will start to quote the manpage at you:

$ perldoc -tf glob
   glob EXPR
   glob    In list context, returns a (possibly empty) list of filename
           expansions on the value of EXPR such as the standard Unix shell
/bin/csh would do. In scalar context, glob iterates through such filename expansions, returning undef when the list is exhausted. This is the internal function implementing the "<*.c>" operator, but you can use it directly. If EXPR is omitted, $_ is used. The
           "<*.c>" operator is discussed in more detail in "I/O Operators"
           in perlop.

           Beginning with v5.6.0, this operator is implemented using the
           standard "File::Glob" extension. See File::Glob for details.

See the sentence "in scalar context"?  What part of that is unclear?

Please learn to read the manual.  If you have *questions* about the
manual, or can't *find* it in the manual, that's fair game for this
list.  But I don't think you will make many friends asking us to quote
the manual for you.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>





--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to