Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: How can I extract part of a string after a specific character

by bronto (Priest)
on Jul 11, 2002 at 12:15 UTC ( #181004=note: print w/replies, xml ) Need Help??


in reply to How can I extract part of a string after a specific character

my $string ; my $title = 'TITLE=SPECIAL CASE 1' ; $string = $title if $title =~ s/^TITLE=// ;

Now $string is SPECIAL CASE 1. If $title didn't match, it is undef, and you can test it with a simple if ($string) {..., for example (but I would rather use if (defined $string) {...)

Ciao!
--bronto

# Another Perl edition of a song:
# The End, by The Beatles
END {
  $you->take($love) eq $you->made($love) ;
}

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (1)
As of 2023-03-24 07:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (60 votes). Check out past polls.

    Notices?