Sponsored Content
Full Discussion: sprintf result on perl
Top Forums Shell Programming and Scripting sprintf result on perl Post 302295971 by Zaxon on Tuesday 10th of March 2009 05:03:35 AM
Old 03-10-2009
Yes, exactly. sprintf make scalar.Smilie Thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

different result on shell and on perl HELP NEEDED

hi i am using this command which would return to be the filename ls -l $dir1 | awk '{print $9}' however on perl when i use: `ls -l $dir1 | awk '{print \$9}' > tmp` it gives me a different result. Everything is the same however a directory does not contain the the forward slash so i... (2 Replies)
Discussion started by: nookie
2 Replies

2. Programming

equivalent of sprintf in C++

Hi My requirement is to convert the following to C++ char buffer; sprintf(buffer,"%s %-50s %6s %-6d %s\n",a.substr(0,5),a.substr(10,20)) Since the buffer is of varying length, i cannot hardcode the value as 90. i would like to convert the buffer to string object so that it can receive any... (1 Reply)
Discussion started by: dhanamurthy
1 Replies

3. Shell Programming and Scripting

Perl script to search sprintf and replace with snprintf

Dear all, I am new to perl script and would need some help for my 1st script. I wrote a script to search sprintf(buf,"%s", sourcestring) and replace with snprintf(buf, sizeof(buf),"%s", sourcestring). As snprintf() requires an extra argument, so it is not a simple search-and-replace. I need to... (1 Reply)
Discussion started by: ChaMeN
1 Replies

4. Shell Programming and Scripting

printf vs sprintf - perl

I would like to assign the output of printf to a variable in perl , it give me back a "1" instead of the time. How can I stuff the variable with what printf returns? Here is my code: #!/usr/bin/perl $time = localtime(time);... (3 Replies)
Discussion started by: Dabheeruz
3 Replies

5. Shell Programming and Scripting

Using Perl to query a website and parse the result

Hi, I am a JAVA programmer and I have no idea about perl. I did use it a long time ago and I don't even remember the basics. So here is my problem: In my work, I am supposed to build a simple program that opens a website (Gene Ontology)and passes my query and returns the result into a file. The... (1 Reply)
Discussion started by: chavanak
1 Replies

6. Shell Programming and Scripting

How do i access sybase using isql and how do i get result set in perl script?

Hi, How do i get result set in perl script using isql while connecting sybase server. I have a perl script which connected to sybase and get the result set. but i wanted to get the result set. How do i get the result set in perl script not unix shell script.. $server ="ServerName"; open... (1 Reply)
Discussion started by: solo123
1 Replies

7. Programming

Problem with Sprintf

Hi, I have the below sample code to hash the input number read from file. File will have 16 to 19 digit number and executable hash the number using some logic and returns the hashed value. Each digit in the 16 digit number is converted to a 4 byte value. That if the input is 16digit integer, the... (6 Replies)
Discussion started by: ramkrix
6 Replies

8. Shell Programming and Scripting

[Solved] Not able to quote perl function in sprintf() !

The required form of command is as perl /product/editique/RFR/preproc/scripts/ExprEval.pl -P 'EGAL_CHAINE (" ","")' -K /varsoft/editique/RFR/preproc/logs/D.RFR.PR.PCAC9.PCPA.00.54.20110920.Evaluate_Expression.logWhat's wrong with this code (it is not quoting the function, I have checked... (1 Reply)
Discussion started by: ezee
1 Replies

9. Shell Programming and Scripting

parsing XML result by using perl?

for some reasons, i need to parse the XML result by using perl. for instance, this is a sample XML result: <Response> <status>success</status> <answer>AAA::AAA</answer> <answer>BBB::BBB</answer> </Response> then i can use this way : my @output = (); foreach my $parts (@all) ##@all... (2 Replies)
Discussion started by: tiger2000
2 Replies

10. Shell Programming and Scripting

Perl : code on ping showing difference result

Hi all, I am using the below code to ping a code and print whehter the connection is successful or not. use Net::Ping; $p = Net::Ping->new(); my $host = "x.x.x.x"; # print "$host is alive.\n" if $p->ping($host); if ($p->ping($host,3)) { print... (0 Replies)
Discussion started by: scriptscript
0 Replies
MB_CONVERT_ENCODING(3)							 1						    MB_CONVERT_ENCODING(3)

mb_convert_encoding - Convert character encoding

SYNOPSIS
string mb_convert_encoding (string $str, string $to_encoding, [mixed $from_encoding = mb_internal_encoding()]) DESCRIPTION
Converts the character encoding of string$str to $to_encoding from optionally $from_encoding. PARAMETERS
o $str - The string being encoded. o $to_encoding - The type of encoding that $str is being converted to. o $from_encoding - Is specified by character code names before conversion. It is either an array, or a comma separated enumerated list. If $from_encoding is not specified, the internal encoding will be used. See supported encodings. RETURN VALUES
The encoded string. EXAMPLES
Example #1 mb_convert_encoding(3) example <?php /* Convert internal character encoding to SJIS */ $str = mb_convert_encoding($str, "SJIS"); /* Convert EUC-JP to UTF-7 */ $str = mb_convert_encoding($str, "UTF-7", "EUC-JP"); /* Auto detect encoding from JIS, eucjp-win, sjis-win, then convert str to UCS-2LE */ $str = mb_convert_encoding($str, "UCS-2LE", "JIS, eucjp-win, sjis-win"); /* "auto" is expanded to "ASCII,JIS,UTF-8,EUC-JP,SJIS" */ $str = mb_convert_encoding($str, "EUC-JP", "auto"); ?> SEE ALSO
mb_detect_order(3). PHP Documentation Group MB_CONVERT_ENCODING(3)
All times are GMT -4. The time now is 02:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy