CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner: [SOLVED] 2 beginner questions: Edit Log

New User

Aug 16, 2012, 9:26 AM

Views: 2708
[SOLVED] 2 beginner questions

First of all, sorry for my english ;)

I got two questions:

1) I have a variable which contains a hexadecimal number, for example:

I want to print it as '3e 5c 46 85 da'. In other words, to use a space separator every two hexadecimal numbers. How can I do that?

2) I was trying to use Regular Expressions but I still get a null variable. I got a string like this:
'%SystemDrive%\Documents and Settings\XXXXX'

I want to save the 'XXXXX' in a variable, and I know that is always after the last backslash (\).

I tried this:

$owner = %SystemDrive%\Documents and Settings\LocalService; 
$owner =~ tr/[\\.*$]//;

But when I print it, $owner contains no data. Any solution?


(This post was edited by HaHaMan on Aug 16, 2012, 12:35 PM)

Edit Log:
Post edited by HaHaMan (New User) on Aug 16, 2012, 9:27 AM
Post edited by HaHaMan (New User) on Aug 16, 2012, 12:35 PM

Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives