Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: How to Pass more than one file in perl MY function

by prad001 (Initiate)
on Sep 29, 2022 at 19:33 UTC ( [id://11147155]=note: print w/replies, xml ) Need Help??


in reply to Re: How to Pass more than one file in perl MY function
in thread How to Pass more than one file in perl MY function

What if the file names are different.. something like /data/j*.1.txt /data/j*.txt /data/q*.1.txt etc..!! Please let me know.. Thank you in advance..
  • Comment on Re^2: How to Pass more than one file in perl MY function

Replies are listed 'Best First'.
Re^3: How to Pass more than one file in perl MY function
by hippo (Bishop) on Sep 29, 2022 at 21:31 UTC

    Well then you would pass them as separate args:

    $ ./gt.pl 'j*.1.txt' 'j*.txt' 'q*.1.txt'

    Obviously the first argument here is redundant as it is a subset of the second.


    🦛

      Is there any way I can pass the all the files in the program and NOT on the command line??? Firstly the list is of the files is huge and I am reading those files to extract the data from those files in the same program..
        Is there any way I can pass the all the files in the program and NOT on the command line

        The arguments in my previous post are not files - they are globbing patterns. It is important that you understand the difference. j*.txt could match thousands of files and you would still only need the one command line argument.

        OTOH, if you need a huge list of patterns the first question is "Why?". Perhaps they can be amalgamated. If not you can simply refer to this huge list of patterns by loading them from a local datafile or from a URL or from a database or from somewhere else.


        🦛

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2024-04-26 03:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found