Re: output not in current directory

2006-09-10 Thread chen li

 What is the code for this from the
> window
> > > promt(not within the script itself)?
> > >
> > > c:\>perl test.pl >1(this will save the result in
> the
> > > current directory.
> > > How about saving the result to c:/perl/self/?)
> > >
> > > Thanks,
> > >
> > > Li
> >
> > Hi Li,
> >
> > Google might help here:
> >
> >
>
http://www.google.com/search?q=output+redirection+dos
> >
> > Does this:
> > c:\>perl test.pl > C:\perl\self\test.out
> > do what you want?
> >
> > - Jen
> >

 c:\>perl test.pl > C:\perl\self\test.out

Yes it is what I want.

Thanks,

Li


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: output not in current directory

2006-09-10 Thread Jen Spinney

On 9/10/06, Jen Spinney <[EMAIL PROTECTED]> wrote:

On 9/10/06, chen li <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> When I run scripts  I want the result saved to a
> different directory instead of the current one on
> window xp. What is the code for this from the window
> promt(not within the script itself)?
>
> c:\>perl test.pl >1(this will save the result in the
> current directory.
> How about saving the result to c:/perl/self/?)
>
> Thanks,
>
> Li

Hi Li,

Google might help here:

http://www.google.com/search?q=output+redirection+dos

Does this:
c:\>perl test.pl > C:\perl\self\test.out
do what you want?

- Jen




Ah, it seems Rob beat me to it. :)

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: output not in current directory

2006-09-10 Thread Jen Spinney

On 9/10/06, chen li <[EMAIL PROTECTED]> wrote:

Hi all,

When I run scripts  I want the result saved to a
different directory instead of the current one on
window xp. What is the code for this from the window
promt(not within the script itself)?

c:\>perl test.pl >1(this will save the result in the
current directory.
How about saving the result to c:/perl/self/?)

Thanks,

Li


Hi Li,

Google might help here:

http://www.google.com/search?q=output+redirection+dos

Does this:
c:\>perl test.pl > C:\perl\self\test.out
do what you want?

- Jen

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: output not in current directory

2006-09-10 Thread Rob Dixon

chen li wrote:


Hi all,

When I run scripts  I want the result saved to a
different directory instead of the current one on
window xp. What is the code for this from the window
promt(not within the script itself)?

c:\>perl test.pl >1(this will save the result in the
current directory.
How about saving the result to c:/perl/self/?)


Your example saves the output in a file called '1'; presumably you knew that.
But Windows would be a lot happier with it being called '1.txt' so that it knew
what sort of contents it had and could default to using notepad (or something)
to open it. Even better, so that /you/ knew what the contents were you could
call it 'test-out.txt'. But on to your question...

You can specify a path on the command line as well as an output file name, like
this:

C:\>perl test.pl > C:\perl\self\test-out.txt

(Note that you need to use backslashes in the path on the command-line as the
command prompt shell isn't as forgiving as Perl!)

or you can reopen STDOUT within the program so that you don't have to redirect
it on the command line:

open STDOUT, '>', 'C:\perl\self\test-out.txt' or die $!;

(Either forward or backward slashes will do here.)

HTH,

Rob


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




output not in current directory

2006-09-10 Thread chen li
Hi all,

When I run scripts  I want the result saved to a
different directory instead of the current one on
window xp. What is the code for this from the window
promt(not within the script itself)?

c:\>perl test.pl >1(this will save the result in the
current directory.
How about saving the result to c:/perl/self/?)

Thanks,

Li


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]