Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Is this sort of possible

by AidanLee (Chaplain)
on Dec 31, 2001 at 18:57 UTC ( [id://135370]=note: print w/replies, xml ) Need Help??


in reply to Is this sort of possible

While grep's and Ovid's examples are great, I thought you might like something a bit more self-documenting:
my @Data = (); while my $line (<FILE>) { push @Data, {}; @{$Data[-1]}{ 'ID', 'Title', 'Date' } = split( /\|/, $line ); } @Data = sort { $a->{'Title'} cmp $b->{'Title'} } @Data; foreach my $line ( @Data ) { print join( ' | ', @$line{ 'ID', 'Title', 'Date' } ), "\n"; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-04-16 08:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found