Re: Perl equivalent to unix script
- From: "J. Gleixner" <glex_no-spam@xxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 30 Oct 2006 12:11:50 -0600
Mike wrote:
Mike wrote:Ok. . . Well, I'm sure here comes another dumb question. I'm fairly
handy with unix and unix scripting, however, I'm terrible at perl.
What I'm looking to do with a perl script is the equivalent of the
following unix (bash) script:
cat tempfile1 | sort > newfile2; rm tempfile1
I'm not completely comfortable with file handling in perl, and I think
it should be easy to do, but I've been unsuccessful in trying to do it.
Post what you've tried.
I'm essentially trying to sort the lines in a file (alphabetically),
and then output them to another file.
I guess I should have said that I don't want to handle this with a
system call either, I'd prefer to figure out, and learn how to do it
with purely perl.
If you want to figure it out, give the documentation a try.
perldoc -f open
perldoc -f sort
perldoc -f unlink
perldoc opentut
Helpful Web sites:
http://perldoc.perl.org/
http://bookmarks.cpan.org/search.cgi?cat=Training%2FTutorials
.
- Prev by Date: Re: Naive threading performance questions
- Next by Date: Re: How do I do full access logging including HTTP headers?
- Previous by thread: How to get a full trace of a prog's execution?
- Next by thread: Re: Perl equivalent to unix script
- Index(es):
Relevant Pages
|
|