What does this expression do?

Posted on 2011-05-02
Last Modified: 2012-05-11

I'm absolutely new in perl and need to translate a perl script to c#.

I think I got the most of the script.

Could anyone please tell me what this line is assigning to $kette if the script is called with for example "MySecret" as parameter?


Thanks in advance

Question by:HugoHiasl
    LVL 31

    Expert Comment

    Prefix script name with Ekz and get variable $sek as suffix
    Concatenate all three parts
    LVL 4

    Expert Comment

    far: forgot # before $sec :-)
    LVL 12

    Author Comment

    The line before is


    So if the script is called  and is called with as MySecret

    it will set $kette = "" ?

    This does not make to much sense because it should encrypt the password... not the name of the script. Are you sure that ARGV[0] is the name of the script and not the first parameter?
    LVL 6

    Accepted Solution

    that one fill  $kett with Ekz concatenated with
    ${Argv[0]} = list of agrument (vriables the [0] means the first argument) given to the programm when its launched.
    and concatenated with $sek variable content
    LVL 12

    Author Closing Comment

    Thanks a lot.
    LVL 4

    Expert Comment


    $sek = $sek % 99999999;

    probably it had some random number assigned before and then it truncates it to 8 digits.
    So the value of sek is not 99999999. it is rather 0 if this is the first occurence of variable.

    And yes $ARGV[0] is first parameter, not the name of the script.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
    There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now