Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: What one-liners do people actually use?

by SamCG (Hermit)
on Dec 13, 2005 at 15:01 UTC ( [id://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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2024-03-29 15:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found