Sponsored Content
Full Discussion: Perl and binary workings
Top Forums Shell Programming and Scripting Perl and binary workings Post 31209 by cbkihong on Monday 4th of November 2002 10:41:24 AM
Old 11-04-2002
GNU/Linux 2.4.10
perl 5.8.0

I run the three lines exactly as quoted and got 3.
 

10 More Discussions You Might Find Interesting

1. Solaris

compiled binary file gives "cannot execute binary file"

Hi, I have two Solaris machines. 1. SunOS X 5.8 Generic_108528-29 sun4u sparc SUNW,Sun-Blade-1500 2. SunOS Y 5.8 Generic_108528-13 sun4u sparc SUNW,Ultra-60 I am trying to buiild a project on both these machines. The Binary output file compiled on machine 2 runs on both the machines. Where... (0 Replies)
Discussion started by: scgupta
0 Replies

2. Shell Programming and Scripting

capturing C++ binary return status in perl

Hello, I have a C++ binary that runs in my perl script. But, Currently, the binary is doing a core dump and i want to capture the retrun status of the binary to report as an issue. Can you please help me on this. Thanks, Sateesh (1 Reply)
Discussion started by: kotasateesh
1 Replies

3. Shell Programming and Scripting

capturing C++ binary return status in perl

Hello, I have a C++ binary that runs in my perl script. But, Currently, the binary is doing a core dump and i want to capture the retrun status of the binary to report as an issue. Can you please help me on this. Thanks, Sateesh (1 Reply)
Discussion started by: kotasateesh
1 Replies

4. Shell Programming and Scripting

Perl : find perl executable binary

Hi I have an oracle perl script running as cron job across multiple unix servers. The issue is the perl binary is found in multiple directories I use in the start of the script ... #!/usr/bin/perl on some servers the script fails because /usr/bin/perl is not present. Is there a way i can... (4 Replies)
Discussion started by: PrasannaKS
4 Replies

5. Shell Programming and Scripting

Convert binary to text Perl script

Hello everyone, I have a binary file with a structure unknown. I have found 2 perl scripts that it seems to do the convertion but I get sintactic errors when I run them, may somebody test these 2 scripts please and see if really work? One if from here... (10 Replies)
Discussion started by: Ophiuchus
10 Replies

6. Shell Programming and Scripting

Displaying a number in binary using perl

printf FH2" 3'b%b : begin\n",$i; where i is an integer in the loop is displaying 3'b1 : begin expected output was 3'b001 : begin (1 Reply)
Discussion started by: dll_fpga
1 Replies

7. Shell Programming and Scripting

Convert binary file to csv and then back to the binary format

Hello *nix specialists, Im working for a non profit organisation in Germany to transport DSL over WLAN to people in areas without no DSL. We are using Linksys WRT 54 router with DD-WRT firmware There are at the moment over 180 router running but we have to change some settings next time. So my... (7 Replies)
Discussion started by: digidax
7 Replies

8. Shell Programming and Scripting

Binary patch using perl

for all who are interested: a bash function scanning all unique strings in FILE that contain a token and replacing it. Furthermore the function demonstrates how to construct a perl command from variables in a script: patchfile() { local -r file="$1" local -r... (1 Reply)
Discussion started by: dodona
1 Replies

9. Programming

PERL: In a perl-scripttTrying to execute another perl-script that SETS SOME VARIABLES !

I have reviewed many examples on-line about running another process (either PERL or shell command or a program), but do not find any usefull for my needs way. (Reviewed and not useful the system(), 'back ticks', exec() and open()) I would like to run another PERL-script from first one, not... (1 Reply)
Discussion started by: alex_5161
1 Replies

10. UNIX for Beginners Questions & Answers

Explanation for Scripts Inner Workings Needed

#!/bin/bash n=$l; typeset -a v x=$(< input.dat) check(){ if; then sed 's/Test/Proc/g' file.sh >fl.sh else exit 13 fi } check $n while ; do x=`expr $x -l` v=$x done less fi.sh l>/dev/null&& echo yes || exit 1 echo v= ${v } exit 0 I have file.sh and input.dat in the current... (3 Replies)
Discussion started by: bananasprite
3 Replies
Locale::PO(3)						User Contributed Perl Documentation					     Locale::PO(3)

NAME
Locale::PO - Perl module for manipulating .po entries from GNU gettext SYNOPSIS
use Locale::PO; $po = new Locale::PO([-option=>value,...]) [$string =] $po->msgid([new string]); [$string =] $po->msgstr([new string]); [$string =] $po->comment([new string]); [$string =] $po->automatic([new string]); [$string =] $po->reference([new string]); [$value =] $po->fuzzy([value]); [$value =] $po->add_flag('c-format'); print $po->dump; $quoted_string = $po->quote($string); $string = $po->dequote($quoted_string); $aref = Locale::PO->load_file_asarray(<filename>,[encoding]); $href = Locale::PO->load_file_ashash(<filename>,[encoding]); Locale::PO->save_file_fromarray(<filename>,$aref,[encoding]); Locale::PO->save_file_fromhash(<filename>,$href,[encoding]); DESCRIPTION
This module simplifies management of GNU gettext .po files and is an alternative to using emacs po-mode. It provides an object-oriented interface in which each entry in a .po file is a Locale::PO object. METHODS
new my Locale::PO $po = new Locale::PO; my Locale::PO $po = new Locale::PO(%options); Create a new Locale::PO object to represent a po entry. You can optionally set the attributes of the entry by passing a list/hash of the form: -option=>value, -option=>value, etc. Where options are msgid, msgid_plural, msgstr, msgctxt, comment, automatic, reference, fuzzy_msgctxt, fuzzy_msgid, fuzzy_msgid_plural, fuzzy, and c-format. See accessor methods below. To generate a po file header, add an entry with an empty msgid, like this: $po = new Locale::PO(-msgid=>'', -msgstr=> "Project-Id-Version: PACKAGE VERSION\n" . "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" . "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" . "Language-Team: LANGUAGE <LL@li.org>\n" . "MIME-Version: 1.0\n" . "Content-Type: text/plain; charset=CHARSET\n" . "Content-Transfer-Encoding: ENCODING\n"); msgid Set or get the untranslated string from the object. This method expects the new string in unquoted form but returns the current string in quoted form. msgid_plural Set or get the untranslated plural string from the object. This method expects the new string in unquoted form but returns the current string in quoted form. msgstr Set or get the translated string from the object. This method expects the new string in unquoted form but returns the current string in quoted form. msgstr_n Get or set the translations if there are purals involved. Takes and returns a hashref where the keys are the 'N' case and the values are the strings. eg: $po->msgstr_n( { 0 => 'found %d plural translations', 1 => 'found %d singular translation', } ); This method expects the new strings in unquoted form but returns the current strings in quoted form. msgctxt Set or get the translation context string from the object. This method expects the new string in unquoted form but returns the current string in quoted form. fuzzy_msgid Set or get the outdated untranslated string from the object. This method expects the new string in unquoted form but returns the current string in quoted form. fuzzy_msgid_plural Set or get the outdated untranslated plural string from the object. This method expects the new string in unquoted form but returns the current string in quoted form. fuzzy_msgctxt Set or get the outdated translation context string from the object. This method expects the new string in unquoted form but returns the current string in quoted form. obsolete Returns 1 if the entry is obsolete. Obsolete entries have their msgid, msgid_plural, msgstr, msgstr_n and msgctxt lines commented out with "#~" When using load_file_ashash, non-obsolete entries will always replace obsolete entries with the same msgid. comment Set or get translator comments from the object. If there are no such comments, then the value is undef. Otherwise, the value is a string that contains the comment lines delimited with " ". The string includes neither the "# " at the beginning of each comment line nor the newline at the end of the last comment line. automatic Set or get automatic comments from the object (inserted by emacs po-mode or xgettext). If there are no such comments, then the value is undef. Otherwise, the value is a string that contains the comment lines delimited with " ". The string includes neither the "#. " at the beginning of each comment line nor the newline at the end of the last comment line. reference Set or get reference marking comments from the object (inserted by emacs po-mode or gettext). fuzzy Set or get the fuzzy flag on the object ("check this translation"). When setting, use 1 to turn on fuzzy, and 0 to turn it off. c_format Set or get the c-format or no-c-format flag on the object. This can take 3 values: 1 implies c-format, 0 implies no-c-format, and undefined implies neither. php_format Set or get the php-format or no-php-format flag on the object. This can take 3 values: 1 implies php-format, 0 implies no-php-format, and undefined implies neither. has_flag if ($po->has_flag('perl-format')) { ... } Returns true if the flag exists in the entry's #~ comment add_flag $po->add_flag('perl-format'); Adds the flag to the #~ comment remove_flag $po->remove_flag('perl-format'); Removes the flag from the #~ comment loaded_line_number When using one of the load_file_as* methods, this will return the line number that the entry started at in the file. dump Returns the entry as a string, suitable for output to a po file. quote Applies po quotation rules to a string, and returns the quoted string. The quoted string will have all existing double-quote characters escaped by backslashes, and will be enclosed in double quotes. dequote Returns a quoted po string to its natural form. load_file_asarray Given the filename of a po-file, reads the file and returns a reference to a list of Locale::PO objects corresponding to the contents of the file, in the same order. Accepts an optional encoding parameter (e.g. "utf8") which defines how the po-file's input stream will be configured. load_file_ashash Given the filename of a po-file, reads the file and returns a reference to a hash of Locale::PO objects corresponding to the contents of the file. The hash keys are the untranslated strings, so this is a cheap way to remove duplicates. The method will prefer to keep entries that have been translated. Accepts an optional encoding parameter (e.g. "utf8") which defines how the po-file's input stream will be configured. save_file_fromarray Given a filename and a reference to a list of Locale::PO objects, saves those objects to the file, creating a po-file. Accepts an optional encoding parameter (e.g. "utf8") which defines how the po-file's output stream will be configured. save_file_fromhash Given a filename and a reference to a hash of Locale::PO objects, saves those objects to the file, creating a po-file. The entries are sorted alphabetically by untranslated string. Accepts an optional encoding parameter (e.g. "utf8") which defines how the po-file's output stream will be configured. AUTHOR
Maintainer: Ken Prows, perl@xev.net Original version by: Alan Schwartz, alansz@pennmush.org BUGS
If you load_file_as* then save_file_from*, the output file may have slight cosmetic differences from the input file (an extra blank line here or there). msgid, msgid_plural, msgstr, msgstr_n and msgctxt expect a non-quoted string as input, but return quoted strings. I'm hesitant to change this in fear of breaking the modules/scripts of people already using Locale::PO. Locale::PO requires blank lines between entries, but Uniforum style PO files don't have any. Please submit all bug requests using CPAN's ticketing system. SEE ALSO
xgettext(1). perl v5.16.3 2013-02-06 Locale::PO(3)
All times are GMT -4. The time now is 01:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy