is there any possibilty to design the open function in perl according to my convinience

I'm going to come right out and say what others have been trying to imply: You don't want to do that. Yes, it's possible, but it's not what you want to do. There are rare circumstances under which someone might want to do that, but it would be someone who knows Perl pretty well, and they wouldn't have to ask *how* to do it. If you have to ask how, it demonstrates that you do not know Perl well enough to understand all the implications of doing this, which implies that you do not want to do it, because the implications will catch you by surprise and cause you no end of trouble.

The other thing that tells me you do not, in fact, want to do this is your use of the phrase "according to my convenience". Redefining builtin functions isn't a source of convenience; in fact, it's downright *inconvenient* (not because it's hard to do, but the other way around: it was made (a little bit) hard to do precisely because of the inconvenience it causes).

Furthermore, your comments in this thread seem to indicate that you don't understand package namespaces, which is an important thing to understand before messing with the built-in portion of your main namespace.

I'm not kidding, you really don't want to do this. This thread almost certainly has an XY Problem. I We don't know what you're trying to accomplish, but there's almost certainly a Much Better Way, and if you post a question about how best to do what you're really trying to do, it's very likely that someone will show you a way to do it that does not involve re-defining builtin functions. (Probably there's a module on the CPAN that does exactly what you're trying to accomplish anyhow...) That way will ultimately be much more convenient.


Sanity? Oh, yeah, I've got all kinds of sanity. In fact, I've developed whole new kinds of sanity. Why, I've got so much sanity it's driving me crazy.

In reply to Re: design the open function by jonadab
in thread design the open function by singam

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.