Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Writing unix-style filters

by njcodewarrior (Pilgrim)
on Apr 11, 2007 at 23:38 UTC ( [id://609526]=note: print w/replies, xml ) Need Help??


in reply to Re: Writing unix-style filters
in thread Writing unix-style filters

If you don't wanna read from the files on the command line, why are you using <>?

Because I'd like to be able to pipe a list of files (from ls, echo, etc) into the script as well as list them on the command line:

ls *.txt | my_script.pl

or

my_script.pl file1.txt file2.txt

or

my_script.pl *.txt

The only way I can figure to do all of the above is using <>.

I'm learning the ins and outs of the *nix OS at the same time I'm learning perl...am I missing something here?

njcodewarrior

Replies are listed 'Best First'.
Re^3: Writing unix-style filters
by ikegami (Patriarch) on Apr 12, 2007 at 01:26 UTC

    Because I'd like to be able to pipe a list of files (from ls, echo, etc) into the script as well as list them on the command line:

    You could easily substitute <STDIN> for <> in your original post since you're using <> exclusively to read from <STDIN>.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-03-28 15:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found