Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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\";}"
or
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2014-07-24 09:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (158 votes), past polls