Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Using wildcards to open files.

by muba (Priest)
on Oct 25, 2012 at 15:50 UTC ( #1000892=note: print w/replies, xml ) Need Help??


in reply to Using wildcards to open files.

Do any of those .msg files have spaces in their names?

Replies are listed 'Best First'.
Re^2: Using wildcards to open files.
by starface245 (Novice) on Oct 25, 2012 at 15:52 UTC
    Yes it does have spaces in the name.
      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 script.pl < $file"; system($cmd); }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1000892]
help
Chatterbox?
[tye]: though, really, I just replace with single calls to clock_gettime( CLOCK_PROCESS_CPUT IME_ID)

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2017-02-23 03:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (338 votes). Check out past polls.