On 4/27/07, Somu <[EMAIL PROTECTED]> wrote:
Please give me one simple example using glob.. I saw the perlopentut,
and perldoc -f open, and perldoc -f glob, but i am unable to make out
anything from them.. I know only how to open files which are in the
same dir or child dir.. But suppose i am in dir D:/Scripts/Test and i
want to open another file E:/Games/readme.txt how do i do it?

On 4/27/07, John W. Krahn <[EMAIL PROTECTED]> wrote:
> Somu wrote:
> > I'm not certain about what EXPR is..
>
>EXPR is any valid Perl expression.
>
>> How do i use glob?
>
>perldoc -f glob
> perldoc File::Glob
>
>> My next question is regarding opening pipes. I tried the following:
> > open ( FH , " notepad " );
> > print FH 'hello' ;
>
>| is the pipe character so something like:
>
> open FH, '| notepad' or die "Cannot open pipe to notepad: $$!";
> print FH 'hello';
> close FH or warn $$! ? "Error closing notepad pipe: $$!"
> : "Exit status $$? from notepad";
>
>perldoc -f open
> perldoc -f close
> perldoc perlopentut
>
>> But its only opening the notepad application, and nothing shows up on
> > the notepad..
>
>John
> --
> Perl isn't a toolbox, but a small machine shop where you can special-order
> certain sorts of tools at low cost and in short order. -- Larry Wall
>
>--
>
>To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> http://learn.perl.org/
>
>

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




use strict;
use warnings;

my @files = glob("*.*");
for(@files)
{
   print $_ . "\n";
}

--
Rodrick R. Brown
http://www.rodrickbrown.com

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


Reply via email to