Hi all, wise monks lurking in the monastery,

I have spent some time here with a proficous enhancement of my Perl skill.

My first quest-script was, two years ago, a recursion through a directory tree that was so difficult to imagine for me in these days (thanks to tachyon).

If you visit my homenode you 'll know why I want to learn Perl: Perl is BEAUTIFULL, clever and fast and make easy simple jobs and possible difficult ones.

I have a lucky long term job like NTsysAdm and I have always hope that my Perl scripting skill will avoid me to learn VB (VB that provoke me gastric pain but was the language of my 'boss').

In these 2 years,(many many thanks to Ovid for his fondamental course about CGI, to dada for his exceptional talent in Win32 problems,to BrowserUk for the inestimable fast and continous support in OLE hack and all, thanks to all monks that spend time to help other monks!),in these 2 years I have developped a suit of Perl scripts to manage automagically all my job concerning IIS hosting administration (2991 sites on 12 machines), including CGI web interface to modify on the fly remote IIS properties, ODBC connections, registry values, NTFS permissions involving remote-local users, synchronization of the identities, checking the disk's space with pie graphs, a SQLite query tool to investigate the domain...

Then my 'boss' is gently shifted to .NET and C# and To save my work-space I have tryed to give him a SOAP interface to connect to my services and here have started the disaster.. I was asking many times how to make SOAP::Lite webservice accessible by a C# client (see 297255) because it seems to my not-so-expert mind that the WSDL generator is not so efficient and C# client need a wsdl file to access the service. I am not able like Rhandom to modify the tools to generate a correct wsdl file (see 391566).

So tomorrow I'll start my first lesson of C# with my 'boss' and I'm not afraid to learn something new, I'm afraid because my Perl effort was wasted time and not appreciated by anyone here at my job and considered only "an exercise".

So in the next year I will learn C#, I 'll make my job of SA by hand because I'll not have the time to update my Perl scripts and I will be sad 'cause I'll use a very proprietary language that works only in a proprietary environment and, I suppose reading some .cs files, make not easy easy things and dreadfull complex tasks.

The voracious SeaShark is devouring my Perl of wisdom.

See you all in my spare time and many many thanks to all. FIGHT THEM ALL.

cheers from Roma Lor*

Replies are listed 'Best First'.
Re: Murder of a Perl coder (announced)
by theorbtwo (Prior) on Oct 13, 2004 at 12:44 UTC

    Sigh. I can tell you're upset, because your English isn't all that good -- and IIRC from your other writings, your English is normally quite good.

    So don't be. Yeah, you're being forced to use an icky language for some things. For other things, there's no reason not to use perl, as I understand it. Use the best language for the job. If somebody complaigns, tell them something -- that you can do it in Perl, and in C#, and it'll take less time to write it in perl. If they persist, well, they're the one that signs your checks.

    And learning a languge -- any language -- isn't just about learning the syntax, it's about learning how to think. Your experince with perl will make you write better C#. They aren't as different as you think, perhaps. C# has hashes too -- they're just a bit harder to get at. It probably has most of the things that you like about perl... somewhere. You just have to find them. A "good" programmer can write assembley in any language... and a good programmer can write perl in any language too. Will you find that C# is harder to write in then Perl? Quite possibly. Will you find some things that you like about C# more then perl? Quite possibly. I hope you let us know when you do.

    Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

      thanks theorbtwo

      yes may be I was upset (I have never heard this expression before) and I agree with you about learning how to think and I'm happy to learn something new but it still remains that my 'boss' dont gave Perl the chance to work in a Win32 environment and my personal future work will be slowed down..

      ..and, last but not least, you think exists ??

      Cheers from rainy roma

      CUsoon Lor*
Re: Murder of a Perl coder (announced)
by zentara (Archbishop) on Oct 13, 2004 at 13:44 UTC
    You are looking at this wrong. The "Great Perl God" has chosen you, Discipulus, to pave the path for the interface between C# and Perl. We all await the wisdom you will learn.


    Your mission Mr. Discipulus, if you choose to accept, is to infiltrate the belly of the SeaShark, identify it's weaknesses, and devise Perl strategies to overcome these weaknesses. This message will self-destruct if on a Win32 platform.

    I'm not really a human, but I play one on earth. flash japh
      Thanks zentara

      your spirit it's mine!!
      such thinks put me on (?!)..
      The "Great Perl God" must be VERY patient


      oh I cannot see the message...

      cheers from roma Lor*

      PS see you on ;)
Re: Murder of a Perl coder (announced)
by EdwardG (Vicar) on Oct 13, 2004 at 13:25 UTC

    You have my sympathy for your bad feelings, but maybe all is not lost. I learned Perl before I learned C# and .Net, and maybe right now it is hard to believe but C# can be almost as much fun as Perl.

    I recommend that you explore the Regex support in .Net (System.Text.RegularExpressions). You should know that it is a publicly stated goal for the .Net framework to be compatible with Perl 5 - and on top of that it adds features like named captures.

    One of the things I miss most about Perl is the one-liners, but then I think I can leave this as idiomatic of Perl and be content.

    I don't think your Perls of wisdom will be devoured, remind yourself that you will always know that there's another way to do things, and whenever you want you can

    perl -e "while(<>){s/abc/def/ig; print}"

    ...while all those around you are doing

    using System; using System.IO; using System.Text.RegularExpressions; namespace YourCompanyName { class myClass { public static void Main() { StreamReader sr = new StreamReader(); ...and on and on and on... } } }


      Why do perl -e "while (<>){s/abc/def/ig; print}" when you can do perl -pe "s/abc/def/ig" ?

        Because someone's got to supply material for the Type D monks. ;-)


        Because there are more important things to remember than perl command line switches.

      You mean you looked at, even used the RegExps in C# and did not throw up? Man you have a good stomach!

      A global match that gives you a data structure five levels deep made of five different types of objects? Replacement that's either a completely static string or a "reference to a function" (for .Net guys "a delegate") that has to be defined somewhere far off because C# doesn't support unnamed functions/blocks? I've seen several examples in C# that implemented something like s{%(\w+)%}{$hash{$1}}g;. None of them was shorter than some twenty lines and each and every one of them was ugly and hard to understand. Shame I don't have the book here.

      I think that if I'll continue to be forced to "work" in C# I'll end up wrapping the real Perl regexps in a .Net class whose design might not be so "clean OO", but will be easier to use. Like I did with VB.

      We'd like to help you learn to help yourself
      Look around you, all you see are sympathetic eyes
      Stroll around the grounds until you feel at home
         -- P. Simon in Mrs. Robinson

        Each to their own taste, but here's the contrast -

        # perl s{%(\w+)%}{$hash{$1}}g // C# Regex.Replace(s, @"%(\w+)%", new MatchEvaluator( hashLookup ) );


        Shame on me 'cause I have forgot to thanks you Jenda!.

        Thanks for all the time you have shared your magic with me, like your funny _b_a_c_k_u_p utility, and with other monks with your inhestimable site-repository.

        cheers from roma Lor*

        PS see you on ;)
      Thanks EdwardG!

      thank you for your suggestion about C# regEX, may be it will be a good point to start having fun with SeaShark, and most important thanks for your sympathy

      cheers from roma Lor*

      PS see you on ;)
Re: Murder of a Perl coder (announced)
by tilly (Archbishop) on Oct 13, 2004 at 16:23 UTC
    My advice is that effective advocacy comes best from someone who has not portrayed himself as too biased. Therefore if you go into C# kicking and screaming, anything negative that you say about it will get discounted.

    By contrast if you go into it with sincere willingness to learn the technology and use it effectively, your complaints and comparisons are more likely to get traction.

      Discipulus, tilly just gave you the best advice you will ever get on this subject. I have "helped" six people make the switch from Windows to Apple, not by telling them that Windows sucks, but by working patiently beside them on a Windows machine while I wore an Apple shirt. They try to start fights about it, but I don't take the bait. "Sure, Windows is a fine OS. They're both good, they both do what you need them to do. I just prefer the way it does this or that thing. Like what I'm doing here: at home on my iMac it would work like this..."

      Eventually my boss got curious enough to check it out on his own. He did about a month of research and now we both have 15" PowerBooks. Never make them angry, just make them wonder what they're missing out on...

Re: Murder of a Perl coder (announced)
by exussum0 (Vicar) on Oct 13, 2004 at 16:22 UTC
    What are the reasons he's shifting? Is it for tighter integraiton? For a standard language across the company?

    I'll give you an example. Recently, my company made a huge shift to windows. Prior, logs were made accessible via tail over ssh to a central box instead of letting developers have access to production machines. It worked flawlessly. If the connection dropped, the connection would be restarted.. and all that goodness. Now, they've switched to windows. Since they dont' allow ssh anymore, and only pcanywhere, we can't do this. Now we are being forced to switch to syslog. Points have been brought up on incomplete log files if a syslog entry is amiss and no auto-catchup. But they've switched anyway. Unfortunately, a worse off system has been put into place as entries sometimes time out and never get there, or if the receiving machine needs to be taken down, it can't get done during the day. Joy for everyone, eh?

    Counter example, is recently we used php and perl, and had to switch away. We switched to java. I've been writing perl for 10 years now. I've also used other languages extensively, including perl and java for some good time now. I can write an orgniazed perl programs, and can engineer modules for reusability. Our new developer, with 2 months experience, needs to do my level of coding. Unfortunately, it results in me getting rid of unecessary code, putting code in better places for reusability or fixing function names. Using perl and php, it's quite hard to refactor these things and just have it rename everywhere applicable. The other part of it is, the company writes in java. There are only some things that work in java, like JMS and RMI. Well, it could be hacked to death, but i'm not here to hack. java was decided to be used for better integration and tools to support ourselves.

    A third side, is recently, I have to do simulations with graph colouring. We were asked to do it OO. Professor asked me, 1 of 6 people, what language I would do it in. When i said perl, I was told how the code would be messy and it would be hard. I finished it about the same time as anyone else could. Doesnt' prove perl is good or bad, but it's a good tool for what I was doing. It was good for me, 'cause I wrote less code than I would in java.

    Lesson to be learned? There are reasons for everything. Sometimes they are bad, sometimes good. Do yourself a favour. Sit and ask your boss why things are changing. If he gives you bad suggestions, think it out with him. You aren't there to write perl. You are there to do work. If it involves you writing code in lisp, there's not much you can do. If it makes money within a reasonable amount of time w/o too much trouble for the company, you will probably use that. If you dont' want to use c#, that's absolutely fine. But unless you can prove to them why another language is better and get it integrated w/o issue, then you'll have a huge uphill battle to fight.

    But please, don't go 'cause of that. perlmonks is about perl, and it's not. It's about figuring how to hack it to death, and understand it, but it's also a place of understanding problems and solutions. What you can do in perl, you can similarly do in other languages. Being here won't be useless. -s out.

    Then B.I. said, "Hov' remind yourself nobody built like you, you designed yourself"

      Tahnks sporty,

      Thanks for your kind replay.
      I think my 'boss' needs someone to complet/review his code.
      I agree completely with your wise words: if they wont make me code in aramaic no problem.. time is money and they give money to me.

      Now I want to tell you something: the only part of my work that was in C#, made by one collegue, and not made by me in Perl, some days ago become instable with strange errors returned about domain user modification..
      In half an hour I have modify one of my scripts to alter the domain user and it runned well:

      In two days my poor collegue find that error was A BUG IN THE PATCH OF THE FRAMEWORK !! you know what I means !

      cheers from roma Lor*

        That's sad to hear. I hope that you run into no more errors in c# to cuase you woes. But if that's the worst of what you get out of c#, and things become "better" for the company, then he made a wise decission. If things become crappy, then he made a poor decision. But none the less, approach him, ask him his reasonings for using c#, and why not languages like, java, c++, perl, ruby.. there must be key reasonings.

        Then B.I. said, "Hov' remind yourself nobody built like you, you designed yourself"

Re: Murder of a Perl coder (announced)
by cbraga (Pilgrim) on Oct 13, 2004 at 13:43 UTC
    AFAIK, ActivePerl ( supports Perl within .Net, allowing you to write .Net components in Perl and using .Net components from Perl. I've never used it but maybe that's what you were looking for?

    ESC[78;89;13p ESC[110;121;13p

Re: Murder of a Perl coder (announced)
by itub (Priest) on Oct 13, 2004 at 13:21 UTC
    Note that there is a free implementation of C# (, although I don't have any personal experience with it (or with the Microsoft version, for that matter...). As far as I know the C# specification is a published standard and anyone is free to implement it.
Re: Murder of a Perl coder (announced)
by gellyfish (Monsignor) on Oct 13, 2004 at 14:32 UTC

    Of course the first thing that you will realise when you start looking at c# is that infact you don't need to have a WSDL file to consume a Web Service, it just makes it simpler as you can create your client stub with the wsdl.exe tool that will generate the code from the WSDL.


Re: Murder of a Perl coder (announced)
by pg (Canon) on Oct 13, 2004 at 16:29 UTC

    Is it not a great thing to learn more languages, I think yes, at least for myself.

    I have used those languages in years, and I never hated one of them, although each has something better than others: (I exclude things like SQL, HTML etc.)

    • BASIC
    • PASCAL
    • PDP-11 (assembler)
    • Z-80 (assembler)
    • C
    • Ada
    • COBOL (that was year 2000)
    • Java
    • Perl
    • C# (just started)

    Besides, have the opportunity to compare Perl with other languages, might just make you love Perl more!

      It's great to learn new languages. Provided they are new. It hurts to go back in time listening to everones' boasting about the progress.

      We'd like to help you learn to help yourself
      Look around you, all you see are sympathetic eyes
      Stroll around the grounds until you feel at home
         -- P. Simon in Mrs. Robinson

        tilly ben42 pg jenda

        may be you have misunderstood my post.
        I dont belive so much in progress but I belive in personal improvement.
        I' m happy learning something new but my prevous work was,by the company point of view, exercise time and not serious and usefull developement.

        Cheers Lor*
Re: Murder of a Perl coder (announced)
by Rhandom (Curate) on Oct 13, 2004 at 16:32 UTC
    I feel bad that I haven't had enough "toit"s to make a new WSDL generator. Sigh...

    I hope your ventures into C# aren't as disappointing as you now seem to indicate. The plus side is that learning any new language gives increased insight, understanding, and proficiency in your existing languages.

    Hope you find success...

    my @a=qw(random brilliant braindead); print $a[rand(@a)];
      Rhandom dont feel bad!

      we have time and when we'll have a new WSDL generator I'll wrap all my methods in a SOAP::Lite server.
      For now I try to find the 6th side of the pentagon.

      Thanks Lor*
Re: Murder of a Perl coder (announced)
by perrin (Chancellor) on Oct 13, 2004 at 21:20 UTC
    No time spent learning a new language is wasted, even if you don't stay with it. It all leads to a better and more well-informed style in your current language. Well, unless the language is JavaScript...
      Well, unless the language is JavaScript...

      I beg to differ ;)

      Javascript, when disregarding the DOM-interfaces, is in fact quite an elegant little language. Functions are first order objects, which means that you have a lot of functional programming goodness like currying and whatnot at your fingertips. This makes it very easy to write event-handlers, or event-handler generators, or in some (esoteric) cases generators for event-handler generators ('twas a rather exotic script, I must admit). Great fun!

      Then again, when you do regard javascript in conjunction with browser-dependent DOM-tree hell, you have a point. As long as the browser-makers don't agree on a standard API, the usefulness of the language is seriously reduced. I hope, and believe, that when sensible browser-makers start to dominate the market (and they are gaining), we will get a de facto standard, and this problem will go away.

      All in all, Javascript is IMHO a tool of enormous potential, though it is still in it's teens. I hope it develops :)

      Mischief. Mayhem. Soap.

        I hope, and believe, that when sensible browser-makers start to dominate the market (and they are gaining), we will get a de facto standard, and this problem will go away.
        Well, you probably won't even have to wait that long. I have found that over the last few years, (for example) starting with the first incarnations of Mozilla and MSIE5.5, that it's actually quite easy to make quite complex code in Javascript that just works across browsers — thus, without using any browser specific code. It really is a lot better already than it used to be in the 3.x/4.x days.

        Yep. It's a shame M$ chose C# and not JScript.Net as their "flagship" language. Double shame they don't even give it reasonable support in Visual Studio.

        We'd like to help you learn to help yourself
        Look around you, all you see are sympathetic eyes
        Stroll around the grounds until you feel at home
           -- P. Simon in Mrs. Robinson

      JavaScript is a surprisingly cool language.


Re: Murder of a Perl coder (announced)
by dfaure (Chaplain) on Oct 15, 2004 at 21:56 UTC

    Please, let me add my brick in the wall:

    Knowing several languages is always a great source of skill improvement. Especially, when trying to mimic some features/behaviors from one language into an other.

    You may also consider my favorites signatures citations...

    HTH, Dominique
    My two favorites:
    If the only tool you have is a hammer, you will see every problem as a nail. --Abraham Maslow
    Bien faire, et le faire savoir...