LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-23-2004, 06:42 PM   #1
andox
Member
 
Registered: May 2003
Location: Mars
Distribution: Red Hat Linux 9
Posts: 100

Rep: Reputation: 15
perl files


HI everyone..
im just wondering if anyone out there knows how to create a file with perl.. I've looked thru different online tutorials.. and none of them say anything about createing a file.. well not with perl.. once actually said use the command "touch" and I tried running on my rhse and didn't work. IS there any other commands I can use to create a file?


on a semi programing topic.. is there web sites or forums on the web that have quick responses.. that's only based on perl?

does anyone know a good site or tutorials thing i can get online for perl? I've got all the basic stuff down. I jus need to learn more on ssl and mysql.

thank you.
 
Old 09-23-2004, 08:48 PM   #2
CroMagnon
Member
 
Registered: Sep 2004
Location: New Zealand
Distribution: Debian
Posts: 900

Rep: Reputation: 33
Re. creating files, have a look at 'man perlopentut' (or here http://www.perldoc.com/perl5.8.0/pod/perlopentut.html)
 
Old 09-24-2004, 04:42 PM   #3
andox
Member
 
Registered: May 2003
Location: Mars
Distribution: Red Hat Linux 9
Posts: 100

Original Poster
Rep: Reputation: 15
thanx
 
Old 09-27-2004, 11:51 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Well, here's the Perl CD bookshelf Online: could be useful
http://iis1.cps.unizar.es/Oreilly/perl/
 
Old 09-28-2004, 06:04 PM   #5
kbcnetau
Member
 
Registered: Dec 2003
Location: South Australia (ex-Devon, UK)
Distribution: SuSE, Slackware, Fedora, Debian, Knoppix
Posts: 141

Rep: Reputation: 15
1) Simple file open, write, close.

open (FOO, ">/home/me/afile");
print FOO "hello, world\n";
close FOO;

If you need to have several print lines to the file, you could redirect standard output to your file handle:
select FOO;
This saves you putting the FOO in every print statement. When you've closed your file, you should put your output back where it belongs:
select STDOUTl


2) I've set up tons of stuff based on Perl and MySQL. Yes, they're fast. The bottleneck tends to be the Internet. If you want to really hammer Perl on a busy server, you should probably have a look at mod_perl. This gets a Perl interpreter into the Apache HTTPD web server - significantly quicker than just calling a normal Perl CGI. I've never bothered with this myself as my client sites have fairly low traffic - the Internet is still the big bottleneck.


3) <http://www.perlmonks.org> The O'Reilly stuff is great - I use the Perl CD bookshelf all the time. I'm not sure that putting a copy on a public web site is necessarily legal - they may get a call from O'Reilly's IP lawyers. If you are thinking about purchasing anything, the CD version is heaps cheaper than buying the books in paper form.

4) Perl absolutely rocks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mv files with perl provkitir Programming 6 03-04-2005 01:02 AM
merging files using perl pantera Programming 1 06-03-2004 12:56 PM
Problem running perl files fuelinjection Linux - General 2 01-19-2004 11:15 PM
Converting perl files to executable mac files mrozkan Programming 0 04-16-2002 09:56 AM
perl files in apache Syncrm Linux - General 3 03-09-2002 03:23 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration