Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^5: Regex Doubt.

by Athanasius (Archbishop)
on Oct 16, 2012 at 03:40 UTC ( [id://999212]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    print "$last_name;
    #     ^
    
  2. or download this
    my $total_names = "Matthew,Thomas,Peter,Randy,George,Federick";
    $total_names =~ /,([^,]+)$/;
    print $1 if $1;
    
  3. or download this
    my $total_names = "Matthew,Thomas,Peter,Randy,George,Federick";
    my ($last_name) = $total_names =~ /,([^,]+)$/;
    print $last_name if $last_name;
    
  4. or download this
    my $last_name = ( split /,/, $total_names ) [ -1 ] ;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 22:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found