Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: split question

by dragonchild (Archbishop)
on Sep 10, 2001 at 16:30 UTC ( #111429=note: print w/ replies, xml ) Need Help??


in reply to Re: split question
in thread split question

A slightly more readable version might be:

my $inLine = "RPC, rpc #001b, (1987)"; my ($year) = $inLine =~ /\((\d+)\)/; die "No year found in '$inLine'\n" unless defined $year;
The reason for checking definedness is because of the potential for an erroneous year zero. (You might want to die on year 0 ... I dunno.)

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.


Comment on Re: Re: split question
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2015-07-03 06:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (48 votes), past polls