Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

RE: Parsing Class Paths

by japhy (Canon)
on Apr 07, 2000 at 16:47 UTC ( [id://7118]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    ($package,$symbol) = $qualified_name =~ /(.*)::(.*)/;
    
  2. or download this
    RESULTS:
    $qualified_name = 'My::Class::Path::func'
    ...
    Benchmark: timing 100000 iterations of Jeff1, Jeff2...
         Jeff1:  8 wallclock secs ( 8.95 usr +  0.00 sys =  8.95 CPU)
         Jeff2:  9 wallclock secs ( 8.82 usr +  0.00 sys =  8.82 CPU)
    
  3. or download this
    $qualified_name = 'My::Class::Path::myfuncdamnthisisareallylongstring'
    Benchmark: timing 100000 iterations of Jeff1, Jeff2...
    ...
    Benchmark: timing 100000 iterations of Jeff1, Jeff2...
         Jeff1: 11 wallclock secs ( 9.12 usr +  0.00 sys =  9.12 CPU)
         Jeff2:  8 wallclock secs ( 8.78 usr +  0.00 sys =  8.78 CPU)
    
  4. or download this
    my ($pkg,$sym) = unpack
      "A" . rindex($qualified_name, "::") . " x2 A*",
      $qualified_name;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://7118]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-18 01:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found