Sponsored Content
Full Discussion: Perl and binary workings
Top Forums Shell Programming and Scripting Perl and binary workings Post 31199 by cbkihong on Monday 4th of November 2002 09:01:44 AM
Old 11-04-2002
I get 3 .....

Code:
$binVal = "000011";
$binVal = "0b" . $binVal;
print oct($binVal);

Smilie
 

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
Config::Perl::V(3pm)					 Perl Programmers Reference Guide				      Config::Perl::V(3pm)

NAME
Config::Perl::V - Structured data retrieval of perl -V output SYNOPSIS
use Config::Perl::V; my $local_config = Config::Perl::V::myconfig (); print $local_config->{config}{osname}; DESCRIPTION
$conf = myconfig () This function will collect the data described in "the hash structure" below, and return that as a hash reference. It optionally accepts an option to include more entries from %ENV. See environment below. Note that this will not work on uninstalled perls when called with "-I/path/to/uninstalled/perl/lib", but it works when that path is in $PERL5LIB or in $PERL5OPT, as paths passed using "-I" are not known when the "-V" information is collected. $conf = plv2hash ($text [, ...]) Convert a sole 'perl -V' text block, or list of lines, to a complete myconfig hash. All unknown entries are defaulted. $info = summary ([$conf]) Return an arbitrary selection of the information. If no $conf is given, "myconfig ()" is used instead. $md5 = signature ([$conf]) Return the MD5 of the info returned by "summary ()" without the "config_args" entry. If "Digest::MD5" is not available, it return a string with only 0's. The hash structure The returned hash consists of 4 parts: build This information is extracted from the second block that is emitted by "perl -V", and usually looks something like Characteristics of this binary (from libperl): Compile-time options: DEBUGGING USE_64_BIT_INT USE_LARGE_FILES Locally applied patches: defined-or MAINT24637 Built under linux Compiled at Jun 13 2005 10:44:20 @INC: /usr/lib/perl5/5.8.7/i686-linux-64int /usr/lib/perl5/5.8.7 /usr/lib/perl5/site_perl/5.8.7/i686-linux-64int /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl . or Characteristics of this binary (from libperl): Compile-time options: DEBUGGING MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP PERL_TRACK_MEMPOOL PERL_USE_SAFE_PUTENV USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API Built under linux Compiled at Jan 28 2009 15:26:59 This information is not available anywhere else, including %Config, but it is the information that is only known to the perl binary. The extracted information is stored in 5 entries in the "build" hash: osname This is most likely the same as $Config{osname}, and was the name known when perl was built. It might be different if perl was cross-compiled. The default for this field, if it cannot be extracted, is to copy $Config{osname}. The two may be differing in casing (OpenBSD vs openbsd). stamp This is the time string for which the perl binary was compiled. The default value is 0. options This is a hash with all the known defines as keys. The value is either 0, which means unknown or unset, or 1, which means defined. derived As some variables are reported by a different name in the output of "perl -V" than their actual name in %Config, I decided to leave the "config" entry as close to reality as possible, and put in the entries that might have been guessed by the printed output in a separate block. patches This is a list of optionally locally applied patches. Default is an empty list. environment By default this hash is only filled with the environment variables out of %ENV that start with "PERL", but you can pass the "env" option to myconfig to get more my $conf = Config::Perl::V::myconfig ({ env => qr/^ORACLE/ }); my $conf = Config::Perl::V::myconfig ([ env => qr/^ORACLE/ ]); config This hash is filled with the variables that "perl -V" fills its report with, and it has the same variables that "Config::myconfig" returns from %Config. inc This is the list of default @INC. REASONING
This module was written to be able to return the configuration for the currently used perl as deeply as needed for the CPANTESTERS framework. Up until now they used the output of myconfig as a single text blob, and so it was missing the vital binary characteristics of the running perl and the optional applied patches. BUGS
Please feedback what is wrong TODO
* Implement retrieval functions/methods * Documentation * Error checking * Tests AUTHOR
H.Merijn Brand <h.m.brand@xs4all.nl> COPYRIGHT AND LICENSE
Copyright (C) 2009-2013 H.Merijn Brand This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2014-01-06 Config::Perl::V(3pm)
All times are GMT -4. The time now is 07:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy