Sponsored Content
Top Forums Shell Programming and Scripting Can someone please explain what tr#A-Za-z0-9+/# -_#; means in perl? Post 302466958 by DGPickett on Wednesday 27th of October 2010 07:50:46 PM
Old 10-27-2010
Looks like a base64 encoding thing.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl doubt plz explain....

hi all i wrote a shell script which uses perl script my code is : >cat filename | while read i >do >perl -e 'require "/home/scripts/abc.pl" ; abc("$i")' >done perl script used will simply check syntax of Cobol programs but it didn't work for me so i asked my colleague he suggested... (1 Reply)
Discussion started by: zedex
1 Replies

2. UNIX for Advanced & Expert Users

perl explain syntax !!!

hi all i was going through some perl code i came across this line and i am not getting what is exactly going on .. $$this{localtion} = GetName->GetVarName("EXE_DIR") ; what is the red part doing in above code (2 Replies)
Discussion started by: zedex
2 Replies

3. Shell Programming and Scripting

perl: Please explain this for me: $hexdigit = (0 .. 9, 'a' .. 'f')[$num & 15];

This is taken from perlop. I can't understand what's going on, please can someone explain this for me? $hexdigit = (0 .. 9, 'a' .. 'f'); to get a hexadecimal digit (2 Replies)
Discussion started by: ksheller
2 Replies

4. Programming

What does it means?

#define abc '\xE8' (7 Replies)
Discussion started by: kamlesh33
7 Replies

5. UNIX for Advanced & Expert Users

What does "__FD_PRN_" means in perl code ?

I have seen something like this in a perl code: $_ =~ s/__FD_PRN_/\\(/g What does this "__FD_PRN_" means. I have searched google but was not able to find any info regarding this. Appreciate if some one can refer to a link for these characters. From comments/code it used to substitue "(" with... (3 Replies)
Discussion started by: sarbjit
3 Replies

6. UNIX for Dummies Questions & Answers

Explain perl formatting commands

Could you please tell the meaning of Below mentioned perl script lines: format OWNER_TOTAL = @< Owner Code @<<<<<<total: @#######.## @#######.## @#######.## @#######.## @#######.## @#######.## @#######.## @#######.## @#######.## @#######.## @###### #.## $prev_cust_type, $prev_owner_code,... (2 Replies)
Discussion started by: vinothrajan55
2 Replies

7. Shell Programming and Scripting

can you explain this perl command?

I am using this line of perl code to change the file format and remove ^M at the end of each line in files: perl -i -pe's/\r$//;' <name of file here> Can you explain to me what this code does, and translate it into bash/awk/sed? (2 Replies)
Discussion started by: locoroco
2 Replies

8. UNIX for Beginners Questions & Answers

Perl: Can someone please explain this code "sort { $a <=> $b } @unsorted"

@sorted = sort { $a <=> $b } @unsorted; I am having hard time understanding how this works? I know the output but interested to know the working. Thanks in advance. (2 Replies)
Discussion started by: Tanu
2 Replies

9. UNIX for Beginners Questions & Answers

Perl/Array Sorting : Can someone please explain below code $h{$_}++

sub uniq { my %h; return grep { !$h{$_}++ } @_ } The above code is to remove duplicates from array. I am having hard time understanding below things (basically around highlighted code in bold)- when was the value inserted in hash? and are we only adding a key in Hash not... (1 Reply)
Discussion started by: Tanu
1 Replies
base64(n)					       Text encoding & decoding binary data						 base64(n)

__________________________________________________________________________________________________________________________________________________

NAME
base64 - base64-encode/decode binary data SYNOPSIS
package require Tcl 8 package require base64 ?2.4.2? ::base64::encode ?-maxlen maxlen? ?-wrapchar wrapchar? string ::base64::decode string _________________________________________________________________ DESCRIPTION
This package provides procedures to encode binary data into base64 and back. ::base64::encode ?-maxlen maxlen? ?-wrapchar wrapchar? string Base64 encodes the given binary string and returns the encoded result. Inserts the character wrapchar every maxlen characters of output. wrapchar defaults to newline. maxlen defaults to 76. Note well: If your string is not simple ascii you should fix the string encoding before doing base64 encoding. See the examples. The command will throw an error for negative values of maxlen, or if maxlen is not an integer number. ::base64::decode string Base64 decodes the given string and returns the binary data. The decoder ignores whitespace in the string. EXAMPLES
% base64::encode "Hello, world" SGVsbG8sIHdvcmxk % base64::encode [string repeat xyz 20] eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6 eHl6eHl6eHl6 % base64::encode -wrapchar "" [string repeat xyz 20] eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6 # NOTE: base64 encodes BINARY strings. % set chemical [encoding convertto utf-8 "Cu2088Hu2081u2080Nu2084Ou2082"] % set encoded [base64::encode $chemical] Q+KCiEjigoHigoBO4oKET+KCgg== % set caffeine [encoding convertfrom utf-8 [base64::decode $encoded]] BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category base64 of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. KEYWORDS
base64, encoding CATEGORY
Text processing COPYRIGHT
Copyright (c) 2000, Eric Melski Copyright (c) 2001, Miguel Sofer base64 2.4.2 base64(n)
All times are GMT -4. The time now is 03:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy