Hi All,
I am trying to convert the below Csh code into Perl.
But i have the following error.
Can any expert help ?
Error:
ls: *tac: No such file or directory
Csh
set $ST_file = `ls -rt *$testid*st*|tail -1`;
Perl
my $ST_file = `ls -rt *$testid*st*|tail -1`; (10 Replies)
i want to split the input by a space and remove specific characters like full stop, comma...... etc. and then save each word in an array.
i got something below, but it didn't work. can anyone please help me?
Thank you
#!/usr/bin/perl -w
while (<>)
{
$line = <>;
@word = split(' ',... (6 Replies)
All I'm trying to split a string at the $ into arrays
@data:=<dataFile>
a $3.33
b $4.44
dfg $0.56
The split command I have been playing with is:
split(/\$/, @data)
which results with
a .33 b .44 dfg .56
any help with this is appreciated
/r
Rick (9 Replies)
Hi,
I have file: data.log.1
### s1
main.build.3495
main.build.199
main.build.3408
###s2
main.build.3495
main.build.3408
main.build.199
I want to read this file and store in two arrays in Perl.
I have following command, which is working fine on command prompt.
perl -n -e... (1 Reply)
I am trying to take first 3 columns in a file which matches the word "abc", but i am getting the below error,
<error>
Global symbol "@F" requires explicit package name at ./new.pl
</error>
whereas when i give the below,grep abc /home/test/file.txt|perl -lane 'print \"$F $F $F\" in unix prompt... (4 Replies)
Hi
I have a file say text.txt and has data as below.
text.txt
-------
/abc/def/tom/hanks
/abc/def/al/pacino
/def/dgg/matt/damon
Now I have to cut the field 3 and field 4 treating / as delimiter and save in the same file. Below is the how the output should be in the same file.
I... (1 Reply)
How can I split following input into stwo strings:
Input:
1^~^2^~^3^~^4^~^5^~^6^~^7^~^8^~^9
Output:
$string1 = 1^~^2^~^
$string2 = 3^~^4^~^5^~^6^~^7^~^8^~^9
Note: the length of string may vary, say upto 15. String 1 will contain only first two. string2 will contain... (10 Replies)
hi,
i am trying to write a script to generate ouput in the following format:
##### buildappi abcd_sh nodebug.#####
##### buildappi ijk_sh nodebug.#####
The given string is as follows:
xtopSharedDLLs = "abcd_sh def_sh ijk_sh " \
+ "jkl_sh any_sh... (15 Replies)
Hi All,
How to split the string KAR_Celltick_Ban_GSMGW3 and want to pickup the third filed. Sometime the string may be "KAR_Celltick_Ban" like this
Thanks in advance (1 Reply)
Hello
I have string (string can have more sections)
LINE="AA;BB;CC;DD;EE"I would like to assigne each part of string separated by ";" to some new variable.
Can someone help? (4 Replies)
Discussion started by: vikus
4 Replies
LEARN ABOUT PHP
hash_final
HASH_FINAL(3) 1 HASH_FINAL(3)hash_final - Finalize an incremental hash and return resulting digestSYNOPSIS
string hash_final (resource $context, [bool $raw_output = false])
DESCRIPTION PARAMETERS
o $context
- Hashing context returned by hash_init(3).
o $raw_output
- When set to TRUE, outputs raw binary data. FALSE outputs lowercase hexits.
RETURN VALUES
Returns a string containing the calculated message digest as lowercase hexits unless $raw_output is set to true in which case the raw
binary representation of the message digest is returned.
EXAMPLES
Example #1
hash_final(3) example
<?php
$ctx = hash_init('sha1');
hash_update($ctx, 'The quick brown fox jumped over the lazy dog.');
echo hash_final($ctx);
?>
The above example will output:
c0854fb9fb03c41cce3802cb0d220529e6eef94e
SEE ALSO hash_init(3), hash_update(3), hash_update_stream(3), hash_update_file(3).
PHP Documentation Group HASH_FINAL(3)