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

Re^2: Append to file or create file depending on input filename.

by pKai (Priest)
on Nov 20, 2009 at 13:48 UTC ( #808435=note: print w/replies, xml ) Need Help??


in reply to Re: Append to file or create file depending on input filename.
in thread Append to file or create file depending on input filename.

I was wondering the same.

To (ab)use 2-arg open in the way the OP describes, he has to do some trickery like:

C:\>perl script.pl ">outfile" C:\>rem Or C:\>perl script.pl ^>outfile

which will effectively hide the output redirect from the cmd and result in an $ARGV[0] containing >outfile.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://808435]
help
Chatterbox?
[marto]: good morning all
[prospect]: Good morning ! More Perl learning today, Man that subroutines chapter is tough.
[marto]: tutorials-> Subroutines may be of interest

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2017-07-24 07:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (348 votes). Check out past polls.