Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Aliasing a builtin?

by graff (Chancellor)
on Mar 11, 2003 at 04:58 UTC ( [id://241947]=note: print w/replies, xml ) Need Help??


in reply to Aliasing a builtin?

Is this sort of a hang-over from using an interactive shell, like you're looking for a way to save a few keystrokes when typing in a perl program, so you'd like some mechanism in perl similar to the common shell alias idiom?

In general, this is not worhwhile, unless obfuscation is one of your goals. Most perl programmers rely on having the builtins look the way they are described in perlfunc, and having them look different may cost more time for others to decipher code than what you saved by using fewer keystrokes.

The best savings are from factoring the coding task so that as little as possible needs to be typed (or pasted) multiple times, rather than simply shortening some strings that you think you need to type often.

BTW, a number of decent code editors provide something like aliases (emacs calls it "abbrev-mode"), where you can define a sequence of a few characters to act like a macro to insert a longer string.

Replies are listed 'Best First'.
Re: Re: Aliasing a builtin?
by xiper (Friar) on Mar 11, 2003 at 21:33 UTC
          In general, this is not worhwhile, unless obfuscation is one of your goals.

    Bingo.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-03-28 22:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found