Re: about glob

2010-12-16 Thread Rob Dixon
On 16/12/2010 13:57, practicalperl wrote: On Thu, Dec 16, 2010 at 9:47 PM, C.DeRykus wrote: There weren't any matches with files and no wildcards in the glob pattern so the pattern itself is returned *. If there had been a wildcard in the pattern, then nothing would have been ret

Re: about glob

2010-12-16 Thread practicalperl
On Thu, Dec 16, 2010 at 9:47 PM, C.DeRykus wrote: > There weren't any  matches with files and no wildcards > in the glob pattern so the pattern itself is returned *.  If > there had been a wildcard in the pattern, then nothing > would have been returned. > Thanks. But still

Re: about glob

2010-12-16 Thread C.DeRykus
On Dec 16, 2:56 am, practicalp...@gmail.com (practicalperl) wrote: > This has been confused me: > > [an...@localhost tmp]$ ls > [an...@localhost tmp]$ perl -le'print glob("foo.3")' > foo.3 > > there is nothing in the tmp directory. > but why glob("f

about glob

2010-12-16 Thread practicalperl
This has been confused me: [an...@localhost tmp]$ ls [an...@localhost tmp]$ perl -le'print glob("foo.3")' foo.3 there is nothing in the tmp directory. but why glob("foo.3") returns the string? $ perl -v This is perl, v5.8.8 built for i686-linux Thanks. -- To

Re: glob files and subdirectories

2010-12-08 Thread Brian Fraser
While some people have suggested File::Find, I'd recommend File::Find::Rule[0]: > use File::Find::Rule; > my $starting_dir = 'C:/whatever'; > my @files = File::Find::Rule->name( '*.html' )->in( $starting_dir ); > say join "\n", @files; Brian. [0] http://search.cpan.org/~rclamp/File-Find-Ru

RE: glob files and subdirectories

2010-12-08 Thread Wagner, David --- Senior Programmer Analyst --- CFS
>-Original Message- >From: Noah [mailto:noah-l...@enabled.com] >Sent: Wednesday, December 08, 2010 12:42 >To: Perl Beginners >Subject: glob files and subdirectories > >Hi there, > >what is the easiest way to get all the filenames like *html in the root >di

Re: glob files and subdirectories

2010-12-08 Thread Shlomi Fish
On Wednesday 08 December 2010 22:49:35 Shawn H Corey wrote: > On 10-12-08 02:41 PM, Noah wrote: > > Hi there, > > > > what is the easiest way to get all the filenames like *html in the root > > directory and all subdirectories? > > > > The glob command ap

Re: glob files and subdirectories

2010-12-08 Thread Shawn H Corey
On 10-12-08 02:41 PM, Noah wrote: Hi there, what is the easiest way to get all the filenames like *html in the root directory and all subdirectories? The glob command appears to just sit at the root directory. Cheers, Noah use File::Find; See `perldoc File::Find` for details. -- Just

Re: glob files and subdirectories

2010-12-08 Thread shawn wilson
Look at find2perl.

Re: glob files and subdirectories

2010-12-08 Thread Robert Wohlfarth
On Wed, Dec 8, 2010 at 1:41 PM, Noah wrote: > Hi there, > > what is the easiest way to get all the filenames like *html in the root > directory and all subdirectories? > > The glob command appears to just sit at the root directory. > Try the File::Next<http://search.c

glob files and subdirectories

2010-12-08 Thread Noah
Hi there, what is the easiest way to get all the filenames like *html in the root directory and all subdirectories? The glob command appears to just sit at the root directory. Cheers, Noah -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners

Re: perl glob returning number

2010-06-25 Thread John W. Krahn
Noah wrote: Hi there, Hello, why is the perl glob command returning a number and not the filenames? my (@filenames, @files); You are creating a new variable named @files which will be empty. for my $file (@files) { Because @files is empty this loop will not execute and *nothing* will

Re: perl glob returning number

2010-06-25 Thread Paul Johnson
On Fri, Jun 25, 2010 at 02:56:34PM -0700, Noah wrote: > Hi there, > > why is the perl glob command returning a number and not the filenames? It's not, it's just the way you are printing it. Try changing that dot to a comma, or C< print "@files\n"; > You nee

perl glob returning number

2010-06-25 Thread Noah
Hi there, why is the perl glob command returning a number and not the filenames? my (@filenames, @files); for my $file (@files) { #my $filename = "$directory/*$file"; #print "$filename\n"; @files = <$directory/*$file> or die $!; print @files .

Re: regex support for glob

2010-01-20 Thread Dr.Ruud
Shameem Ahamed wrote: I have files with digits as extensions. Like file.0, file.1 file.2..file.100,file.101 etc. I want to select only the first 30 files. I used glob("file.[0-4]?[0-9]") but it doesn't seem to be working. Try: "file.{[0-9],[0-4][0-9]}&quo

Re: regex support for glob

2010-01-20 Thread Shawn H Corey
Shameem Ahamed wrote: > Hi All, > > I am wondering how can i use the glob function to get only the first few > files. > > > I have files with digits as extensions. Like file.0, file.1 > file.2..file.100,file.101 etc. > > I want to select only the first 30

Re: regex support for glob

2010-01-20 Thread John W. Krahn
Parag Kalra wrote: On Wed, Jan 20, 2010 at 2:20 PM, Shameem Ahamed wrote: I am wondering how can i use the glob function to get only the first few files. I have files with digits as extensions. Like file.0, file.1 file.2..file.100,file.101 etc. I want to select only the first 30 files

Re: regex support for glob

2010-01-20 Thread Parag Kalra
; } my @Req_Input_Files; # Getting first 30 files out of the lot of 50 foreach(1..30){ my $tmp_file = 'file.'.$_; push @Req_Input_Files, glob $tmp_file; } print "@Req_Input_Files\n"; O/P: perl Search_30_Files.pl file.1 file.2 file.3 file.4 file.5 file.6 file.7 fi

regex support for glob

2010-01-20 Thread Shameem Ahamed
Hi All, I am wondering how can i use the glob function to get only the first few files. I have files with digits as extensions. Like file.0, file.1 file.2..file.100,file.101 etc. I want to select only the first 30 files. I used glob("file.[0-4]?[0-9]") but it doesn't see

Re: removing files in unix or linux using glob?

2008-11-21 Thread Chas. Owens
On Fri, Nov 21, 2008 at 16:38, Richard Lee <[EMAIL PROTECTED]> wrote: > Richard Lee wrote: >> >> Richard Lee wrote: >>> >>> stion on this.. suppose there is 3 files in temp directory >>> >>> /tmp/yahoo1 >>> /tmp/yahoo2 >>> /tmp/yahoo3 >>> >>> and I wanted to take the last file that was created.. wo

Re: removing files in unix or linux using glob?

2008-11-21 Thread Richard Lee
Richard Lee wrote: Richard Lee wrote: stion on this.. suppose there is 3 files in temp directory /tmp/yahoo1 /tmp/yahoo2 /tmp/yahoo3 and I wanted to take the last file that was created.. would this work? my $filename = shift; my @file_1 = ; my $file_1 = $file_1[-1]; push @files, $file_1; i

Re: removing files in unix or linux using glob?

2008-11-21 Thread Richard Lee
Richard Lee wrote: stion on this.. suppose there is 3 files in temp directory /tmp/yahoo1 /tmp/yahoo2 /tmp/yahoo3 and I wanted to take the last file that was created.. would this work? my $filename = shift; my @file_1 = ; my $file_1 = $file_1[-1]; push @files, $file_1; i am not 100% sure if

Re: removing files in unix or linux using glob?

2008-11-21 Thread Richard Lee
Mr. Shawn H. Corey wrote: See: * perldoc -f unlink * perldoc -f glob * perldoc perlfunc and search for -f under "Alphabetical Listing of Perl Functions" one more question on this.. suppose there is 3 files in temp directory /tmp/yahoo1 /tmp/yahoo2 /

Re: removing files in unix or linux using glob?

2008-11-19 Thread Richard Lee
Mr. Shawn H. Corey wrote: for my $file ( glob( '/tmp/yahoo.*' ) ){ unlink $file if -f $file; } See: * perldoc -f unlink * perldoc -f glob * perldoc perlfunc and search for -f under "Alphabetical Listing of Perl Functions" thanks, I t

Re: removing files in unix or linux using glob?

2008-11-19 Thread Mr. Shawn H. Corey
On Wed, 2008-11-19 at 12:12 -0500, Richard Lee wrote: > I thought I could do this, > > if ( -f q#/tmp/yahoo.* ) { > system("rm -rf /tmp/yahoo.*"); > } > > what am i missing? > for my $file ( glob( '/tmp/yahoo.*' ) ){ unlink $file if

Re: removing files in unix or linux using glob?

2008-11-19 Thread Paul Johnson
On Wed, Nov 19, 2008 at 12:12:50PM -0500, Richard Lee wrote: > I thought I could do this, > > if ( -f q#/tmp/yahoo.* ) { >system("rm -rf /tmp/yahoo.*"); > } > > what am i missing? A hash, the glob() function, or perhaps just that the test is superflu

removing files in unix or linux using glob?

2008-11-19 Thread Richard Lee
I thought I could do this, if ( -f q#/tmp/yahoo.* ) { system("rm -rf /tmp/yahoo.*"); } what am i missing? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Open() and glob EXPR

2007-05-02 Thread Somu
Ok i got that.. I also checked the perldoc -f q -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Open() and glob EXPR

2007-04-28 Thread Jay Savage
On 4/28/07, Somu <[EMAIL PROTECTED]> wrote: Thank you all.. Now i'm able to open files from other drives and directories.. The EXPR in glob EXPR is actually a kind of regexp then? What is this new q{} operator? I am sorry for the previous dubious emails, they actually were errors

Re: Open() and glob EXPR

2007-04-28 Thread Somu
Thank you all.. Now i'm able to open files from other drives and directories.. The EXPR in glob EXPR is actually a kind of regexp then? What is this new q{} operator? I am sorry for the previous dubious emails, they actually were errors made by the mail sender. -- To unsubscribe, e-mail: [

Re: Open() and glob EXPR

2007-04-28 Thread Dr.Ruud
"Rodrick Brown" schreef: > my @files = glob("*.*"); The glob() also returns directory names, so maybe @names is a better name for that variable. With "*.*", all names are left out that start with a dot, or that contain no dot at all. Try: perl -wle 'pri

Re: Open() and glob EXPR

2007-04-27 Thread Chas Owens
On 4/27/07, Somu <[EMAIL PROTECTED]> wrote: snip My next question is regarding opening pipes. I tried the following: open ( FH , " notepad " ); print FH 'hello' ; But its only opening the notepad application, and nothing shows up on the notepad.. snip I fear that you are trying to open the

Re: Open() and glob EXPR

2007-04-27 Thread Jay Savage
Please don't top post. 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 d

Re: Open() and glob EXPR

2007-04-27 Thread Rodrick Brown
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

Re: Open() and glob EXPR

2007-04-27 Thread Somu
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

Re: Open() and glob EXPR

2007-04-26 Thread John W. Krahn
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 'h

Re: Open() and glob EXPR

2007-04-26 Thread Jeff Pang
open FH,">","notepad" or die $!; # create a new file open FH,">>","notepad" or die $!; # append to a file,if not exists,then create one see "perldoc -f open". 2007/4/27, Somu <[EMAIL PROTECTED]>: I'm not certain about wha

Open() and glob EXPR

2007-04-26 Thread Somu
I'm not certain about what EXPR is.. How do i use glob? My next question is regarding opening pipes. I tried the following: open ( FH , " notepad " ); print FH 'hello' ; But its only opening the notepad application, and nothing shows up on the notepad.. -- To un

Re: Strange problem with glob <>

2006-12-28 Thread Madhur Kashyap
Okies... yeah ..later I changed it to glob() and it worked, but I was little bit concerned why it works with switch module. Nevertheless, I have had wierd troubles with Switch module in past ... Thanks Madhur On 12/28/06, Mumia W. <[EMAIL PROTECTED]> wrote: On 12/28/2006 01:42 AM,

Re: Strange problem with glob <>

2006-12-28 Thread Mumia W.
On 12/28/2006 01:42 AM, Madhur Kashyap wrote: Hi there, Have a look at these two different implementations. IMPL2 works somehow. The problem I am facing is that the glob <$pat> does not return any value in IMPL1 but it returns in IMPL2. Can somebody tell what could be the p

Re: Strange problem with glob <>

2006-12-28 Thread Igor Sutton
Hi Madhur, 2006/12/28, Madhur Kashyap <[EMAIL PROTECTED]>: Hi there, Have a look at these two different implementations. IMPL2 works somehow. The problem I am facing is that the glob <$pat> does not return any value in IMPL1 but it returns in IMPL2. Can somebody tell what

Strange problem with glob <>

2006-12-27 Thread Madhur Kashyap
Hi there, Have a look at these two different implementations. IMPL2 works somehow. The problem I am facing is that the glob <$pat> does not return any value in IMPL1 but it returns in IMPL2. Can somebody tell what could be the problem. I have also tried including the advanced glob module

Re: glob and "-f" mismatch under Windows

2006-12-23 Thread Jen Spinney
On 12/23/06, Ken Foskey <[EMAIL PROTECTED]> wrote: On Thu, 2006-12-21 at 16:45 +, Bryan K. Wright wrote: > Hi folks, > > I'm porting a script to Windows, and I've run into an > odd mismatch between the results returned by "glob" and the > -f op

Re: glob and "-f" mismatch under Windows

2006-12-22 Thread Ken Foskey
On Thu, 2006-12-21 at 16:45 +, Bryan K. Wright wrote: > Hi folks, > > I'm porting a script to Windows, and I've run into an > odd mismatch between the results returned by "glob" and the > -f operator. If I take a test script like the following: >

glob and "-f" mismatch under Windows

2006-12-21 Thread Bryan K. Wright
Hi folks, I'm porting a script to Windows, and I've run into an odd mismatch between the results returned by "glob" and the -f operator. If I take a test script like the following: my @files = glob ("*.exe"); for my $f (@files) { print "Pro

Re: confusing question about GLOB

2006-03-28 Thread John W. Krahn
Jeff Pang wrote: >>>[EMAIL PROTECTED] coremail]$ perl -le 'our %test = (type => "software"); >>>print ${$::{test}{HASH}}{type}' >>>[ no output ] >>You are trying to print $::{test}->{HASH}->{type} but $::{test} does not >>contain a hash reference. > > Thanks John.Then why can this work?

Re: confusing question about GLOB

2006-03-28 Thread Jeff Pang
>> [EMAIL PROTECTED] coremail]$ perl -le 'our %test = (type => "software"); >> print ${$::{test}{HASH}}{type}' >> [ no output ] > >You are trying to print $::{test}->{HASH}->{type} but $::{test} does not >contain a hash reference. > Thanks John.Then why can this work? $ perl -le 'our

Re: confusing question about GLOB

2006-03-28 Thread John W. Krahn
est}->{HASH}->{type} but $::{test} does not contain a hash reference. > The first command prove that " $::{test} == *main::test "; > The second command access the GLOB *main::test and get the value 'software' > in hash %test. > > My question is: > why

confusing question about GLOB

2006-03-27 Thread Jeff Pang
ASH}}{type}' software [EMAIL PROTECTED] coremail]$ perl -le 'our %test = (type => "software"); print ${$::{test}{HASH}}{type}' [ no output ] The first command prove that " $::{test} == *main::test "; The second command access the GLOB *main::test and

Re: Glob with spaces

2006-01-25 Thread Chas Owens
On 1/25/06, DiGregorio, Dave <[EMAIL PROTECTED]> wrote: > Is there a way to glob if the directory path has spaces? > > The following does not work > > $sourcePath = "C:/Documents and Settings/xyz/abc ; > > files = glob $sourcePath ; This seems to work: my @f

Glob with spaces

2006-01-25 Thread DiGregorio, Dave
Is there a way to glob if the directory path has spaces? The following does not work $sourcePath = "C:/Documents and Settings/xyz/abc ; files = glob $sourcePath ; Thanks David R. DiGregorio Vocollect 703 Rodi Road Pittsburgh, PA 15235 P. 412-349-2440 [EMAIL PROT

Re: Why glob() ?

2005-11-14 Thread Peter Scott
On Sun, 13 Nov 2005 22:47:05 -0500, Tom Allison wrote: > Gustav Wiberg wrote: >> Hi again! >> >> If I understood it right... >> >> @list = glob('*.txt'); >> >> would return all files that ends with *.txt in current directory? >> &g

Re: Why glob() ?

2005-11-14 Thread Gustav Wiberg
> Cc: Sent: Monday, November 14, 2005 7:36 AM Subject: Re: Why glob() ? Gustav> Hi there! Lo Gustav> ps. I don't have the manual or Perl installed on this computer... U should install so. Playing with perl without the docs is like playing football without the ball... Why don't

Re: Why glob() ?

2005-11-13 Thread Guillaume R.
> Gustav> Hi there! Lo >Gustav> ps. I don't have the manual or Perl installed on this >computer... U should install so. Playing with perl without the docs is like playing football without the ball... Why don't u install it? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e

Re: Why glob() ?

2005-11-13 Thread Tom Allison
Gustav Wiberg wrote: Hi again! If I understood it right... @list = glob('*.txt'); would return all files that ends with *.txt in current directory? Usually. If there are a lot of files in the directory, this will file. About the same time that the shell command 'rm' o

Re: Why glob() ?

2005-11-13 Thread Tom Allison
Randal L. Schwartz wrote: "Gustav" == Gustav Wiberg <[EMAIL PROTECTED]> writes: Gustav> Why to use glob()-command when I can use exec() ??? I don't get it... In modern Perl, glob() is internal, where exec/system/backquote/pipes are external, so it's very likel

RE: Why glob() ?

2005-11-12 Thread Charles K. Clarkson
Gustav Wiberg wrote: : ps. I don't have the manual or Perl installed on this computer... http://perldoc.perl.org/ HTH, Charles K. Clarkson -- Mobile Homes Specialist 254 968-8328 . . . With Liberty and Justice for all (heterosexuals). -- To unsubscribe, e-mail

Re: Why glob() ?

2005-11-12 Thread Gustav Wiberg
- Original Message - From: "Randal L. Schwartz" To: "Gustav Wiberg" <[EMAIL PROTECTED]> Cc: Sent: Sunday, November 13, 2005 12:10 AM Subject: Re: Why glob() ? "Gustav" == Gustav Wiberg <[EMAIL PROTECTED]> writes: Gustav> Hi there! G

Re: Why glob() ?

2005-11-12 Thread Randal L. Schwartz
> "Gustav" == Gustav Wiberg <[EMAIL PROTECTED]> writes: Gustav> Hi there! Gustav> Thanx! Gustav> That's all I needed to know! :-) Gustav> /G Gustav> ps. I don't have the manual or Perl installed on this computer... Then why are you asking about Perl? How do you expect to use it? Psychic po

Re: Why glob() ?

2005-11-12 Thread Gustav Wiberg
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" To: "Gustav Wiberg" <[EMAIL PROTECTED]> Cc: Sent: Saturday, November 12,

Re: Why glob() ?

2005-11-12 Thread Randy W. Sims
Gustav Wiberg wrote: This seems totally meaningless, but what would $list = glob('*.txt') return? Try it. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Why glob() ?

2005-11-12 Thread Randal L. Schwartz
>>>>> "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

Re: Why glob() ?

2005-11-12 Thread Gustav Wiberg
Hi again! Thanx! :-) I'm trying to ask as much as possible just to be on the clear with it... :-) This seems totally meaningless, but what would $list = glob('*.txt') return? /G http://www.varupiraten.se/ - Original Message - From: "Randal L. Schwartz" To

Re: Why glob() ?

2005-11-12 Thread Randal L. Schwartz
>>>>> "Gustav" == Gustav Wiberg <[EMAIL PROTECTED]> writes: Gustav> Hi again! Gustav> If I understood it right... Gustav> @list = glob('*.txt'); Gustav> would return all files that ends with *.txt in current directory? Yes. What part of &qu

Re: Why glob() ?

2005-11-12 Thread Gustav Wiberg
Hi again! If I understood it right... @list = glob('*.txt'); would return all files that ends with *.txt in current directory? /G http://www.varupiraten.se/ - Original Message - From: "Randal L. Schwartz" To: ; "Gustav Wiberg" <[EMAIL PROTECTED]&g

Re: Why glob() ?

2005-11-12 Thread Gustav Wiberg
Hi there! Thanx!!! :-) /G - Original Message - From: "Randal L. Schwartz" To: ; "Gustav Wiberg" <[EMAIL PROTECTED]> Sent: Saturday, November 12, 2005 11:10 PM Subject: Re: Why glob() ? "Gustav" == Gustav Wiberg <[EMAIL PROTECTED]> writes

Re: Why glob() ?

2005-11-12 Thread Randal L. Schwartz
>>>>> "Gustav" == Gustav Wiberg <[EMAIL PROTECTED]> writes: Gustav> Why to use glob()-command when I can use exec() ??? I don't get it... In modern Perl, glob() is internal, where exec/system/backquote/pipes are external, so it's very likely faster t

Why glob() ?

2005-11-12 Thread Gustav Wiberg
Hi there! Why to use glob()-command when I can use exec() ??? I don't get it... /G http://www.varupiraten.se/

Re: Glob and space in directory name

2003-11-28 Thread R. Joseph Newton
Rob Dixon wrote: > Joseph wrote: > > > > Just remember that the enclosing double-quotes are always a part > > of Windows long filenames. When the the sytem processes the > > string expression offered as an argument, it takes only the > > textual content, and strips the quuotes. Enclose the whole

Re: Glob and space in directory name

2003-11-28 Thread Rob Dixon
Joseph wrote: > > Just remember that the enclosing double-quotes are always a part > of Windows long filenames. When the the sytem processes the > string expression offered as an argument, it takes only the > textual content, and strips the quuotes. Enclose the whole > string, including double-qu

Re: Glob and space in directory name

2003-11-28 Thread R. Joseph Newton
"Wagner, David --- Senior Programmer Analyst --- WGO" wrote: > Boris Shor wrote: > > And when I rename the directory to "House 98" (space instead of > > underscore), the following does not: > > > > @filelist = glob("w:/stleg/Colorado/House 98/*

Re: Glob and space in directory name

2003-11-27 Thread Rob Dixon
David --- Senior Programmer Analyst --- Wgo Wagner wrote: > > > Note: I went into File::Glob and it gives the following: > > Since v5.6.0, Perl's CORE::glob() is implemented in terms of > bsd_glob(). [...] Due to historical reasons, CORE::glob() will also > split

Re: Glob and space in directory name

2003-11-26 Thread John W. Krahn
Boris Shor wrote: > > Why does the following work (eg, give me an array filled with matching file > names): > > @filelist = glob("w:/stleg/Colorado/House_98/*.htm"); > > And when I rename the directory to "House 98" (space instead of underscore), > t

Re: Glob and space in directory name

2003-11-26 Thread Steve Grazzini
David Wagner wrote: > Dan Muey wrote: >>>> @filelist = glob("w:/stleg/Colorado/House_98/*.htm"); >>>> >>>> And when I rename the directory to "House 98" (space instead of >>>> underscore), the following does not: &g

RE: Glob and space in directory name

2003-11-26 Thread Dan Muey
> Understood, but I know that the space within a > directory name must have the \ otherwise it won't work, but > if I try say ( for my testing purposes): > > $MyLoc = "d:/00Common\ Perl/"; > @filelist = glob($MyLoc . "pl0*.pl"); > >

RE: Glob and space in directory name

2003-11-26 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Dan Muey wrote: >>> @filelist = glob("w:/stleg/Colorado/House_98/*.htm"); >>> >>> And when I rename the directory to "House 98" (space instead of >>> underscore), the following does not: >>> > > > The reason is you escap

RE: Glob and space in directory name

2003-11-26 Thread Dan Muey
> > @filelist = glob("w:/stleg/Colorado/House_98/*.htm"); > > > > And when I rename the directory to "House 98" (space instead of > > underscore), the following does not: > > The reason is you escaped the space in $MyLoc but not in /House 98/

Re: Glob and space in directory name

2003-11-26 Thread Daniel Staal
--As off Wednesday, November 26, 2003 3:58 PM -0500, Boris Shor is alleged to have said: Why does the following work (eg, give me an array filled with matching file names): @filelist = glob("w:/stleg/Colorado/House_98/*.htm"); And when I rename the directory to "House 98&quo

RE: Glob and space in directory name

2003-11-26 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Boris Shor wrote: > Why does the following work (eg, give me an array filled with > matching file names): > > @filelist = glob("w:/stleg/Colorado/House_98/*.htm"); > > And when I rename the directory to "House 98" (space instead of > underscore), the fol

Glob and space in directory name

2003-11-26 Thread Boris Shor
Why does the following work (eg, give me an array filled with matching file names): @filelist = glob("w:/stleg/Colorado/House_98/*.htm"); And when I rename the directory to "House 98" (space instead of underscore), the following does not: @filelist = glob("w:/stle

Re: How do I glob with escaped spaces in a directory

2003-11-06 Thread david
Dan Anderson wrote: > When I use: > > my @foo = glob "/foo/bar baz/*"; > or > my @foo = glob "/foo/bar\ baz/*"; > > Glob doesn't return the files in those directories, @foo equals > ("/foo/bar"); > > However, if I do: > >

Re: How do I glob with escaped spaces in a directory

2003-11-06 Thread drieux
On Thursday, Nov 6, 2003, at 10:21 US/Pacific, Dan Anderson wrote: [..] How do I escape spaces? Perldoc glob doesn't say. [..] an interesting problem, one thing that may influence the problem is how your underlying shell does the 'expansion' - as the perldoc -f glob notes, with p

How do I glob with escaped spaces in a directory

2003-11-06 Thread Dan Anderson
When I use: my @foo = glob "/foo/bar baz/*"; or my @foo = glob "/foo/bar\ baz/*"; Glob doesn't return the files in those directories, @foo equals ("/foo/bar"); However, if I do: my @foo = glob "/foo/bar*baz/*"; @foo equals an array with all the

RE: Variable instaed of GLOB REF

2003-08-18 Thread Dan Muey
> > There are ways to fake a filehandle by tieing it to a module, > > but that is a bit cumbersome. Looking at the Mail::Internet > > docs it seems that you can pass it an array reference instead > > of a filehandle ref. > > > > > Oh yeah I see that now, that may be just the ticket. > I'll tr

RE: Variable instaed of GLOB REF

2003-08-18 Thread Dan Muey
> There are ways to fake a filehandle by tieing it to a module, > but that is a bit cumbersome. Looking at the Mail::Internet > docs it seems that you can pass it an array reference instead > of a filehandle ref. > Oh yeah I see that now, that may be just the ticket. I'll try it out and let

RE: Variable instaed of GLOB REF

2003-08-18 Thread Hanson, Rob
Message- From: Dan Muey [mailto:[EMAIL PROTECTED] Sent: Monday, August 18, 2003 2:58 PM To: Dan Muey; [EMAIL PROTECTED] Subject: RE: Variable instaed of GLOB REF > Howdy all! > > If you have a function that is expecting a FILEHANDLE as it's Sorry FILHANDLE Refence actually.

RE: Variable instaed of GLOB REF

2003-08-18 Thread Dan Muey
w and pass that FILEHANDLE off instead of STDIN or ??? I could pass it another filehandle ref, I just need to figure out how to assign $data to a filehandle and use that instead of STDIN right? If so how would one go about setting up a filehandle for a variable? Or wil the Glob reference

Variable instaed of GLOB REF

2003-08-18 Thread Dan Muey
Howdy all! If you have a function that is expecting a FILEHANDLE as it's argument how could you supply it a variable instead? For instance: my $mio = Mail::Internet(\*STDIN); ... Which is peachy. What I'd like to be able to do is use the data in the vari

XML::LibXSLT glob problem

2003-06-12 Thread ryan
Please help a desperate sole This is the error that I am receiving Can't coerce GLOB to string in entersub at /usr/local/lib/perl5/site_perl/5.6.1/i686-linux/XML/LibXSLT.pm line 88. XML::LibXSLT::parse_stylesheet('XML::LibXSLT=HASH(0x8cc31e0)', 'XML::LibXML::Docum

Re: Printing to a glob variable

2003-06-10 Thread royce . wells
[EMAIL PROTECTED] <[EMAIL PROTECTED]cc: tions.net> Subject: P

Re: Printing to a glob variable

2003-06-10 Thread John W. Krahn
James Edward Gray II wrote: > > I'm trying to print call print with a variable I'm sure holds a > typeglob with an open file handle. I know the variable is a hash > lookup, so I expected print to complain, however, I thought adding the > parenthesis was all that I had to do to clarify what I mean

Re: Printing to a glob variable

2003-06-10 Thread Jenda Krynicky
From: James Edward Gray II <[EMAIL PROTECTED]> > I'm trying to print call print with a variable I'm sure holds a > typeglob with an open file handle. I know the variable is a hash > lookup, so I expected print to complain, however, I thought adding the > parenthesis was all that I had to do to c

Printing to a glob variable

2003-06-10 Thread James Edward Gray II
I'm trying to print call print with a variable I'm sure holds a typeglob with an open file handle. I know the variable is a hash lookup, so I expected print to complain, however, I thought adding the parenthesis was all that I had to do to clarify what I meant. Doesn't look like it though, be

Re: confused with File::Glob

2003-02-09 Thread Rob Dixon
Harry Putnam wrote: > "John W. Krahn" <[EMAIL PROTECTED]> writes: >>> >>> use File::Glob ':glob'; >>^^^ >> Note that the only options available are ':case', ':nocase' and >> ':globa

Re: confused with File::Glob

2003-02-09 Thread Harry Putnam
"John W. Krahn" <[EMAIL PROTECTED]> writes: >> cat ./testglob.pl >> #!/usr/local/bin/perl -w >> >> use File::Glob ':glob'; >^^^ > Note that the only options available are ':case', ':nocase' a

Re: confused with File::Glob

2003-02-08 Thread John W. Krahn
ther point. > cat ./testglob.pl > #!/usr/local/bin/perl -w > > use File::Glob ':glob'; ^^^ Note that the only options available are ':case', ':nocase' and ':globally', John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: confused with File::Glob

2003-02-08 Thread Harry Putnam
Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> writes: > And || enforces scalar context, so func() won't (can't) return a list, in > your case. Thanks, I'd have been a very long time figuring that out... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: confused with File::Glob

2003-02-08 Thread Jeff 'japhy' Pinyan
On Feb 8, Harry Putnam said: > @files = bsd_glob("$glob_pattern",GLOB_ERR)|| die "Yikes: $!"; This line screws you up. Change the || to 'or'. @files = bsd_glob(...) or die "Yikes: $!"; The reason being: || binds very tightly, and 'or' binds less tightly. With ||, your code is like @file

confused with File::Glob

2003-02-08 Thread Harry Putnam
Apparently I'm not getting what it is that File::Glob is supposed to do: ls tmp/file_[0-9]*|wc -l 99 All 99 look like tmp/file_NUM with incrementing number. Why doesn't this code unwind the list of files? when this command is given: ./testglob.pl 'tmp/file_[0-9]*'

Re: glob subtlety question

2003-01-03 Thread David Eason
The following has the same output as John's way: my @Bobs_way = glob "@ARGV" unless ! @ARGV; print "Bob\'s way:\n"; for $arg (@Bobs_way) {print "- $arg\n";}; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

  1   2   >