Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: What one-liners do people actually use?

by SamCG (Hermit)
on Dec 13, 2005 at 15:01 UTC ( #516321=note: print w/ replies, xml ) Need Help??

in reply to What one-liners do people actually use?

Note: on Windows. . . I don't use dbm's extensively, but it does come up. . .

perl -e "use SDBM_File;use Fcntl;tie %h, 'SDBM_File', 'H:\dbm\mydbmfil +e', O_RDWR, 0600;for (sort keys %h){print \"$_=$h{$_}\n\";}"
H:\>perl -e "use SDBM_File;use Fcntl;tie %h, 'SDBM_File', 'H:\dbm\mydb +mfile', O_RDWR, 0600;map {print \"$_=$h{$_}\n\";} sort keys %h;"
I may eventually put one of these into a script, I guess, but it's kind of short. I use a similar sort of technique for some other small manipulations (such as when I want to change the value of one key or something).

They're also the first one liners I've really used besides ultra-simple ones like perl -v.

Comment on Re: What one-liners do people actually use?
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2016-02-11 11:22 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (368 votes), past polls