FAQ 5.35 Why doesn't glob("*.*") get all the files?


This is an excerpt from the latest version perlfaq5.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest ...
Posted On: Tuesday 27th of November 2012 11:52:05 PM Total Views:  539
View Complete with Replies

RELATED TOPICS OF Perl PROGRAMMING LANGUAGE




FAQ 5.35 Why can't I use "C:\temp\foo" in DOS paths? Why doesn't `C:\temp\foo.exe` work?

This is an excerpt from the latest version perlfaq5.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 5.35: Why can't I use "C:\temp\foo" in DOS paths Why doesn't `C:\temp\foo.exe` work Whoops! You just put a tab and a formfeed into that filename! Remember that within double quoted strings ("like\this"), the backslash is an escape character. The full list of these is in "Quote and Quote-like Operators" in perlop. Unsurprisingly, you don't have a file called "ctab)emp(formfeed)oo" or "ctab)emp(formfeed)oo.exe" on your legacy DOS filesystem. Either single-quote your strings, or (preferably) use forward slashes. Since all DOS and Windows versions since something like MS-DOS 2.0 or so have treated "/" and "\" the same in a path, you might as well use the one that doesn't clash with Perl--or the POSIX shell, ANSI C and C++, awk, Tcl, Java, or Python, just to mention a few. POSIX paths are more portable, too. -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod.
VIEWS ON THIS POST

134

Posted on:

Tuesday 16th October 2012
View Replies!

FAQ 5.35 Why can't I use "C:\temp\foo" in DOS paths? Why doesn't `C:\temp\foo.exe` work?

This is an excerpt from the latest version perlfaq5.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 5.35: Why can't I use "C:\temp\foo" in DOS paths Why doesn't `C:\temp\foo.exe` work Whoops! You just put a tab and a formfeed into that filename! Remember that within double quoted strings ("like\this"), the backslash is an escape character. The full list of these is in "Quote and Quote-like Operators" in perlop. Unsurprisingly, you don't have a file called "ctab)emp(formfeed)oo" or "ctab)emp(formfeed)oo.exe" on your legacy DOS filesystem. Either single-quote your strings, or (preferably) use forward slashes. Since all DOS and Windows versions since something like MS-DOS 2.0 or so have treated "/" and "\" the same in a path, you might as well use the one that doesn't clash with Perl--or the POSIX shell, ANSI C and C++, awk, Tcl, Java, or Python, just to mention a few. POSIX paths are more portable, too. -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod.
VIEWS ON THIS POST

136

Posted on:

Saturday 20th October 2012
View Replies!

FAQ 5.35 Why doesn't glob("*.*") get all the files?

This is an excerpt from the latest version perlfaq5.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 5.35: Why doesn't glob("*.*") get all the files Because even on non-Unix ports, Perl's glob function follows standard Unix globbing semantics. You'll need "glob("*")" to get all (non-hidden) files. This makes glob() portable even to legacy systems. Your port may include proprietary globbing functions as well. Check its documentation for details. -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod. -- Posted via a free Usenet account from http://www.teranews.com
VIEWS ON THIS POST

128

Posted on:

Monday 22nd October 2012
View Replies!

FAQ 5.35 Why doesn't glob("*.*") get all the files?

This is an excerpt from the latest version perlfaq5.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 5.35: Why doesn't glob("*.*") get all the files Because even on non-Unix ports, Perl's glob function follows standard Unix globbing semantics. You'll need "glob("*")" to get all (non-hidden) files. This makes glob() portable even to legacy systems. Your port may include proprietary globbing functions as well. Check its documentation for details. -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod. -- Posted via a free Usenet account from http://www.teranews.com
VIEWS ON THIS POST

129

Posted on:

Friday 26th October 2012
View Replies!

sprintf doesnt work in s///e syntax.

perl -le ' ### this part works $var=sprintf "%d", 0x11; print $var; ### and we get 17 output $_ = "{0x11}"; #s/(0x\d+)/hex($1)/e; #### this part works ok and we see a {17} output s/(0x\d+)/sprintf("%d",$1)/e; #### this part does NOT ...
VIEWS ON THIS POST

262

Posted on:

Thursday 15th November 2012
View Replies!

Re: bind double click to resize text widget(s)

--- listmail@triad.rr.com wrote: > $topw->bind('', \&resize(0)); > $botw->bind('', \&resize(1)); $topw->bind('', [\&resize, 0]); $botw->bind('', [\&resize, 1]); Check out 'perldoc Tk::callbacks' for more info. --Ala __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com -++**==--++**==--++**==--++**==--++**==--++**==--++**== This message was posted through the ...
VIEWS ON THIS POST

208

Posted on:

Monday 26th November 2012
View Replies!

bug in getOpenFile / getCloseFile in Windows XP?

i'm developing an application under windows using perl 5.8.7 build 813 from ActiveState. i'm calling the filedialog: my @types = ( ["PNG Files", ".png"], ); my $file = $main->getOpenFile(-title => "Open image", -defaultextension=>"png", -filetypes=>\@types); now everything works fine, i ...
VIEWS ON THIS POST

106

Posted on:

Monday 26th November 2012
View Replies!

Keep getting error message! What does it mean?

I am just getting started in PerlTk. I keep getting the error message: Can't call method "pack" on an undefined value at (file name)line ... What is this trying to tell me Code follows: my $wCountry = $CountryFrame->Listbox( )->pack(qw/-padx 5 ...
VIEWS ON THIS POST

132

Posted on:

Monday 26th November 2012
View Replies!

Is it possible to hide a widget which was packed ?

In article <429b5e5e$1@news.bezeqint.net>, dv@mailtag.com says... > Hi , > > I have a widget which is being built on any case, but is packed (displayed) > only if a certain button is pressed at run-time. > This works great. > ...
VIEWS ON THIS POST

156

Posted on:

Monday 26th November 2012
View Replies!

Re: Composite Widget Problem

--- Slaven Rezic wrote: > Add > > $w->ConfigSpecs(-background => ["SELF"]); > > to the Populate method. Heh. I had tried: $w->ConfigSpecs(-bg => ["SELF"]); but that didn't work because -bg is an alias. I also tried: $w->ConfigSpecs(DEFAULT => ["SELF"]); ...
VIEWS ON THIS POST

121

Posted on:

Monday 26th November 2012
View Replies!

LINUX: getOpenFile filetypes

Further to my previous post "limiting getOpenFile filetypes" is there anyone running LINUX who can try this script and see if they get a list of ".ps*" and ".eps*", or only ".ps" and ".eps" as the windows seem to ...
VIEWS ON THIS POST

154

Posted on:

Monday 26th November 2012
View Replies!

Newbie :cget + getting button text on an undetermined number of buttons.

I have to create an undetermined number of buttons on the fly. When the button is invoked I need to know what the text for that button is. I've looked at 'cget' and am getting a 'Can't call method "cget" ...
VIEWS ON THIS POST

218

Posted on:

Monday 26th November 2012
View Replies!

Re: Problem with getSaveFile / getOpenFile

This is a MIME encapsulated multipart message - please use a MIME-compliant e-mail program to open it. Dies ist eine mehrteilige Nachricht im MIME-Format - bitte verwenden Sie zum Lesen ein MIME-konformes Mailprogramm. --========GMXBoundary229831109750952 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit > ...
VIEWS ON THIS POST

128

Posted on:

Monday 26th November 2012
View Replies!

focusNext and get method

Is there any workaround to use the 'get' method and 'focusNext' at the same script. In the following simple I need to mark the 'focusNext' to make it work properly. But I need the text to be focused and ...
VIEWS ON THIS POST

102

Posted on:

Monday 26th November 2012
View Replies!

Right to left writing in text widget

Hi Everybody, I have a request concerning to typing text right to left in a text widget. I have no idea how to solve this problem. Is there anybody hwo has an answer With the Best: Zsolt -++**==--++**==--++**==--++**==--++**==--++**==--++**== This message ...
VIEWS ON THIS POST

142

Posted on:

Monday 26th November 2012
View Replies!

Are list mssages getting propagatd to comp.lang.perl.tk?

For the past few days, I've noticed that messages don't seem to be sent on to the newsgroup. Is this new Rob...
VIEWS ON THIS POST

151

Posted on:

Monday 26th November 2012
View Replies!

dialogBox without widget reference

Is it possible to call a dialog box without a widget reference I want to have a standard input box function that I can call from any function without that function having to have a widget passed in and without ...
VIEWS ON THIS POST

291

Posted on:

Monday 26th November 2012
View Replies!

Socket, cannot get clean results.

, I am working on an interactive server/client setup, not using INET::Sockets. Everything is gravy except for a little leftover stuff being shown. I type a command w/ args, CLIENT join()s the command with args and sends the newstring,the SERVER ...
VIEWS ON THIS POST

175

Posted on:

Monday 26th November 2012
View Replies!

get the return status

hi in unix, i have a program called program_a and i use the system call to invoke it system("program_a"); How do i get the return status of program_a if program_a returns a few status codes...
VIEWS ON THIS POST

204

Posted on:

Monday 26th November 2012
View Replies!

FAQ 5.21 I still don't get locking. I just want to increment the number in the file. How can I do this?

This is an excerpt from the latest version perlfaq5.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest ...
VIEWS ON THIS POST

599

Posted on:

Tuesday 27th November 2012
View Replies!