Append a string to a file in Perl in one-line fashion

Want to append a string to a file in Perl one-line fashion. DOS Shell, we can do
echo This is a test >> test.txt
In Perl, can it be achived? I know that open a file with option ">>..." in Perl. Appending can be done. How about commad-line fashion?  
jl66Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jl66Author Commented:
The command-line fshion means that
perl -p -e ..........
0
Adam314Commented:
perl -e 'print "The new line\n"' >> file.txt
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jl66Author Commented:
Thanks for the info. I tried it and found the following:
E:\oracle\perl\5.8.3\bin\MSWin32-x86-multi-thread>perl -e 'print "The new line\n" ' >> file.txt
Can't find string terminator "'" anywhere before EOF at -e line 1.

E:\ora10g\perl\5.8.3\bin\MSWin32-x86-multi-thread>perl -version
This is perl, v5.8.3 built for MSWin32-x86-multi-thread
Copyright 1987-2003, Larry Wall
....
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

jl66Author Commented:
ora10g = oracle.
0
ozoCommented:
perl -le "print 'The new line' " >> file.txt
0
TalmashCommented:
why not trying simple way:

echo "new line" >> file
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.