Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Sorting files you Have read

by GrandFather (Sage)
on Nov 16, 2006 at 23:16 UTC ( #584631=note: print w/ replies, xml ) Need Help??


in reply to Re: Sorting files you Have read
in thread Sorting files you Have read

If you are going to use strict; use warnings; (and it is a really really good idea), then you really really need to declare your variables: ;)

use strict; # a good idea use warnings; # and another my $input = 'myinput.txt'; open(my $in, "<", $input) or die "Could not open $input because $!\n"; my @unsorted = <$in>; chomp (@unsorted); # get rid of end-of-record markers close ($in); my @sorted = sort @unsorted;

DWIM is Perl's answer to Gödel


Comment on Re^2: Sorting files you Have read
Select or Download Code
Re^3: Sorting files you Have read
by brusimm (Pilgrim) on Nov 16, 2006 at 23:34 UTC
    Thank you, everyone
    This points me in the right direction
    I used to do IDL and Fortran (About 7 years ago..)
    but this seems harder. Sheesh.. is it me being out of the programming loop so long, or is see-nellity setting in?
    Maybe you shouldn't answer that!!
    Take care.

      You're OK. Perl is just different from what most people are used to. e.g. my CS modules at university (about 3 years ago) mostly used Java, and I have mostly hobby experience of C/C++, but I'd probably feel like you do now if I suddenly tried to do enterprise Java, use C++ templates, use C# or even use Perl in any meaningful way (my main work language is Delphi, although I do support some Perl projects I didn't develop).

      How can you feel when you're made of steel? I am made of steel. I am the Robot Tourist.
      Robot Tourist, by Ten Benson

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://584631]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2015-07-04 14:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls