Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8371727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:14:00+00:00 2026-06-09T14:14:00+00:00

I am using perl to address some text files. I want to use perl

  • 0

I am using perl to address some text files. I want to use perl filename wild card to find all the useful files in a folder and address them one by one, but my there are spaces in the filename. Then I find the filename wildcard cannot address those filenames properly. Here is my code:

my $term = "Epley maneuver";
my @files = <rawdata/*$term*.csv>;
my $infiles;
foreach $infilename (@files) {
    if($infilename =~ m/(\d+)_.*\.csv/)
    {
        $infiles{$infilename} = $1;
        print $1."\n";
    }
}

The filename are like:

34_Epley maneuver_2012_4_6.csv
33_Epley maneuver_2012_1_3.csv
32_Epley maneuver_2011_10_12.csv
...

They are in a folder named “rawdata”.

When I used this for terms that don’t contain spaces, like “dizzy”, it works well. But when the term contains space, it just stop working. I searched this on Google, but find little useful information.

What happens and how can I do this correctly?
Any help will be good. Thanks a lot.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T14:14:01+00:00Added an answer on June 9, 2026 at 2:14 pm

    The glob operator works like the command-line processor. If you write <rawdata/*Epley maneuver*.csv> it will look for files that match rawdata/*Epley or maneuver*.csv

    You must put your glob expression in double-quotes:

    my @files = <"rawdata/*$term*.csv">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Perl's format and write functions to output some text. The requirements are
I've been using perl, MongoDB, and GridFS for some pet development, and wonder -
I am using Perl to do text processing with regex. I have no control
How to extract emails address from a string using perl and to put the
Using Perl's XML::LibXSLT necessitates that I use XSLT 1.0, which means that I am
I am using Perl to print some data read from one file to another.
I want to retrieve the email address from the table and using that to
I need to find email address and name(of admin, registrar, tech if available) using
I am using perl v14 on windows. I have 2 simple files: $SIG{'INT'} =
I am using the Net::FTP in perl to do some file transfers. when I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.