[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 308
  • Last Modified:

What does this expression do?

Hi...

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?

$kette="Ekz${ARGV[0]}#$sek";

Thanks in advance




0
HugoHiasl
Asked:
HugoHiasl
1 Solution
 
farzanjCommented:
Prefix script name with Ekz and get variable $sek as suffix
Concatenate all three parts
0
 
a1jCommented:
far: forgot # before $sec :-)
0
 
HugoHiaslAuthor Commented:
The line before is

$sek%=99999999

So if the script is called  encrypt.pl  and is called with as

enrypt.pl MySecret

it will set $kette = "Ekzencrypt.pl#99999999" ?

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?
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
OsmozeCommented:
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
0
 
HugoHiaslAuthor Commented:
Thanks a lot.
0
 
a1jCommented:
the
$sek%=99999999

means
$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.
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now