Perl conversion & perldoc question


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Perl conversion & perldoc question
# 1  
Old 09-11-2005
Perl conversion & perldoc question

Working my way through a perl book and can't find this;
You can convert from binary to ordinal numbers using 0b in front of the binary value but how do you go the other way, from ordinal to binary? Is there a function for this?

On Perldoc, is there a document that gives all of the available functions and system variables. I'm hunting for something other that Perlfunc, something that simply lists them all.
# 2  
Old 09-11-2005
Code:
$ perl -e 'print sprintf("%b\n", 15);'
1111
$ perl -e 'print sprintf("%b\n", 18);'
10010

As for the list of functions, is this what you want (this is actually derived from perlfunc anyway)?

http://perldoc.perl.org/index-functions.html

As for variables, read perlvar:

http://perldoc.perl.org/perlvar.html
# 3  
Old 09-11-2005
As for the list of functions, is this what you want (this is actually derived from perlfunc anyway)?

http://perldoc.perl.org/index-functions.html

As for variables, read perlvar:

http://perldoc.perl.org/perlvar.html[/QUOTE]


I was really wondering about finding the information in perldoc but those links will work great.
Thanks
Thumper
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Not able ot collect perldoc output to a file

I need the output of perldoc command collected to a file # perldoc -l File::Scan::ClamAV > /usr/src/asas.txt No documentation found for "File::Scan::ClamAV". # cat /usr/src/asas.txt # (2 Replies)
Discussion started by: anil510
2 Replies

2. Shell Programming and Scripting

awk Help: quick and easy question may be: How to use &&

Hi Guru's. I am trying to use to check if $5 is greater than 80 & if not 100, then to print $0 : awk '{ if ($5>80) && if ($5 != 100) print $0} But getting error: >bdf1|sed 's/%//g'|awk '{ if ($5>80) && if ($5 != 100) print $0}' syntax error The source line is 1. The error... (6 Replies)
Discussion started by: rveri
6 Replies

3. Shell Programming and Scripting

conversion of loop in perl

Hello Sir, How can i convert below two loop lines in perl for BLOCK in /sys/block/myblock* for BLOCK in /dev/myblock* How i can write them in perl like foreach( </sys/block/myblock*/queue/nr_requests> ) (5 Replies)
Discussion started by: learnbash
5 Replies

4. Shell Programming and Scripting

Timestamp conversion in PERL

Hi, I have a file as below I need to overwrite the 2 nd column alone to numeric format like "06122011030414012345" as per the timestamp value output file should be the microseconds can be neglected if required. Any help will be appreciated. Thanks in advance (1 Reply)
Discussion started by: irudayaraj
1 Replies

5. Shell Programming and Scripting

Epoch & Unix Timestamp Conversion Tools

Hi All, Please read the below data carefully. I need an unix command for converting unix timestamp to Epoch timestamp. I need to daily convert this today's unix(UTC) time to epoch time, so i am thinking to make a shellscript for this. Please help me for this by providing... (3 Replies)
Discussion started by: aish11
3 Replies

6. UNIX for Dummies Questions & Answers

Find & Replace identifiers using a conversion table

Hi ! I have input.tab with one column containing Item IDs under a number format (the second column is the Location of this item): Location Item ID rack1 12; 35; 43 rack35 23; 894; 5478; 98 etc... (The number of Items per row is variable. Item IDs in a same field are... (17 Replies)
Discussion started by: lucasvs
17 Replies

7. Shell Programming and Scripting

Find & Replace string in multiple files & folders using perl

find . -type f -name "*.sql" -print|xargs perl -i -pe 's/pattern/replaced/g' this is simple logic to find and replace in multiple files & folders Hope this helps. Thanks Zaheer (0 Replies)
Discussion started by: Zaheer.mic
0 Replies

8. Shell Programming and Scripting

perl newbie . &&..programming newbie (question 2)

Hello everyone, I am having to do a lot of perl scripting these days and I am learning a lot. I have this problem I want to move files from a folder and all its sub folders to one parent folder, they are all .gz files.. there is folder1\folder2\*.gz and there are about 50 folders... (1 Reply)
Discussion started by: xytiz
1 Replies

9. Shell Programming and Scripting

Conversion question about ksh

Hi all, New to ksh and had a few questions to see if this is doable in ksh or if I am going to have to call out to a tcl procedure. I have an Ascii file I want to convert to hex then search and remove all hex chars '0A' and then convert back to Ascii. Here is an example of an Ascii file I am... (2 Replies)
Discussion started by: hgjdv
2 Replies

10. UNIX for Dummies Questions & Answers

PERL & KSH Big Question

Hi All, Anyhelp on the following is highly appreciated I have a flat file which contains entrys like this L1 I1 B1 R1 L2 I2,I3 B1 R2 L3 I1 x R3 L4 x B2 R1 L5 I2 B1 R4 x means no entry Now after reading the... (3 Replies)
Discussion started by: jingi1234
3 Replies
Login or Register to Ask a Question