Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re^2: Using wildcards to open files.

by starface245 (Novice)
on Oct 25, 2012 at 15:52 UTC ( #1000893=note: print w/replies, xml ) Need Help??

in reply to Re: Using wildcards to open files.
in thread Using wildcards to open files.

Yes it does have spaces in the name.

Replies are listed 'Best First'.
Re^3: Using wildcards to open files.
by frozenwithjoy (Priest) on Oct 25, 2012 at 21:10 UTC
    That's causing your problem. You are only using the chunk before the first space for each file.

    I haven't had a chance to test this in your exact usage situation, but try the following. It replaces spaces in the file names with escaped spaces.

    #!/usr/bin/perl @files = glob("*.msg"); foreach $file(@files) { $file =~ s/ /\\\ /g; $cmd = "perl < $file"; system($cmd); }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1000893]
and the monastery is silent...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2017-01-23 14:53 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (192 votes). Check out past polls.