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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
$cmd =~ /.+\"(.+)\"/;

 



hujirong
Novice

Nov 10, 2009, 7:51 AM

Post #1 of 2 (509 views)
$cmd =~ /.+\"(.+)\"/; Can't Post

What does the following code do? The result of command `cleartool ...` is ("ACPT").


Code
   

$cmd = `cleartool desc -fmt %[ENV]Sa stream:TCI_ACPT@\TCI_PVOB`;

$cmd =~ /.+\"(.+)\"/;



toolic
User

Nov 10, 2009, 8:36 AM

Post #2 of 2 (506 views)
Re: [hujirong] $cmd =~ /.+\"(.+)\"/; [In reply to] Can't Post

It looks at the contents of the $cmd variable, captures whatever is inside the double quotes and stores the value into the $1 special variable.

The following should print ACPT:

Code
print $1;


 
 


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

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