New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug in <*>? (linux) #1263
Comments
From vanbalen@mc.eduThere appears to be a bug in filesys I/O (under Linux) which breaks up My perl config (both Linux and HP-UX) is attached, along with the Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration: Characteristics of this binary (from libperl): Malfunc-ing program: The behaviour I'm talking about can be obtained by running: prompt$ echo fred > "foo bar baz" which should result in the message "Error renaming baz: No such file or #! /usr/bin/perl sub chmp_whitespace { ($#ARGV>-1) or die "You must provide cmd line args!"; $regexp = shift @ARGV; #if -s switch is present, strip $fns of whitespace foreach $fn (<*>) { #proceed to replace regexps Perl config under HP-UX: Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration: Characteristics of this binary (from libperl): |
From vanbalen@mc.eduSummary of my perl5 (5.0 patchlevel 5 subversion 3) configuration: Characteristics of this binary (from libperl): |
From vanbalen@mc.eduSummary of my perl5 (5.0 patchlevel 5 subversion 3) configuration: Characteristics of this binary (from libperl): |
From [Unknown Contact. See original ticket]
That's right. Here's the story. If you just use the standard built-in glob, then for compatibility #!/bin/sh -x That prints just "/tmp/fred", which isn't there. But that's The work around is simple. Just use File::Glob ":glob" in that #!/bin/sh -x Now it reports having globbed "/tmp/fred stuff", as you Note that when you pull in :glob, or :globally for the Here are other examples: use File::Glob ':glob'; use File::Glob 'csh_glob'; ## override the core glob ## override the core glob, forcing case sensitivity ## override the core glob forcing case *in*sensitivity And here's the full thing, the default globbage in 5.6. --tom NAME SYNOPSIS ## override the core glob (even with -T) ## override the core glob, forcing case sensitivity ## override the core glob forcing case insensitivity DESCRIPTION `GLOB_ERR' `GLOB_MARK' `GLOB_NOCASE' `GLOB_NOCHECK' `GLOB_NOSORT' The FreeBSD extensions to the POSIX standard are the following `GLOB_BRACE' `GLOB_NOMAGIC' `GLOB_QUOTE' `GLOB_TILDE' `GLOB_CSH' The POSIX provided `GLOB_APPEND', `GLOB_DOOFFS', and the DIAGNOSTICS `GLOB_NOSPACE' `GLOB_ABEND' In the case where glob() has found some matching paths, but is Note that glob() deviates from POSIX and FreeBSD glob(3) Be aware that all filenames returned from File::Glob are NOTES * On DOSISH systems, backslash is a valid directory separator * Win32 users should use the real slash. If you really want to AUTHOR Copyright (c) 1989, 1993 The Regents of the University of California. Redistribution and use in source and binary forms, with or without 1. Redistributions of source code must retain the above copyright THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
From [Unknown Contact. See original ticket]Tom Christiansen <tchrist@chthon.perl.com> wrote
That's true about splitting on spaces *within the glob argument*. foreach $fn (<*>) { doesn't have have spaces in the glob argument, just in the filename. Also I don't see the effect David reports. Trying touch "foo bar baz" then in the Perl debugger I see DB<1> x <foo*> A list of length one, not three. This is with any Perl version up to 5.005_03. So it seems that HP-UX, Solaris 2.6 and SunOS4 do the right thing here, Something to do with the Linux shell? Mike Guy |
From [Unknown Contact. See original ticket]
Oh, ok.
Neither do I.
No, I can't reproduce it under "Linux" (whatever that means, since its
There is no Linux shell. :-( But here is perl5.005_03 on RedHate 6.0: DB<1> open(FH, ">foo bar blarch") or die; or directly: redhat% perl -e '@got = <foo*>; print "got ", scalar @got' Or more tellingly... redhat# strace -s 60 -f perl -e '@got = <foo*>; print "got ", scalar @got' fork() = 29368 That gives me an idea! redhat% touch "foo ' stuff ' can be a problem" redhat% perl5.003 -le '@got = <foo*>; print "got ", scalar @got' Wicked! you *can* screw it up. Well, with that release. But not redhat% perl5.5.670 -le '@got = <foo*>; print "got ", scalar @got' Interestingly, I cannot using the same Linux-freaking sequence (or openbsd% ktrace -i perl5.00404 -le '@got = <foo*>; print "got ", scalar @got' openbsd% kdump | grep foo I leave you to draw your own conclusions on these various matters. --tom |
From [Unknown Contact. See original ticket]On Sat, 4 Mar 2000, M.J.T. Guy wrote:
I'm running bash under Linux Mandrake 7.0-2 if that helps an (also I'll be outa town for a few days and check back on this Thursday.
David van Balen mailto: vanbalen@mc.edu |
From The RT System itselfThis issue has been resolved in perl5.6 with the new internal glob stuff. |
Migrated from rt.perl.org#2259 (status was 'resolved')
Searchable as RT2259$
The text was updated successfully, but these errors were encountered: