Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re^3: Using wildcards to open files.

by frozenwithjoy (Curate)
on Oct 25, 2012 at 21:10 UTC ( #1000942=note: print w/ replies, xml ) Need Help??

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

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); }

Comment on Re^3: Using wildcards to open files.
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1000942]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (14)
As of 2015-11-25 13:01 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (675 votes), past polls